text stringlengths 4 1.02M | meta dict |
|---|---|
import bifrost.main
bifrost.main.main()
| {
"content_hash": "63baa4c658fd660eeff9a7b2bcdc2471",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 19,
"avg_line_length": 20,
"alnum_prop": 0.8,
"repo_name": "justcompile/bifrost",
"id": "dc0a196e1e503f9b70d7ecf1d89471d4ad5c6002",
"size": "40",
"binary": false,
"copie... |
from __future__ import unicode_literals
# Third-party imports
from cloudify import ctx
from cloudify.decorators import operation
# Local imports
from .. import constants
from .. import utils
from ..gcp import check_response
from ..pubsub import PubSubBase
class Subscription(PubSubBase):
def __init__(self,
... | {
"content_hash": "ccdc8d0a79a648b1faac53b2eb8ba444",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 79,
"avg_line_length": 32.99367088607595,
"alnum_prop": 0.6059850374064838,
"repo_name": "cloudify-cosmo/cloudify-gcp-plugin",
"id": "632766726bd1c27e1fcb874640b3a8e21e5e006... |
from __future__ import print_function, unicode_literals
import os
import random
import re
import select
import socket
import ssl
import string
import subprocess
import sys
import time
from itertools import count
from threading import Event, Lock, Thread
import paho.mqtt.client as mqtt
import ttfw_idf
from common_test... | {
"content_hash": "d6a67ff3d0c976f8811b88ca6770221f",
"timestamp": "",
"source": "github",
"line_count": 403,
"max_line_length": 149,
"avg_line_length": 47.72456575682382,
"alnum_prop": 0.6199240888056985,
"repo_name": "espressif/esp-idf",
"id": "f87c37635727a379cb84c85d03d2378ec2cac480",
"size": "1... |
from msrest.serialization import Model
class ApplicationGatewaySslPolicy(Model):
"""Application Gateway Ssl policy.
:param disabled_ssl_protocols: Ssl protocols to be disabled on application
gateway.
:type disabled_ssl_protocols: list[str or
~azure.mgmt.network.v2017_09_01.models.ApplicationGat... | {
"content_hash": "ba30180ea024583e462c3d185cf23133",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 83,
"avg_line_length": 47.888888888888886,
"alnum_prop": 0.6895591647331787,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "06bf7ace735f6aaee2944e36157309244923cc8a",
... |
import django_filters
from rest_framework import permissions, viewsets
from rest_framework.response import Response
from rest_framework.filters import SearchFilter
from rest_framework import filters
from rest_framework import generics
from custom_functions import *
from itertools import groupby
from django.http impo... | {
"content_hash": "2052c4a4dda4b5bd791f05bc6a388150",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 105,
"avg_line_length": 35.35031847133758,
"alnum_prop": 0.6807207207207208,
"repo_name": "Guillaume-Docquier/Thingy",
"id": "0f93a0da3ded86eecf36f83ddc7a704400d05af8",
"s... |
"""
rMake, build utility for conary - build functionality
"""
| {
"content_hash": "bb0ddc07a8f168430f8071304f485d1e",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 53,
"avg_line_length": 20.666666666666668,
"alnum_prop": 0.7096774193548387,
"repo_name": "sassoftware/rmake",
"id": "8633c1f3db5f91dfa34528b4a2768768c33ea5ab",
"size": "649... |
from .user_logic import UserLogic
| {
"content_hash": "957ee4ef063d1f003d4b43be1db34407",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 33,
"avg_line_length": 34,
"alnum_prop": 0.8235294117647058,
"repo_name": "HueyPark/Unreal-Knights",
"id": "8840ba49d11a71d95064df5d0a22e6399d7ceeb0",
"size": "34",
"binar... |
import tables
import numpy as np
try:
import pycuda.gpuarray as garray
PYCUDA = True
except ImportError:
PYCUDA = False
def write_memory_to_file(A, filename, mode = 'w', title='test'):
"""
write memory to a h5 file
h5 file contains root.real and root.imag(if A complex)
best ... | {
"content_hash": "fea933f1da19714acf76e99c5718dc13",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 97,
"avg_line_length": 29.00653594771242,
"alnum_prop": 0.5590356016223524,
"repo_name": "cerrno/neurokernel",
"id": "41310596009d5a64238d718a0298a9f3e48a3259",
"size": "4... |
from django.contrib import admin
from comments.models import Comment
admin.site.register(Comment)
| {
"content_hash": "70b7548740da04041a21c012ae7ffa45",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 35,
"avg_line_length": 20,
"alnum_prop": 0.83,
"repo_name": "bakowroc/newsfeed-system",
"id": "98aa2bf89a501f9202f713854f8574b172fe3583",
"size": "100",
"binary": false,
... |
"""
There is a new alien language which uses the latin alphabet. However, the order
among letters are unknown to you. You receive a list of non-empty words from the
dictionary, where words are sorted lexicographically by the rules of this new
language. Derive the order of letters in this language.
Example 1:
Input:
[... | {
"content_hash": "35ce6783cb777210eca066f543d56f9a",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 118,
"avg_line_length": 26.28787878787879,
"alnum_prop": 0.5100864553314121,
"repo_name": "algorhythms/LeetCode",
"id": "3945a78f0321becb6a522d3f7369e389171ad428",
"size":... |
"""Dummy helper methods invoked in other constructors."""
def GenerateMachineName(prefix, suffix):
"""Generates name of a VM."""
return prefix + "-" + suffix
| {
"content_hash": "b7012ded020b6edf25cb8dcf67a82937",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 57,
"avg_line_length": 27.333333333333332,
"alnum_prop": 0.6951219512195121,
"repo_name": "jackgr/helm",
"id": "a553e65ddab9aa867d7ea4911a274f8d4ab65fa6",
"size": "164",
"... |
import json
import re
from django import forms
import arrow
from kombu.exceptions import KombuError
from common import tasks
from data_import.models import DataType
from .models import (
DataRequestProject,
DataRequestProjectMember,
OAuth2DataRequestProject,
OnSiteDataRequestProject,
)
class DataR... | {
"content_hash": "e12d69bc9787e8e5ecba39f6860bf3fa",
"timestamp": "",
"source": "github",
"line_count": 502,
"max_line_length": 88,
"avg_line_length": 33.01792828685259,
"alnum_prop": 0.5732126696832579,
"repo_name": "OpenHumans/open-humans",
"id": "a953d1cfa592b381c13f9bc5b2ea53df31c0dbfc",
"size"... |
"""Label counter for the loops continue"""
class LoopCounter:
"""Loop counter"""
COUNTER = 0
@staticmethod
def get_next():
"""Return next loop continue label name"""
LoopCounter.COUNTER += 1
return "loop_label_{}".format(LoopCounter.COUNTER)
| {
"content_hash": "3d397c2175c86d5ed6971d571bdafd9d",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 58,
"avg_line_length": 25.818181818181817,
"alnum_prop": 0.6232394366197183,
"repo_name": "NeonMercury/python-lua",
"id": "73e673577db6d44e912083a7b619fe02f5732855",
"size"... |
from pymarkdownlint.tests.base import BaseTestCase
from pymarkdownlint.lint import MarkdownLinter
from pymarkdownlint.rules import RuleViolation
from pymarkdownlint.config import LintConfig
class RuleOptionTests(BaseTestCase):
def test_lint(self):
linter = MarkdownLinter(LintConfig())
sample = se... | {
"content_hash": "7e87e29bc1f943e3dff9ae29f2328167",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 97,
"avg_line_length": 47.166666666666664,
"alnum_prop": 0.6336866902237926,
"repo_name": "jorisroovers/pymarkdownlint",
"id": "f74dab8eed49925367d25354ef9ec895cdce0fc7",
"... |
""" test CoxPH model """
import unittest
from numpy import exp
from sparktkregtests.lib import sparktk_test
class CoxPH(sparktk_test.SparkTKTestCase):
def setUp(self):
"""Build the frames needed for the tests."""
super(CoxPH, self).setUp()
dataset = self.get_file("multi_cox_5c_1kr.csv"... | {
"content_hash": "399a49c5202d95d7d5723dd72aad11a3",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 77,
"avg_line_length": 39.75688073394495,
"alnum_prop": 0.5384792892581055,
"repo_name": "grehx/spark-tk",
"id": "ed528b6f4bd4ccb8c9edd2f525c8ee4733e25109",
"size": "9372"... |
from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect, HttpResponse
from django.core.urlresolvers import reverse
from django.views import generic
from django.utils import timezone
from .models import Choice, Question
class IndexView(generic.ListView):
template_name = ... | {
"content_hash": "ac6357ae7aeeb2d8713664169f78ebb8",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 111,
"avg_line_length": 36.04081632653061,
"alnum_prop": 0.6766704416761042,
"repo_name": "lorimccurry/django-polls",
"id": "e3cd78979a18748b77c8738a7f3efdbe5f59eaad",
"siz... |
'''
Configure Chronos jobs via a salt proxy.
.. code-block:: yaml
my_job:
chronos_job.config:
- config:
schedule: "R//PT2S"
command: "echo 'hi'"
owner: "me@example.com"
.. versionadded:: 2015.8.2
'''
from __future__ import absolute_import
import copy
import loggin... | {
"content_hash": "48fb9d8c0d55ed87c12105aacf78d585",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 91,
"avg_line_length": 33.18978102189781,
"alnum_prop": 0.5179239058720035,
"repo_name": "stephane-martin/salt-debian-packaging",
"id": "25ebe87174d97483732e130abf6b29f8e4fa... |
import subprocess
import netaddr
from oslo_log import log
import six
from tempest_lib.common.utils import misc as misc_utils
from tempest_lib import exceptions as lib_exc
from tempest.common import fixed_network
from tempest.common.utils import data_utils
from tempest.common.utils.linux import remote_client
from temp... | {
"content_hash": "9f9f51a8a40581b8dbb203b7df3d0407",
"timestamp": "",
"source": "github",
"line_count": 1380,
"max_line_length": 79,
"avg_line_length": 41.70652173913044,
"alnum_prop": 0.5686734427938493,
"repo_name": "hayderimran7/tempest",
"id": "da4ebbebbc9291dfe352d3def2aa069a05866840",
"size":... |
import os
import sys
from setuptools import setup, find_packages
def read_files(filename):
try:
with open(os.path.join(os.path.dirname(__file__), filename), "r") as f:
return f.read()
except IOError:
return ""
long_desc = read_files("README.md")
requirements = read_files("REQUIR... | {
"content_hash": "15de776cc02d467396b52fc0bd3d13b5",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 95,
"avg_line_length": 28.386363636363637,
"alnum_prop": 0.6805444355484388,
"repo_name": "HCDevelopers/MultiEncoder",
"id": "3fe9b5df80882154f5a78a9f3da9308bac9df0bf",
"si... |
import urllib
import os
import hashlib
with open('media_urls.txt','r') as f:
for url in f:
imagename = os.path.basename(url)
m = hashlib.md5(url).hexdigest()
if '.jpg' in url:
shortname = m + '.jpg'
elif '.png' in url:
shortname = m + '.png'
else:
print ... | {
"content_hash": "2db245ffd1f027114713d09a27e89c90",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 50,
"avg_line_length": 22.863636363636363,
"alnum_prop": 0.5506958250497018,
"repo_name": "mixbe/kerstkaart2013",
"id": "010e651dbf9d0ac4d082ac6196fd08f20ab8a3fb",
"size": ... |
from bs4 import BeautifulSoup
import urllib2
import string
import re
import sqlite3
eng_alphabet = string.uppercase
eng_alphabet = re.sub('W', '', eng_alphabet)
eng_alphabet = re.sub('C', '', eng_alphabet)
uzb_alphabet = [letter for letter in eng_alphabet] + ["O\xe2\x80\x98", "G\xe2\x80\x98", "SH", "CH"]
urls = ["http... | {
"content_hash": "7fdd785a3aadf58ebf3feb42a2e22669",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 163,
"avg_line_length": 30.850467289719628,
"alnum_prop": 0.5680096940321114,
"repo_name": "muminoff/boshqacha",
"id": "d348e743f1180571867c5ccd405be73f03030009",
"size": ... |
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_tatooine_aaph_koden.iff"
result.attribute_template_id = 9
result.stfName("theme_park_name","aaph_koden")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "2b578fcd6ad653d8ae6d06dfa9d30bef",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 73,
"avg_line_length": 23.76923076923077,
"alnum_prop": 0.6990291262135923,
"repo_name": "obi-two/Rebelion",
"id": "b31b429031bd17b1333cf7c34355881f2703cffe",
"size": "454"... |
import imp
import os
import sys
BENCHMARK_DIR = os.path.join(os.path.split(os.path.abspath(__file__))[0], 'benchmark')
sys.path.append(BENCHMARK_DIR)
def load_from_file(filepath):
mod_name,file_ext = os.path.splitext(os.path.split(filepath)[-1])
if file_ext.lower() == '.py':
module = imp.load_source(mod_name... | {
"content_hash": "21d8fe2f93a631a07adc4300ac345d9d",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 86,
"avg_line_length": 30.772727272727273,
"alnum_prop": 0.6528803545051699,
"repo_name": "matteobertozzi/RaleighSL",
"id": "9e5143078056fbeacdbeabced0f504c332ea9e9f",
"siz... |
"""
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from fabric import util
from fabric import exec_train
from fabric import DatasetRecord
from models import ModelSdc
from processors import ProcessorSdc
from feeds import FeedImage... | {
"content_hash": "6247449a0a68d380effa73b3309bcb25",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 116,
"avg_line_length": 27.373333333333335,
"alnum_prop": 0.6151972722844617,
"repo_name": "rwightman/tensorflow-litterbox",
"id": "bd0dda13e3f45459796171448e8e91b99a34d4af",... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pima.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "c925fd18f14ad90aeca9c1a91671c5f0",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 68,
"avg_line_length": 25,
"alnum_prop": 0.7066666666666667,
"repo_name": "bdunnette/pima",
"id": "e4fd2800cd526f603cd31222071dd12354bad91f",
"size": "247",
"binary": fals... |
import nnvm.symbol as sym
from nnvm.compiler import graph_util
def test_cnn_gradients():
# input data
h = 128
w = 128
data_shape = (1000, 3, h, w)
data = sym.Variable('data', shape=data_shape, dtype=0)
# conv2d
num_channels = 64
kernel_size = 32
conv_w_shape = (num_channels, 3, ker... | {
"content_hash": "44456cb5594bbd8267fed5e2b33aed13",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 102,
"avg_line_length": 35.11029411764706,
"alnum_prop": 0.6257591623036649,
"repo_name": "mlperf/training_results_v0.6",
"id": "d3f25097819b22bfc3a8404444b8e5dc2e23ebf5",
... |
from collections import defaultdict
from .voter import Voter
from ..messages.append_entries import AppendEntriesMessage
from ..messages.client import ClientMessage, ClientLeaderResponse
class Leader(Voter):
def __init__(self, timeout=1.0):
super(Leader, self).__init__(timeout=timeout)
self._nextI... | {
"content_hash": "c61a9f5de3104f10cfabee84a1eb379a",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 99,
"avg_line_length": 36.71568627450981,
"alnum_prop": 0.5748998664886515,
"repo_name": "hulu/monaco",
"id": "15198f11373d683537064cca769b115b4155d0ab",
"size": "3745",
... |
"""CARLS APIs for Neural Structured Learning."""
from research.carls import dynamic_embedding_config_pb2
from research.carls import dynamic_embedding_neighbor_cache
from research.carls import dynamic_embedding_ops
from research.carls import kbs_server_helper_pybind as kbs_server_helper
from research.carls import neigh... | {
"content_hash": "9c01c6fc7312a3cb0accc3137c93b37a",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 89,
"avg_line_length": 43.275862068965516,
"alnum_prop": 0.8087649402390438,
"repo_name": "tensorflow/neural-structured-learning",
"id": "77df31fac54f9c36b3ed4f71f8bff8aab89d... |
import direct.directbase.DirectStart
from panda3d.core import Filename,Buffer,Shader
from panda3d.core import PandaNode,NodePath
from panda3d.core import AmbientLight,DirectionalLight
from panda3d.core import TextNode,Point3,Vec4
from direct.showbase.DirectObject import DirectObject
from direct.filter.CommonFilters imp... | {
"content_hash": "d59e6bf165200c5cdef1d6f3e8317c50",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 98,
"avg_line_length": 38.00917431192661,
"alnum_prop": 0.6430123099203475,
"repo_name": "ToonTownInfiniteRepo/ToontownInfinite",
"id": "433a1b58927617b435daf635df1765c235b5... |
from nb2html import post_todict
def test_post_todict():
post = """---
layout: post
title: Title of post
date: Today
summary: My summary
tags: ipython
extra_key: extra value
---
Stuff that shouldn't be captured
"""
shouldbe = {
'date': 'Today',
'extra_key': 'extra ... | {
"content_hash": "8cf89407f108228d77c16f2f7da00ed0",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 102,
"avg_line_length": 23,
"alnum_prop": 0.5921325051759835,
"repo_name": "d10genes/blog",
"id": "540c8dfd0ff470428f5623e281e2ee976f628cb0",
"size": "966",
"binary": fal... |
"""Unit tests for time utilities."""
# pytype: skip-file
import datetime
import unittest
import pytz
from google.protobuf import duration_pb2
from google.protobuf import timestamp_pb2
from apache_beam.utils.timestamp import Duration
from apache_beam.utils.timestamp import Timestamp
class TimestampTest(unittest.Te... | {
"content_hash": "b6144570692b0410cb3239510350fb97",
"timestamp": "",
"source": "github",
"line_count": 224,
"max_line_length": 101,
"avg_line_length": 42.24107142857143,
"alnum_prop": 0.6820968082857747,
"repo_name": "robertwb/incubator-beam",
"id": "9ad8014878d922b1a430611e38af95ed155eea65",
"siz... |
from django.shortcuts import redirect
from maps import api
def add_map(request):
api.views.create_map_area(request, form=True)
return redirect('/control/')
def create_question(request):
api.views.create_question(request)
return redirect('/control/')
def create_question_set(request):
return ap... | {
"content_hash": "4af76e69b1ab24854fcbe017fd50cec7",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 49,
"avg_line_length": 21,
"alnum_prop": 0.7338935574229691,
"repo_name": "sevazhidkov/greenland",
"id": "bc86db72e52253c6a01dde302b0850ce2160585e",
"size": "357",
"binar... |
base58_digits = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
from . import fields
def base58_encode(address_bignum):
"""This function converts an address in bignum formatting
to a string in base58, it doesn't prepend the '1' prefix
for the Bitcoin address.
:param address_bignum: The a... | {
"content_hash": "7aa3306e5a697e01799f8a68ed979eb3",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 78,
"avg_line_length": 34.63265306122449,
"alnum_prop": 0.6764879198585739,
"repo_name": "perone/protocoin",
"id": "b07f1b0fb83fa32bba2734c2547ae8b863892a55",
"size": "1717... |
from __future__ import unicode_literals
from cms.models import CMSPlugin
from django.db import models
from django.utils.translation import ugettext_lazy as _
from filer.fields.file import FilerFileField
from filer.utils.compatibility import python_2_unicode_compatible
from cmsplugin_filer_utils import FilerPluginMana... | {
"content_hash": "443f3c107aa5001d9e66a8359c6f9221",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 103,
"avg_line_length": 32.357142857142854,
"alnum_prop": 0.6591611479028697,
"repo_name": "nephila/cmsplugin-filer",
"id": "7dc424efb0944db956dc3f11a5cbd7f3c4e40f81",
"siz... |
from azure.identity import DefaultAzureCredential
from azure.mgmt.hybridkubernetes import ConnectedKubernetesClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-hybridkubernetes
# USAGE
python get_clusters_example.py
Before run the sample, please set the values of the client I... | {
"content_hash": "582fb55e258e9dde966c34e7bad3ee37",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 156,
"avg_line_length": 34.63636363636363,
"alnum_prop": 0.7436570428696413,
"repo_name": "Azure/azure-sdk-for-python",
"id": "33688be960b4974a740ad53257a931632c7791e6",
"s... |
"""This module contains AWS S3 to Snowflake operator."""
from __future__ import annotations
import warnings
from typing import Any, Sequence
from airflow.models import BaseOperator
from airflow.providers.snowflake.hooks.snowflake import SnowflakeHook
from airflow.providers.snowflake.utils.common import enclose_param
... | {
"content_hash": "549193363cdfd50178cd11bed2e29e9c",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 113,
"avg_line_length": 39.587786259541986,
"alnum_prop": 0.6372927111453914,
"repo_name": "apache/airflow",
"id": "58fbcbffd335afc3235a96459fce8187fd59bfc6",
"size": "597... |
from __future__ import absolute_import
import uuid
import subprocess
import copy
from subprocess import PIPE
from xformmanager.storageutility import *
from xformmanager.xformdef import FormDef
from xformmanager.copy import prepare_migration_objects, migrate
from xformmanager.models import MetaDataValidatio... | {
"content_hash": "38cdb752d1b950b5b935bb0a7775a5da",
"timestamp": "",
"source": "github",
"line_count": 334,
"max_line_length": 114,
"avg_line_length": 44.74550898203593,
"alnum_prop": 0.608497825359652,
"repo_name": "commtrack/temp-aquatest",
"id": "32b0a19d190c4b5ae3f2c1a8b9642939a370f5c1",
"size... |
"""
Copyright (C) 2015 itsbriany
Finds the offsets of a string in a file
"""
from optparse import OptionParser
from sys import exit
parser = OptionParser(usage="usage: %prog [options] <search string> <file>",
version="%prog 1.0")
parser.add_option('-b', action='store_true', default=False, des... | {
"content_hash": "0670842089bf5c90d6c8efd50bb2373f",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 80,
"avg_line_length": 21.11111111111111,
"alnum_prop": 0.6017543859649123,
"repo_name": "itsbriany/Tools",
"id": "98ae2c5cb4abea949415c42753503df5b692442e",
"size": "1140"... |
from __future__ import print_function, absolute_import, unicode_literals
class PureOkapiMixin(object):
"""
Mixin that allows the Kivy layer to listen to the pure Okapi layer
without the pure Okapi layer being any the wiser.
"""
def fire_event(self, event_name, *args, **kwargs):
if hasattr(... | {
"content_hash": "ed0e05560745cdafc20bf12ceb4a97df",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 72,
"avg_line_length": 36.72727272727273,
"alnum_prop": 0.6732673267326733,
"repo_name": "kostyll/kivy-okapi",
"id": "f068fd00d7bb610a4f1eff5807a072abb478b508",
"size": "40... |
import math
import random
def init(world):
return random.random()*3+0.2
| {
"content_hash": "2b541e8679ebb1be33e354fa768f6e35",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 32,
"avg_line_length": 15.4,
"alnum_prop": 0.7142857142857143,
"repo_name": "ofavre/cellulart",
"id": "abebe0a4e705a29fa364a14b03cde5a83a5e9132",
"size": "131",
"binary": ... |
import os.path
import sys
import urllib.request
import re
import gettext
import json
import subprocess
from tempfile import TemporaryDirectory
import xml.etree.ElementTree as ET
TABLE_URL = "https://www.unicode.org/repos/cldr/tags/latest/common/supplemental/plurals.xml"
MARKER_BEGIN = "// Code generated with scripts... | {
"content_hash": "10e904bbf45bc50c201e20dda43be2ce",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 119,
"avg_line_length": 34.30120481927711,
"alnum_prop": 0.6283807516684229,
"repo_name": "c72578/poedit",
"id": "1c07de47d142b697887f20ae2b001e4adce535ab",
"size": "3081",... |
import sys
import os
import unittest
import subprocess
import urllib
import traceback
import shutil
from time import sleep
sys.path.insert(0, '.')
sys.path.insert(0, '../')
sys.path.insert(0, '../../')
from LendingClubInvestor import util
from LendingClubInvestor import AutoInvestor
from LendingClubInvestor.settings i... | {
"content_hash": "06f1dbf0c8755045d49736dc82287176",
"timestamp": "",
"source": "github",
"line_count": 491,
"max_line_length": 114,
"avg_line_length": 37.794297352342156,
"alnum_prop": 0.6261249124319663,
"repo_name": "sigmavirus24/LendingClubAutoInvestor",
"id": "dc75509fc2c062411394dd357298f405573... |
from __future__ import unicode_literals
import copy
import datetime
import json
import uuid
from django.core.exceptions import NON_FIELD_ERRORS
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.validators import RegexValidator
from django.forms import (
BooleanField, CharField, Checkb... | {
"content_hash": "7fa163c9085015b5202b2cf93b5a1fe3",
"timestamp": "",
"source": "github",
"line_count": 3471,
"max_line_length": 131,
"avg_line_length": 47.16940363007779,
"alnum_prop": 0.5899099099099099,
"repo_name": "sgzsh269/django",
"id": "2bd49b7361d17e0478415d0817f79a00a5c7934b",
"size": "16... |
print('Navnene er:')
print('David Fotel')
print('Theo Askov')
| {
"content_hash": "5ad78d8b570e0eb1c534ef11f746d935",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 20,
"avg_line_length": 20.666666666666668,
"alnum_prop": 0.6935483870967742,
"repo_name": "davsebamse/su0159navn",
"id": "0858b80b7171756e50698641c95e33bc52ce00b9",
"size": ... |
from app import app, etcd_client
from utils import randompass
import models
import click
import utils
# Get Blueprint Apps
from view import view_bp
from api import web_api
from auth import auth_flask_login
# Register Blueprints
app.register_blueprint(view_bp)
app.register_blueprint(web_api)
app.register_blueprint(... | {
"content_hash": "399489666f5d0a7a09e56be735e03782",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 95,
"avg_line_length": 20.741935483870968,
"alnum_prop": 0.6415241057542769,
"repo_name": "rtx3/Microburst",
"id": "55e83edec8c50341ef6ac8994250dd98b199b464",
"size": "1313... |
from django.contrib import admin
from .models import Truck, Company
# Register your models here.
@admin.register(Truck, Company)
# @admin.register(Company)
class TruckAdmin(admin.ModelAdmin):
pass
class CompanyAdmin(admin.ModelAdmin):
pass | {
"content_hash": "97de17beb1f660755d8f596132adbc8c",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 37,
"avg_line_length": 24.2,
"alnum_prop": 0.7975206611570248,
"repo_name": "pixelgremlins/ztruck",
"id": "f9f58c79e29c6f27ac93bc5c7bda9780768f359b",
"size": "242",
"bina... |
from mockit.manager import MockObjectManager
class MockObject(object):
_mock_manager_class = MockObjectManager
def __init__(self, **kwargs):
self._mock = self._mock_manager_class(self, **kwargs)
def __getattr__(self, key):
if self._mock.is_enabled(key):
return object.__getatt... | {
"content_hash": "73857b8c612b646f836eb79ed41e5d12",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 61,
"avg_line_length": 25.358974358974358,
"alnum_prop": 0.5631951466127402,
"repo_name": "dugan/mockit",
"id": "c44d880027e56176898223e27c797c0856938ee4",
"size": "1267",
... |
from django.db import migrations, models
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('products', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='LocationType',
fields=[
('id', models.AutoField(v... | {
"content_hash": "e666257bffeb8ef388a991ee3683c48f",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 148,
"avg_line_length": 54.878787878787875,
"alnum_prop": 0.586416344561016,
"repo_name": "dimagi/commcare-hq",
"id": "90e1834d1bebd4e763d87bdd623b754b4630ac53",
"size": "3... |
def allLongestStrings(inputArray):
return [s for s in inputArray if len(s) == max([len(i) for i in inputArray])]
| {
"content_hash": "e3c5fa0353325cab903a98a5605efa34",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 81,
"avg_line_length": 58.5,
"alnum_prop": 0.7008547008547008,
"repo_name": "gianimpronta/Codefights",
"id": "075c877409a55845429488a935046b466d0f2d90",
"size": "117",
"bi... |
import os
import sys
import tempfile
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'telemetry'))
from telemetry.internal.browser import browser_finder
from telemetry.internal.browser import browser_options
def _RunPrebuilt(options):
browser_to_create = browser_finder.FindBrowser(options)
with br... | {
"content_hash": "1c8dae29aa3c640f415d86a12fcdae73",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 75,
"avg_line_length": 33.21212121212121,
"alnum_prop": 0.7153284671532847,
"repo_name": "Bysmyyr/chromium-crosswalk",
"id": "2f5bbd2ba5d73a01ef515b88d24ae9b10a565e6f",
"si... |
from __future__ import print_function
import theano
a = theano.tensor.vector() # declare variable
b = theano.tensor.vector() # declare variable
out = a ** 2 + b ** 2 + 2 * a * b # build symbolic expression
f = theano.function([a, b], out) # compile function
print(f([1, 2], [4, 5])) # prints [ 25. 49.]
| {
"content_hash": "57c4eb20617c04dc525706ca102b8161",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 62,
"avg_line_length": 44.285714285714285,
"alnum_prop": 0.635483870967742,
"repo_name": "rizar/attention-lvcsr",
"id": "96288eb95d20a85bd6b43ae21b752279bc60c533",
"size": "... |
"""Entity class that represents Z-Wave node."""
import logging
from itertools import count
from homeassistant.core import callback
from homeassistant.const import ATTR_BATTERY_LEVEL, ATTR_WAKEUP, ATTR_ENTITY_ID
from homeassistant.helpers.entity_registry import async_get_registry
from homeassistant.helpers.device_regis... | {
"content_hash": "07e273c7489f172c245260a5908381ae",
"timestamp": "",
"source": "github",
"line_count": 352,
"max_line_length": 88,
"avg_line_length": 32.51988636363637,
"alnum_prop": 0.5931685157683235,
"repo_name": "fbradyirl/home-assistant",
"id": "c60314d35798a5fa77d5b3e6217daaba68a4dafa",
"siz... |
from __future__ import print_function
import json
from optparse import make_option
from django.core.management.base import BaseCommand
from django.utils import dateparse, timezone
from wagtail.wagtailcore.models import Page, PageRevision
def revision_date_expired(r):
expiry_str = json.loads(r.content_json).get(... | {
"content_hash": "5854d66f505c7a6e8bc060ce071d54ce",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 79,
"avg_line_length": 36.74545454545454,
"alnum_prop": 0.47699158832261257,
"repo_name": "lojack/wagtail",
"id": "9a69f5f2e1649707bdba33658e14237a03e5e9f1",
"size": "4042... |
import json
from trove.common import exception
from trove.common import utils
from trove.guestagent.datastore.experimental.couchbase import service
from trove.guestagent.datastore.experimental.couchbase import system
from trove.guestagent.strategies.backup import base
from trove.common.i18n import _
from trove.opensta... | {
"content_hash": "19c5c6debc4b06e93370b3f60d283d7c",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 70,
"avg_line_length": 37.215053763440864,
"alnum_prop": 0.49436579023403643,
"repo_name": "daizhengy/RDS",
"id": "798326d35ca7c24eb102301503182a795f356a9c",
"size": "4107"... |
from flask.ext.restful import Resource, marshal, reqparse, fields
from api.exceptions import MessageNotFound
from db.external import (
connection,
get_messages,
get_message,
add_message,
delete_message
)
class IsoDateTimeField(fields.Raw):
def format(self, value):
return value.isoform... | {
"content_hash": "db7a8669d41d2fc2b2c6c262d480eafa",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 66,
"avg_line_length": 25.796116504854368,
"alnum_prop": 0.5724501317275122,
"repo_name": "chuo06/palindrome",
"id": "40d74af376144bf103fcbd903404204155d1a9c7",
"size": "2... |
"""Usage: python wallpaper.py [OPTIONS] TAGS
TAGS is a space delimited list of tags
OPTIONS:
-w screenwidth or --width screenwidth
-h screenheight or --height screenheight
-f filename or --file filename
Requires:
- Python Imaging Library [http://www.pythonware.com/products/pil/]
"""
__author__ = "Shuai Chen <... | {
"content_hash": "cef276df31a018e3e6e6c43b6458b9fc",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 85,
"avg_line_length": 27.75409836065574,
"alnum_prop": 0.5883047844063792,
"repo_name": "chenusc11/flickr-crawler",
"id": "12654598341eb5c2d2340864d4922ef42000ed09",
"siz... |
import pytest
from geoconvert.convert import (
ca_address_to_province_code,
ca_postcode_to_province_code,
ca_province_name_to_province_code,
)
class TestCanada:
@pytest.mark.parametrize(
"input_data, expected",
[
("Toronto, Ontario", "ON"),
("Québec", "QC"),
... | {
"content_hash": "9c661840b68e77a222a8d0c5b28cbba8",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 76,
"avg_line_length": 34.377049180327866,
"alnum_prop": 0.5240820219360992,
"repo_name": "jurismarches/geoconvert",
"id": "c323212429797ddd89ea263250244d708e08b0ff",
"size... |
from syncgateway import urls
class Endpoint(object):
def __init__(self, url, database, session):
self.url = url
self.database = database
self.session = session
@property
def database_url(self):
return urls.base_url(self.url, self.database)
| {
"content_hash": "6af11f9a912f318b7e283c31b3f81f72",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 53,
"avg_line_length": 22.153846153846153,
"alnum_prop": 0.6354166666666666,
"repo_name": "ecordell/syncgateway-admin-client",
"id": "05fb8b48e1366da978e094c51f4197fc16065a63... |
from dataclasses import dataclass
@dataclass
class MyClass:
"""
Class description
Parameters:
at<caret>tr1: attribute description
"""
attr1 = 3
def __init__(self, attr1):
pass | {
"content_hash": "61a53e69a2758188b410c45be1c6469a",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 43,
"avg_line_length": 14.6,
"alnum_prop": 0.6073059360730594,
"repo_name": "JetBrains/intellij-community",
"id": "6745d77e4e628f5bee2d2d18a3d9951edad06868",
"size": "219",... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.development")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# i... | {
"content_hash": "a1cf32b070b154918dfade3916e7bb3f",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 82,
"avg_line_length": 37.80952380952381,
"alnum_prop": 0.6246851385390428,
"repo_name": "ameistad/dokku-django-template",
"id": "907bd31df816a7079b952d15e92202b6babf19ac",
... |
from inspect import getmembers
from django.conf import settings
class AppSettings(object):
"""
An app setting object to be used for handling app setting defaults
gracefully and providing a nice API for them. Say you have an app
called ``myapp`` and want to define a few defaults, and refer to t... | {
"content_hash": "aa30e781488e8a6b437776334c3312de",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 77,
"avg_line_length": 37.764150943396224,
"alnum_prop": 0.6162877841618786,
"repo_name": "alsoicode/django-maintenancemode",
"id": "cdfa473e51476fc9797be7c9229dc446a5a048ac... |
from flask import session
from flask_pluginengine import current_plugin
from wtforms.fields.core import BooleanField, StringField
from wtforms.fields.simple import TextAreaField
from wtforms.validators import DataRequired, ValidationError
from indico.modules.vc.forms import VCRoomAttachFormBase, VCRoomFormBase
from in... | {
"content_hash": "e8177ee3ed1f2ee63240701dd0a79737",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 114,
"avg_line_length": 47.532786885245905,
"alnum_prop": 0.5464735299189516,
"repo_name": "ThiefMaster/indico-plugins",
"id": "77d750ea7a7ba0168fdb54de9b52536708f7d52c",
... |
import sys
import os
# If extensions (or modules to document with autodoc) are in another
# directory, add these directories to sys.path here. If the directory is
# relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# Get the proje... | {
"content_hash": "cf8d15efd9a57eb364c19dadb16e01ff",
"timestamp": "",
"source": "github",
"line_count": 260,
"max_line_length": 76,
"avg_line_length": 31.05,
"alnum_prop": 0.7046946612164003,
"repo_name": "matheuscas/pyfuzzy_toolbox",
"id": "0d482508ef5facc9d75659e3f18be604bdee9dc9",
"size": "8523"... |
import json
class JsonConf():
def __init__(self):
pass
def write_json_conf(self, path, config):
with open(path, 'w') as f:
json.dump(config, f)
def get_json_conf(self, path):
with open(path, 'r') as f:
config = json.load(f)
return config
| {
"content_hash": "1e0e83a2eb10b4d4e53a402757d2fef4",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 44,
"avg_line_length": 19.4375,
"alnum_prop": 0.5273311897106109,
"repo_name": "Ernestyj/PyStudy",
"id": "dacf4220086dfc6b465578e8cae81fc77c3c9e09",
"size": "335",
"binar... |
"""
Hook for http://pypi.python.org/pypi/h5py/
"""
hiddenimports = ['_proxy','utils','defs']
| {
"content_hash": "2f16579149c10aeea02265b4e37d5951",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 42,
"avg_line_length": 15.833333333333334,
"alnum_prop": 0.6210526315789474,
"repo_name": "bl4ckdu5t/registron",
"id": "c462b1691e5372d2e3cb21fff67deb2d8a1e6dc3",
"size": "5... |
""" Context manager for gcloud which redirects config directory to temp location """
import os
import subprocess
class GCloudContext(object):
def __init__(self, project_id, creds_file=None):
self._project_id = project_id
self._creds_file = creds_file
def __enter__(self):
if self._cre... | {
"content_hash": "a745a84fc57fb4bd9bdc09a037c3f1e3",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 88,
"avg_line_length": 33.142857142857146,
"alnum_prop": 0.6045258620689655,
"repo_name": "GoogleCloudPlatform/professional-services-data-validator",
"id": "be150daa623ffcb68... |
import os
from django.conf import settings as s
def gitFetch(repo_path, username,repo_name,branch_name):
'''
directory: target directory
url: git fetch url from github
'''
print "fetch "+repo_path
remote_url = s.SPIDER_GITHUB+username+"/"+repo_name+".git"
if not os.path.exists(repo_path):
os.makedirs(repo_... | {
"content_hash": "198c151961e89b7f0d23a9a33240b3f0",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 94,
"avg_line_length": 33.142857142857146,
"alnum_prop": 0.6745689655172413,
"repo_name": "gitireadme/gitireadme.server",
"id": "3f8ac156e7957fb1b0fd2331d038bbb447575448",
... |
from django.test import TestCase
from frigg.builds.models import Build, BuildResult, Project
from frigg.helpers.github import _get_status_from_build, get_pull_request_url
class GithubHelpersTestCase(TestCase):
def test__get_status_from_build(self):
error = RuntimeError()
build = Build.objects.cr... | {
"content_hash": "93db7c5b2805870fd6a168777c7d0125",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 94,
"avg_line_length": 45.806451612903224,
"alnum_prop": 0.6669014084507042,
"repo_name": "frigg/frigg-hq",
"id": "737143dcf23d22eae544525f06c133db0346a64d",
"size": "1420"... |
from __future__ import unicode_literals, division, absolute_import
import copy
import logging
import pickle
from datetime import datetime, timedelta
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from flexget import db_schema
from flexget.event import event
from flexget.manager import... | {
"content_hash": "5ff940402e5d190ac14898279519ab87",
"timestamp": "",
"source": "github",
"line_count": 191,
"max_line_length": 119,
"avg_line_length": 44.109947643979055,
"alnum_prop": 0.5583382789317507,
"repo_name": "sean797/Flexget",
"id": "66444d88b605d01363239ff2bc219a9146fa14d1",
"size": "84... |
"""local_session_caching.py
Create a new Dogpile cache backend that will store
cached data local to the current Session.
This is an advanced example which assumes familiarity
with the basic operation of CachingQuery.
"""
from dogpile.cache.api import CacheBackend, NO_VALUE
from dogpile.cache.region import register_... | {
"content_hash": "99197c834e9c81f493a2f6edf376aa02",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 73,
"avg_line_length": 32,
"alnum_prop": 0.6723484848484849,
"repo_name": "rclmenezes/sqlalchemy",
"id": "383b31c11e54bdca373f85bfe1afe2d9212bba3d",
"size": "3168",
"bina... |
"""Test that mq sends don't wedge their threads.
Starts a number of sender threads, and runs for a set amount of
time. Each thread sends messages as fast as it can, and after each
send, pops from a Queue. Meanwhile, the Queue is filled with one
marker per second. If the Queue fills, the test fails, as that
indicates t... | {
"content_hash": "c760546600ac84e42527d4b875b59657",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 100,
"avg_line_length": 30.49618320610687,
"alnum_prop": 0.4708385481852315,
"repo_name": "jasonrbriggs/stomp.py",
"id": "b3a8506f35ea7564ebc76ee20c8f0addd0cde9c5",
"size"... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('atados_core', '0014_auto_20151029_1624'),
]
operations = [
migrations.AddField(
model_name='subscription',
name='card_id',
... | {
"content_hash": "74a97be0e364ed67491a95c11e0ce3d9",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 86,
"avg_line_length": 24.157894736842106,
"alnum_prop": 0.6013071895424836,
"repo_name": "atados/api",
"id": "a1cfbcddb071e03bd100840d4599cd63f98227d1",
"size": "483",
"... |
"""
.. module: lemur.database
:platform: Unix
:synopsis: This module contains all of the database related methods
needed for lemur to interact with a datastore
:copyright: (c) 2015 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
.. moduleauthor:: Kevin Glisson... | {
"content_hash": "7c92241cfb45111e2a63dcb5d3ce3580",
"timestamp": "",
"source": "github",
"line_count": 290,
"max_line_length": 80,
"avg_line_length": 21.724137931034484,
"alnum_prop": 0.6158730158730159,
"repo_name": "nevins-b/lemur",
"id": "5f4f6004b93337c54f110844e8b1c650a24b9f1b",
"size": "6300... |
from django.db import models
from django.db import IntegrityError
from django.utils.text import slugify
from common.tools import fetch_from_web_api, fetch_from_entrez
from Bio import Entrez, Medline
from string import Template
import urllib.request,json
import logging
import re
class WebResource(models.Model):
... | {
"content_hash": "82386f40b917ba63c630943f977e827d",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 104,
"avg_line_length": 34.91747572815534,
"alnum_prop": 0.5523425552620603,
"repo_name": "cmunk/protwis",
"id": "c56a2d0ada5719bb7f342220576353a08ac586aa",
"size": "7193"... |
import sys
import pytest
import pandas
import numpy as np
from numpy.testing import assert_array_equal
import ray
from ray.util.client.ray_client_helpers import ray_start_client_server
modin_compatible_version = sys.version_info >= (3, 7, 0)
modin_installed = True
if modin_compatible_version:
try:
import ... | {
"content_hash": "f181ce86f42d078cfc46827109b04b4b",
"timestamp": "",
"source": "github",
"line_count": 396,
"max_line_length": 79,
"avg_line_length": 32.52020202020202,
"alnum_prop": 0.5859605528808821,
"repo_name": "pcmoritz/ray-1",
"id": "f6df4d08224d5483c8f9361d3a7f3785670c0c76",
"size": "13787... |
import numpy as np
import itertools
class ListRunsParser(object):
"""
will clean up the current_list_of_runs with the new added runs
ex: [1,2,3,4,7] -> 1-4,7
if a new run is already in the list of runs, it will then be removed from the list
ex: [1,2,3,4] with new run [1] -> 2-4
"""
list_c... | {
"content_hash": "7f909eb9a480e9443b1e5106c1fc556d",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 101,
"avg_line_length": 34.8359375,
"alnum_prop": 0.531509307019511,
"repo_name": "neutrons/FastGR",
"id": "ef00539e934b0994ec0223f549d8d30d6c05f2b7",
"size": "4459",
"b... |
from __future__ import unicode_literals
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name="roasttron",
version="0.1.0",
author="Chris VanSchyndel",
author_email="chrisvanschyndel@gmail.com",
packages=[
"roasttron",
],
include... | {
"content_hash": "f044c9c71d8e6e88a786bfa44e221f6d",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 46,
"avg_line_length": 20.636363636363637,
"alnum_prop": 0.6343612334801763,
"repo_name": "chrisvans/roasttron",
"id": "2f6ba4d05d036a785eac0dd7bac936695aa549b5",
"size": "... |
import sys
import os.path
# importing parent modules
sys.path.append(os.path.join(os.path.dirname(__file__), '../..'))
import json
from bottle import route, get, post, delete, static_file, response, request, run
from ctx.generators import TimeGenerator, CalendarGenerator, GPSGenerator
from ctx.widgets import TimeWidg... | {
"content_hash": "47eb9b975e4f7bba6f7a2148c7a185ab",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 111,
"avg_line_length": 29.727272727272727,
"alnum_prop": 0.6826367652055726,
"repo_name": "fmca/ctxpy",
"id": "2be922a6401ef7515a6a921b402617f40dbe5e88",
"size": "2943",
... |
"""
This experiment was created using PsychoPy2 Experiment Builder (v1.90.1),
on Mon Jun 11 10:48:56 2018
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Neuroscience Methods, 162(1-2), 8-13.
Peirc... | {
"content_hash": "b5d8c7dbd83f1f89ec7975e386d95a78",
"timestamp": "",
"source": "github",
"line_count": 474,
"max_line_length": 104,
"avg_line_length": 39.654008438818565,
"alnum_prop": 0.6724303043200681,
"repo_name": "djangraw/PsychoPyParadigms",
"id": "a7319293ac8f79ba9d128b258cfe9046cbc9438b",
... |
"""mazingame.__main__: executed when mazingame directory is called as script."""
from .mazingame import main
main()
| {
"content_hash": "851049ff80e5c5fe0afc5f1e8bebf4ca",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 80,
"avg_line_length": 18.714285714285715,
"alnum_prop": 0.6564885496183206,
"repo_name": "samisalkosuo/mazingame",
"id": "3f487b5118630b6164edfa017ea8d8d2e05e13da",
"size":... |
"""
Import related utilities and helper functions.
"""
import sys
import traceback
def import_class(import_str):
"""Returns a class from a string including module and class."""
mod_str, _sep, class_str = import_str.rpartition('.')
try:
__import__(mod_str)
return getattr(sys.modules[mod_st... | {
"content_hash": "1fa1f722c70e51985028dc4c9d064b3f",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 72,
"avg_line_length": 30.120689655172413,
"alnum_prop": 0.6433886662850601,
"repo_name": "citrix-openstack-build/oslo.vmware",
"id": "9816fd47a03dfcc0c78e838d82e9a4d5aeed865... |
from __future__ import annotations
import asyncio
import sublime
class Handle:
def __init__(self, callback, args):
self.callback = callback
self.args = args
def __call__(self):
if self.callback:
self.callback(*self.args)
def cancel(self):
self.callback = None
self.args = None
class SublimeEventLoop... | {
"content_hash": "489e8c5658b4c0aa3bbe8f59edf8abde",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 60,
"avg_line_length": 21.97457627118644,
"alnum_prop": 0.7377554955649827,
"repo_name": "dmilith/SublimeText3-dmilith",
"id": "8416e49b161b1f9fa4a598c114015578c037e06f",
... |
from __future__ import unicode_literals
import os, json, sys, subprocess, shutil
import frappe
import frappe.database
import getpass
import importlib
from frappe.model.db_schema import DbManager
from frappe.model.sync import sync_for
from frappe.utils.fixtures import sync_fixtures
from frappe.website import render
fro... | {
"content_hash": "59965f3e79220ff4d92be38cd14307ac",
"timestamp": "",
"source": "github",
"line_count": 401,
"max_line_length": 145,
"avg_line_length": 29.950124688279303,
"alnum_prop": 0.7147377185678602,
"repo_name": "indautgrp/frappe",
"id": "89d0ca16a1e37cb9a05e847af803f538f83e2954",
"size": "1... |
import six
from sqlalchemy import types
from sqlalchemy_utils.exceptions import ImproperlyConfigured
from .scalar_coercible import ScalarCoercible
ip_address = None
try:
from ipaddress import ip_address
except ImportError:
try:
from ipaddr import IPAddress as ip_address
except ImportError:
... | {
"content_hash": "110f749552e04e571d72dcea03780b83",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 78,
"avg_line_length": 26.904109589041095,
"alnum_prop": 0.6430753564154786,
"repo_name": "rmoorman/sqlalchemy-utils",
"id": "7ec9741fb879662442c791931a71df7d2648b5d1",
"si... |
"""A simple script that generates a yara rule from a list of strings. It's
useful for things like generating rules based on lists of domains."""
from __future__ import print_function, unicode_literals
from argparse import ArgumentParser
from os.path import basename
from collections import OrderedDict
from datetime im... | {
"content_hash": "ccfb778bea31008fb9e970fd703288c6",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 105,
"avg_line_length": 30.914285714285715,
"alnum_prop": 0.6968576709796673,
"repo_name": "seanthegeek/toolbox",
"id": "4b4991b1985e644e477760a56d63bcedcc59f8c3",
"size": ... |
from wtforms.validators import Optional
from wtforms_widgets.base_form import BaseForm
from wtforms_widgets.fields.core import DateField, TimeField
from pycroft.helpers.utc import combine_or_midnight, DateTimeTz
class RescheduleTaskForm(BaseForm):
when = DateField("Neues Datum")
when_time = TimeField("Genaue... | {
"content_hash": "da6dfcf6eeb8de031681580b91af453e",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 71,
"avg_line_length": 37.5625,
"alnum_prop": 0.6855241264559068,
"repo_name": "agdsn/pycroft",
"id": "f7bb26f1d6365f3ca1361cc6a24029c3da5ae4de",
"size": "813",
"binary":... |
"""
.. module: security_monkey.watchers.iam_role
:platform: Unix
.. version:: $$VERSION$$
.. moduleauthor:: Patrick Kelley <pkelley@netflix.com> @monkeysecurity
"""
from security_monkey.watcher import Watcher
from security_monkey.watcher import ChangeItem
from security_monkey.exceptions import BotoConnectionIssu... | {
"content_hash": "e059241914404e3e99c9b1648a292649",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 112,
"avg_line_length": 39.162393162393165,
"alnum_prop": 0.5499781754692274,
"repo_name": "guardian/security_monkey",
"id": "3ab50a0c4db0d75d7e824829232704f9b8380663",
"s... |
"""Time sheet evaluator that uses the Google Calendar API or the CalDAV API."""
import json
import os.path
import subprocess
import sys
import tempfile
import webbrowser
from datetime import datetime, date, timedelta
import humanfriendly
import pytz
from lxml import etree
import matcher
from helpers import init
__a... | {
"content_hash": "9cb0ecd42b8da3bf6fdaf8ae211bd899",
"timestamp": "",
"source": "github",
"line_count": 289,
"max_line_length": 79,
"avg_line_length": 37.238754325259514,
"alnum_prop": 0.5351235829771418,
"repo_name": "a-w/timesheet",
"id": "5c31df207020f680e321a1b20ebd93d8031a17ad",
"size": "11409... |
'''
Copyright (c) 2017 Mark Fisher
Licensed under the MIT License, see LICENSE in the project root for full license.
Tree based file system browser widget for browsing the file tree from a movable root.
'''
# pylint: disable=C0103
import os
import re
import datetime
import shutil
import string
import subprocess
from... | {
"content_hash": "b222c91b123605a68271e51e9371b783",
"timestamp": "",
"source": "github",
"line_count": 644,
"max_line_length": 101,
"avg_line_length": 32.99689440993789,
"alnum_prop": 0.5846117647058824,
"repo_name": "mfish38/project_explorer",
"id": "47f79037aecb8096b97269ebead79a84e6f973c8",
"si... |
"""
The Django settings for partisan-discourse in production
"""
##########################################################################
## Imports
##########################################################################
import os
from .base import *
#############################################################... | {
"content_hash": "b21e78fd7da7fb86620813633e140be0",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 74,
"avg_line_length": 25.846153846153847,
"alnum_prop": 0.38095238095238093,
"repo_name": "DistrictDataLabs/partisan-discourse",
"id": "2d5366f6352bd774877c577cdd34eab1eb4a9... |
import openstackdocstheme
copyright = u'2015, OpenStack contributors'
html_copy_source = False
html_last_updated_fmt = '%Y-%m-%d %H:%M'
html_show_sourcelink = False
html_theme = 'openstackdocs'
html_theme_path = [openstackdocstheme.get_html_theme_path()]
html_use_index = False
master_doc = 'index'
project = u'OpenStac... | {
"content_hash": "2b53cf4cbe957c6173341d7390f9cabe",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 60,
"avg_line_length": 30.615384615384617,
"alnum_prop": 0.7487437185929648,
"repo_name": "JordanP/openstack-snippets",
"id": "3cd9352cfe6965ece5db5e44e3d16fc7c9a6d8aa",
"s... |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class HereNow(Choreography):
def __init__(self, temboo_session):
"""
Create a new i... | {
"content_hash": "cbb3cb324e3691d2c524cc7677cff717",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 171,
"avg_line_length": 41.96296296296296,
"alnum_prop": 0.6810826713739335,
"repo_name": "lupyuen/RaspberryPiImage",
"id": "bb9db0b8539a0fef1f0cc11abe1e4f43e5a8ff76",
"siz... |
import argparse
import hail as hl
parser = argparse.ArgumentParser()
parser.add_argument('-v', required=True, choices=['150', '151'], help='dbSNP build to load.')
parser.add_argument('-b', required=True, choices=['GRCh37', 'GRCh38'], help='Reference genome build to load.')
args = parser.parse_args()
name = 'dbSNP'
ve... | {
"content_hash": "5389354e3644f8c557ea5c567aab2722",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 133,
"avg_line_length": 48.13157894736842,
"alnum_prop": 0.5729907053034445,
"repo_name": "hail-is/hail",
"id": "245ebf37c457b71bdb6f6933aa2ebdfe69e4ae34",
"size": "1830",
... |
"""
sphinx-execute-code module for execute_code directive
To use this module, add: extensions.append('sphinx_execute_code')
Available options:
'linenos': directives.flag,
'output_language': directives.unchanged,
'hide_code': directives.flag,
'hide_headers': directives.flag,
'fi... | {
"content_hash": "15d66034c84ed4aa277fd5a80f0eb16f",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 103,
"avg_line_length": 30.401315789473685,
"alnum_prop": 0.5953256870807184,
"repo_name": "jpsenior/sphinx-execute-code",
"id": "99255211004a5af43fbdc0518fb689d8eb448830",
... |
from __future__ import absolute_import
import itertools
import logging
import time
import sys
import json
import os
import threading
import fcntl
#from multiprocessing import Process, Lock
# cassandra
from cassandra.cluster import Cluster
from cassandra.query import dict_factory
from cassandra.query import SimpleSta... | {
"content_hash": "2649c8ae289b45f362f98925c1ad1a65",
"timestamp": "",
"source": "github",
"line_count": 413,
"max_line_length": 153,
"avg_line_length": 39.45762711864407,
"alnum_prop": 0.5361438389788905,
"repo_name": "milaw/docker-registry-driver-cassandra",
"id": "e3189f647ce62588c3b7663414557901f9... |
class Person(BaseModel):
description = models.TextField(blank=True)
family_name = models.CharField(max_length=255, null=True, blank=True)
email = models.EmailField(null=True, blank=True)
creator = models.ForeignKey('self', null=True, blank=True,
related_name='person_creat... | {
"content_hash": "9c4819022523ac0aa9930f2e4ae1c8e5",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 78,
"avg_line_length": 39.970588235294116,
"alnum_prop": 0.6438557763061075,
"repo_name": "tuomas777/linkedevents",
"id": "6d753375629bb85fc2aa9418e3178adc4726eea8",
"size"... |
__author__ = 'tommipor'
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, Text, DateTime
Base = declarative_base()
class DeviceClass(Base):
__tablename__ = 'Device'
deviceID = Column(String(255), primary_key=True)
allowedOrganizations = Col... | {
"content_hash": "82d5de5aed6e9510ebf4fba1480cde0f",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 279,
"avg_line_length": 40.319148936170215,
"alnum_prop": 0.6321899736147757,
"repo_name": "improve-project/platform",
"id": "38758b7d08ba5dc08e3a50fbe24f953de7542567",
"si... |
"""
Main module from which the application is started and the web interface mounted
To start the application directly using the python web server, you can just do
::
python web.py
Refer to server installation documentation for more details how to deploy in production.
"""
from octopus.core import app, initialis... | {
"content_hash": "4bf11dc1108b1b6a6e344df7f0789f9b",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 164,
"avg_line_length": 32.645833333333336,
"alnum_prop": 0.7000638162093171,
"repo_name": "JiscPER/jper-sword-in",
"id": "b7c3920baf611d79b673ec80a339cde35d4501e7",
"size"... |
__author__="EIXXIE"
#将MOS文件夹添加到系统环境变量
import sys
import os
curPath = os.path.abspath(os.path.dirname(__file__))
rootPath = os.path.split(curPath)[0]
sys.path.append(rootPath)
from sqlalchemy import orm,or_, and_, desc
from sqlalchemy import Table, Column, Integer, String
from wtforms.ext.sqlalchemy.fields import Quer... | {
"content_hash": "c3c6073e88ece90d450e799d31f9f6d9",
"timestamp": "",
"source": "github",
"line_count": 385,
"max_line_length": 312,
"avg_line_length": 36.50909090909091,
"alnum_prop": 0.5691519635742743,
"repo_name": "iotate/svnmaster",
"id": "1d3e22effbf2f013e434e8403d747c61d2df39d8",
"size": "14... |
import vodka
import vodka.exceptions
class Configurator:
"""
Handles interactive configuration process guided
by specs defined via config Handler classes
Attributes:
plugin_manager (ConfigPluginManager): plugin manager instance to use
during plugin configuration
skip_defa... | {
"content_hash": "04e6b5beb9f847f81db5207eeb5506f5",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 88,
"avg_line_length": 35.49152542372882,
"alnum_prop": 0.5468003820439351,
"repo_name": "20c/vodka",
"id": "08ab83dad2ce5d0882295450d27f946ba0ce8634",
"size": "4188",
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.