text stringlengths 4 1.02M | meta dict |
|---|---|
from __future__ import print_function
from shapely.geometry import box
from awips.dataaccess import DataAccessLayer as DAL
from awips.ThriftClient import ThriftRequestException
from awips.test.dafTests import baseDafTestCase
from awips.test.dafTests import params
import unittest
#
# Tests common to all radar factorie... | {
"content_hash": "8c08344d22c1ec4d55fc9bc05bb102e4",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 84,
"avg_line_length": 41.60919540229885,
"alnum_prop": 0.6393646408839779,
"repo_name": "mjames-upc/python-awips",
"id": "8608fbe4318ae2e29910b94197af08003027062f",
"size... |
"""
Prediction part of the algorithm.
"""
import tensorflow as tf
import numpy as np
import os
import preprocessing as pp
import analysis as an
from tensorflow.contrib import learn
import csv
from sklearn import metrics
import pandas as pd
import matplotlib.pyplot as plt
from pandas_ml import ConfusionMatrix
import ya... | {
"content_hash": "64b5c407fe38b3de917eb39d663180c8",
"timestamp": "",
"source": "github",
"line_count": 461,
"max_line_length": 97,
"avg_line_length": 41.11279826464208,
"alnum_prop": 0.5564290613623173,
"repo_name": "Omadzu/feature-oriented-sentiment-analysis",
"id": "fa2f6f4a5f8fbf3c1bbb3de9602833b... |
import logging
from jenkinsapi import jenkins
from jenkinsflow.flow import serial
def main(api):
my_jobs = ['fast_test_helloworld', 'slow_test_helloworld']
with serial(api, timeout=200, report_interval=3) as ctrl1:
ctrl1.invoke('compile_helloworld')
with ctrl1.parallel(timeout=200, report_... | {
"content_hash": "c080079d6dfd05729e8daed95de2bf5d",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 69,
"avg_line_length": 25.59090909090909,
"alnum_prop": 0.6536412078152753,
"repo_name": "lechat/devops-python-jenkins",
"id": "4219becd6687e6b86177c5e2fa975d5a01c9cd6d",
"... |
from itertools import permutations
import re
import numpy as np
import pytest
import pandas as pd
from pandas import (
Index, Interval, IntervalIndex, Timedelta, Timestamp, date_range,
interval_range, isna, notna, timedelta_range)
import pandas.core.common as com
from pandas.tests.indexes.common import Base
i... | {
"content_hash": "a8eb9b23c7731d4269c5a1b0ba7757db",
"timestamp": "",
"source": "github",
"line_count": 1142,
"max_line_length": 79,
"avg_line_length": 41.13747810858143,
"alnum_prop": 0.5902637348602567,
"repo_name": "cbertinato/pandas",
"id": "b2f409837344a587ee9bc002d3e2c44c46671432",
"size": "4... |
"""
Script to test if a range of ports are open for listening between two crust servers.
"""
import subprocess
import time
import unittest
import benchline.command
import benchline.async
class TestSequenceFunctions(unittest.TestCase):
@benchline.async.forked
def _listen_on_port(self, server, port):
p... | {
"content_hash": "993dc2efc57b4e81108cd29f5cac2f99",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 127,
"avg_line_length": 39.83606557377049,
"alnum_prop": 0.5810699588477366,
"repo_name": "pauldeden/my-workstation-scripts",
"id": "ab5c0bcef6a38d385fb704b40d8865f531907df9"... |
import re
from django.core.exceptions import ValidationError
from django.http import HttpRequest, HttpResponse
from django.utils.translation import gettext as _
from zerver.decorator import require_realm_admin
from zerver.lib.actions import do_add_realm_playground, do_remove_realm_playground
from zerver.lib.exception... | {
"content_hash": "85ab3baeb7132fd12738536e39fb8e1a",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 88,
"avg_line_length": 39.815384615384616,
"alnum_prop": 0.7329984544049459,
"repo_name": "punchagan/zulip",
"id": "a426bd1a7833a95c7d68ab596defcbaeb4eb3335",
"size": "2588... |
from calvin.runtime.south.plugins.async import server_connection
class Server(object):
def __init__(self, node, mode, delimiter, max_length, actor_id=None):
self.connection_factory = server_connection.ServerProtocolFactory(node.sched.trigger_loop, mode, delimiter, max_length, actor_id)
def start(self... | {
"content_hash": "0dfdf5c4b1e21011af86e9ae6c1a6839",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 137,
"avg_line_length": 28.816326530612244,
"alnum_prop": 0.6473087818696884,
"repo_name": "MalmoUniversity-DA366A/calvin-base",
"id": "f443b61aa013e95ed11bddc2bab30715363f28... |
"""
Corretor.test_questao_avaliacao_erro
~~~~~~~~~~~~~~
Testa coisas relacionada ao corretor de C++
com relação a questoes feitas por um aluno, porem de forma errada.
Justamente para testar se quando feito de forma incorreta as questoes sao corrigidas e o resultado
é que deu incorreto.
:copy... | {
"content_hash": "fcb63984ef965d9a5ac75b3da9196b5d",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 121,
"avg_line_length": 45.024096385542165,
"alnum_prop": 0.7043082686647043,
"repo_name": "arruda/amao",
"id": "ae3f2b289999a51230e855d356bd32b69a570b11",
"size": "3776",
... |
"""Functions to plot raw M/EEG data."""
# Authors: Eric Larson <[email protected]>
# Jaakko Leppakangas <[email protected]>
#
# License: Simplified BSD
import copy
from functools import partial
import numpy as np
from ..annotations import _annotations_starts_stops
from ..filter import create_fi... | {
"content_hash": "fba23b8a7a88f5025447bab6521a70d8",
"timestamp": "",
"source": "github",
"line_count": 1275,
"max_line_length": 79,
"avg_line_length": 43.246274509803925,
"alnum_prop": 0.5777943016739513,
"repo_name": "adykstra/mne-python",
"id": "2e61b6c817c55fee589722f5c6206aaf8ed3ba78",
"size":... |
from compiler_common import unique_everseen, generate_var_name, get_hdr_name, get_hdrfld_name
from utils.codegen import format_expr, format_type, gen_format_slice
import os
#[ #pragma once
#[ #include "dpdk_lib.h"
#[ #include "tables.h"
for table in hlir.tables:
#[ void make_${table.name}_set_default_table_entr... | {
"content_hash": "9811e05136ba791c39c2beec7bc27c63",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 151,
"avg_line_length": 34.916666666666664,
"alnum_prop": 0.7326968973747017,
"repo_name": "P4ELTE/t4p4s",
"id": "841aa2fb68ba84f44929acee00d4df03d4b6f219",
"size": "519",
... |
"""
Signals management for the Members app.
"""
##########################################################################
## Imports
##########################################################################
import hashlib
from django.utils import timezone
from django.dispatch import receiver
from django.db.models.... | {
"content_hash": "d3b4865df59202c0908e0db262ce192d",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 74,
"avg_line_length": 32.734693877551024,
"alnum_prop": 0.5099750623441397,
"repo_name": "DistrictDataLabs/logbook",
"id": "76155e44e50a2e39cc98797f02a71a17a46eb178",
"siz... |
from flask import Flask, g, request
from flask_babel import Babel
from flask_login import LoginManager, current_user
from flask_wtf.csrf import CSRFProtect
from flask_gravatar import Gravatar
import psycopg2
import os
from datetime import timedelta
from dotenv import load_dotenv, find_dotenv
import json
from raven.cont... | {
"content_hash": "2f51ce224e3715d252f136961175759e",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 104,
"avg_line_length": 27.72872340425532,
"alnum_prop": 0.6802225206215231,
"repo_name": "itucsdb1739/itucsdb1739",
"id": "2687af22181c25bb03cf463ba823f438f656691b",
"siz... |
from unittest import mock
import pytest
from swagger_zipkin.decorate_client import decorate_client
def test_decorate_client_non_attr():
client = object()
with pytest.raises(AttributeError):
decorate_client(client, mock.Mock(), 'attr')
def test_decorate_client_non_callable():
client = mock.Moc... | {
"content_hash": "52ac0f1cb5da2cced225f642588fba40",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 71,
"avg_line_length": 26.054545454545455,
"alnum_prop": 0.6496859734822051,
"repo_name": "Yelp/swagger_zipkin",
"id": "80fb362b61c85a44da3df3db4b56f6883f149708",
"size": "... |
"""
sentry.utils.runner
~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
from logan.runner import run_app, configure_app
import base64
import os
import sys
import pkg_reso... | {
"content_hash": "653b5aa51db12ddd418989ab9789d147",
"timestamp": "",
"source": "github",
"line_count": 464,
"max_line_length": 122,
"avg_line_length": 29.711206896551722,
"alnum_prop": 0.6640069635862469,
"repo_name": "kevinlondon/sentry",
"id": "e0ea277ca63e4445b9739b8327a45104420a90d1",
"size": ... |
"""
Wrappers for Webhook objects.
.. currentmodule:: curious.dataclasses.webhook
"""
import typing
from curious.dataclasses import channel as dt_channel, embed as dt_embed, guild as dt_guild, \
user as dt_user
from curious.dataclasses.bases import Dataclass
from curious.util import base64ify
class Webhook(Data... | {
"content_hash": "0acc237d78af18b729905f0c2cebd7fa",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 99,
"avg_line_length": 35.244897959183675,
"alnum_prop": 0.5689056166763173,
"repo_name": "SunDwarf/curious",
"id": "2350ed21b28a3c25162815f7e0f98fd55a770504",
"size": "75... |
from abc import abstractmethod
from typing import ClassVar, FrozenSet, List, Type
from permuta import Av, MeshPatt, Perm
from permuta.enumeration_strategies.abstract_strategy import (
EnumerationStrategyWithSymmetry,
)
class CoreStrategy(EnumerationStrategyWithSymmetry):
"""Abstract class for a core related ... | {
"content_hash": "ae3aff9acbff9dc6cf694462457bd31e",
"timestamp": "",
"source": "github",
"line_count": 238,
"max_line_length": 87,
"avg_line_length": 28.747899159663866,
"alnum_prop": 0.6226249634609763,
"repo_name": "PermutaTriangle/Permuta",
"id": "5cc3f18bec8608fb909094d7f41c949a64e2652e",
"siz... |
import curses
import curses.ascii
from ped_core import keytab
from ped_test_util import read_str,validate_dialog,editor_test_suite,play_macro,screen_size,match_attr
from ped_ssh_dialog.ssh_dialog import SSHFileDialog
from ped_ssh_dialog.ssh_mod import ssh_put, ssh_del, ssh_stat
from ped_dialog import dialog
import pyte... | {
"content_hash": "2e8b048b68020195f85d13d799849604",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 193,
"avg_line_length": 47.97938144329897,
"alnum_prop": 0.6035668242372153,
"repo_name": "jpfxgood/ped",
"id": "6d0db0a9bb87efe0293ee75181048c4473bf46f7",
"size": "4654",
... |
'''Command processor for GRIT. This is the script you invoke to run the various
GRIT tools.
'''
import os
import sys
if __name__ == '__main__':
sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), '..'))
import getopt
from grit import util
import grit.exception
import grit.tool.android2grd
import grit.too... | {
"content_hash": "4d7c6a0996ecd759e19a1ba62dea04d2",
"timestamp": "",
"source": "github",
"line_count": 210,
"max_line_length": 80,
"avg_line_length": 30.89047619047619,
"alnum_prop": 0.6317249884384153,
"repo_name": "paul99/clank",
"id": "a7f692840b4bf2f3c22adc8b0d5ecf6b084d26a8",
"size": "6680",
... |
"""Assessment Open Service Interface Definitions
assessment version 3.0.0
The Assessment OSID provides the means to create, access, and take
assessments. An ``Assessment`` may represent a quiz, survey, or other
evaluation that includes assessment ``Items``. The OSID defines methods
to describe the flow of control and ... | {
"content_hash": "b7109005430b8e4db3b1794ccc8b173f",
"timestamp": "",
"source": "github",
"line_count": 9582,
"max_line_length": 198,
"avg_line_length": 39.20037570444583,
"alnum_prop": 0.6278772582783573,
"repo_name": "birdland/dlkit-doc",
"id": "9f367990fbd4c3f03788f50d35a8d6082edcf7ed",
"size": ... |
import traceback
import sys
from _pydev_bundle.pydev_console_utils import BaseInterpreterInterface
from _pydev_bundle.pydev_ipython_console_011 import get_pydev_frontend
from _pydevd_bundle.pydevd_constants import dict_iter_items
from _pydevd_bundle.pydevd_io import IOBuf
# Uncomment to force PyDev standard shell.
#... | {
"content_hash": "94ef6232bbdd7101b8a9f9468545dbee",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 125,
"avg_line_length": 41.655913978494624,
"alnum_prop": 0.5771812080536913,
"repo_name": "vvv1559/intellij-community",
"id": "9eeba70a830be0a9936aa91f855977046deb1fcf",
"... |
SECRET_KEY = None
DATABASE_URL = None
| {
"content_hash": "ff393c344014ec8cb2e678f63163bf93",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 19,
"avg_line_length": 19,
"alnum_prop": 0.7368421052631579,
"repo_name": "WilliamMayor/scytale.xyz",
"id": "1b77e9860130f3842b8dcd990c6e0478ad6b517d",
"size": "38",
"bina... |
def get_submission_karma_for_user(subreddit, user):
"""
Obtain submission karma for user in the specified subreddit
"""
karma = 0
submitted_posts = user.submissions.top('all')
for post in submitted_posts:
subreddit_name = post.subreddit.display_name
if subreddit_name == subre... | {
"content_hash": "4789b36b452ec3b2f3117f415c77980c",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 95,
"avg_line_length": 22.764705882352942,
"alnum_prop": 0.6511627906976745,
"repo_name": "DanyCaissy/Reddit",
"id": "e95c34ab7c5db11e326bdb3778eacb8dcaea2141",
"size": "11... |
"""Customised storage for notifications."""
from __future__ import absolute_import
from django.contrib.messages.storage.base import Message
from django.utils.safestring import mark_safe
from messages_extends.storages import FallbackStorage
from messages_extends.models import Message as PersistentMessage
from messages_... | {
"content_hash": "fbef4494bbd24e84509a98bff24a309a",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 80,
"avg_line_length": 47.131147540983605,
"alnum_prop": 0.64,
"repo_name": "safwanrahman/readthedocs.org",
"id": "e94f46e4fbe85e3a579a1ba66eb59ad189093f3a",
"size": "2875"... |
'''Autogenerated by get_gl_extensions script, do not edit!'''
from OpenGL import platform as _p
from OpenGL.GL import glget
EXTENSION_NAME = 'GL_SGIX_texture_lod_bias'
_p.unpack_constants( """GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E
GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F
GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190""", globals())
def glIni... | {
"content_hash": "18abc7a300a29ec59d10801a973e27c3",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 71,
"avg_line_length": 38.76923076923077,
"alnum_prop": 0.7579365079365079,
"repo_name": "frederica07/Dragon_Programming_Process",
"id": "ede17b151fb62bf78a2a23561b80665c9df8... |
'''
nknguyen soe ucsc edu
Feb 14 2012
Aggregate overlap statistics from different experiments into a table
Input: input directory containing overlap-statistic files, one for each pair of samples
Output: 1/Mode1: Table of overlapping statistics across different cutoffs where: Rows = pairs of samples. Cols = "Sample1\tSa... | {
"content_hash": "78a7686440ae216d09638b6ba13cad0f",
"timestamp": "",
"source": "github",
"line_count": 482,
"max_line_length": 544,
"avg_line_length": 42.60995850622407,
"alnum_prop": 0.5949459538416594,
"repo_name": "ngannguyen/immunoseq",
"id": "02911408a3a57b08ba84e84d3ed5be962a173a2c",
"size":... |
""" Provider info for Azure
"""
from perfkitbenchmarker import provider_info
from perfkitbenchmarker import benchmark_spec
class AzureProviderInfo(provider_info.BaseProviderInfo):
UNSUPPORTED_BENCHMARKS = ['mysql_service']
CLOUD = benchmark_spec.AZURE
| {
"content_hash": "6ce9df6140832d03a3aaa134945ed79d",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 56,
"avg_line_length": 21.75,
"alnum_prop": 0.7931034482758621,
"repo_name": "mateusz-blaszkowski/PerfKitBenchmarker",
"id": "d6f6a30fe3714de4b6e1ae50dcce584cadcf3624",
"si... |
import numpy as np
from isaac.stats import sigmoid
__all__ = [
"LinearRegression",
"LogisticRegression"
]
class LinearRegression(object):
def __init__(self, weights):
self.weights = weights
self.dimension = len(weights)
@classmethod
def from_dimension(cls, dimension, v... | {
"content_hash": "50fc499b3e07f64723f98bdaf2b35698",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 79,
"avg_line_length": 26.94047619047619,
"alnum_prop": 0.5558992487847989,
"repo_name": "chaobin/isaac",
"id": "94a007f8d992caabe1e76b023ba4d9c1638bcf17",
"size": "2263",
... |
from functools import wraps
from flask_wtf import FlaskForm
from wtforms import FieldList, FloatField, StringField
from wtforms.validators import DataRequired, Optional
class SellForm(FlaskForm):
"""
FlaskForm for selling items.
"""
name = StringField('name', validators=[DataRequired()])
descript... | {
"content_hash": "92c61dea7f40342b9ac3d98edfc55c41",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 98,
"avg_line_length": 33.138888888888886,
"alnum_prop": 0.6756077116512993,
"repo_name": "GoogleCloudPlatform/serverless-store-demo",
"id": "afdec7fb062d2c7f73c1e06da78e8164... |
"""Handling Starmade Blueprints in App Engine & Datastore"""
from google.appengine.ext import blobstore, ndb
SCHEMA_VERSION_CURRENT = 25
class Blueprint(ndb.Model):
"""Datastore Entity for Blueprints"""
attached_count = ndb.IntegerProperty(indexed=False)
blob_key = ndb.StringProperty(indexed=False)
c... | {
"content_hash": "9872d077f7a6e20f5046a61696f99f20",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 74,
"avg_line_length": 48.333333333333336,
"alnum_prop": 0.7280172413793103,
"repo_name": "dmcgrath/starmade-blueprint-library",
"id": "4e1c9b7614870998fad6a8d594180873a82de5... |
import datetime
import json
import time
import requests
import twstock
# import sys
try:
from json.decoder import JSONDecodeError
except ImportError:
JSONDecodeError = ValueError
from requests.exceptions import ProxyError
SESSION_URL = 'http://mis.twse.com.tw/stock/index.jsp'
STOCKINFO_URL = 'http://mis.twse.c... | {
"content_hash": "d37023278bfe19ad865e9aff3fd36518",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 93,
"avg_line_length": 29.694444444444443,
"alnum_prop": 0.5886342376052386,
"repo_name": "TCCinTaiwan/twstock",
"id": "2cdf3efc6e2f70e1b6cafca7c69317d9e343aedb",
"size": ... |
import os
import threading
from django.http import HttpResponse
from djangoautoconf.django_utils import retrieve_param
from obj_sys.models_ufs_obj import UfsObj
from tagging.models import Tag, TaggedItem
from tagging.utils import parse_tag_input
import json
class UfsFilter(object):
def __init__(self):
se... | {
"content_hash": "97a49752cbea6a07e2a47cf011820a35",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 106,
"avg_line_length": 32.888,
"alnum_prop": 0.5842860617854536,
"repo_name": "weijia/django-local-apps",
"id": "de0e6cf04a880bb33f7fdfe2b5938407acfbf8df",
"size": "4111"... |
"""anyconfig configobj backend module.
"""
from __future__ import absolute_import
from .configobj_ import Parser
__version__ = "0.1.4"
__all__ = ["Parser", ]
# vim:sw=4:ts=4:et:
| {
"content_hash": "fea977d7cb5e2e192a1389dbac7d0038",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 38,
"avg_line_length": 20,
"alnum_prop": 0.6444444444444445,
"repo_name": "ssato/python-anyconfig-configobj-backend",
"id": "0261cf3252ff06cc7c0dd04722c099f7d4d1fb66",
"size... |
import aggravator
from click.testing import CliRunner
def test_show_groups():
runner = CliRunner()
result = runner.invoke(aggravator.cli, [
'--uri=example/config.yml',
'--env=dev',
'--show'
])
assert result.exit_code == 0
assert 'app' in result.output
assert 'windows' in... | {
"content_hash": "1db35c00c08bc203b667cbd5761f8f83",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 44,
"avg_line_length": 25.76923076923077,
"alnum_prop": 0.6268656716417911,
"repo_name": "petercb/aggravator",
"id": "ed4aa6dd2b5416b5381e5279c74cfb4c1bbee47c",
"size": "33... |
from django.db import models
from django.dispatch import receiver
from django.contrib.auth.models import User
from allauth.account.signals import user_signed_up
from core.models import TimeStampedModel
class UserProfile(TimeStampedModel):
user = models.OneToOneField(User, related_name='profile')
email = mode... | {
"content_hash": "dd78ea3e52b33a5e2861f032117b8ad0",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 81,
"avg_line_length": 29.8125,
"alnum_prop": 0.6568832983927324,
"repo_name": "shubhendusaurabh/referiend",
"id": "c32f0c3e7af8155ec05a7c6b64fd78eacad2413e",
"size": "1431... |
from __future__ import (
unicode_literals,
print_function,
division,
absolute_import,
)
# Make Py2's str equivalent to Py3's
str = type('')
import picamera.mmal as mmal
class PiCameraWarning(Warning):
"""
Base class for PiCamera warnings.
"""
class PiCameraDeprecated(PiCameraWarni... | {
"content_hash": "d85fc149b50599220cf41ce9630e2983",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 85,
"avg_line_length": 30.523809523809526,
"alnum_prop": 0.6477379095163807,
"repo_name": "naziris/HomeSecPi",
"id": "1c11316c736f163268db56262b77864c17f0abc2",
"size": "4... |
import os
from lib.base_plugin import BasePlugin
class ZombieDriverPlugin(BasePlugin):
Name = "Zombie Driver"
support_os = ["Windows"]
def backup(self, _):
_.add_files('Settings', os.path.join(os.environ['APPDATA'], 'ZombieDriver'), [
'controller.cfg',
'Ogre17.cfg',
... | {
"content_hash": "104ba397cb53449d8723c2bbcde67f0d",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 94,
"avg_line_length": 32.285714285714285,
"alnum_prop": 0.5719026548672567,
"repo_name": "Pr0Ger/SGSB",
"id": "6781f0db2d1a2b520f7dcdbb940243338ab55e1e",
"size": "904",
... |
from scrapy.conf import settings
from scrapy.contrib.exporter import JsonItemExporter
class DjangoFixtureExporter(JsonItemExporter):
def export_item(self, item):
if self.first_item:
self.first_item = False
else:
self.file.write(',\n')
itemdict = {
... | {
"content_hash": "0348d4f042f27ef89652864d287006a6",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 62,
"avg_line_length": 27.22222222222222,
"alnum_prop": 0.5836734693877551,
"repo_name": "ltiao/nba_stats_bot",
"id": "c259585923809c361472a45376ceddf8d5b8e382",
"size": "4... |
import tkinter as tk
import constants.charts_constants as const
from utils.charts.chart_entries import ChartEntries
class ColumnChart(tk.Canvas):
"""
- Use to draw column chart.
"""
def __init__(self,
parent):
"""
:param parent: Parent.
"""
tk.Can... | {
"content_hash": "fa3a6e0d286d15034d75615d6e61ee7e",
"timestamp": "",
"source": "github",
"line_count": 269,
"max_line_length": 86,
"avg_line_length": 26.944237918215613,
"alnum_prop": 0.4326710816777042,
"repo_name": "dani-i/bachelor-project",
"id": "3c5e4008869e22b88842de664b34bde8cdfd4099",
"siz... |
if __name__ == "__main__":
import sys
import os
os.environ['DJANGO_SETTINGS_MODULE'] = \
'lino_book.projects.noi1r.settings'
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "60cc4f79974ee3034a4b2151ae754486",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 64,
"avg_line_length": 35.714285714285715,
"alnum_prop": 0.664,
"repo_name": "lino-framework/book",
"id": "1313ce281b4eb92b99dfac0de209938855d21810",
"size": "272",
"binar... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^(?P<project_slug>[a-zA-Z0-9\_\-\.]+)/?$',
'isafonda.views.fondasms_handler',
name='fondasms_project'),
url... | {
"content_hash": "d528183ecd54dbaae11267d639f5e207",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 56,
"avg_line_length": 31.5,
"alnum_prop": 0.6091269841269841,
"repo_name": "yeleman/isafonda",
"id": "d053c465fa006423338ac623c210e87e14a605e8",
"size": "504",
"binary":... |
from astropy.tests.pytest_plugins import *
from .tests.pytest_fixtures import *
# This is to figure out ccdproc version, rather than using Astropy's
from . import version
try:
packagename = os.path.basename(os.path.dirname(__file__))
TESTED_VERSIONS[packagename] = version.version
except NameError:
pass
... | {
"content_hash": "b3c37278c6df28ef565c238638428239",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 68,
"avg_line_length": 26.25,
"alnum_prop": 0.7476190476190476,
"repo_name": "evertrol/ccdproc",
"id": "22785cd9e01116385282fbfd0ae154e1bdb71ed1",
"size": "832",
"binary"... |
"""TopologyView app unit tests."""
# Copyright 2015 Solinea, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | {
"content_hash": "27d57b12e580fb38c8206074d104a084",
"timestamp": "",
"source": "github",
"line_count": 342,
"max_line_length": 79,
"avg_line_length": 38.845029239766085,
"alnum_prop": 0.5137372977041776,
"repo_name": "slashk/goldstone-server",
"id": "ca98eb08be5e8da476eb6f684fe313795c25047c",
"siz... |
"""
Simplifying the evaluation of a model. Multiple attacks are initialized and
run against a model at every evaluation step.
"""
import logging
import tensorflow as tf
from cleverhans.utils_tf import model_eval
from cleverhans.attacks import FastGradientMethod
from cleverhans.attacks import MadryEtAl
from attacks_m... | {
"content_hash": "7995fee10ea0fd0ac5caa676247c2806",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 79,
"avg_line_length": 37.58796296296296,
"alnum_prop": 0.5786426899864515,
"repo_name": "cihangxie/cleverhans",
"id": "165f3aea3e05c0144e839886a51ea3d724da6343",
"size": ... |
from app.dao.todoDao import TodoDao
class Todo():
def __init__(self, name, content):
self.name = name
self.content = content
@classmethod
def fromDB(cls, dbObj):
obj = cls(dbObj.get('name'), dbObj.get('content'))
obj.id = dbObj.get('_id')
return obj
def json... | {
"content_hash": "89cc041c31174f758b394090b9bd0551",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 58,
"avg_line_length": 20.772727272727273,
"alnum_prop": 0.5185995623632386,
"repo_name": "arpitbbhayani/penny",
"id": "f87b7315b3a74fca2d4bf9c8cada2c9f8a64e9db",
"size": "... |
"""
owtf.lib.owtf_process
~~~~~~~~~~~~~~~~~~~~~
Consists of owtf process class and its manager
"""
from multiprocessing import Process, Queue
from owtf.db.session import get_scoped_session
from owtf.utils.error import setup_signal_handlers
from owtf.plugin.runner import runner
from owtf.utils.logger import OWTFLogger... | {
"content_hash": "5b7fef5f24aa578bc8676e6bfe36624b",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 78,
"avg_line_length": 28.546875,
"alnum_prop": 0.6157635467980296,
"repo_name": "owtf/owtf",
"id": "fe6562b7d4cacc1ca7ddd1fc12934a300823d9b8",
"size": "1827",
"binary": ... |
class FacebookException(Exception):
pass
class IncompleteProfileError(FacebookException):
pass
class AlreadyConnectedError(FacebookException):
def __init__(self, users):
self.users = users
class AlreadyRegistered(FacebookException):
pass
class MissingPermissionsError(FacebookException):... | {
"content_hash": "fc3aed001fc39ec491e96fe69f0f8dc1",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 49,
"avg_line_length": 16.5,
"alnum_prop": 0.7515151515151515,
"repo_name": "michaelBenin/Django-facebook",
"id": "20f9d29bb3ffd2b00b906f8c38f4ce9417eba198",
"size": "330",... |
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| {
"content_hash": "3c155bbbf1884c1f65670fb257a828b1",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 42,
"avg_line_length": 26.5,
"alnum_prop": 0.6792452830188679,
"repo_name": "perezg/infoxchange",
"id": "2e375b3ca43b5eb8ed127df40905724a3f089f47",
"size": "152",
"binary"... |
from flask import Flask
from socketio import Server
from flask_restful import Api
app = Flask("REDIS_VIEWER", static_folder='static', static_url_path='')
sio = Server()
_api = Api(app)
@app.route("/")
def _provide_static():
return app.send_static_file('index.html')
def register(Resource, route):
"""
Re... | {
"content_hash": "d19d0ba9da291e346fc67fb99b2f6311",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 71,
"avg_line_length": 22.5,
"alnum_prop": 0.6868686868686869,
"repo_name": "fcjack/redis-viewer",
"id": "f53217141fc7141905f1960db040f81650da6ec6",
"size": "495",
"binar... |
import itertools
import json
import re
import sys
from pathlib import Path
import pytest
from jupyter_client.kernelspec import find_kernel_specs, get_kernel_spec
from jupytext.cell_reader import rst2md
from jupytext.cli import system
from jupytext.myst import is_myst_available
from jupytext.pandoc import is_pandoc_av... | {
"content_hash": "e5e0dde80718bd8a9f24cdcaa6697fa0",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 98,
"avg_line_length": 33.6985294117647,
"alnum_prop": 0.6679031202269256,
"repo_name": "mwouts/jupytext",
"id": "d5495d9ae466d7c5e80c21c6613a491eb05a44e7",
"size": "4583"... |
from __future__ import print_function
from gevent import monkey # noqa
monkey.patch_all() # noqa
import json
import logging
import operator
import sys
import traceback
import bottle
import bson
import pymongo
# __about__
__title__ = 'hello-bottle'
__summary__ = 'It says hello.'
__url__ = 'https://github.com/sams... | {
"content_hash": "dcfd2b2a911795b5ca52c756c39ccdc5",
"timestamp": "",
"source": "github",
"line_count": 297,
"max_line_length": 77,
"avg_line_length": 25.589225589225588,
"alnum_prop": 0.5851315789473684,
"repo_name": "samstav/hello-bottle",
"id": "6d52103336f0b7bbfe71d91a369962e08561dda5",
"size":... |
import bacon
font = bacon.Font('res/DejaVuSans.ttf', 24)
print('The font has ascent %d and descent %d' % (font.ascent, font.descent))
class Game(bacon.Game):
def on_tick(self):
bacon.clear(0, 0, 0, 1)
bacon.draw_string(font, 'Hello, Bacon!', 50, 50)
bacon.run(Game()) | {
"content_hash": "0974bef5493dfafd3856097b74f7f48f",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 76,
"avg_line_length": 28.9,
"alnum_prop": 0.643598615916955,
"repo_name": "aholkner/bacon",
"id": "4bcc79f9b0c996c7adb3bad6dfcc4d8c93a94d15",
"size": "289",
"binary": fa... |
import pygame
import Config
import Song
from Language import _
LEFT = 0x1
RIGHT = 0x2
UP = 0x4
DOWN = 0x8
ACTION1 = 0x10
ACTION2 = 0x20
KEY1 = 0x40
KEY2 = 0x80
KEY3 = 0x100
KEY4 = 0x200
KEY5 = 0x400
CANCEL = 0x800
SCORE_MULTIPLIER = [0, 10, 20, 30]
# define configuration keys
Config.defi... | {
"content_hash": "4e9dc9454de02ce9c6005b79797069de",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 84,
"avg_line_length": 28.7027027027027,
"alnum_prop": 0.5795668549905838,
"repo_name": "fretsonfire/fof-python",
"id": "68e19b2987dbfbde51d4f521f7cb23245938c877",
"size":... |
from __future__ import (absolute_import, division, print_function)
from odm2api.ODM2.models import (CVElevationDatum, CVSamplingFeatureGeoType,
CVSamplingFeatureType, SamplingFeatures)
import pytest
from .. import test_connection as testConnection
__author__ = 'stephanie'
dbs = tes... | {
"content_hash": "a3dabc4ac7699e224caf5950de3019b5",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 76,
"avg_line_length": 24.357142857142858,
"alnum_prop": 0.7126099706744868,
"repo_name": "emiliom/ODM2PythonAPI",
"id": "82c62836283ca9bb5715fb47f5a15003a922e903",
"size":... |
"""Calculate the total number of elements contained in a dictionary of lists"""
__author__ = 'Nicola Moretto'
__license__ = "MIT"
def howMany(aDict):
'''
Calculate the total number of elements contained in a dictionary of lists
:param aDict: Dictionary of lists
:return: Total size of lists
'''
... | {
"content_hash": "a2f846e55681d9fcc8b6f66fbb7ff3cc",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 79,
"avg_line_length": 26.8,
"alnum_prop": 0.654228855721393,
"repo_name": "nicola88/edx",
"id": "68a98873a98c57c36d1bbb2a84d7c00aed3b9085",
"size": "402",
"binary": fals... |
import os
import sys
import pinproc
import Queue
import yaml
import time
import copy
import logging
from procgame import config
from gameitems import *
from procgame import util
from mode import *
from pdb import PDBConfig, LED
from procgame import LEDs
def config_named(name):
if not os.path.isfile(name): # If we ... | {
"content_hash": "9b4617fa5a8750d9a938aa2a6b70a1f6",
"timestamp": "",
"source": "github",
"line_count": 762,
"max_line_length": 211,
"avg_line_length": 44.90288713910761,
"alnum_prop": 0.5736789805938742,
"repo_name": "mjocean/PyProcGameHD-SkeletonGame",
"id": "d395e9323e403f4d58fecd6dc13640ff71c5bb2... |
import unittest
import numpy as np
import sys
sys.path.append('..')
from op_test import OpTest, convert_float_to_uint16
import paddle
import paddle.fluid as fluid
from paddle.fluid import Program, program_guard
import paddle.fluid.core as core
paddle.enable_static()
class TestTransposeOp(OpTest):
def setUp(self... | {
"content_hash": "2e3d5b6d5a0566d0b86c50bbb782e4a1",
"timestamp": "",
"source": "github",
"line_count": 381,
"max_line_length": 86,
"avg_line_length": 35,
"alnum_prop": 0.5739032620922385,
"repo_name": "PaddlePaddle/Paddle",
"id": "a802f9da215b45e35636cf1a50f67d7c8ec508ea",
"size": "13948",
"bina... |
from twitter import *
o = Twitter("your-consumer-key","your-consumer-secret")
o.getRequestToken()
print o.getAuthorizeUrl()
verifier = raw_input("Verifier:")
o.getAccessToken(verifier)
while(1 == 1):
m = raw_input("Method:")
u = raw_input("URL:")
print o.get(m,u)
| {
"content_hash": "929df27c4103128637a5b6081e0fc35d",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 55,
"avg_line_length": 22.416666666666668,
"alnum_prop": 0.6951672862453532,
"repo_name": "joushx/OAuth.py",
"id": "c50ec8aa5a7504008e6bf64fa8954ec177b2ec0e",
"size": "269"... |
"""
Support for MQTT switches.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.mqtt/
"""
import logging
from typing import Optional
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.components.mqtt import (
A... | {
"content_hash": "b0ef1e55ba6ae21ca68e08a559531352",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 79,
"avg_line_length": 34.43564356435643,
"alnum_prop": 0.6232029902242668,
"repo_name": "persandstrom/home-assistant",
"id": "b79f8f12b877f6491615a43e7fa71c630323bc58",
"... |
from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.api import neutron as neutron
from openstack_dashboard.dashboards.router import dashboard
class Nexus1000v(horizon.Panel):
name = _("Cisco Nexus 1000v")
slug = 'nexus1000v'
permissions = ('openstack.services.n... | {
"content_hash": "e0b91477562c5329458b88b0f6f64398",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 59,
"avg_line_length": 29.571428571428573,
"alnum_prop": 0.7705314009661836,
"repo_name": "spandanb/horizon",
"id": "3698f46d501a4f30640eb2188086a3b68410e326",
"size": "109... |
"""The user interface for our app"""
import os,sys
# Import Qt modules
from PyQt4 import QtCore,QtGui
# Import the compiled UI module
from windowUi import Ui_MainWindow
# Create a class for our main window
class Main(QtGui.QMainWindow):
def __init__(self):
QtGui.QMainWindow.__init__(self)
... | {
"content_hash": "ec3889bdd0e8c81caa93906bf82ce00f",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 63,
"avg_line_length": 22.78125,
"alnum_prop": 0.6337448559670782,
"repo_name": "evandrix/Splat",
"id": "93a204c6c57ef78c7a7f9c85d526d1013318b613",
"size": "754",
"binary... |
import ast
import os.path
import dj_database_url
from django.contrib.messages import constants as messages
DEBUG = ast.literal_eval(os.environ.get('DEBUG', 'True'))
SITE_ID = 1
PROJECT_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))
ROOT_URLCONF = 'saleor.urls'
WSGI_APPLICATION = 'saleor.w... | {
"content_hash": "634f5a829b286d8b3530cd4214c958bb",
"timestamp": "",
"source": "github",
"line_count": 299,
"max_line_length": 78,
"avg_line_length": 29.51505016722408,
"alnum_prop": 0.6666288951841359,
"repo_name": "arth-co/saleor",
"id": "90c55c7c6e8d9b68230d8af21c3092e74b56d189",
"size": "8825"... |
from pyglet import app
from pyglet import gl
from pyglet import window
class Display(object):
'''A display device supporting one or more screens.
:Ivariables:
`name` : str
Name of this display, if applicable.
`x_screen` : int
The X11 screen number of this d... | {
"content_hash": "485fa168c8d3970e909709aa85f7760e",
"timestamp": "",
"source": "github",
"line_count": 299,
"max_line_length": 80,
"avg_line_length": 32.979933110367895,
"alnum_prop": 0.5672852651860866,
"repo_name": "niklaskorz/pyglet",
"id": "be1900bc9d9e08498c43fb38e9666294b5066eb5",
"size": "9... |
from plotly.basedatatypes import BaseTraceType as _BaseTraceType
import copy as _copy
class Ohlc(_BaseTraceType):
# class properties
# --------------------
_parent_path_str = ""
_path_str = "ohlc"
_valid_props = {
"close",
"closesrc",
"customdata",
"customdatasrc",... | {
"content_hash": "4808e7ef7ca4c0c9eda0ea2996830853",
"timestamp": "",
"source": "github",
"line_count": 1578,
"max_line_length": 89,
"avg_line_length": 31.042458808618505,
"alnum_prop": 0.5405940594059406,
"repo_name": "plotly/python-api",
"id": "5f23105e5fb6e02bd4da89022912ba657fc67ed4",
"size": "... |
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('..'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names ... | {
"content_hash": "8ca0ac6134e82fdffe41476d107e3eed",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 80,
"avg_line_length": 29.71875,
"alnum_prop": 0.6622502628811777,
"repo_name": "JackWalpole/splitwavepy",
"id": "41ad9da01d1d95f4478ec9addb1f0afe2baa9ec3",
"size": "5442"... |
from flask import render_template, request
from app import app
from brewmaster import BrewMaster
# ROUTING/VIEW FUNCTIONS
@app.route('/', methods=['GET'])
@app.route('/index', methods=['GET'])
def index():
search_term = request.args.get('search_term', None)
if search_term:
brew = BrewMaster(search_te... | {
"content_hash": "9e58f8f1218dbef49b846af84734b29e",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 77,
"avg_line_length": 28.526315789473685,
"alnum_prop": 0.6614391143911439,
"repo_name": "stormpython/brewmaster",
"id": "3fe8201d767176413526fc22a5a55e57a6ed6d55",
"size"... |
from django.conf.urls import patterns, include, url
from friends import views
urlpatterns = patterns('',
url(r'^$', views.index, name='index'),
url(r'^set_user/$', views.set_user, name='set_user'),
url(r'^friends/$', views.friends, name='friends'),
url(r'^remove_friend/$', views.remove_friend, name='re... | {
"content_hash": "ff53a08aa1b1df742a368c7554530927",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 72,
"avg_line_length": 41.63636363636363,
"alnum_prop": 0.648471615720524,
"repo_name": "Nagasaki45/Friends-Mapper",
"id": "c36938845358bc33d63897838c40bc1a8bc171f3",
"size... |
from verta._internal_utils import pagination_utils
class TestPaginationUtils:
def test_from_proto(self):
fn = pagination_utils.page_limit_from_proto
assert fn(-1) is None
assert fn(0) == 0
assert fn(1) == 1
def test_to_proto(self):
fn = pagination_utils.page_limit_to_pr... | {
"content_hash": "7c237f8658d259affa46d9c57edaf405",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 51,
"avg_line_length": 28.933333333333334,
"alnum_prop": 0.5783410138248848,
"repo_name": "mitdbg/modeldb",
"id": "70d82d92604c16db6b97dfc2fff649e8ad4b8973",
"size": "475",... |
import unittest
import mock
from sqlalchemy import *
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from latte.trackers import TagTracker
class TestTagTracker(unittest.TestCase):
def setUp(self):
self.db = mock.Mock()
self.tracker = TagTracker(self.... | {
"content_hash": "36a81f2bcae1b6f2a5fe0ef82a66d0cc",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 89,
"avg_line_length": 40.96153846153846,
"alnum_prop": 0.6676056338028169,
"repo_name": "flakas/Latte",
"id": "d5626a4311c8e726c67ab5a8af9026ac68d61d30",
"size": "2130",
... |
from rapidsms.apps.base import AppBase
class Unsubscribe(AppBase):
def handle(self, msg):
if msg.text == 'stop':
if msg.connection.contact is None:
msg.respond(
"You must JOIN or REGISTER yourself before you can " +
"stop echildcare serv... | {
"content_hash": "b68833b7293b2aaa4d58b17aef4091f5",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 90,
"avg_line_length": 34.10526315789474,
"alnum_prop": 0.5787037037037037,
"repo_name": "Parbhat/echildcare",
"id": "0e4c4baa4497fed1a6f3cf7f9a3f52e56e6be1a0",
"size": "64... |
from __future__ import print_function, division
from collections import deque
from random import randint
from sympy.external import import_module
from sympy import Mul, Basic, Number, Pow, Integer
from sympy.physics.quantum.represent import represent
from sympy.physics.quantum.dagger import Dagger
__all__ = [
# ... | {
"content_hash": "ced249d607b1366dccac7deba183e50f",
"timestamp": "",
"source": "github",
"line_count": 849,
"max_line_length": 80,
"avg_line_length": 32.45583038869258,
"alnum_prop": 0.6016330974414806,
"repo_name": "AunShiLord/sympy",
"id": "3f3917e303306adac43c8f1ee09e691ca5d8da38",
"size": "275... |
from conans import python_requires
import os
common = python_requires('llvm-common/0.0.0@orbitdeps/stable')
class LLVMInstCombine(common.LLVMModulePackage):
version = common.LLVMModulePackage.version
name = 'llvm_instcombine'
llvm_component = 'llvm'
llvm_module = 'InstCombine'
llvm_requires = ['ll... | {
"content_hash": "e2b964f781c4bf9ef0b3361daec4e303",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 106,
"avg_line_length": 36.63636363636363,
"alnum_prop": 0.7320099255583127,
"repo_name": "pierricgimmig/orbitprofiler",
"id": "b4d90de11bcd13d85de02ecffe08d63ecfe02e1e",
"... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('gametracker', '0002_game_match_player'),
]
operations = [
migrations.AlterField(
model_name='match',
name='notes',
field=models.TextField(default=None),
... | {
"content_hash": "e3125d2c08afa3f1cefb8aa72f35d8bf",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 50,
"avg_line_length": 21.0625,
"alnum_prop": 0.5727002967359051,
"repo_name": "GoogleCloudPlatform/serverless-expeditions",
"id": "3880ef9dba985b42fb5cd370500010e501192146",... |
"""
UncertaintySampling app of the Online Learning Library for Next.Discovery
author: Kevin Jamieson, [email protected]
last updated: 1/17/2015
"""
import numpy.random
from next.apps.PoolBasedTripletMDS.algs.RandomSampling import utilsMDS
from next.apps.PoolBasedTripletMDS.Prototype import PoolBasedTripletMDSP... | {
"content_hash": "d8c7409299e94547e6eb46d0a45669d9",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 100,
"avg_line_length": 30.23076923076923,
"alnum_prop": 0.6720101781170483,
"repo_name": "crcox/NEXT",
"id": "96034c993c27acebfbf03ecc6754a1b191f257d8",
"size": "3930",
... |
# Author: Lisandro Dalcin
# Contact: [email protected]
"""
Support for building mpi4py with distutils/setuptools.
"""
# -----------------------------------------------------------------------------
import os
import re
import sys
import copy
import glob
import shlex
import shutil
import platform
from distutils impo... | {
"content_hash": "fda5e747e242a9271f0b0dd27daa974a",
"timestamp": "",
"source": "github",
"line_count": 1330,
"max_line_length": 79,
"avg_line_length": 34.08796992481203,
"alnum_prop": 0.5539846041864261,
"repo_name": "mpi4py/mpi4py",
"id": "49caafa11eff7f8cecf554cffd727a32f8212fd3",
"size": "45337... |
"""
MoinMoin - Multiple configuration handler and Configuration defaults class
@copyright: 2000-2004 Juergen Hermann <[email protected]>,
2005-2008 MoinMoin:ThomasWaldmann.
2008 MoinMoin:JohannesBerg
@license: GNU GPL, see COPYING for details.
"""
import re
import os
import sy... | {
"content_hash": "12626d710ca0646007a5f4fda0d8cb3f",
"timestamp": "",
"source": "github",
"line_count": 1465,
"max_line_length": 429,
"avg_line_length": 48.33993174061433,
"alnum_prop": 0.6192211019797227,
"repo_name": "RealTimeWeb/wikisite",
"id": "8735afa82ca35a9ca100be1c0e696d46a7349b3e",
"size"... |
import numpy as np
from bokeh.models import ColumnDataSource, Plot, LinearAxis, Grid
from bokeh.models.markers import Cross
from bokeh.io import curdoc, show
N = 9
x = np.linspace(-2, 2, N)
y = x**2
sizes = np.linspace(10, 20, N)
source = ColumnDataSource(dict(x=x, y=y, sizes=sizes))
plot = Plot(
title=None, pl... | {
"content_hash": "7c961b99863680dcaa5c87cfc3e378b4",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 94,
"avg_line_length": 24.21875,
"alnum_prop": 0.712258064516129,
"repo_name": "stonebig/bokeh",
"id": "4d65c37b21f4d079f25849efe30f4c2b79ef6822",
"size": "775",
"binary"... |
"""Entity representing a Sonos battery level."""
from __future__ import annotations
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import DEVICE_CLASS_BATTERY, PERCENTAGE
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from .const import SONOS_CREATE_BATTERY
fr... | {
"content_hash": "aa8886294a580df9bd71a7baf6b50c89",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 82,
"avg_line_length": 31.6,
"alnum_prop": 0.6766877637130801,
"repo_name": "lukas-hetzenecker/home-assistant",
"id": "a71ac7cef218d9ef791ceee4bc836c68b96e69f0",
"size": "1... |
from django.conf import settings
from django.test import TestCase
from django.test.utils import override_settings
from ..bower import bower_adapter
import os
import shutil
try:
TEST_COMPONENTS_ROOT = os.path.join(
settings.TEST_PROJECT_ROOT, 'bower_components',
)
except AttributeError:
TEST_COMPON... | {
"content_hash": "a946a835f21622e01e9ab54c699685f5",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 79,
"avg_line_length": 29.2972972972973,
"alnum_prop": 0.6808118081180812,
"repo_name": "ramcn/demo3",
"id": "ca61152b33af9c699347b9c415d042dbc85a91df",
"size": "1084",
"... |
import os
INSTALLED_APPS = (
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.sitemaps",
"django.contrib.admin",
"django.contrib.staticfiles",
"django.contrib.messages",
"feincms",
"feincms.module.medialibrary",
"testapp",
"el... | {
"content_hash": "267a49944825cd830ced76162c8a132d",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 70,
"avg_line_length": 27.057471264367816,
"alnum_prop": 0.6308411214953271,
"repo_name": "feincms/feincms-elephantblog",
"id": "717501b88f807be80831f7e4f5b638aa40699f05",
... |
from __future__ import annotations
import math
import pathlib
import warnings
import meshio
import npx
import numpy as np
from numpy.typing import ArrayLike, NDArray
from ._exceptions import MeshplexError
from ._helpers import _dot, _multiply, grp_start_len
__all__ = ["Mesh"]
class Mesh:
def __init__(self, po... | {
"content_hash": "39750e4e935101bfed66ee66021241f4",
"timestamp": "",
"source": "github",
"line_count": 1396,
"max_line_length": 97,
"avg_line_length": 38.38037249283668,
"alnum_prop": 0.5547882565930682,
"repo_name": "nschloe/voropy",
"id": "c5efdd0f8da0718a77b3282afcc7a0a0d85d7f14",
"size": "5357... |
from plugin import UserEventConditionPlugin, PLUGIN_CONST, plugin_name
# setup localization for both plugin text and configuration pane
# locale.setlocale(locale.LC_ALL, locale.getlocale())
# locale.bindtextdomain(APP_NAME, APP_LOCALE_FOLDER)
# locale.textdomain(APP_NAME)
# _ = locale.gettext
# if localization is su... | {
"content_hash": "cead4b380d89fc66e0d6f54d06dbbc8d",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 77,
"avg_line_length": 35.16981132075472,
"alnum_prop": 0.6716738197424893,
"repo_name": "almostearthling/when-wizard",
"id": "c8a372f797a0749c0f6cebfaea2865d21337a61d",
"s... |
import cv2
import numpy as np
class Square(object):
'''
Object that represents a _projected_ square`
'''
def __init__(self, vertices):
'''
Initialise the object by giving it a list of vertices
[[x1,y1],...[xn,yn]]
'''
self.vertices = vertices
... | {
"content_hash": "741d12e2ee4d2534951d49affb4f46c7",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 83,
"avg_line_length": 26.09090909090909,
"alnum_prop": 0.5313588850174216,
"repo_name": "ezietsman/photogrammetry-playground",
"id": "a1eaa0ed8d46d9c5a6c9e4dc81fea0e9d0e748... |
"""
定时任务
"""
import logging
from apscheduler.schedulers.blocking import BlockingScheduler
from apscheduler.executors.pool import ThreadPoolExecutor
from pytz import timezone
import redis
from app import app
from archive import ArchiveManager
from models import Activity
if 'REDIS' in app.config:
redis_client = redi... | {
"content_hash": "4815437ef1ff8e4269daabbac8f4bf04",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 105,
"avg_line_length": 29.555555555555557,
"alnum_prop": 0.7377819548872181,
"repo_name": "ak64th/IntQuiz",
"id": "5f687d839cda659c946d9df4f8ed1566a7a186bc",
"size": "1087... |
from __future__ import print_function
from __future__ import absolute_import
import sys
import jinja2
TEMPLATE = """from django.test import TestCase
from django.core.urlresolvers import reverse
class TestView(TestCase):
{% for target, name in targets %}
def test_{{ name|replace('-', '_') }}(self):
# ... | {
"content_hash": "aa67dbdcb28de43af942c69c597805e2",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 54,
"avg_line_length": 25.115384615384617,
"alnum_prop": 0.6431852986217458,
"repo_name": "artcz/epcon",
"id": "49f054fe55104ebed9eaadbfc81d5b64fede9b62",
"size": "675",
... |
import unittest
import sys
import os
import mock
sys.path.append('./spark_jobs')
class Test_base(unittest.TestCase):
@staticmethod
def _get_target_class():
from base import MarrecoBase
return MarrecoBase
def test_ctor(self):
klass = self._get_target_class()(['test'])
se... | {
"content_hash": "857ec2708436006a92cd03828cd1981c",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 60,
"avg_line_length": 21.333333333333332,
"alnum_prop": 0.6,
"repo_name": "WillianFuks/PySpark-RecSys",
"id": "abc4ae7fd9c4a5e924375d5e9b45f92d84d1caf3",
"size": "1731",
... |
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):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations ... | {
"content_hash": "3ee193af2ac0f60c819ac76f7bd1cfbf",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 124,
"avg_line_length": 34.67857142857143,
"alnum_prop": 0.6148300720906282,
"repo_name": "andela-engmkwalusimbi/Picha",
"id": "cde493f77495f5bd482e3eaa3a4d5f4c6b3e1b8d",
"... |
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
class DecoderRNN(nn.Module):
def __init__(self, hidden_size, output_size, n_layers=1, use_cuda=True):
super(DecoderRNN, self).__init__()
self.hidden_size = hidden_size
self.n_layers = n_l... | {
"content_hash": "92dd806fc14d45aa28d7159c5cd0a1cb",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 76,
"avg_line_length": 33.1875,
"alnum_prop": 0.6139359698681732,
"repo_name": "dikshant2210/Neural-Machine-Translation",
"id": "0c47407db1f10d6b19d84274cdef759912e7949b",
... |
from datetime import date
import pytest
from xs import Boolean, Date, Integer, PositiveInteger, TopLevelElement
from xs.test import assert_valid, assert_invalid, assert_converts
def test_Boolean_from_xml():
assert Boolean.from_xml("0") == False
assert Boolean.from_xml("1") == True
assert Boolean.from_xml... | {
"content_hash": "c6abda8a848f9111e1a148f6636c9ae4",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 76,
"avg_line_length": 24.506666666666668,
"alnum_prop": 0.6343852013057671,
"repo_name": "gtback/excess",
"id": "87ad8ecbdbe4c9fff4ab6f282ee1bc935e773ef3",
"size": "1838",... |
import datetime
import htmls
import mock
from django import forms
from django.contrib import messages
from django.http import Http404
from django.test import TestCase
from django.utils import timezone
from cradmin_legacy import cradmin_testhelpers
from model_bakery import baker
from devilry.apps.core.models import As... | {
"content_hash": "fa00d931483102afda22cb24a172742f",
"timestamp": "",
"source": "github",
"line_count": 920,
"max_line_length": 118,
"avg_line_length": 48.74891304347826,
"alnum_prop": 0.6131017413989164,
"repo_name": "devilry/devilry-django",
"id": "a3f4f8580c58f953243df0ec10f5d6ece1335b18",
"size... |
__author__ = 'Igor'
import pandas as pd
import nltk
from nltk.corpus import stopwords
import re
from bs4 import BeautifulSoup
TRAIN_FILE_PATH = "data/labeledTrainData.tsv"
TEST_FILE_PATH = "data/testData.tsv"
def load(test=False, remove_stopwords=False):
if test:
path = TEST_FILE_PATH
e... | {
"content_hash": "0d24082c840f620ee2478127f4126452",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 88,
"avg_line_length": 29.266666666666666,
"alnum_prop": 0.6066818526955201,
"repo_name": "IgowWang/MyKaggle",
"id": "10f27f636971437b80827176f0b5bd0ba01385b7",
"size": "14... |
import sys,logging,shutil
logger = logging.getLogger(__name__)
from AlpgenInputFile import AlpgenInputFile
sys.path.append('/users/hpcusers/balsam/argo_deploy/argo_core')
from ArgoJob import ArgoJob
from BalsamJob import BalsamJob
import GridFtp
class AlpgenArgoJob:
INPUT_FILE_POSTFIX_IMODE0 = '.input.0'
INPUT_F... | {
"content_hash": "602ab4c3a1a0dcc799f1fd310a626f56",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 125,
"avg_line_length": 44.95302013422819,
"alnum_prop": 0.5407584353538369,
"repo_name": "hep-cce/hpc-edge-service",
"id": "bfd23550ff5ac96894a940afe810356e7c2f507f",
"si... |
from .nc_api import OobController
from .nc_api import ConnectError
| {
"content_hash": "1032f944c437ae6ea9eb77752e00d172",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 33,
"avg_line_length": 33.5,
"alnum_prop": 0.8208955223880597,
"repo_name": "intel-ctrlsys/actsys",
"id": "ab306d53045af59c2f7b588287c5aa54ab93bbf2",
"size": "128",
"binar... |
import datetime
class DateRange(object):
near_time = datetime.timedelta(seconds=10 * 60)
def __init__(self, start, end):
assert start < end
self._start, self._end = start, end
@property
def start(self):
return self._start
@property
def end(self):
return self.... | {
"content_hash": "44e0e237cb1806aea7730fe7d537d1c4",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 98,
"avg_line_length": 33.241379310344826,
"alnum_prop": 0.5632780082987552,
"repo_name": "leohemsted/gfitpy",
"id": "4bd08bb3268f5b4f34f6043e376244fddb40776c",
"size": "28... |
from twisted.python import usage
from ooni.utils import log
from ooni.utils import randomStr, randomSTR
from ooni.templates import tcpt
class UsageOptions(usage.Options):
optParameters = [
['backend', 'b', None, 'The OONI backend that runs a TCP echo server'],
['backendport', 'p', 80,
'S... | {
"content_hash": "886f1ca0a82dc31d3e48209eda5559cd",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 79,
"avg_line_length": 32.05882352941177,
"alnum_prop": 0.6089121887287025,
"repo_name": "0xPoly/ooni-probe",
"id": "2109677192e4be370cfade012cb16d3f4895428d",
"size": "38... |
"""
Author: Isabel Restrepo
"""
import os, sys, subprocess
import glob
import time
from optparse import OptionParser
import numpy as np
from numpy import linalg as LA
#from vpcl_adaptor import *
#from boxm2_utils import *
#parser = OptionParser()
#parser.add_option("--srcRoot", action="store", type="string", dest="s... | {
"content_hash": "15d965ccbe26593c8808cab196d038f6",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 166,
"avg_line_length": 29.608695652173914,
"alnum_prop": 0.6605482134116495,
"repo_name": "mirestrepo/voxels-at-lems",
"id": "a589e69f4a824ab731012c4f5196ad4fd8c65605",
"... |
import re
import json
import fileinput
import collections
import emoji
counts = collections.Counter()
EMOJI_RE = emoji.get_emoji_regexp()
for line in fileinput.input():
tweet = json.loads(line)
if 'full_text' in tweet:
text = tweet['full_text']
else:
text = tweet['text']
for char in ... | {
"content_hash": "8578f940ab305701e3f696b373da4ca5",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 40,
"avg_line_length": 20.363636363636363,
"alnum_prop": 0.6428571428571429,
"repo_name": "edsu/twarc",
"id": "dd26163e630547c0c8b3ade511ab772a509a9f82",
"size": "472",
"... |
from oslo_utils import timeutils
import six
from tempest.api.identity import base
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
class TokensV3Test(base.BaseIdentityV3Test):
@decorators.idempotent_id('a9512ac3-3909-48a4-b395-11f438e16260')
def test_validate_token(self):
... | {
"content_hash": "0e5ec87e25a82f8ba1ed2ac20734d7c7",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 79,
"avg_line_length": 42.888888888888886,
"alnum_prop": 0.6354552183567728,
"repo_name": "masayukig/tempest",
"id": "fa1c47ffc40595b8350e98e1f0cb8c8ebedd3c08",
"size": "6... |
import password_encrypt
import templating
from google.appengine.ext import ndb
class User(ndb.Model):
name = ndb.StringProperty(required=True)
pw_hash = ndb.StringProperty(required=True)
email = ndb.StringProperty()
joindate = ndb.DateTimeProperty(auto_now_add=True)
@classmethod
def by_id(cl... | {
"content_hash": "7a05753e0f09932e2a9c3327b2638968",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 73,
"avg_line_length": 28.40721649484536,
"alnum_prop": 0.5826528760660498,
"repo_name": "samrum/fswd-project3",
"id": "51994d2401f32d13111c9f41e6917ac5c35dac3a",
"size": ... |
import SocialObjectGateway
import PolicyProcessor
from tests import *
import Exceptions
| {
"content_hash": "ee30e8aec20d3f7cb4ffe5a048b28e73",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 26,
"avg_line_length": 22,
"alnum_prop": 0.875,
"repo_name": "uoscompsci/PRISONER",
"id": "72d2f0ee64546e17a1cb340156fc86818ba45863",
"size": "88",
"binary": false,
"cop... |
from collections import OrderedDict
from pants.backend.native.targets.native_artifact import NativeArtifact
from pants.backend.native.targets.native_library import CLibrary, CppLibrary
from pants.backend.native.tasks.c_compile import CCompile
from pants.backend.native.tasks.cpp_compile import CppCompile
from pants.bac... | {
"content_hash": "21a9f2eb2599b1a21442e67ce9f58966",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 93,
"avg_line_length": 40.12258064516129,
"alnum_prop": 0.5553947579996784,
"repo_name": "tdyas/pants",
"id": "560823367db51ef3187fd920d39a9123967e342e",
"size": "6351",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.