text stringlengths 4 1.02M | meta dict |
|---|---|
'''
Script to generate:
a. measurement units, their max min and avg values from the data/ metadata generated in previous steps.
b. clustering of units based on domain. eg: metre, centimeter -> LENGTH, joule ->ENERGY etc.
c. clustering of units based on MIME type
Requirements:
i. A map of units and domains- available... | {
"content_hash": "d55d2d4cd4e5b74bcb4a629ccb7ec3f8",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 201,
"avg_line_length": 34.86082474226804,
"alnum_prop": 0.6608014194883928,
"repo_name": "harshfatepuria/Evaluation-of-Content-Analysis-on-TREC-Polat-DD-Dataset",
"id": "65... |
from django.core.checks import Error, register
from feder.records.models import Record, AbstractRecord
from feder.records.registry import record_type_registry
@register()
def record_type_registry_fill_check(app_configs, **kwargs):
errors = []
for field in Record._meta.related_objects:
if (
... | {
"content_hash": "a3568d19d4bd58c2f0e6cbe66732c356",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 81,
"avg_line_length": 32.333333333333336,
"alnum_prop": 0.5927835051546392,
"repo_name": "watchdogpolska/feder",
"id": "7241ee45c7f869f4f13792ffaa2f0a0bd11e3f49",
"size": ... |
from django.conf.urls.defaults import patterns, url
from nepal.resources import views
urlpatterns = patterns('',
url('^profile/edit/(\d+)/$', views.profile_edit, name='nepal-resources-profile-edit'),
url('^pack/create/$', views.pack_create, name='nepal-resources-pack-create'),
url('^pack/edit/(\d+)... | {
"content_hash": "e08de62d65ec3e9eb1198ee90576ac0b",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 90,
"avg_line_length": 56.3,
"alnum_prop": 0.6483126110124334,
"repo_name": "hollow/nepal",
"id": "53a88f5d533da7b442b2d016d60ddb17e9b3dbbb",
"size": "563",
"binary": fal... |
from collections import defaultdict
from itertools import combinations, product
import kevlar
from kevlar.sequence import Record, KmerOfInterest
from kevlar.sequence import write_record, parse_augmented_fastx
from khmer import Counttable
from networkx import Graph, connected_components
from re import search
class Kev... | {
"content_hash": "735d0a81fcebaecea4e0fc375914a3b0",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 78,
"avg_line_length": 28.293478260869566,
"alnum_prop": 0.6258163657318478,
"repo_name": "dib-lab/kevlar",
"id": "57df89d11023d9d6291a27c233e65b05cb1c8356",
"size": "2974"... |
"""A collection of data structures that are particularly
useful for developing and improving a classifier
"""
import numpy
import json
class ConfusionMatrix(object):
"""Confusion matrix for evaluating a classifier
For more information on confusion matrix en.wikipedia.org/wiki/Confusion_matrix
"""
I... | {
"content_hash": "576937b040a7e1d77b6067bc9384c280",
"timestamp": "",
"source": "github",
"line_count": 323,
"max_line_length": 102,
"avg_line_length": 35.55727554179567,
"alnum_prop": 0.5856334349151067,
"repo_name": "jimmycallin/master-thesis",
"id": "a428921bafe206eeda19909a682e4310bfa68378",
"s... |
import getopt
import sys
from coapthon.server.coap import CoAP
from exampleresources import BasicResource,BasicResource1,BasicResource2,BasicResource3,BasicResource4,BasicResource5,BasicResource6,BasicResource7 , Long, Separate, Storage, Big, voidResource, XMLResource, ETAGResource, \
Child, \
MultipleEncodingR... | {
"content_hash": "1330c85efce37ec652db44f1b923b1b0",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 222,
"avg_line_length": 35.361111111111114,
"alnum_prop": 0.6087981146897093,
"repo_name": "thejdeep/CoAPthon",
"id": "c9d61ba3d701b63ab5d81e1a0e5667961e505aaa",
"size": "2... |
from distutils.core import setup
setup(
name='sogemood-backend',
version='1.0',
packages=[''],
url='sogemood.appspot.com',
license='MIT',
author='mwerlen',
author_email='maxime@werlen.fr',
description='SogeMood\'s Backend'
)
| {
"content_hash": "62b5a026f7c713c0434c52019e7d5268",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 37,
"avg_line_length": 21.5,
"alnum_prop": 0.6395348837209303,
"repo_name": "SogeMood/sogemood-backend",
"id": "90d8d1638a20b26c58ede927d8edd43e9e26ad10",
"size": "258",
... |
"""Implements the majority of smart_open's top-level API.
The main functions are:
* ``parse_uri()``
* ``open()``
"""
import collections
import io
import locale
import logging
import os
import os.path as P
import pathlib
import urllib.parse
import warnings
#
# This module defines a function called smart_open so... | {
"content_hash": "85ea9de4834c0352cda1a2ee1cc366ff",
"timestamp": "",
"source": "github",
"line_count": 513,
"max_line_length": 106,
"avg_line_length": 30.857699805068226,
"alnum_prop": 0.6435881238155401,
"repo_name": "RaRe-Technologies/smart_open",
"id": "b827a2210194e86f4cf35a3dbe1c5905f344271b",
... |
from typing import MutableMapping, MutableSequence
from google.protobuf import timestamp_pb2 # type: ignore
from google.type import postal_address_pb2 # type: ignore
import proto # type: ignore
from google.cloud.channel_v1.types import common
__protobuf__ = proto.module(
package="google.cloud.channel.v1",
... | {
"content_hash": "c2be0d5dfac97b1128b1326c837e841c",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 78,
"avg_line_length": 32.3,
"alnum_prop": 0.6056071551427589,
"repo_name": "googleapis/python-channel",
"id": "3d6ecc6cca4a6f8935be0f8fab75166010518942",
"size": "6414",
... |
import rospy
import thread
import threading
import time
import mavros
import actionlib
import smach
import smach_ros
from math import *
from mavros.utils import *
from mavros import setpoint as SP
from tf.transformations import quaternion_from_euler
from uav_explorer_states import *
from util_states import *
from uav_... | {
"content_hash": "8169712c6dd3c8e9d52f504ba300f606",
"timestamp": "",
"source": "github",
"line_count": 373,
"max_line_length": 155,
"avg_line_length": 35.16353887399464,
"alnum_prop": 0.5417047880451357,
"repo_name": "kuri-kustar/kuri_mbzirc_challenge_3",
"id": "7a0501ab05ae91079393369e25d6ab3f1e0a3... |
"""Tests for baremetal utils."""
import mox
from nova import exception
from nova import test
from nova.virt.baremetal import utils
class BareMetalUtilsTestCase(test.TestCase):
def test_random_alnum(self):
s = utils.random_alnum(10)
self.assertEqual(len(s), 10)
s = utils.random_alnum(100... | {
"content_hash": "a8b483140e964a08b7c8e4ea4330ed2e",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 44,
"avg_line_length": 22.5,
"alnum_prop": 0.6861111111111111,
"repo_name": "fajoy/nova",
"id": "827b1fcaf0b1b4ef78a61bd1b8916fa67f3858cb",
"size": "1077",
"binary": fals... |
import datetime
import json
import logging
import os
import pickle
import threading
import time
import urllib
import uuid
from functools import wraps
import google.appengine.api.users
import webapp2
from google.appengine.api import taskqueue
from google.appengine.api.datastore_errors import TransactionFailedError
from... | {
"content_hash": "fc8310609ab9a9927afc273f8d6a10a3",
"timestamp": "",
"source": "github",
"line_count": 579,
"max_line_length": 126,
"avg_line_length": 33.06390328151986,
"alnum_prop": 0.6334621813623067,
"repo_name": "our-city-app/oca-backend",
"id": "883b13afc6873bdfa9372bb528df87dfc55eb77d",
"si... |
"""This module is deprecated. Please use :mod:`airflow.sensors.base`."""
import warnings
# pylint: disable=unused-import
from airflow.sensors.base import BaseSensorOperator # noqa
warnings.warn(
"This module is deprecated. Please use `airflow.sensors.base`.", DeprecationWarning, stacklevel=2
)
| {
"content_hash": "dc049d89f755c25ae300d5dae6f50f46",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 101,
"avg_line_length": 30.3,
"alnum_prop": 0.7623762376237624,
"repo_name": "sekikn/incubator-airflow",
"id": "cfcc6842f0f74b8b5c0aa3e53e1b74ceb66c14f0",
"size": "1090",
... |
from boxlet.game_engine import GameEngine
import pyglet
from pyglet.gl import *
class MyWindow(pyglet.window.Window):
def __init__(self, **kwargs):
super(MyWindow, self).__init__(**kwargs)
glEnable(GL_BLEND)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
self.time = 0.0
... | {
"content_hash": "b1f69e6d79334a8cd869f08c3393a7b9",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 78,
"avg_line_length": 32.927536231884055,
"alnum_prop": 0.6139964788732394,
"repo_name": "elemel/boxlet",
"id": "23bf69f6f76bce2b0c770d70637bd09c30479b3b",
"size": "2272",... |
"""Kerberos command"""
from __future__ import annotations
import daemon
from daemon.pidfile import TimeoutPIDLockFile
from airflow import settings
from airflow.security import kerberos as krb
from airflow.utils import cli as cli_utils
from airflow.utils.cli import setup_locations
@cli_utils.action_cli
def kerberos(... | {
"content_hash": "337ada52f03e06171bced692d12e53b5",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 84,
"avg_line_length": 30.944444444444443,
"alnum_prop": 0.6346499102333932,
"repo_name": "nathanielvarona/airflow",
"id": "eec77f6d6f745718fbaa54ccda7c42c1d7856b0c",
"size... |
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('deploys', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='deplo... | {
"content_hash": "72c6e09b1c81e6c529d39eca44843c68",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 154,
"avg_line_length": 31.48148148148148,
"alnum_prop": 0.6176470588235294,
"repo_name": "mQuadrics/videplo",
"id": "500dec6e30256d4cfcdf8b2700f0005cea35a378",
"size": "92... |
import uuid
import mock
import tempfile
from pyethereum.utils import sha3
class ConfigHook(object):
def before_feature(self, context, feature):
'''
.. note::
`context.conf` is used instead of `context.config` because `config`
is used internally in `context` by *behave*
... | {
"content_hash": "26bc16e487ce5f4d90eecff1052fe597",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 79,
"avg_line_length": 28.34090909090909,
"alnum_prop": 0.5517241379310345,
"repo_name": "mrmayfield/pyethereum",
"id": "2ee81283714174a1abb263fbe81e25120862dae4",
"size": ... |
from mrq.job import Job
import pytest
from mrq.queue import Queue, send_task
import time
from mrq.context import set_current_config, get_config
def test_pause_resume(worker):
worker.start(flags="--paused_queues_refresh_interval=0.1")
Queue("high").pause()
assert Queue("high").is_paused()
# wait fo... | {
"content_hash": "7736fd488cd47b2a6b13bdaf7a9c4752",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 112,
"avg_line_length": 24.193548387096776,
"alnum_prop": 0.6233333333333333,
"repo_name": "pricingassistant/mrq",
"id": "42f5b33b9a0d4bf2f8d81dc65ec7480873ad770d",
"size"... |
import sys
import os
from rstem import led_matrix, button
import random
import time
# notify of progress
print("P50")
sys.stdout.flush()
# initialize led matrix
#led_matrix.init_grid(2,2)
led_matrix.init_matrices([(0,8),(8,8),(8,0),(0,0)])
# set up buttons
A = 4
B = 17
UP = 25
DOWN = 24
LEFT = 23
RIGHT = 18
START =... | {
"content_hash": "b1fe534b603f4ff96a3c53036f943774",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 92,
"avg_line_length": 29.70731707317073,
"alnum_prop": 0.5686918445539135,
"repo_name": "scottsilverlabs/raspberrystem",
"id": "a2418d2c8614872277d199fd4bd4e9d828ac01e1",
... |
from pickle_this import get_data | {
"content_hash": "e7f5c4bd39df5ed614e3e93b7fd9a58a",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 32,
"avg_line_length": 32,
"alnum_prop": 0.84375,
"repo_name": "chrisjdavie/Cookit",
"id": "44eefc70d1ea63459dd78cca1f0da8104a1682f7",
"size": "32",
"binary": false,
"co... |
import pytest
from test.conftest import got_postgresql
@pytest.mark.skipif(not got_postgresql(), reason='Needs postgresql')
class TestSqlitePostgresSchemaEquivalence(object):
def test_equality(self, schema_sl, schema_pg):
sl_table_names = set([t.name for t in schema_sl.tables])
pg_table_names = s... | {
"content_hash": "6a39d92f751ba0ea2a854cc3b0b0a779",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 76,
"avg_line_length": 38.464285714285715,
"alnum_prop": 0.6248839368616528,
"repo_name": "freewilll/abridger",
"id": "784ca88da4959d82031d8db166504dcee2042417",
"size": "1... |
import sys
from osgpypp import osg
from osgpypp import osgDB
from osgpypp import osgText
from osgpypp import osgViewer
# Translated from file 'osgtexture2D.cpp'
# OpenSceneGraph example, osgtexture2D.
#*
#* Permission is hereby granted, free of charge, to any person obtaining a copy
#* of this software and associ... | {
"content_hash": "eedc62fed4379163504183b0463f70b1",
"timestamp": "",
"source": "github",
"line_count": 709,
"max_line_length": 144,
"avg_line_length": 32.141043723554304,
"alnum_prop": 0.6478409689310163,
"repo_name": "JaneliaSciComp/osgpyplusplus",
"id": "b1806cf75d91c48f3d35f005a8decc4903d90943",
... |
import mne
import sys
from mne import compute_covariance
from my_settings import (epochs_folder, mne_folder)
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
reject = dict(
grad=4000e-13, # T / m (gradiometers)
mag=4e-12, # T (magnetometers)
eeg=180e-6 #
)
subject = sys.argv[1... | {
"content_hash": "a52d5974e5c0ceb7cc8cae4ea66a63c0",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 76,
"avg_line_length": 24.642857142857142,
"alnum_prop": 0.7072463768115942,
"repo_name": "MadsJensen/CAA",
"id": "8a1f48dae0509eaabdf15a850cdc57fbfa9bcf4c",
"size": "690",... |
from aiida.orm import Code, DataFactory
from aiida.orm.workflow import Workflow
from aiida.workflows.wf_phonon import WorkflowPhonon
from aiida.orm import load_node, load_workflow
from aiida.orm.calculation.inline import make_inline
StructureData = DataFactory('structure')
ParameterData = DataFactory('parameter')
Arra... | {
"content_hash": "7b72328f42209381cd4de2b84fa2b2f0",
"timestamp": "",
"source": "github",
"line_count": 279,
"max_line_length": 130,
"avg_line_length": 40.939068100358426,
"alnum_prop": 0.6382419891437576,
"repo_name": "abelcarreras/aiida_extensions",
"id": "6ce6cb236899414b56bed0ba36c3acc65f28d800",... |
import django.utils.version
from .constants import DEFAULT_PROTOCOL
from .fields import PickledObjectField
__all__ = 'VERSION', '__version__', 'DEFAULT_PROTOCOL', 'PickledObjectField'
VERSION = (3, 1, 0, 'final', 0)
__version__ = django.utils.version.get_version(VERSION)
| {
"content_hash": "2d4383d4d4c93820627dce3d55dbcae4",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 76,
"avg_line_length": 27.6,
"alnum_prop": 0.7246376811594203,
"repo_name": "gintas/django-picklefield",
"id": "46e9c081aab70a730debbd77d2de1c4f2a7aa533",
"size": "276",
... |
from __future__ import unicode_literals
from django.contrib.sites.models import Site
from django.db import models, connection
from django.db.backends.utils import truncate_name
from django.test import TestCase
from .models.publication import Publication
from .models.article import Article
class Advertisement(models... | {
"content_hash": "de0523f55403484868407e71e0c8a55f",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 98,
"avg_line_length": 34.758620689655174,
"alnum_prop": 0.6418650793650794,
"repo_name": "gdi2290/django",
"id": "84b1dd1c301fb0a7c880bf6b60373ecca129a0f1",
"size": "3024"... |
from graphene import Schema
class Schema(Schema):
"""
This class creates a graphql schema that resolves its fields using
the natuilus event queue for asynchronous data retrieval.
"""
def __init__(self, executor=None, auto_camelcase=None, **kwds):
super().__init__(
auto_c... | {
"content_hash": "33f9105a9d232f0a5545c7f17d71ca32",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 74,
"avg_line_length": 30.416666666666668,
"alnum_prop": 0.6054794520547945,
"repo_name": "aaivazis/nautilus",
"id": "3b7454a6a44bfabbdeb4f7bb6e306a1103ee2592",
"size": "38... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import cv2
import numpy as np
try:
import cPickle as pickle
except ImportError:
import pickle
import os
import math
from utils.timer import Timer
from utils.cython_nms import nms, nms_new
from utils.boxes_g... | {
"content_hash": "4704b9089dc5b1c763f580855fdcb62d",
"timestamp": "",
"source": "github",
"line_count": 191,
"max_line_length": 101,
"avg_line_length": 32.910994764397905,
"alnum_prop": 0.6264715240216354,
"repo_name": "kukuruza/tf-faster-rcnn",
"id": "932fc888dd917e88827e22b0344b3105d20e094d",
"si... |
"""Unit tests to cover AdGroupAdService."""
__author__ = 'api.sgrinberg@gmail.com (Stan Grinberg)'
import base64
import os
import sys
sys.path.insert(0, os.path.join('..', '..', '..'))
import unittest
from adspygoogle.common import Utils
from tests.adspygoogle.adwords import HTTP_PROXY
from tests.adspygoogle.adword... | {
"content_hash": "e97a4b48f42504dc237150095fbfa453",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 78,
"avg_line_length": 31.827338129496404,
"alnum_prop": 0.5522151898734177,
"repo_name": "nearlyfreeapps/python-googleadwords",
"id": "319c26b4489abba5d9a5724f89524f11282e5... |
import dask.dataframe as dd
import pandas as pd
from featuretools.utils.gen_utils import import_or_none, is_instance
ps = import_or_none('pyspark.pandas')
def to_pandas(df, index=None, sort_index=False, int_index=False):
'''
Testing util to convert dataframes to pandas. If a pandas dataframe is passed in, j... | {
"content_hash": "7998987be8032978421c6b396a559cd1",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 115,
"avg_line_length": 32.53333333333333,
"alnum_prop": 0.6591530054644809,
"repo_name": "Featuretools/featuretools",
"id": "db4345404b6ca90e4eed93171b796043cdc6f8bb",
"si... |
"""Main entry point into the Identity service."""
import abc
import functools
import os
import uuid
from oslo_config import cfg
from oslo_log import log
from oslo_utils import importutils
import six
from keystone import clean
from keystone.common import cache
from keystone.common import dependency
from keystone.comm... | {
"content_hash": "18b82d3f7fd474291939590911c06d17",
"timestamp": "",
"source": "github",
"line_count": 573,
"max_line_length": 79,
"avg_line_length": 35.92321116928447,
"alnum_prop": 0.6292751651768363,
"repo_name": "darren-wang/ks3",
"id": "821aacfeb8983391e3efcfbd6c0f69b97246be0e",
"size": "2117... |
import pandas as pd
def get_test_data():
test_data = pd.read_csv('data/classification_data/dev_split.csv')
#print test_data
test = test_data['Participant_ID'].tolist()
#print test
#test.append(video)
clm_d = pd.read_csv('data/disc_nondisc/discriminative_CLM.csv')
covarep_d = pd.read_csv('d... | {
"content_hash": "b8b33215f70592bbf68c26614d10b6ab",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 79,
"avg_line_length": 32.53333333333333,
"alnum_prop": 0.6239754098360656,
"repo_name": "ab93/Depression-Identification",
"id": "a2363c0281c207e1a5d81f298a0e03e38fb409f8",
... |
"""
Methods for detecting objects leading to pickling failures.
"""
from __future__ import absolute_import, with_statement
import dis
from inspect import ismethod, isfunction, istraceback, isframe, iscode
from inspect import getmodule
from .pointers import parent, reference, at, parents, children
from .dill import _t... | {
"content_hash": "f5561e272bedeb1ddf50769495219faf",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 79,
"avg_line_length": 37.17063492063492,
"alnum_prop": 0.6159923134408029,
"repo_name": "mindw/dill",
"id": "7e62f07750b2b9b4ef28c09801126ecf332de010",
"size": "9656",
... |
"""
Utilities for the safeopt library (e.g., sampling).
Author: Felix Berkenkamp (befelix at inf dot ethz dot ch)
"""
from __future__ import print_function, absolute_import, division
from collections import Sequence # isinstance(...,Sequence)
import numpy as np
import scipy as sp
import matplotlib.pyplot ... | {
"content_hash": "8c147c86ea48c1ce35da4068a5fd55d0",
"timestamp": "",
"source": "github",
"line_count": 381,
"max_line_length": 79,
"avg_line_length": 35.39632545931759,
"alnum_prop": 0.5391517128874388,
"repo_name": "befelix/SafeOpt",
"id": "d2921b5febc711ddc8cc22ac82a74f680b14734d",
"size": "1348... |
"""This package provides tools for appending layers to docker images."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
from containerregistry.client import docker_name
from containerregistry.client.v2_2 import docker_digest
from containerreg... | {
"content_hash": "bd0d85a99c4280d544824d68cfbdeef5",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 95,
"avg_line_length": 31.768421052631577,
"alnum_prop": 0.6640159045725647,
"repo_name": "kubeflow/fairing",
"id": "e3b0160ef14ec4c04c8e323ca6dae88906a9f4d1",
"size": "361... |
import logging
from django.db import models
from django.db.models import CASCADE
from chroma_core.models import AlertStateBase
from chroma_core.models import AlertEvent
from chroma_core.models import DeletableStatefulObject
from chroma_core.models import StateChangeJob
from chroma_core.models import Job
from chroma_co... | {
"content_hash": "2b7e07dee63e88e11f279d177438c923",
"timestamp": "",
"source": "github",
"line_count": 434,
"max_line_length": 212,
"avg_line_length": 35.53917050691244,
"alnum_prop": 0.6703189834024896,
"repo_name": "intel-hpdd/intel-manager-for-lustre",
"id": "da9f3e77f6a78340d55c145c0dfa32ebd8d74... |
"""
Module to set up run time parameters for Clawpack -- classic code.
The values set in the function setrun are then written out to data files
that will be read in by the Fortran code.
"""
import os
import numpy as np
#------------------------------
def setrun(claw_pkg='classic'):
#---------------------------... | {
"content_hash": "befa0c0ade630c5264f8d18e9c95c7b1",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 92,
"avg_line_length": 31.896860986547086,
"alnum_prop": 0.5584141712357655,
"repo_name": "amath574w2015/am574-class",
"id": "fa01cc6b3644bcbb3f2f521ed71fa968123b20cf",
"s... |
import sqlite3
DAYS = {day:x for (x, day) in enumerate(['M', 'T', 'W', 'R', 'F', 'S', 'U'], start=1)}
def humanize_time(time):
"""Convert a time from the database's format to a human readable string.
Args:
time::Int - The time to convert.
Returns:
_::String - The converted... | {
"content_hash": "a87681f248cdaaf75f8ad2331900e4b4",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 92,
"avg_line_length": 38.59649122807018,
"alnum_prop": 0.5118181818181818,
"repo_name": "martin-tran/ucalgary-free-room-finder",
"id": "ef4060fa28f670554b56b73dfa94a07d22aa... |
import os
import json
from colors import Colors
'''
Class responsible for touching the JSON file. It is the only entity that modifies the underlying JSON.
It's called from the space and application class's.
'''
class Storage:
'''
Upon creation of object: initialize the file (if not already done), and set up fil... | {
"content_hash": "926fce676ca2e75df03295008a00e05d",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 103,
"avg_line_length": 24.313725490196077,
"alnum_prop": 0.6739247311827957,
"repo_name": "ahoskins/poof",
"id": "b2295488c0ba60905c85b2db8d6221bc9ce1aa57",
"size": "3720... |
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 model 'Reference'
db.create_table(u'cmsplugin_reference', (
(u'cmsplugin_ptr', self.gf('django.db.models.fields... | {
"content_hash": "7e092e8eb57c0aaa2682c432cfa3b53d",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 157,
"avg_line_length": 63.28125,
"alnum_prop": 0.577037037037037,
"repo_name": "robertour/commas",
"id": "431fb32b67b36a7d4fd9e39e33c9b7b88a1963b6",
"size": "4074",
"bin... |
"""
rgenetics datatypes
Ross Lazarus
for the rgenetics and galaxy projects
genome graphs datatypes derived from Interval datatypes
genome graphs datasets have a header row with appropriate columnames
The first column is always the marker - eg columname = rs, first row= rs12345 if the rows are snps
subsequent... | {
"content_hash": "b7bd3478a91d17957a25b403678db2dc",
"timestamp": "",
"source": "github",
"line_count": 758,
"max_line_length": 195,
"avg_line_length": 44.04485488126649,
"alnum_prop": 0.5418738393338525,
"repo_name": "volpino/Yeps-EURAC",
"id": "6dea663208b7bd26fbe46f8c9036ae8170159fe3",
"size": "... |
from rest_framework import status
from rest_framework.response import Response
from .errors import ConfigError
def poster(posting_task):
try:
posting_task()
except ConfigError as e:
return Response({
'details': str(e),
}, status=status.HTTP_503_SERVICE_UNAVAILABLE)
ret... | {
"content_hash": "85925bd8863aa443a6266df77cc7efc0",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 54,
"avg_line_length": 23.928571428571427,
"alnum_prop": 0.6716417910447762,
"repo_name": "vaniakosmos/memes-reposter",
"id": "9203054fae14db76997c0b125623ac8f1167981f",
"s... |
from . import string_utils
from . import property_utils
from . import shadergraph_utils
from . import scene_utils
from .. import rman_constants
from .. import rman_config
from collections import OrderedDict
from copy import deepcopy
import bpy
import os
import getpass
__BLENDER_TO_RMAN_DSPY__ = { 'TIFF': 'tiff', 'TARG... | {
"content_hash": "4a275fd04fe809c9ae956507495a1bf0",
"timestamp": "",
"source": "github",
"line_count": 742,
"max_line_length": 138,
"avg_line_length": 43.44474393530997,
"alnum_prop": 0.5259647598957687,
"repo_name": "adminradio/RenderManForBlender",
"id": "e3b6622aafd8b71be83e22aaa6a51dc440cf6b94",... |
from direct.distributed import DistributedObject
from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase import ToontownGlobals
from pandac.PandaModules import *
from math import *
import math
from direct.fsm.FSM import FSM
from toontown.minigame import ArrowKeys
from direct.showbase import PythonUtil... | {
"content_hash": "f2fda6ca33d78242b5b4fda398aab6cd",
"timestamp": "",
"source": "github",
"line_count": 719,
"max_line_length": 170,
"avg_line_length": 41.55910987482615,
"alnum_prop": 0.5803687962250259,
"repo_name": "ksmit799/Toontown-Source",
"id": "ec88aba26b62bd9b21cee548b9f6ce91fba49e33",
"si... |
"""
Packet definitions, enumerations, and helper functions for IEEE 802.11a physical
layer protocol.
Revision Info
=============
* $LastChangedBy: mandke $
* $LastChangedDate: 2011-09-27 22:15:57 -0500 (Tue, 27 Sep 2011) $
* $LastChangedRevision: 5167 $
:author: Ketan Mandke <kmandke@mail.utexas.edu>
:copyright:
... | {
"content_hash": "058f19ce41219667c872d88450537a71",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 81,
"avg_line_length": 35.61538461538461,
"alnum_prop": 0.6505708114779389,
"repo_name": "reidlindsay/wins",
"id": "48874d91c784e5c0186c1547757b3fe566098667",
"size": "650... |
"""
my_method does a thing. There are many like it, but this one is mine.
? Do we really need this?
! Deprecated
@param my_param Do some stuff with this
"""
# ! Import the modules
import sys
import random
# * var to set up loop
myVar = True
# ? will this loop ever terminate?
while myVar:
# TODO:... | {
"content_hash": "64b8c3b58dc5883ce9c8a6b94116d02d",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 83,
"avg_line_length": 20.138248847926267,
"alnum_prop": 0.5528604118993135,
"repo_name": "aaron-bond/better-comments",
"id": "0fdeb07f30e06d7e5d8e4f134e30fdc98615f56e",
"... |
"""
Test CuisineCore module
"""
import unittest
from unittest.mock import patch, PropertyMock
import copy
from JumpScale import j
@patch('JumpScale.core.redis.Redis.hget')
@patch('JumpScale.core.redis.Redis.hset')
class TestCuisineCore(unittest.TestCase):
def setUp(self):
self.dump_env = {
'... | {
"content_hash": "5f6469184287540d009391084c6eaeb1",
"timestamp": "",
"source": "github",
"line_count": 348,
"max_line_length": 259,
"avg_line_length": 44.14367816091954,
"alnum_prop": 0.5816950917849238,
"repo_name": "Jumpscale/jumpscale_core8",
"id": "7bcba7c596e7d2b6148e86304b5dd20f73cfc469",
"s... |
from bottle import route, mako_template as template, redirect, request, response, get, post
from bottle import static_file, view #为了不经过controller直接返回诸如html,css等静态文件引入
from model.documents import *
from setting import *
DATE_FORMAT = '%Y-%m-%d %H:%M:%S' # 入库格式化时间
@post('/add_order', method = 'POST')
def add_item():
#... | {
"content_hash": "847ab66a66629db6fd11cca7f7e21846",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 91,
"avg_line_length": 28.890625,
"alnum_prop": 0.7030827474310438,
"repo_name": "buddyli/android_intership",
"id": "1d02118c95d9845373c3d76059b01905cbc65a5c",
"size": "198... |
from __future__ import absolute_import
from .call_request import CallRequestMessage, call_req_rw
from .call_request_continue import call_req_c_rw
from .call_response import CallResponseMessage, call_res_rw
from .call_response_continue import call_res_c_rw
from .cancel import CancelMessage, cancel_rw
from .claim import... | {
"content_hash": "cd37e98a6c78af32d90a3d79a1ddac06",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 59,
"avg_line_length": 30.74468085106383,
"alnum_prop": 0.7245674740484429,
"repo_name": "uber/tchannel-python",
"id": "92b86d034aea6fd41e8dd6fde69e68522e4eaa9c",
"size": "... |
from django.shortcuts import render
from fristapp.models import People, Aritcle
from django.http import HttpResponse
from django.template import Context, Template
# Create your views here.
def first_try(request):
person = People(name='Spork', job="officer")
html_string = '''
<html lang="en">
<head>
... | {
"content_hash": "2d8e0c78d1e8bf4de822b677d2571ee6",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 104,
"avg_line_length": 22.46,
"alnum_prop": 0.6518254674977738,
"repo_name": "LTMana/code",
"id": "4fa10f4db44c615a8b9c9ffa5d2a38600c24b4fd",
"size": "1123",
"binary": f... |
from __future__ import absolute_import
import sys
from os import environ
from celery import Celery
from .utils.conf_builder import AppConfig
from .utils.scheduler import Scheduler
coyote_config = environ.get('COYOTECONFIG', 'coyote.yaml')
coyote = AppConfig(coyote_config)
sys.path += coyote.syspaths
app = Celery(in... | {
"content_hash": "080daf2ba97497aa46b67932ce03152e",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 71,
"avg_line_length": 31.736842105263158,
"alnum_prop": 0.7711442786069652,
"repo_name": "charlesthomas/coyote",
"id": "35641287f612e65b3b8dd7bad08857cc7e4ccbb2",
"size": ... |
import os
import unittest
from typing import List
def binary_search(array, from_index, to_index, key):
while from_index <= to_index:
middle = (from_index + to_index) // 2
if array[middle] < key:
from_index = middle + 1
elif array[middle] > key:
to_index = middle - ... | {
"content_hash": "ebcf2e1a3d7d6c664e5fc18a3c10cfef",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 76,
"avg_line_length": 29.354166666666668,
"alnum_prop": 0.5386799148332151,
"repo_name": "altermarkive/Coding-Interviews",
"id": "be0a8731d057d3d84deb5d1f8c18b7c16d564334",
... |
import os
import os.path
biomas = ["AMAZONIA", "MATAATLANTICA", "PANTANAL", "CERRADO", "CAATINGA", "PAMPA", "ZONACOSTEIRA"]
'''
CLASSIFICACAO
'''
# mosaico de classificacao por bioma e ano
for bioma in biomas:
nextAno = 2008
print os.path.exists('../CLASSIFICACAOFT/BIOMA/' + bioma)
while nextAno <= 201... | {
"content_hash": "6432488ccdab9dab31097ef22c69f57b",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 192,
"avg_line_length": 45.56603773584906,
"alnum_prop": 0.634575569358178,
"repo_name": "TerrasAppSolutions/seeg-mapbiomas-workspace",
"id": "76789a6eef5a8efccf387f01bb2920... |
import os
import unittest
from gitviewfs_objects import Directory
import dir_structure.shallow
from tests.structs.shallow import paths
from tests.structs.shallow.utils import BaseDefaultDirStructTest,\
BaseDefaultDirStructIntegrationTest
class RootDirPathTest(BaseDefaultDirStructTest):
def test_path(self):
sel... | {
"content_hash": "8b551cdf5fae7d66bb2d6efd1b694607",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 81,
"avg_line_length": 26.875,
"alnum_prop": 0.7674418604651163,
"repo_name": "erdavila/gitviewfs",
"id": "98c52aaa10966aede25f9aedfe1c371a619c4b5a",
"size": "860",
"bina... |
from __future__ import unicode_literals
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.test.client import RequestFactory
from django.contrib.auth.models import User
from django.utils import timezone
from happenings.models import Event
from happenings.templatetags.happenings_... | {
"content_hash": "16fffc4f464d51db2d7fd62785549fe9",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 70,
"avg_line_length": 34.01754385964912,
"alnum_prop": 0.6173285198555957,
"repo_name": "wreckage/django-happenings",
"id": "7aad9c8b40e4f49b84f7411528ea42a588b5dae2",
"si... |
import os
import subprocess
def is_program_installed(program_name):
'''Determines if a given program is installed by checking if calling
subprocess with its program executable as parameter yields a file not
found error. If subprocess terminates with file not found or some
different error, we assume tha... | {
"content_hash": "bdfd0c79e2ce9e6bb8023015ac8422a6",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 79,
"avg_line_length": 32.10344827586207,
"alnum_prop": 0.6466165413533834,
"repo_name": "mguenther/pdfextract",
"id": "bb7f071d902a2380eb9526c43a251eab17284185",
"size": "... |
"""Pilot layout."""
from makani.gs.monitor2.apps.layout import base
from makani.gs.monitor2.apps.plugins.indicators import control
from makani.gs.monitor2.apps.plugins.indicators import ground_station
class PilotLayout(base.BaseLayout):
"""The pilot layout."""
_NAME = 'Pilot'
_DESIRED_VIEW_COLS = 12
_ORDER_... | {
"content_hash": "6e66691e764e8382e33b616eaaee831d",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 69,
"avg_line_length": 31.076923076923077,
"alnum_prop": 0.6621287128712872,
"repo_name": "google/makani",
"id": "59ba269f8868c795553c5cb37ade67fe7005c2af",
"size": "3013",... |
"""
Spyder configuration options.
Note: Leave this file free of Qt related imports, so that it can be used to
quickly load a user config file.
"""
import os
import sys
# Local import
from spyder.config.base import CHECK_ALL, EXCLUDED_NAMES
from spyder.config.fonts import MEDIUM, SANS_SERIF
from spyder.config.utils i... | {
"content_hash": "8838bec2383dab697a3ae14ff5b12047",
"timestamp": "",
"source": "github",
"line_count": 633,
"max_line_length": 161,
"avg_line_length": 38.79462875197472,
"alnum_prop": 0.459339495866759,
"repo_name": "sys-bio/tellurium",
"id": "0484323b6e2e8337e253c7d077f191c917f497e9",
"size": "24... |
import re
from .base_linter import BaseLinter, INPUT_METHOD_TEMP_FILE
CONFIG = {
'language': 'Puppet',
'executable': 'puppet',
'lint_args': ['parser', 'validate', '--color=false', '{filename}'],
'test_existence_args': '-V',
'input_method': INPUT_METHOD_TEMP_FILE
}
class Linter(BaseLinter):
d... | {
"content_hash": "064bbbbfff3d8902d1cff8f694d7427a",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 156,
"avg_line_length": 42.266666666666666,
"alnum_prop": 0.5615141955835962,
"repo_name": "benesch/sublime-linter",
"id": "86c911c278babeab989232831f7c1c1eb1d674ef",
"size... |
import os, sys
sys.path.append("../")
import SocialObjects
from SocialObjects import *
import workflow
import gateway
import persistence
import tests
import server
| {
"content_hash": "60138c6fd81738aafdaa42930864733e",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 27,
"avg_line_length": 18.22222222222222,
"alnum_prop": 0.8109756097560976,
"repo_name": "uoscompsci/PRISONER",
"id": "97002e3753276f3647da38e28b723ce222d5c811",
"size": "16... |
import json
import six
from oslo_utils import timeutils as tu
from senlin.common import exception
from senlin.db.sqlalchemy import api as db_api
from senlin.tests.unit.common import base
from senlin.tests.unit.common import utils
from senlin.tests.unit.db import shared
UUID1 = shared.UUID1
UUID2 = shared.UUID2
UUID3... | {
"content_hash": "2bafd31df6de4a4bb8981edeb5480218",
"timestamp": "",
"source": "github",
"line_count": 514,
"max_line_length": 79,
"avg_line_length": 41.007782101167315,
"alnum_prop": 0.5931777208463801,
"repo_name": "Alzon/senlin",
"id": "603920a6fdc5d7aa24626d411b1ef5d7d481fdf9",
"size": "21627"... |
import os
import unittest
from unittest.mock import Mock, PropertyMock, patch
from airflow.providers.apache.hive.operators.hive_to_samba import Hive2SambaOperator
from airflow.utils.operator_helpers import context_to_airflow_vars
from tests.providers.apache.hive import DEFAULT_DATE, TestHiveEnvironment
class TestHiv... | {
"content_hash": "ce0affb15529a21e09b163ecb6bb4152",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 102,
"avg_line_length": 44.36538461538461,
"alnum_prop": 0.6757693974859125,
"repo_name": "mtagle/airflow",
"id": "58f88149af8c4f246bf6560e40679f3e4c36f78b",
"size": "3094"... |
"""sqlitemagic provices a simple magic for interacting with SQLite
databases stored on disk.
Usage:
%%sqlite filename.db
select personal, family from person;
produces:
Alan|Turing
Grace|Hopper
"""
# This file is copyright 2013 by Greg Wilson: see
# https://github.com/gvwilson/sqlitemagic/blob/master/LICENSE
# for ... | {
"content_hash": "a35f27b8d6015566c82d064ca15945d5",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 83,
"avg_line_length": 27.142857142857142,
"alnum_prop": 0.6533834586466165,
"repo_name": "selimnairb/2014-02-25-swctest",
"id": "4a1e83d51b1345997baa3a1056c62bd3b3998093",
... |
def down_slope(x, left, right):
return float(float(right - x) / float(right - left))
def up_slope(x, left, right):
return float(float(x - left) / float(right - left))
| {
"content_hash": "dbf787bd72601731b9d8fb5fa79a23bd",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 56,
"avg_line_length": 29.5,
"alnum_prop": 0.6384180790960452,
"repo_name": "JakeCowton/Pok-e-Lol",
"id": "fbffc0296a3ca55acdabb07e37dcb76d1e9bda0b",
"size": "198",
"binar... |
from .test import *
def test(suite='raam.test',verbosity=2):
"""
Runs all tests from the module.
Parameters
----------
verbosity : int (optional)
Test output verbosity
"""
suite = unittest.TestLoader().loadTestsFromNames([suite])
#suite = unittest.TestLoader().loadTestsFrom... | {
"content_hash": "0e3a4a5f5fb64924cbc1d65ef4efdec8",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 86,
"avg_line_length": 28,
"alnum_prop": 0.6714285714285714,
"repo_name": "marekpetrik/RAAM",
"id": "c9349a325b396f55f6d5adcfcbf9c25eb3fe390f",
"size": "420",
"binary": f... |
from .exceptions import OperationDeclarationException
from .memory import MEMORY, MemoryValue
TOKENS = {}
class Operation(type):
def __init__(cls, name, bases, dct):
if "TOKEN" in dct:
if dct["TOKEN"] not in TOKENS:
TOKENS[dct["TOKEN"]] = cls()
else:
... | {
"content_hash": "5fb134ef0c84e261255ff94ce8f610ea",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 101,
"avg_line_length": 29.689320388349515,
"alnum_prop": 0.6355461085676913,
"repo_name": "nint8835/InvitationASM",
"id": "54dcd82b3683547f99f6398de465f9b6ff81e282",
"siz... |
"""Frontend handler tests."""
import os
import shutil
import tempfile
import unittest
from google.cloud import ndb
import frontend_handlers
from osv import models
from osv import tests
class FrontendHandlerTest(unittest.TestCase):
"""Frontend handler tests."""
def setUp(self):
tests.reset_emulator()
se... | {
"content_hash": "3ca7553c7a79937f130b75ce89ccda43",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 66,
"avg_line_length": 23.464912280701753,
"alnum_prop": 0.49794392523364484,
"repo_name": "google/osv.dev",
"id": "b382e85b33c0fdde38947bcecdbd01d31b1d29e7",
"size": "325... |
"""
Translates the MedleyDB Melody and Instrument Activation annotations to a set
of JAMS files.
The original data is found online at the following URL:
http://marl.smusic.nyu.edu/medleydb
Example:
./medleydb_parser.py MedleyDB/ [-o MedleyDB_JAMS/]
"""
__author__ = "Rachel M. Bittner"
__copyright__ = "Copyrig... | {
"content_hash": "f09eb655dca7f39692f69c0d2d1fafe6",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 86,
"avg_line_length": 36.184615384615384,
"alnum_prop": 0.6374716553287982,
"repo_name": "urinieto/jams",
"id": "faacd4bad3af3b6c19b5163b14353a39960e6878",
"size": "7078"... |
"""VirtualHelixItem for the PropertyView.
Attributes:
KEY_COL (int): :class:`QTreeWidgetItem` column that will display property keys
VAL_COL (int): :class:`QTreeWidgetItem` column that will display property values
"""
from typing import (
List
)
from PyQt5.QtCore import (
Qt,
QModelIndex
)
from Py... | {
"content_hash": "b7fd21dd7ffa160fe443ad05554db0d2",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 110,
"avg_line_length": 34.558510638297875,
"alnum_prop": 0.552100969678313,
"repo_name": "scholer/cadnano2.5",
"id": "7efa4cc782189f0531e576deaf0fabf725074ef4",
"size": "... |
import argparse
import json
import os
import sys
import pkg_resources
import argcomplete
import traceback
import subprocess
import click
from click.exceptions import ClickException
from dateutil import parser
from .pydl4j import set_config, get_config
from .pydl4j import validate_config, is_docker_available
from .pydl... | {
"content_hash": "250db800b3c2058ea6e7d942d36913f6",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 174,
"avg_line_length": 37.8563829787234,
"alnum_prop": 0.5420823380637909,
"repo_name": "RobAltena/deeplearning4j",
"id": "f48d4e01e0a31e00d018236a5dc54962f47f9f04",
"siz... |
# This code is part of pyCMPL
#
# Copyright (C) 2013
# Mike Steglich - Technical University of Applied Sciences
# Wildau, Germany
#
# pyCMPL is a project of the Technical University of
# Applied Sciences Wildau and the Institute for Operations Research
# and Business Management at the Martin Luther ... | {
"content_hash": "7ea70bf66a096179f7bc257078e0b949",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 77,
"avg_line_length": 27.8,
"alnum_prop": 0.6502490315439956,
"repo_name": "Mangara/ArboralExplorer",
"id": "c0cef33080a857ee23c3e2d318e6b79ded3c1db2",
"size": "1880",
"... |
import os
import urllib
import datetime
import csv
import unicodecsv
def daterange(start, stop, step_days=1):
current = start
step = datetime.timedelta(step_days)
if step_days > 0:
while current < stop:
yield current
current += step
elif step_days < 0:
while current > stop:
yield current
current +=... | {
"content_hash": "bfec184f2e5f272e1145fb5711487d40",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 81,
"avg_line_length": 26.854545454545455,
"alnum_prop": 0.6479350033852403,
"repo_name": "struct78/fault-trace",
"id": "3db9505279ba3d31963a6cd90c06f61621bc3499",
"size": ... |
from .importer import BlackduckCRImporter
from dojo.models import Finding
class BlackduckComponentRiskParser(object):
"""
Can import as exported from Blackduck:
- from a zip file containing a security.csv, sources.csv and components.csv
"""
def get_scan_types(self):
return ["Blackduck Com... | {
"content_hash": "e858fb97fbfed5d2ddbcfb9bf99ca0c3",
"timestamp": "",
"source": "github",
"line_count": 301,
"max_line_length": 114,
"avg_line_length": 45.800664451827245,
"alnum_prop": 0.5608588423037865,
"repo_name": "rackerlabs/django-DefectDojo",
"id": "5711fd3c8cf1259f2a974b1c91eaad7a63e79c43",
... |
from __future__ import unicode_literals
import sys
import os
import warnings
import ruamel.yaml as yaml
__author__ = "Pymatgen Development Team"
__email__ ="pymatgen@googlegroups.com"
__maintainer__ = "Shyue Ping Ong"
__maintainer_email__ ="shyuep@gmail.com"
__version__ = "2018.6.11"
SETTINGS_FILE = os.path.join(os... | {
"content_hash": "4a49dcf191b60399d05703c29fb72f86",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 80,
"avg_line_length": 31.597701149425287,
"alnum_prop": 0.6184066933430338,
"repo_name": "nisse3000/pymatgen",
"id": "a6b747320f3205f83859c8aa0cd4975a39375d29",
"size": "2... |
try:
from http.server import HTTPServer, SimpleHTTPRequestHandler
except ImportError:
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
import ssl
import threading
import pytest
from requests.compat import urljoin
def prepare_url(value):
# Issue #1483: Make... | {
"content_hash": "52d98a0df2e013e7477c1912139eb193",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 73,
"avg_line_length": 27.25862068965517,
"alnum_prop": 0.7235926628716003,
"repo_name": "psf/requests",
"id": "530a4c2a5f9917d62ffed2e2eecfdb8164655740",
"size": "1581",
... |
import boto3
import datetime
import json
kinesis = boto3.client("kinesis")
payload = {
"network": "array_of_things_chicago",
"meta_id": 0,
"node_id": "0000001e0610ba72",
"sensor": "tmp421",
"data": {"temperature": 10.0},
"datetime": str(datetime... | {
"content_hash": "bbd1bfe04c0b245ff043e54ef9100781",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 53,
"avg_line_length": 22.17391304347826,
"alnum_prop": 0.5450980392156862,
"repo_name": "UrbanCCD-UChicago/plenario-lambdas",
"id": "20b5ea634514a682f59dd80276450e372dc7f004... |
import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="scattersmith.textfont", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pa... | {
"content_hash": "7706ccb8123eb19ff4a13b7009ac5e87",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 80,
"avg_line_length": 33.57142857142857,
"alnum_prop": 0.597872340425532,
"repo_name": "plotly/plotly.py",
"id": "2d7df6248cde2122bdd03c7e67e0b64f0749cff8",
"size": "470",... |
import os
import sys
import json
import collections
srcfile = os.path.realpath(__file__)
deployDir = os.path.split(srcfile)[0]
rootDirProject = os.path.split(deployDir)[0]
electionConfig = rootDirProject + "/_configFiles_/handlerConfigFile.json"
try:
jsonFile = open(electionConfig, 'r+')
jsonData = json.load... | {
"content_hash": "2fbdcc2bd44e5c70b588a5b48923623d",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 91,
"avg_line_length": 29.904761904761905,
"alnum_prop": 0.7340764331210191,
"repo_name": "escapin/ElectionManager",
"id": "6f1dc4f8f92425c011453a67f1cb9ca4548689c2",
"size... |
import contextlib
import threading
from oslo_db.sqlalchemy import session
from oslo_log import log as logging
from sqlalchemy import MetaData
from trove.common import cfg
from trove.common.i18n import _
from trove.db.sqlalchemy import mappers
_FACADE = None
_LOCK = threading.Lock()
LOG = logging.getLogger(__name__... | {
"content_hash": "4cd71b8438f9c56443b1591b6b8eff36",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 78,
"avg_line_length": 30.470149253731343,
"alnum_prop": 0.5919666911584619,
"repo_name": "zhangg/trove",
"id": "188b7d5123425cf07880c352b23ee7a9ba6b7ad0",
"size": "4719",... |
import os
import sys
from scipy.io import loadmat
homepath = os.path.join('..', '..')
if not homepath in sys.path:
sys.path.insert(0, homepath)
import dlearn.stats as stats
from dlearn.utils.serialize import save_data
def compute_stats(output, target):
n = target.shape[1]
ret = [0] * n
for j in xra... | {
"content_hash": "f8b571d9a02fa9daa02b044ef4869722",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 53,
"avg_line_length": 21.791666666666668,
"alnum_prop": 0.5994263862332696,
"repo_name": "Cysu/dlearn",
"id": "56b5f1562579062cb52dd8eab11f46728c4c053e",
"size": "1046",
... |
import os
import shutil
import stat
import tempfile
import threading
import time
import unittest
from collections import namedtuple
from pyspark import SparkConf, SparkFiles, SparkContext
from pyspark.testing.utils import ReusedPySparkTestCase, PySparkTestCase, QuietTest, SPARK_HOME
class CheckpointTests(ReusedPySpa... | {
"content_hash": "c96be6117fb3b85fb58d423d77763c9f",
"timestamp": "",
"source": "github",
"line_count": 295,
"max_line_length": 95,
"avg_line_length": 40.40338983050847,
"alnum_prop": 0.6421679671113348,
"repo_name": "darionyaphet/spark",
"id": "edfea42bed71d8a6f38a0ccda21a8cb7cc1ea8b4",
"size": "1... |
from ramrod import base, errors, utils
from ramrod.options import DEFAULT_UPDATE_OPTIONS
from ramrod.cybox import Cybox_2_0_Updater
# relative
from . import register_updater
from .base import BaseSTIXUpdater, STIXVocab
class MotivationVocab(STIXVocab):
OLD_TYPES = ('MotivationVocab-1.0',)
NEW_TYPE = 'Motivat... | {
"content_hash": "066311d28022ba3a94378c782084f590",
"timestamp": "",
"source": "github",
"line_count": 344,
"max_line_length": 171,
"avg_line_length": 41.81104651162791,
"alnum_prop": 0.6500034763262185,
"repo_name": "STIXProject/stix-ramrod",
"id": "34adde36ac40cade7c928b80fa93aaab8593e91f",
"siz... |
""" Run bot logic
If --Run Task-- is selected, the task will be sent to tw_daemon.py.
Then tw_deamon will run main twitter logic (twitter_daemon.py)
"""
import yaml # pip install pyyaml is needed
import logging
import pika # pip install pika is needed
import sys
SERVER_IP = "localhost" # if no config
#logging.basicCo... | {
"content_hash": "675b2e96e2785070b425bd656efa2ced",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 100,
"avg_line_length": 35.56603773584906,
"alnum_prop": 0.5949602122015916,
"repo_name": "merzlyakov-me/Twitter_Bot",
"id": "da578416e2022a0b75807de2b73189da922bad95",
"s... |
from __future__ import unicode_literals
from django.db import models, migrations
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('taskmanager', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Project',
fields... | {
"content_hash": "0bfb22d81d538cef6ae7d41904e7b113",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 251,
"avg_line_length": 39.5625,
"alnum_prop": 0.5647709320695102,
"repo_name": "memnonila/taskbuster",
"id": "756b2f87569593cd2e91679a4b5c5bb79d16970d",
"size": "1290",
... |
"""Default high score mode."""
| {
"content_hash": "c736d3a0bc6debcaf44b200e28ab4fa7",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 30,
"avg_line_length": 31,
"alnum_prop": 0.6451612903225806,
"repo_name": "missionpinball/mpf",
"id": "87352e235d5faaed6a63ac1bb498ad42062c1fc8",
"size": "31",
"binary": f... |
import testtools
from neutron.agent.linux import keepalived
from neutron.tests import base
# Keepalived user guide:
# http://www.keepalived.org/pdf/UserGuide.pdf
class KeepalivedGetFreeRangeTestCase(base.BaseTestCase):
def test_get_free_range(self):
free_range = keepalived.get_free_range(
pa... | {
"content_hash": "6a47059ad70a7508902471d1e42f8b66",
"timestamp": "",
"source": "github",
"line_count": 278,
"max_line_length": 77,
"avg_line_length": 33.226618705035975,
"alnum_prop": 0.5524520948359857,
"repo_name": "cloudbase/neutron-virtualbox",
"id": "624ccd2f851ea68a81ee024ae256fc4d061a4ff0",
... |
import tensorflow as tf # neural network for function approximation
import gym # environment
import numpy as np # matrix operation and math functions
from gym import wrappers
# GLOBAL SETTINGS
RNG_SEED = 8
ENVIRONMENT = "CartPole-v0"
# ENVIRONMENT = "CartPole-v1"
MAX_EPISODES = 1000
HIDDEN_LAYER = True
HIDDEN_SIZE = 6... | {
"content_hash": "ff4dcd7d5916d415eb8828393c121262",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 79,
"avg_line_length": 30.678571428571427,
"alnum_prop": 0.650523864959255,
"repo_name": "GitYiheng/reinforcement_learning_test",
"id": "10e095abcb7f3a6fa1e85c07fda4ac70b7db... |
import re
import unittest
import subprocess32 as subprocess
import Gaffer
import GafferTest
class StatsApplicationTest( GafferTest.TestCase ) :
def test( self ) :
script = Gaffer.ScriptNode()
script["frameRange"]["start"].setValue( 10 )
script["frameRange"]["end"].setValue( 50 )
script["variables"].addChi... | {
"content_hash": "710bb5d6fe810649f25d1ab12051f364",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 133,
"avg_line_length": 32.54054054054054,
"alnum_prop": 0.6727574750830565,
"repo_name": "appleseedhq/gaffer",
"id": "b9b49ba3ba877bf00a45b88c9448708e2c1271fa",
"size": "3... |
import unittest
from contains_digits import contains_digits
class Test_Digits_Containning(unittest.TestCase):
def test_containning_digits(self):
self.assertTrue(contains_digits(297876954274, [2, 7, 5, 9]))
if __name__ == "__main__":
unittest.main()
| {
"content_hash": "57e48477e9436143315b1139dda431fe",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 68,
"avg_line_length": 22.5,
"alnum_prop": 0.6962962962962963,
"repo_name": "sevgo/Programming101",
"id": "ee3fdc4237dd1dc3178a55b6920372f0d3bd5f7d",
"size": "294",
"bina... |
import urllib
import urllib2
print ('------------------------error 404 ------------------------------------------')
url = 'https://api.ordnancesurvey.co.uk/places/v1/addresses/find?'
values = {'query':'''ORDNANCE SURVEY, 4, ADANAC DRIVE, NURSLING, SOUTHAMPTON, SO1 0AS''',
'dataset':'DPA,LPI',
'key... | {
"content_hash": "87cc51b2ceee6abc5f6a7d35885d03bf",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 89,
"avg_line_length": 35,
"alnum_prop": 0.45795148247978434,
"repo_name": "GusSmith21/OS-Places",
"id": "238408d5c21b2f33319e412caa2d115affd246b7",
"size": "3710",
"bin... |
import os
import sys
import time
from magnolia.utility import *
from magnolia.utility import LOG as L
from magnolia.script.sinoalice import testcase_normal
class TestCase(testcase_normal.TestCase):
def __init__(self, *args, **kwargs):
super(TestCase, self).__init__(*args, **kwargs)
@classmethod
d... | {
"content_hash": "8f93bb15cf4ecd88740393679baafb2b",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 62,
"avg_line_length": 35.787234042553195,
"alnum_prop": 0.5618311533888228,
"repo_name": "setsulla/stir",
"id": "9296ab5cafd205b08daf2a7551536a4f9f9b5510",
"size": "1682",... |
'''Displays a helpful help message full of help.'''
__matcher__ = '%NICK.*help'
def respond(brain, user, message, groups):
yield 'name\t| description\t| regex'
for script in brain.bot_info['scripts']:
name = script.__name__.split('.')[-1]
regex = script.__matcher__.replace('%NICK', brain.bot_i... | {
"content_hash": "711c88b4ce8747e8b822e4c482f72208",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 75,
"avg_line_length": 38.083333333333336,
"alnum_prop": 0.5820568927789934,
"repo_name": "iDevy/yaubot",
"id": "5c4e7a9c1beb0ee4dd622c1105ea9bc932f156e0",
"size": "1036",
... |
from django.urls import path
from . import views
urlpatterns = [
path('district-create', views.district_create),
path('districts-load', views.districts_load),
path('district-edit', views.district_edit),
path('district-save-limit', views.district_save_limit),
]
| {
"content_hash": "a8bac32f24ff731d4fd35ed3f5ef0555",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 59,
"avg_line_length": 27.9,
"alnum_prop": 0.7096774193548387,
"repo_name": "moodpulse/l2",
"id": "e52b5ce7c358c450643eef5c0636178ec31d38e3",
"size": "279",
"binary": fal... |
from benchexec.tools.sv_benchmarks_util import get_data_model_from_task, ILP32, LP64
import benchexec.result as result
import benchexec.tools.template
class Tool(benchexec.tools.template.BaseTool2):
"""
Tool info for Deagle, an SMT-based concurrent program verification tool.
Project URL: https://githu... | {
"content_hash": "65f8fc64364b10e2a0b0313b6ee2901e",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 88,
"avg_line_length": 34.1,
"alnum_prop": 0.6407624633431085,
"repo_name": "sosy-lab/benchexec",
"id": "ad0bbbc59c5f790d9bb8d9216f75c0ceb2191d2b",
"size": "1594",
"binar... |
import os, sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "web_dja.settings")
# Add the lib/ directory to the system path
sys.path.append("lib")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "80b96f61b75b6cdffdbc748b108ce097",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 71,
"avg_line_length": 29.7,
"alnum_prop": 0.6868686868686869,
"repo_name": "jradd/Django_web_dja",
"id": "3982e3d98ae3a7d93d8d5ce159736a3566029577",
"size": "319",
"bina... |
from unittest import mock
from oslo_config import cfg
from oslo_utils import units
from ironic_inspector import node_cache
from ironic_inspector.plugins import base
from ironic_inspector.plugins import standard as std_plugins
from ironic_inspector import process
from ironic_inspector.test import base as test_base
fro... | {
"content_hash": "b6feab16124c164a40b06fea18a3521f",
"timestamp": "",
"source": "github",
"line_count": 511,
"max_line_length": 79,
"avg_line_length": 44.82974559686888,
"alnum_prop": 0.5883534136546185,
"repo_name": "openstack/ironic-inspector",
"id": "3f3139a7008a386db8e9a8c53c7b1a056b940da1",
"s... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
def shape(tensor):
static = tensor.get_shape().as_list()
dynamic = tf.unstack(tf.shape(tensor))
assert len(static) == len(dynamic)
combined = [d if s is None else s for s, d in... | {
"content_hash": "03ccb5faa753fcafa17bff009f1879f9",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 69,
"avg_line_length": 27.76923076923077,
"alnum_prop": 0.7119113573407202,
"repo_name": "google-research/planet",
"id": "e3929b96336722c1f451023a49905bde20ba5d4b",
"size":... |
def find_slope(points):
dx = points[2] - points[0]
dy = points[3] - points[1]
return str(dy / dx) if dx else 'undefined'
| {
"content_hash": "e62306fb5e44a60fd21fcd05d5026bfb",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 46,
"avg_line_length": 26.8,
"alnum_prop": 0.5970149253731343,
"repo_name": "RevansChen/online-judge",
"id": "fc51ad5dfba7d0a6a0199cff4253ce86a8f0eb1b",
"size": "152",
"bi... |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import with_statement
import collections
import os
import stat
import types
import warnings
from twisted.internet import defer
from twisted.internet.endpoints import TCP4ClientEndpoint
from twisted.internet.endpoints import U... | {
"content_hash": "65c39dddb80cc195ed4159a384b7d6f7",
"timestamp": "",
"source": "github",
"line_count": 941,
"max_line_length": 169,
"avg_line_length": 37.05207226354941,
"alnum_prop": 0.5889978775884817,
"repo_name": "david415/txtorcon",
"id": "c18a5778e5681ec0fdfbf65a736b8e431c024ff7",
"size": "3... |
'''
@author: Josinaldo
# 1) Faça um programa que peça dois números inteiros e imprima a soma desses dois números
'''
if __name__ == '__main__':
n1 = int (raw_input("Digite o primeiro número: "))
n2 = int (raw_input("Digite o segundo número: "))
print "A soma deles é: %d" % (n1 + n2)
| {
"content_hash": "acf2b316d93e6b572c5125d5c00a1fa2",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 89,
"avg_line_length": 33,
"alnum_prop": 0.6195286195286195,
"repo_name": "GADS2014M/Exercicios",
"id": "ed00cce80f79e0ea5e0ba8c7aff6a38249e68488",
"size": "323",
"binary"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.