text stringlengths 0 1.05M | meta dict |
|---|---|
from dockyard.utils.driver import Driver
from dockyard.driver.app._model.build import Build
from dockyard.const import APIStatus
from dockyard.var import GLOBAL
import time
class BuildDriver(Driver, Build):
def get_logs(self):
if self.exists():
err, msg = GLOBAL.logging.get_logs_by_build(self)... | {
"repo_name": "galileo-project/Galileo-dockyard",
"path": "server/dockyard/driver/app/_build.py",
"copies": "1",
"size": "1866",
"license": "mit",
"hash": 1037252855102987900,
"line_mean": 27.7076923077,
"line_max": 64,
"alpha_frac": 0.5471596999,
"autogenerated": false,
"ratio": 3.58846153846153... |
from dockyard.utils.driver import Driver
from dockyard.driver.app._model import App
from dockyard.const import APIStatus
from dockyard.driver.app._build import BuildDriver
class AppDriver(Driver, App):
def gets_by_user(self, user):
self.find({"user_id": user.id})
if self.exists():
retu... | {
"repo_name": "galileo-project/Galileo-dockyard",
"path": "server/dockyard/driver/app/_app.py",
"copies": "1",
"size": "1786",
"license": "mit",
"hash": 7384740708132944000,
"line_mean": 27.8064516129,
"line_max": 66,
"alpha_frac": 0.5475923852,
"autogenerated": false,
"ratio": 3.690082644628099,... |
from dockyard.utils.driver import Driver
from dockyard.driver.manager._model import Manager
from dockyard.driver.user import User
from dockyard.const import APIStatus
from dockyard.utils import encrypt
class ManagerDriver(Driver, Manager):
def get_users(self):
users = User().all()
if users.exists(... | {
"repo_name": "galileo-project/Galileo-dockyard",
"path": "server/dockyard/driver/manager/_manager.py",
"copies": "1",
"size": "1510",
"license": "mit",
"hash": -1693261767653783800,
"line_mean": 29.22,
"line_max": 70,
"alpha_frac": 0.5774834437,
"autogenerated": false,
"ratio": 3.83248730964467,... |
from dockyard.utils import gen_random
from dockyard.var import GLOBAL
from tornado import httpserver
from tornado.ioloop import IOLoop
from tornado.options import define, options
from tornado.web import Application
def main(opt):
GLOBAL.mongo(opt.mongo_host, opt.mongo_port, opt.database)
settings = {"login_u... | {
"repo_name": "galileo-project/Galileo-dockyard",
"path": "server/dockyard/main.py",
"copies": "1",
"size": "1255",
"license": "mit",
"hash": 2186524201947008800,
"line_mean": 34.8571428571,
"line_max": 77,
"alpha_frac": 0.5784860558,
"autogenerated": false,
"ratio": 3.6271676300578033,
"config... |
from dockyard.utils.request import Request
class GitHubClient:
class __Oauth:
AUTH_URL = "https://github.com/login/oauth/authorize"
ACCESS_TOKEN_URL = "https://github.com/login/oauth/access_token"
def __init__(self, request=None):
self.__request = request or Request()
... | {
"repo_name": "galileo-project/Galileo-dockyard",
"path": "server/dockyard/utils/github.py",
"copies": "1",
"size": "1718",
"license": "mit",
"hash": 2655837533567256600,
"line_mean": 28.6206896552,
"line_max": 99,
"alpha_frac": 0.5139697322,
"autogenerated": false,
"ratio": 4.21078431372549,
"... |
from docopt import docopt
from flooder import Flooder
from grid_func import GridFunc
_doc = """\
Usage: floodfill_vreco.py <v_final_out>
floodfill_vreco.py <v_final_out> <p1> <p2>
"""
_split_bounds = lambda s: [_.split(':') for _ in s.split(',')]
_parse_bound = lambda b: [None if _ is '' else float(_) for _ i... | {
"repo_name": "tzelleke/MinEnergyPath",
"path": "mepfinder/cli_facade.py",
"copies": "1",
"size": "1230",
"license": "mit",
"hash": 5201337782730777000,
"line_mean": 31.3684210526,
"line_max": 86,
"alpha_frac": 0.556097561,
"autogenerated": false,
"ratio": 2.727272727272727,
"config_test": fals... |
from docopt import docopt
from graph_tool.all import *
from operator import itemgetter
class Ontobuilder:
"""
Iteratively adds the most probable relation between two terms to the ontology. Currently supports hyperonymy and
cohyponymy relations. Also, any new relations that are implied by adding the first... | {
"repo_name": "hans-hjelm/ontolingual",
"path": "ontobuilder/ontobuilder.py",
"copies": "1",
"size": "24593",
"license": "apache-2.0",
"hash": 8522584184483604000,
"line_mean": 46.7533980583,
"line_max": 119,
"alpha_frac": 0.5108364169,
"autogenerated": false,
"ratio": 3.9704552793025507,
"conf... |
from docopt import docopt
from graph_tool.all import *
from scipy.stats import pearsonr
class PathLengthPmcc:
"""
Reads two ontologies (graphs) in graph-tool format. Calculates all shortest path lengths between two terms in the
learned ontology, then does the same for the gold standard (for all terms in t... | {
"repo_name": "hans-hjelm/ontolingual",
"path": "ontoeval/path_length_pmcc.py",
"copies": "1",
"size": "2720",
"license": "apache-2.0",
"hash": -3020387872596450300,
"line_mean": 40.8461538462,
"line_max": 119,
"alpha_frac": 0.6073529412,
"autogenerated": false,
"ratio": 3.4170854271356785,
"co... |
from docopt import docopt
from graph_tool.all import *
import xml.etree.ElementTree as ET
class EurovocOntobuilder:
"""
Reads Eurovoc ``desc_thes.xml`` and ``relation_bt.xml`` files and saves them as graph-tool binary format graphs.
"""
def __init__(self):
self.ontology = Graph()
self... | {
"repo_name": "hans-hjelm/ontolingual",
"path": "ontobuilder/eurovoc_ontobuilder.py",
"copies": "1",
"size": "3318",
"license": "apache-2.0",
"hash": 2328022769463238700,
"line_mean": 39.4634146341,
"line_max": 116,
"alpha_frac": 0.5997588909,
"autogenerated": false,
"ratio": 3.2786561264822134,
... |
from docopt import docopt
from nose.tools import assert_equals
from scrapple import cmd
doc = cmd.__doc__
def test_version():
args = docopt(doc, "--version")
assert_equals(args['--version'], True)
def test_genconfig():
args1 = docopt(doc, "genconfig project1 google.com")
assert_equals(args1['<projectname>'], ... | {
"repo_name": "AlexMathew/scrapple",
"path": "tests/test_cmd.py",
"copies": "2",
"size": "2090",
"license": "mit",
"hash": -1476505474127459600,
"line_mean": 33.262295082,
"line_max": 79,
"alpha_frac": 0.6889952153,
"autogenerated": false,
"ratio": 2.9068150208623087,
"config_test": false,
"h... |
from docopt import docopt
from .utils import prepare_objective
from .algorithms.evolutionary_algorithm import Population
from .algorithms.particle_swarm_optimization import PSO
def parse_arguments(doc, version=None):
arguments = docopt(doc, version=version)
try:
algorithm = arguments["--algorithm"].lo... | {
"repo_name": "Axelrod-Python/axelrod-evolver",
"path": "src/axelrod_dojo/arguments.py",
"copies": "1",
"size": "2985",
"license": "mit",
"hash": -7477743346661260000,
"line_mean": 34.1176470588,
"line_max": 88,
"alpha_frac": 0.6090452261,
"autogenerated": false,
"ratio": 4.481981981981982,
"co... |
from docopt import docopt
from vmtouchparser import parse
usage = \
"""
diskwarmer. Heats up files into the disk cache from previously
produced vmtouch -v report.
Usage:
warm [options] sort [--limit=<limit>] <report>
Options:
-h --help Show this screen.
--version Show version.
"""
def sort... | {
"repo_name": "andrewguy9/diskwarmer",
"path": "diskwarmer/__init__.py",
"copies": "1",
"size": "1298",
"license": "mit",
"hash": -7236136995344904000,
"line_mean": 26.6170212766,
"line_max": 104,
"alpha_frac": 0.6047765794,
"autogenerated": false,
"ratio": 3.228855721393035,
"config_test": fal... |
from docopt import docopt
import numpy as np
from collections import defaultdict
from representations.embedding import SVDEmbedding, Embedding
from representations.explicit import PositiveExplicit
from os.path import join, basename, normpath
import pandas as pd
import emotion_lexicons
def main():
args = docopt(""... | {
"repo_name": "hellrich/JeSemE",
"path": "pipeline/transform_models/vectors2similarity.py",
"copies": "1",
"size": "9809",
"license": "mit",
"hash": -2771136601043715600,
"line_mean": 34.6690909091,
"line_max": 126,
"alpha_frac": 0.6205525538,
"autogenerated": false,
"ratio": 3.552698297718218,
... |
from docopt import docopt
import numpy as np
import pandas as pd
from patsy import dmatrices
from sklearn.ensemble import GradientBoostingClassifier as GBC
from sklearn.ensemble import RandomForestClassifier as RFC
from sklearn.linear_model import LogisticRegression
from sklearn import metrics
from sklearn.model_select... | {
"repo_name": "hans-hjelm/ontolingual",
"path": "ontoclassifier/ontoclassifier.py",
"copies": "1",
"size": "4397",
"license": "apache-2.0",
"hash": 8311531583351242000,
"line_mean": 42.1078431373,
"line_max": 131,
"alpha_frac": 0.5992722311,
"autogenerated": false,
"ratio": 3.5632090761750406,
... |
from docopt import docopt
import re
import os
WORD = 0
POS = 1
LEMMA = 2
ORIGINAL = 3
id_pattern = re.compile(".* id=\"(\d+)\" .*")
period_pattern = re.compile(".* period=\"(\d+)\" .*")
def main():
args = docopt("""
Usage:
transformrsc.py <rsc.vrt> <targetpath>
""")
source = args["<rsc.vrt>"]... | {
"repo_name": "hellrich/JeSemE",
"path": "pipeline/preprocessing/transformrsc.py",
"copies": "1",
"size": "1975",
"license": "mit",
"hash": 8932063664755098000,
"line_mean": 26.4305555556,
"line_max": 77,
"alpha_frac": 0.5235443038,
"autogenerated": false,
"ratio": 3.6641929499072354,
"config_t... |
from docopt import docopt
import sys
class CLI:
commands = set()
options = set()
actions = {}
@classmethod
def usage(cls):
return '''
Usage:
{commands}
Options:
{options}
'''.format(
commands='\n '.join(cls.commands),
options... | {
"repo_name": "dacjames/mara-lang",
"path": "bootstrap/mara/contrib/cli.py",
"copies": "1",
"size": "1571",
"license": "mit",
"hash": -7603523033591919000,
"line_mean": 19.9466666667,
"line_max": 60,
"alpha_frac": 0.5085932527,
"autogenerated": false,
"ratio": 4.363888888888889,
"config_test": ... |
from docopt import docopt
import sys
#transforms wlp files into plaintext
def main(args):
RAW = 0
LEMMA = 1
POS = 2
in_files = args["<wlp_files>"]
column = LEMMA if args["--lemma"] else RAW
lower = args["--lower"]
for in_file in in_files:
txt = []
try:
with ... | {
"repo_name": "hellrich/JeSemE",
"path": "pipeline/preprocessing/coha_converter.py",
"copies": "1",
"size": "1534",
"license": "mit",
"hash": -589381599663553000,
"line_mean": 30.3265306122,
"line_max": 219,
"alpha_frac": 0.4126466754,
"autogenerated": false,
"ratio": 4.123655913978495,
"config... |
from docopt import docopt
class NoSuchCommandError(Exception):
"""Error thrown when an unknown command is entered"""
pass
class CommandHandler:
"""Executes named commands"""
def __init__(self, input_validator):
self.input_validator = input_validator
def _add(self, argv):
"""Usage... | {
"repo_name": "tobier/tajm",
"path": "tajm/commands.py",
"copies": "1",
"size": "3371",
"license": "mit",
"hash": 6755969474068810000,
"line_mean": 31.4134615385,
"line_max": 87,
"alpha_frac": 0.5677840403,
"autogenerated": false,
"ratio": 4.423884514435696,
"config_test": false,
"has_no_keyw... |
from docopt import docopt
from xortool.charset import get_charset
class ArgError(Exception):
pass
def parse_char(ch):
"""
'A' or '\x41' or '0x41' or '41'
'\x00' or '0x00' or '00'
"""
if ch is None:
return None
if len(ch) == 1:
return ord(ch)
if ch[0:2] in ("0x", "\\x... | {
"repo_name": "hellman/xortool",
"path": "xortool/args.py",
"copies": "1",
"size": "1379",
"license": "mit",
"hash": 4646555762360523000,
"line_mean": 26.0392156863,
"line_max": 76,
"alpha_frac": 0.5329949239,
"autogenerated": false,
"ratio": 3.2911694510739857,
"config_test": false,
"has_no_... |
from docopt import docopt
class AbstractCommand:
"""Base class for the commands"""
def __init__(self, command_args, global_args):
"""
Initialize the commands.
:param command_args: arguments of the command
:param global_args: arguments of the program
"""
self.a... | {
"repo_name": "rgreinho/docopt-subcommands-example",
"path": "commands.py",
"copies": "1",
"size": "1964",
"license": "mit",
"hash": -7147524082968753000,
"line_mean": 27.0571428571,
"line_max": 111,
"alpha_frac": 0.5621181263,
"autogenerated": false,
"ratio": 4.117400419287212,
"config_test": ... |
from docopt import docopt
from scipy.sparse import dok_matrix, csr_matrix
import numpy as np
from representations.matrix_serializer import save_matrix, save_vocabulary, load_count_vocabulary
def main():
args = docopt("""
Usage:
counts2pmi.py [options] <counts> <output_path>
Optio... | {
"repo_name": "ruhulsbu/WEAT4TwitterGroups",
"path": "histwords/sgns/hyperwords/hyperwords/counts2pmi.py",
"copies": "2",
"size": "2892",
"license": "mit",
"hash": 1908755107320481000,
"line_mean": 28.7659574468,
"line_max": 97,
"alpha_frac": 0.5836791148,
"autogenerated": false,
"ratio": 3.36279... |
from docopt import docopt
from scipy.stats.stats import spearmanr
from representations.representation_factory import create_representation
def main():
args = docopt("""
Usage:
ws_eval.py [options] <representation> <representation_path> <task_path>
Options:
--neg NUM Nu... | {
"repo_name": "ruhulsbu/WEAT4TwitterGroups",
"path": "histwords/sgns/hyperwords/hyperwords/ws_eval.py",
"copies": "2",
"size": "1347",
"license": "mit",
"hash": -3906777074699207700,
"line_mean": 30.0714285714,
"line_max": 114,
"alpha_frac": 0.6154417223,
"autogenerated": false,
"ratio": 3.915697... |
from docopt import docopt
# noinspection PyListCreation
def main():
args = docopt("""
Usage:
corpus2sgns.sh [options] <corpus> <output_dir>
Options:
--thr NUM The minimal word count for being in the vocabulary [default: 100]
--win NUM Window size [default: 2]
... | {
"repo_name": "ruhulsbu/WEAT4TwitterGroups",
"path": "histwords/sgns/hyperwords/hyperwords/corpus2sgns_params.py",
"copies": "2",
"size": "1942",
"license": "mit",
"hash": -3362160855936320500,
"line_mean": 31.4827586207,
"line_max": 88,
"alpha_frac": 0.5535530381,
"autogenerated": false,
"ratio"... |
from docopt import docopt
# noinspection PyListCreation
def main():
args = docopt("""
Usage:
corpus2svd.sh [options] <corpus> <output_dir>
Options:
--thr NUM The minimal word count for being in the vocabulary [default: 100]
--win NUM Window size [default: 2]
... | {
"repo_name": "williamleif/histwords",
"path": "sgns/hyperwords/hyperwords/corpus2svd_params.py",
"copies": "2",
"size": "1994",
"license": "apache-2.0",
"hash": -2456311223176041500,
"line_mean": 30.6885245902,
"line_max": 88,
"alpha_frac": 0.5471414243,
"autogenerated": false,
"ratio": 3.727102... |
from docpie.element import Atom, Option, Command, Argument
from docpie.element import Optional, Required, OptionsShortcut
from docpie.element import Either
from docpie.tokens import Token
from docpie.error import DocpieError
import logging
import re
import textwrap
import warnings
logger = logging.getLogge... | {
"repo_name": "TylerTemp/docpie",
"path": "docpie/parser.py",
"copies": "1",
"size": "34499",
"license": "mit",
"hash": -4819384753907074000,
"line_mean": 34.7793176972,
"line_max": 79,
"alpha_frac": 0.4679845793,
"autogenerated": false,
"ratio": 4.203094541910332,
"config_test": false,
"has_... |
from docqa.data_processing.document_splitter import TopTfIdf, MergeParagraphs
from docqa.data_processing.text_utils import NltkPlusStopWords
from docqa.triviaqa.build_span_corpus import TriviaQaWebDataset
from docqa.utils import flatten_iterable
def main():
data = TriviaQaWebDataset()
stop = NltkPlusStopWord... | {
"repo_name": "allenai/document-qa",
"path": "docqa/data_analysis/find_noisy_paragraph.py",
"copies": "1",
"size": "1189",
"license": "apache-2.0",
"hash": -8087652376041809000,
"line_mean": 35.0606060606,
"line_max": 105,
"alpha_frac": 0.5475189235,
"autogenerated": false,
"ratio": 3.72727272727... |
from docqa import model_dir
from docqa import trainer
from docqa.data_processing.qa_training_data import ContextLenBucketedKey, ContextLenKey
from docqa.dataset import ClusteredBatcher
from docqa.doc_qa_models import Attention
from docqa.encoder import DocumentAndQuestionEncoder, SingleSpanAnswerEncoder
from docqa.eval... | {
"repo_name": "allenai/document-qa",
"path": "docqa/scripts/train_bidaf.py",
"copies": "1",
"size": "3769",
"license": "apache-2.0",
"hash": 6424232827809783000,
"line_mean": 43.3529411765,
"line_max": 122,
"alpha_frac": 0.6972671796,
"autogenerated": false,
"ratio": 3.7059980334316616,
"config... |
from docset.actions import cached_html, update_toc
from docset.scrape import scrape
import index_rules
import logging
import os
from rust_doc import guide_title
import toc_rules
from types import to_dash_type
log = logging.getLogger('docset.rust')
# Creates a full qualified name based on prefix and name
def make_fqn... | {
"repo_name": "vhbit/rust-docset",
"path": "docset/rust/actions.py",
"copies": "1",
"size": "2445",
"license": "mit",
"hash": -3963530061973104600,
"line_mean": 27.1034482759,
"line_max": 78,
"alpha_frac": 0.6220858896,
"autogenerated": false,
"ratio": 3.2044560943643514,
"config_test": false,
... |
from docset.index import Index
from docset import rules
import os
import shutil
def build_docset(info, ds_rules, src_dir, out_dir):
root_dir = os.path.join(out_dir, info['name'] + '.docset')
content_dir = os.path.join(root_dir, 'Contents')
resources_dir = os.path.join(content_dir, 'Resources')
doc_dir... | {
"repo_name": "vhbit/rust-docset",
"path": "builder.py",
"copies": "1",
"size": "1230",
"license": "mit",
"hash": -32142809591768190,
"line_mean": 29.75,
"line_max": 67,
"alpha_frac": 0.5837398374,
"autogenerated": false,
"ratio": 3.253968253968254,
"config_test": false,
"has_no_keywords": fa... |
from .docs import doc_scatter, doc_params
from .utils import *
from inspect import signature
import matplotlib.pyplot as pl
import numpy as np
import pandas as pd
@doc_params(scatter=doc_scatter)
def scatter(
adata=None,
basis=None,
x=None,
y=None,
vkey=None,
color=None,
use_raw=None,
... | {
"repo_name": "theislab/scvelo",
"path": "scvelo/plotting/scatter.py",
"copies": "1",
"size": "33575",
"license": "bsd-3-clause",
"hash": 5399321161651128000,
"line_mean": 38.5931603774,
"line_max": 88,
"alpha_frac": 0.4792851824,
"autogenerated": false,
"ratio": 4.018551765409934,
"config_test... |
from docs_manager.models import Docs
from docs_manager.sphinx_helper import SphinxHelper
from experiments_manager.models import ChosenExperimentSteps
from git_manager.helpers.github_helper import GitHubHelper
from quality_manager.measurements.measurement import MeasurementAbstraction
from quality_manager.models import ... | {
"repo_name": "MOOCworkbench/MOOCworkbench",
"path": "quality_manager/measurements/docs_measurement.py",
"copies": "1",
"size": "2422",
"license": "mit",
"hash": 539108086661487400,
"line_mean": 39.3666666667,
"line_max": 94,
"alpha_frac": 0.6494632535,
"autogenerated": false,
"ratio": 4.27915194... |
from docstore import connect
from json import load, loads, dumps
from os import access, chmod, listdir, makedirs, stat, X_OK
from os.path import abspath, basename, dirname, exists, \
isfile, isdir, join as pathjoin
from platform import node
from shutil import copy, copytree
from stat import S_IEXEC
... | {
"repo_name": "douglassquirrel/alexandra",
"path": "infralib/installer.py",
"copies": "1",
"size": "3828",
"license": "mit",
"hash": -7573508275073210000,
"line_mean": 37.28,
"line_max": 76,
"alpha_frac": 0.6530825496,
"autogenerated": false,
"ratio": 3.203347280334728,
"config_test": false,
... |
from docstring_parser.common import DocstringStyle
from docstring_parser.parser import parse
def test_rest() -> None:
docstring = parse(
"""
Short description
Long description
Causing people to indent:
A lot sometimes
:param spam: spam desc
:param in... | {
"repo_name": "rr-/docstring_parser",
"path": "docstring_parser/tests/test_parser.py",
"copies": "1",
"size": "4974",
"license": "mit",
"hash": 6693868171953307000,
"line_mean": 28.4319526627,
"line_max": 61,
"alpha_frac": 0.6105749899,
"autogenerated": false,
"ratio": 4.23679727427598,
"config... |
from .._docstrings import DocstringComponents
EXAMPLE_DICT = dict(
param_a="""
a : str
The first parameter.
""",
)
class ExampleClass:
def example_method(self):
"""An example method.
Parameters
----------
a : str
A method parameter.
"""
def exam... | {
"repo_name": "anntzer/seaborn",
"path": "seaborn/tests/test_docstrings.py",
"copies": "3",
"size": "1243",
"license": "bsd-3-clause",
"hash": -2722018733018956000,
"line_mean": 20.4310344828,
"line_max": 79,
"alpha_frac": 0.5977473854,
"autogenerated": false,
"ratio": 4.022653721682848,
"confi... |
from docstructure import SITE_STRUCTURE, HREF_MAP, BASENAME_MAP
from lxml.etree import (parse, fromstring, ElementTree,
Element, SubElement, XPath)
import os, shutil, re, sys, copy, time
RST2HTML_OPTIONS = " ".join([
'--no-toc-backlinks',
'--strip-comments',
'--language en',
'--... | {
"repo_name": "nvoron23/hue",
"path": "desktop/core/ext-py/lxml/doc/mkhtml.py",
"copies": "29",
"size": "5344",
"license": "apache-2.0",
"hash": 3843860410820210700,
"line_mean": 37.1714285714,
"line_max": 79,
"alpha_frac": 0.591504491,
"autogenerated": false,
"ratio": 3.4544279250161605,
"conf... |
from docstructure import SITE_STRUCTURE, HREF_MAP, BASENAME_MAP
from lxml.etree import (parse, fromstring, ElementTree,
Element, SubElement, XPath, XML)
import os
import re
import sys
import copy
import shutil
import subprocess
try:
from io import open as open_file
except ImportError:
f... | {
"repo_name": "cloudera/hue",
"path": "desktop/core/ext-py/lxml-3.3.6/doc/mkhtml.py",
"copies": "17",
"size": "10373",
"license": "apache-2.0",
"hash": -2743575677430203400,
"line_mean": 40.1626984127,
"line_max": 164,
"alpha_frac": 0.6009833221,
"autogenerated": false,
"ratio": 3.451913477537438... |
from docstructure import SITE_STRUCTURE, HREF_MAP, BASENAME_MAP
from lxml.etree import (parse, fromstring, tostring, ElementTree,
Element, SubElement, XPath, XML)
import os, shutil, re, sys, copy, time, subprocess
RST2HTML_OPTIONS = " ".join([
'--no-toc-backlinks',
'--strip-comments',
... | {
"repo_name": "wilsonssun/baseball-gamethread",
"path": "build/lxml/doc/mkhtml.py",
"copies": "1",
"size": "9284",
"license": "bsd-3-clause",
"hash": -4688125779666614000,
"line_mean": 41.2,
"line_max": 164,
"alpha_frac": 0.5951098664,
"autogenerated": false,
"ratio": 3.4680612626073963,
"confi... |
from doct import Document
import time as ttime
import uuid
from analysisstore.client.conf import top_dir
from analysisstore.client.asutils import doc_or_uid_to_uid, read_from_json, write_to_json
from os.path import expanduser
import mongoquery
import json
class LocalAnalysisClient:
def __init__(self, top_dir=to... | {
"repo_name": "NSLS-II/analysisstore",
"path": "analysisstore/client/local_commands.py",
"copies": "1",
"size": "4829",
"license": "bsd-3-clause",
"hash": 2996414706824160000,
"line_mean": 33.7410071942,
"line_max": 89,
"alpha_frac": 0.5754814661,
"autogenerated": false,
"ratio": 3.78745098039215... |
from documentadmin import SchemaAdmin
from django import forms
from django.contrib.admin.util import flatten_fieldsets
from django.utils.functional import curry
from dockit.forms.formsets import BaseInlineFormSet, inlinedocumentformset_factory
class InlineSchemaAdmin(SchemaAdmin):
schema = None
formset = Bas... | {
"repo_name": "zbyte64/django-dockit",
"path": "dockit/admin/inlines.py",
"copies": "1",
"size": "4198",
"license": "bsd-3-clause",
"hash": 4004348702332325000,
"line_mean": 38.6037735849,
"line_max": 112,
"alpha_frac": 0.6107670319,
"autogenerated": false,
"ratio": 3.964117091595845,
"config_t... |
from document import Document, get_new_urls
from .base_scraper import BaseScraper
import logging
import scrapelib
from .massgov import url_scraper_dict
from .massgov import results_page_scraper
log = logging.getLogger(__name__)
URL_PREFIX = 'http://www.mass.gov/eopss/funding-and-training/'
class MassGovEOPSSScrap... | {
"repo_name": "RagtagOpen/bidwire",
"path": "bidwire/scrapers/massgov_eopss_scraper.py",
"copies": "1",
"size": "1999",
"license": "mit",
"hash": 7725123169247249000,
"line_mean": 33.4655172414,
"line_max": 79,
"alpha_frac": 0.5867933967,
"autogenerated": false,
"ratio": 3.800380228136882,
"con... |
from .document import Document
from collections import defaultdict
from .ndcg import ndcg
import numpy as np
class Simulator(object):
'''
A simulator based on a learning to rank dataset.
Args:
dataset_filepaths:
paths to the file including relevance grade and
features in th... | {
"repo_name": "mpkato/interleaving",
"path": "interleaving/simulation/simulator.py",
"copies": "1",
"size": "4170",
"license": "mit",
"hash": 4049648078513788400,
"line_mean": 36.2321428571,
"line_max": 111,
"alpha_frac": 0.5213429257,
"autogenerated": false,
"ratio": 3.8256880733944953,
"confi... |
from ..document import Document
from ..event import Event
from ..selection import Interval
from bisect import bisect_left
from logging import debug
def init_conceal(doc):
doc.view.conceal = Conceal(doc)
doc.OnGenerateGlobalConceal = Event('OnGenerateGlobalConceal')
doc.OnGenerateLocalConceal = Event('On... | {
"repo_name": "Chiel92/fate",
"path": "fate/view/conceal.py",
"copies": "1",
"size": "5712",
"license": "mit",
"hash": -294487943716124000,
"line_mean": 36.8278145695,
"line_max": 93,
"alpha_frac": 0.5980392157,
"autogenerated": false,
"ratio": 3.7653263019116676,
"config_test": false,
"has_n... |
from ..document import Document
from ..event import Event
from logging import debug
# Dependencies
from .. import filetype
def init_view(doc):
doc.OnRefreshView = Event('OnRefreshView')
doc.view = View(doc)
# Refresh at least once to ensure a valid state
# Other refreshes must be done by the userin... | {
"repo_name": "Chiel92/fate",
"path": "fate/view/__init__.py",
"copies": "1",
"size": "1410",
"license": "mit",
"hash": -1445691985535355600,
"line_mean": 25.6037735849,
"line_max": 81,
"alpha_frac": 0.6695035461,
"autogenerated": false,
"ratio": 3.9275766016713094,
"config_test": false,
"has... |
from .document import Document
from .index import Index
class Design(Document):
"""
Connection to a design document, which stores custom indexes and other database functions.
Learn more about design documents from the [Cloudant docs](http://docs.cloudant.com/api/design.html)
"""
def index(self, ... | {
"repo_name": "ibmjstart/bluemix-python-sample-twitter-influence-app",
"path": "app/cloudant-python/cloudant/design.py",
"copies": "1",
"size": "2775",
"license": "apache-2.0",
"hash": 7040949765104376000,
"line_mean": 39.8088235294,
"line_max": 141,
"alpha_frac": 0.6209009009,
"autogenerated": fal... |
from .document import Document
from .node import Node
from io import StringIO
import html
void_elements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]
raw_text_elements = ["script", "style"]
escapable_raw_text_elements = ["textarea", "title"]... | {
"repo_name": "minacle/yarh",
"path": "yarh/element.py",
"copies": "1",
"size": "2293",
"license": "bsd-2-clause",
"hash": 1479392062985336300,
"line_mean": 33.7424242424,
"line_max": 137,
"alpha_frac": 0.5708678587,
"autogenerated": false,
"ratio": 4.051236749116608,
"config_test": false,
"h... |
from Document import Document
from SuperDocument import SuperDocument
class SuperDocGenerator():
'''
Daniel Klein
Computer-Based Honors Program
The University of Alabama
9.26.2013
Given a list of Document objects, this class will combine the text of the
documents into one text and the ... | {
"repo_name": "dmarklein/WordCloud",
"path": "old/SuperDocGenerator.py",
"copies": "1",
"size": "2094",
"license": "apache-2.0",
"hash": 4022102103857645600,
"line_mean": 31.2307692308,
"line_max": 83,
"alpha_frac": 0.5893027698,
"autogenerated": false,
"ratio": 4.3354037267080745,
"config_test... |
from .document import ENC
from .document import Reader
from .document import by_mention
from .evaluate import get_measure, Evaluate
from collections import Counter
from collections import namedtuple
class _Missing(object):
def __str__(self):
return "MISSING"
MISSING = _Missing()
class LinkingError(name... | {
"repo_name": "jamesxia4/neleval",
"path": "neleval/analyze.py",
"copies": "2",
"size": "3663",
"license": "apache-2.0",
"hash": 7574561244439364000,
"line_mean": 32.9166666667,
"line_max": 91,
"alpha_frac": 0.5432705433,
"autogenerated": false,
"ratio": 3.839622641509434,
"config_test": false,... |
from document import *
class Collection(object):
"""
A Collection exposes the interface of ccollection.
Collections are the components of a store
and they are composed by documents.
A collection allows to perform CRUD operations
over the documents it owns
"""
def __init__(self, cstor_f... | {
"repo_name": "ethronsoft/stor",
"path": "bindings/python/ethronsoft/pystor/collection.py",
"copies": "1",
"size": "8913",
"license": "bsd-2-clause",
"hash": -1096854965189205000,
"line_mean": 32.3820224719,
"line_max": 122,
"alpha_frac": 0.4865926175,
"autogenerated": false,
"ratio": 4.184507042... |
from .document import PDFDocument
class PDFStreamer:
def __init__(self, block_generator, letterhead=None, layout='portrait'):
self.generator = block_generator
self.pdf = PDFDocument(block_generator.css, letterhead, layout)
def __iter__(self):
yield from self.pdf.header()
page... | {
"repo_name": "systori/bericht",
"path": "bericht/pdf/stream.py",
"copies": "1",
"size": "1707",
"license": "bsd-3-clause",
"hash": 4374234631383470600,
"line_mean": 40.6341463415,
"line_max": 105,
"alpha_frac": 0.4979496192,
"autogenerated": false,
"ratio": 4.7154696132596685,
"config_test": f... |
from documents.constants import *
from documents.exporters import BaseExporter
class SQLExporter(BaseExporter):
"""
A base class of all sql exporters.
"""
TYPE_MAPPING = {
TYPES_INTEGER: "int",
TYPES_BOOLEAN: "bool",
TYPES_TEXT: "longtext",
TYPES_TIME: "time",
T... | {
"repo_name": "fatiherikli/dbpatterns",
"path": "web/dbpatterns/documents/exporters/sql.py",
"copies": "1",
"size": "3353",
"license": "mit",
"hash": -623677308370925600,
"line_mean": 31.2403846154,
"line_max": 79,
"alpha_frac": 0.5651655234,
"autogenerated": false,
"ratio": 4.07411907654921,
"... |
from .documents import Document
from .exceptions import CollectionNotBound
class Collection(object):
"""A collection is a container for a list of documents.
In JSON terms this would be the structural datatype ``Array``. It provides
methods to manipulate the collection. The collection itself is stored as ... | {
"repo_name": "30loops/python-docar",
"path": "docar/collections.py",
"copies": "1",
"size": "2875",
"license": "bsd-3-clause",
"hash": -7679270071563117000,
"line_mean": 29.585106383,
"line_max": 79,
"alpha_frac": 0.6010434783,
"autogenerated": false,
"ratio": 4.705400981996727,
"config_test":... |
from ..documents import numbering_level
def read_numbering_xml_element(element):
abstract_nums = _read_abstract_nums(element)
nums = _read_nums(element, abstract_nums)
return Numbering(nums)
def _read_abstract_nums(element):
abstract_num_elements = element.find_children("w:abstractNum")
return d... | {
"repo_name": "JoshBarr/python-mammoth",
"path": "mammoth/docx/numbering_xml.py",
"copies": "1",
"size": "1696",
"license": "bsd-2-clause",
"hash": 992477194114374000,
"line_mean": 27.7457627119,
"line_max": 87,
"alpha_frac": 0.664504717,
"autogenerated": false,
"ratio": 3.371769383697813,
"con... |
from documents.models import Document, DocumentVerifier
from .base import BaseUnitTest
class HomePageViewUnitTest(BaseUnitTest):
def test_home_page_render_home_template(self):
response = self.client.get('/filters/home/')
self.assertTemplateUsed(response, 'filters/home.html')
def test_home_pa... | {
"repo_name": "sychsergiy/DocFlow",
"path": "doc_flow/apps/filters/tests/test_views.py",
"copies": "1",
"size": "2640",
"license": "bsd-3-clause",
"hash": 1854819549059124700,
"line_mean": 42.2786885246,
"line_max": 116,
"alpha_frac": 0.6856060606,
"autogenerated": false,
"ratio": 4.1706161137440... |
from docutils.core import publish_doctree
from docutils import nodes
import sys
def create_node(text):
"""
Converts a reStructuredText String into a docutils.node
This node can be included in the document.
"""
return publish_doctree(text).children
def trim(docstring):
"""
Removes spaces ... | {
"repo_name": "lovelysystems/lovely.pyrest",
"path": "lovely/pyrest/sphinx/helpers.py",
"copies": "1",
"size": "1407",
"license": "apache-2.0",
"hash": -7609721170770337000,
"line_mean": 28.3125,
"line_max": 64,
"alpha_frac": 0.6439232409,
"autogenerated": false,
"ratio": 4.150442477876106,
"co... |
from docutils.core import Publisher
from docutils.parsers.rst.roles import code_role
# Monkey patch docutils to give short css names
# credit: http://stackoverflow.com/a/21766874/832573
def process_programmatic_settings(self, settings_spec,
settings_overrides,
... | {
"repo_name": "has2k1/mizani",
"path": "doc/sphinxext/inline_code_highlight.py",
"copies": "2",
"size": "1101",
"license": "bsd-3-clause",
"hash": -4307588910213610500,
"line_mean": 34.5161290323,
"line_max": 71,
"alpha_frac": 0.6248864668,
"autogenerated": false,
"ratio": 4.317647058823529,
"c... |
from docutils.core import publish_parts
from docutils.io import StringOutput
from sphinx.builders import BUILTIN_BUILDERS
from sphinx.builders.html import SingleFileHTMLBuilder
from sphinx.writers.html import HTMLWriter
from sphinx.util.osutil import relative_uri
class SingleStringHTMLBuilder(SingleFileHTMLBuild... | {
"repo_name": "strogo/djpcms",
"path": "djpcms/contrib/flowrepo/markups/rst/builders.py",
"copies": "1",
"size": "1246",
"license": "bsd-3-clause",
"hash": -4731608766292497000,
"line_mean": 31.8157894737,
"line_max": 78,
"alpha_frac": 0.6741573034,
"autogenerated": false,
"ratio": 3.89375,
"co... |
from docutils.core import publish_parts
from . import base
#==============================================================================#
class ReStructuredTextArticleCompiler(base.ArticleCompiler):
# Subclasses may use DOCUTILS_SETTINGS to customize Docutils' behavior.
DOCUTILS_SETTINGS = {}
# Op... | {
"repo_name": "colossalbit/goblog",
"path": "goblog/core/articlecompilers/restructuredtext.py",
"copies": "1",
"size": "1779",
"license": "bsd-3-clause",
"hash": 8996503135941176000,
"line_mean": 36.0625,
"line_max": 80,
"alpha_frac": 0.5576166386,
"autogenerated": false,
"ratio": 4.2559808612440... |
from docutils.core import publish_parts
from docutils import nodes
from docutils.parsers.rst import directives
import re
import threading
g_data = threading.local()
g_data.g_style = {}
class highlight_block(nodes.General, nodes.Text):pass
from docutils.writers.html4css1 import Writer, HTMLTranslator
cl... | {
"repo_name": "wwfifi/uliweb",
"path": "uliweb/utils/rst.py",
"copies": "2",
"size": "2633",
"license": "bsd-2-clause",
"hash": -9146493728991554000,
"line_mean": 29.7469879518,
"line_max": 128,
"alpha_frac": 0.6152677554,
"autogenerated": false,
"ratio": 3.646814404432133,
"config_test": false... |
from docutils.core import publish_string
from sys import argv
from webbrowser import open as browser_open
TEMPLATE_CONTENTS = """
<!DOCTYPE html>
<html lang="en">
<head>
<title>{filename}</title>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">
... | {
"repo_name": "LuRsT/rst2bootstrap",
"path": "rst2bootstrap.py",
"copies": "1",
"size": "1158",
"license": "mit",
"hash": -794534802405963300,
"line_mean": 24.1739130435,
"line_max": 107,
"alpha_frac": 0.6183074266,
"autogenerated": false,
"ratio": 3.6878980891719744,
"config_test": false,
"h... |
from docutils.core import publish_string, publish_parts
import io
import logging
import json
import jsonschema
class RSTBuilder(object):
"""A simple builder for reStructuredText help.
Does not support all of RST by a long shot. However, it provides sufficient functionality to be useful for
generating hel... | {
"repo_name": "JeffHeard/sondra",
"path": "sondra/help.py",
"copies": "1",
"size": "16692",
"license": "apache-2.0",
"hash": 7706919633798883000,
"line_mean": 31.7294117647,
"line_max": 110,
"alpha_frac": 0.5317517374,
"autogenerated": false,
"ratio": 4.18660647103085,
"config_test": false,
"... |
from docutils import core, io
def html_parts(input_string, source_path=None, destination_path=None,
input_encoding='unicode', doctitle=True,
initial_header_level=1):
"""
Given an input string, returns a dictionary of HTML document parts.
Dictionary keys are the names of part... | {
"repo_name": "codefisher/djangopress",
"path": "djangopress/core/format/restructed_text.py",
"copies": "1",
"size": "2515",
"license": "mit",
"hash": -8794696444591674000,
"line_mean": 40.9333333333,
"line_max": 77,
"alpha_frac": 0.6715705765,
"autogenerated": false,
"ratio": 4.2127303182579565,... |
from docutils import core, io
def parse_tag_names(tag_string, delimiter=','):
"""
:param tag_string:
:param delimiter:
:return list of tag strings:
"""
if not tag_string:
return []
tags = tag_string.split(delimiter)
return [tag.strip() for tag in tags]
def make_tag_string(... | {
"repo_name": "logston/plog-work",
"path": "blog/utils.py",
"copies": "1",
"size": "2868",
"license": "bsd-3-clause",
"hash": 6959346912189635000,
"line_mean": 34.8625,
"line_max": 77,
"alpha_frac": 0.6628312413,
"autogenerated": false,
"ratio": 4.103004291845494,
"config_test": false,
"has_n... |
from docutils import frontend, writers
from .translator import Translator
class Writer(writers.Writer):
supported = ('markdown',)
"""Formats this writer supports."""
output = None
"""Final translated form of `document`."""
# Add configuration settings for additional Markdown flavours here.
... | {
"repo_name": "sixty-north/rst_to_md",
"path": "rst_to_md/writer.py",
"copies": "1",
"size": "1066",
"license": "mit",
"hash": -6215041765119049000,
"line_mean": 29.4571428571,
"line_max": 71,
"alpha_frac": 0.6125703565,
"autogenerated": false,
"ratio": 4.555555555555555,
"config_test": false,
... |
from docutils import nodes, languages
class Context:
def __init__(self):
self.head = []
self.body = []
self.foot = []
def put_head(self, text):
self.head.append(text)
def put_body(self, text):
self.body.append(text)
def put_foot(self, text):
self.foot... | {
"repo_name": "sixty-north/rst_to_md",
"path": "rst_to_md/translator.py",
"copies": "1",
"size": "12005",
"license": "mit",
"hash": -5002355478183468000,
"line_mean": 31.0133333333,
"line_max": 109,
"alpha_frac": 0.5685964182,
"autogenerated": false,
"ratio": 3.8416,
"config_test": false,
"ha... |
from docutils import nodes
from docutils.core import publish_string
from docutils.readers.standalone import Reader
from docutils.transforms.misc import Transitions
from docutils.writers.docutils_xml import Writer
from lxml import etree
class HovercraftTransitions(Transitions):
@property
def _doc_transitions(... | {
"repo_name": "PHSTARS/hovercraft",
"path": "hovercraft/parse.py",
"copies": "3",
"size": "7034",
"license": "mit",
"hash": -8414155422370175000,
"line_mean": 33.145631068,
"line_max": 84,
"alpha_frac": 0.5712254763,
"autogenerated": false,
"ratio": 4.239903556359253,
"config_test": false,
"h... |
from docutils import nodes
from docutils import statemachine
from docutils.parsers.rst import Directive
class AttrDict(dict):
def __init__(self, *args, **kwargs):
super(AttrDict, self).__init__(*args, **kwargs)
self.__dict__ = self
def split_content(l):
parts = []
part = []
label = N... | {
"repo_name": "mdboom/understanding-json-schema",
"path": "source/sphinxext/tab.py",
"copies": "1",
"size": "5428",
"license": "bsd-3-clause",
"hash": -7312280870675824000,
"line_mean": 23.3408071749,
"line_max": 77,
"alpha_frac": 0.5838246131,
"autogenerated": false,
"ratio": 3.6114437791084497,... |
from docutils import nodes
from docutils import statemachine
from sphinx.util.compat import Directive
class AttrDict(dict):
def __init__(self, *args, **kwargs):
super(AttrDict, self).__init__(*args, **kwargs)
self.__dict__ = self
def split_content(l):
parts = []
part = []
language = ... | {
"repo_name": "agreco/understanding-json-schema",
"path": "source/sphinxext/language_specific.py",
"copies": "7",
"size": "4936",
"license": "bsd-3-clause",
"hash": 8993001779989063000,
"line_mean": 24.0558375635,
"line_max": 77,
"alpha_frac": 0.5921799028,
"autogenerated": false,
"ratio": 3.6267... |
from docutils import nodes
from docutils.nodes import figure, caption, Text, reference, raw, SkipNode, Element, topic
from sphinx.roles import XRefRole
from docutils.parsers.rst import Directive
from docutils.parsers.rst import directives
import json
class odsatable(Element): pass
def loadTable():
try:
tabl... | {
"repo_name": "hosamshahin/OpenDSA",
"path": "RST/ODSAextensions/odsa/odsatable/odsatable.py",
"copies": "4",
"size": "3425",
"license": "mit",
"hash": -4690047580694544000,
"line_mean": 32.9108910891,
"line_max": 90,
"alpha_frac": 0.5982481752,
"autogenerated": false,
"ratio": 3.8920454545454546... |
from docutils import nodes
from docutils.parsers.rst import Directive, directives
from sphinx import addnodes
from sphinx.domains.std import GenericObject
from sphinx.errors import SphinxError
from utils import build_table_from_list
def read_cabal_file(pkg_path):
import re
cabal_file = open(pkg_path, 'r').read... | {
"repo_name": "ezyang/ghc",
"path": "docs/users_guide/ghc_packages.py",
"copies": "1",
"size": "2220",
"license": "bsd-3-clause",
"hash": -3740259591889199000,
"line_mean": 33.6875,
"line_max": 81,
"alpha_frac": 0.5972972973,
"autogenerated": false,
"ratio": 3.7755102040816326,
"config_test": f... |
from docutils import nodes
from docutils.parsers.rst import Directive, directives
from sphinx.util.nodes import set_source_info
# node that will be replaced by an index of howto topics
# along with brief examples
class howtoindex(nodes.General, nodes.Element): pass
# The howtoindex directive takes no arguments, optio... | {
"repo_name": "jamesward/xsbt",
"path": "src/sphinx/_sphinx/exts/howto.py",
"copies": "3",
"size": "9544",
"license": "bsd-3-clause",
"hash": -8447364123985354000,
"line_mean": 38.7666666667,
"line_max": 103,
"alpha_frac": 0.650146689,
"autogenerated": false,
"ratio": 3.897100857492854,
"config... |
from docutils import nodes
from docutils.parsers.rst import Directive, directives
import os.path as osp
import sys,traceback
from StringIO import StringIO
import codecs
NAMESPACE = {}
def eval_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
"""
:param name: The role name used in the documen... | {
"repo_name": "SFPD/rlreloaded",
"path": "control4/misc/control_sphinx_ext.py",
"copies": "1",
"size": "7067",
"license": "mit",
"hash": 1168188453029546800,
"line_mean": 37.6174863388,
"line_max": 178,
"alpha_frac": 0.5851139097,
"autogenerated": false,
"ratio": 4.275257108287962,
"config_test... |
from docutils import nodes
from docutils.parsers.rst import Directive
from docutils.parsers.rst.directives.admonitions import BaseAdmonition
from sphinx.util.compat import make_admonition
from sphinx.locale import _
def setup(app):
app.add_stylesheet('tutorial.css')
app.add_javascript('jquery.fitvids.js')
... | {
"repo_name": "ChickTech/mobile-app-tutorial",
"path": "tutorial.py",
"copies": "1",
"size": "2782",
"license": "mit",
"hash": 2112639592472599600,
"line_mean": 27.387755102,
"line_max": 96,
"alpha_frac": 0.6808051761,
"autogenerated": false,
"ratio": 3.589677419354839,
"config_test": false,
... |
from docutils import nodes
from docutils.parsers.rst import Directive
from docutils.statemachine import StringList
from mne.defaults import DEFAULTS
from mne.io.pick import (_PICK_TYPES_DATA_DICT, _DATA_CH_TYPES_SPLIT,
_DATA_CH_TYPES_ORDER_DEFAULT)
class MNESubstitution(Directive): # noqa: ... | {
"repo_name": "drammock/mne-python",
"path": "doc/sphinxext/mne_substitutions.py",
"copies": "14",
"size": "1804",
"license": "bsd-3-clause",
"hash": -8834594530457558000,
"line_mean": 36.5833333333,
"line_max": 75,
"alpha_frac": 0.5509977827,
"autogenerated": false,
"ratio": 3.7899159663865545,
... |
from docutils import nodes
from docutils.parsers.rst import Directive
from sphinx.builders import Builder
from sphinx.directives import CodeBlock
from sphinx.errors import SphinxError
import os, os.path, fnmatch, subprocess
import codecs
import urllib
import re
try:
urlquote = urllib.parse.quote
except:
# Pyth... | {
"repo_name": "avigad/logic_and_proof",
"path": "lean_sphinx.py",
"copies": "2",
"size": "3646",
"license": "apache-2.0",
"hash": 8975538048126303000,
"line_mean": 31.5535714286,
"line_max": 102,
"alpha_frac": 0.6228743829,
"autogenerated": false,
"ratio": 3.4266917293233083,
"config_test": fal... |
from docutils import nodes
from docutils.parsers.rst import Directive
from sphinx.locale import _
def setup(app):
app.add_node(highlights,
html=(visit_highlights_node, depart_highlights_node),
latex=(visit_highlights_node, depart_highlights_node),
text=(visit_high... | {
"repo_name": "indigits/sparse-plex",
"path": "docs/extensions/admonitions.py",
"copies": "1",
"size": "2234",
"license": "apache-2.0",
"hash": -3491916454234010000,
"line_mean": 30.4647887324,
"line_max": 83,
"alpha_frac": 0.6683079678,
"autogenerated": false,
"ratio": 3.8319039451114922,
"con... |
from docutils import nodes
from docutils.parsers.rst import Directive
from sphinx.util.compat import make_admonition
from sphinx.locale import _
def setup(app):
app.add_node(
yippie_node,
html=(visit_yippie_node, depart_yippie_node),
latext=(visit_yippie_node, depart_yippie_node),
... | {
"repo_name": "Ritsyy/fjord",
"path": "docs/exts/yippie.py",
"copies": "3",
"size": "1138",
"license": "bsd-3-clause",
"hash": -1401951498035573200,
"line_mean": 27.45,
"line_max": 81,
"alpha_frac": 0.6485061511,
"autogenerated": false,
"ratio": 3.327485380116959,
"config_test": false,
"has_n... |
from docutils import nodes
from docutils.parsers.rst import Directive
class html_hidden(nodes.Element):
pass
def visit_html_hidden_latex(self, node):
self.body.append(node["before-not-html"])
def depart_html_hidden_latex(self, node):
pass
def visit_html_hidden_html(self, node):
self.body.append(... | {
"repo_name": "Luthaf/Chemharp-python",
"path": "doc/htmlhidden.py",
"copies": "2",
"size": "1252",
"license": "mpl-2.0",
"hash": 1020740674321543800,
"line_mean": 24.04,
"line_max": 84,
"alpha_frac": 0.6469648562,
"autogenerated": false,
"ratio": 3.477777777777778,
"config_test": false,
"has... |
from docutils import nodes
from docutils.parsers.rst import Directive
class html_hidden(nodes.Element):
pass
def visit_html_hidden_latex(self, node):
self.body.append(node['before-not-html'])
def depart_html_hidden_latex(self, node):
pass
def visit_html_hidden_html(self, node):
self.body.append(... | {
"repo_name": "chemfiles/chemfiles",
"path": "doc/ext/htmlhidden.py",
"copies": "2",
"size": "1316",
"license": "bsd-3-clause",
"hash": 3365011210763879400,
"line_mean": 24.3076923077,
"line_max": 73,
"alpha_frac": 0.6155015198,
"autogenerated": false,
"ratio": 3.62534435261708,
"config_test": ... |
from docutils import nodes
from docutils.parsers.rst import directives
from docutils.parsers.rst.directives.admonitions import BaseAdmonition
import os
import re
import codecs
import yaml
from collections import OrderedDict
import sphinx
from sphinx.ext.graphviz import render_dot_html, render_dot_latex, \
render_d... | {
"repo_name": "myyasuda/sphinx_erdiagram",
"path": "myasuda/sphinx/erdiagram.py",
"copies": "1",
"size": "9954",
"license": "mit",
"hash": 7687595385952222000,
"line_mean": 28.7872340426,
"line_max": 105,
"alpha_frac": 0.5463265306,
"autogenerated": false,
"ratio": 3.482587064676617,
"config_te... |
from docutils import nodes
from docutils.parsers.rst import directives
from sphinx import addnodes
from sphinx.directives import ObjectDescription, Directive
from sphinx.roles import XRefRole
from sphinx.domains import Domain, ObjType
from sphinx.domains.python import _pseudo_parse_arglist
from sphinx.locale import l_,... | {
"repo_name": "Lemma1/MAC-POSTS",
"path": "doc_builder/sphinx-contrib/coffeedomain/sphinxcontrib/coffeedomain/domain.py",
"copies": "3",
"size": "6181",
"license": "mit",
"hash": 5408096786828007000,
"line_mean": 33.3388888889,
"line_max": 89,
"alpha_frac": 0.5725610743,
"autogenerated": false,
"... |
from docutils import nodes
from docutils.parsers.rst import directives
CODE = """\
<object width="%(width)i" height="%(height)i">
<param name="flashvars" value="offsite=true&lang=en-us&page_show_url=%2Fphotos%2F75341362%40N04%2Fsets%2F72157629059614751%2Fshow%2F&page_show_back_url=%2Fphotos%2F75341362%40N04%2Fsets%2... | {
"repo_name": "vlas-sokolov/pyspeckit",
"path": "docs/sphinxext/flickr.py",
"copies": "11",
"size": "2354",
"license": "mit",
"hash": -2395193031311671300,
"line_mean": 44.2692307692,
"line_max": 403,
"alpha_frac": 0.6784197111,
"autogenerated": false,
"ratio": 2.8954489544895448,
"config_test"... |
from docutils import nodes
from docutils.parsers.rst import directives
CODE = """\
<object type="application/x-shockwave-flash"
class="youtube-embed"
data="http://www.youtube.com/v/%(yid)s">
<param name="movie" value="http://www.youtube.com/v/%(yid)s"></param>
<param name="wmod... | {
"repo_name": "zCFD/zCFDguide",
"path": "docs/source/youtube.py",
"copies": "2",
"size": "1518",
"license": "bsd-3-clause",
"hash": 6202805977006689000,
"line_mean": 32,
"line_max": 77,
"alpha_frac": 0.6021080369,
"autogenerated": false,
"ratio": 3.473684210526316,
"config_test": false,
"has_... |
from docutils import nodes
from docutils.parsers.rst import directives
CODE = """\
<object type="application/x-shockwave-flash"
width="%(width)s"
height="%(height)s"
class="youtube-embed"
data="http://www.youtube.com/v/%(yid)s">
<param name="movie" value="http://www.youtube.com/v/%(... | {
"repo_name": "bx5974/sikuli",
"path": "docs/source/youtube.py",
"copies": "3",
"size": "1510",
"license": "mit",
"hash": -3784746680874884000,
"line_mean": 34.9523809524,
"line_max": 77,
"alpha_frac": 0.6,
"autogenerated": false,
"ratio": 3.4553775743707096,
"config_test": false,
"has_no_key... |
from docutils import nodes
from docutils.transforms import Transform
from docutils.readers.standalone import Reader
try:
from django.utils.module_loading import import_string
except ImportError:
# django 1.6
from django.utils.module_loading import import_by_path as import_string
from waliki.settings impor... | {
"repo_name": "beres/waliki",
"path": "waliki/directives/transforms.py",
"copies": "8",
"size": "26474",
"license": "bsd-3-clause",
"hash": 1584705768615799800,
"line_mean": 28.1243124312,
"line_max": 86,
"alpha_frac": 0.3087935333,
"autogenerated": false,
"ratio": 4.652724077328647,
"config_te... |
from docutils import nodes
from docutils.writers.html4css1 import HTMLTranslator
from sphinx.latexwriter import LaTeXTranslator
# Define LaTeX math node:
class latex_math(nodes.General, nodes.Element):
pass
def math_role(role, rawtext, text, lineno, inliner,
options={}, content=[]):
i = rawtext.... | {
"repo_name": "M-R-Houghton/euroscipy_2015",
"path": "stats/_sphinxext/mathml.py",
"copies": "1",
"size": "20129",
"license": "mit",
"hash": 5943041319676012000,
"line_mean": 35.4655797101,
"line_max": 792,
"alpha_frac": 0.5237219931,
"autogenerated": false,
"ratio": 3.2544866612772836,
"config... |
from docutils import nodes
from sphinx.domains.python import PyXRefRole
URL_DIRECTIVES = {'url'}
PY_DIRECTIVES = {'class', 'function'}
def setup(app):
"""Install the plugin.
:param app: Sphinx application context.
"""
app.add_role('map', mapping_role)
app.add_config_value('xref_mapping_dict', N... | {
"repo_name": "menpo/sphinx-map-xrefrole",
"path": "sphinxmapxrefrole/__init__.py",
"copies": "1",
"size": "2476",
"license": "bsd-3-clause",
"hash": 4030311708957681700,
"line_mean": 33.3888888889,
"line_max": 79,
"alpha_frac": 0.5989499192,
"autogenerated": false,
"ratio": 3.6845238095238093,
... |
from docutils import nodes
from sphinx.ext.viewcode import collect_pages
from sphinx.pycode import ModuleAnalyzer
import imp
from sphinx import addnodes
import re
from sphinx.util.compat import Directive
import os
from docutils.statemachine import StringList
from sphinx.environment import NoUri
import sys
py2k = sys.... | {
"repo_name": "Cito/sqlalchemy",
"path": "doc/build/builder/viewsource.py",
"copies": "2",
"size": "6032",
"license": "mit",
"hash": 503734904049308540,
"line_mean": 27.8612440191,
"line_max": 88,
"alpha_frac": 0.5760941645,
"autogenerated": false,
"ratio": 3.9894179894179893,
"config_test": fa... |
from docutils import nodes
from sphinx import addnodes
from sphinx.directives import ObjectDescription
from sphinx.domains import Domain, ObjType
from sphinx.locale import l_, _
from sphinx.roles import XRefRole
class HIEDirective(ObjectDescription):
def add_target_and_index(self, name, sig, signode):
targ... | {
"repo_name": "ankhers/haskell-ide-engine",
"path": "docs/source/hiedomain.py",
"copies": "5",
"size": "3798",
"license": "bsd-3-clause",
"hash": 4156279718802229000,
"line_mean": 35.8737864078,
"line_max": 77,
"alpha_frac": 0.5473933649,
"autogenerated": false,
"ratio": 3.915463917525773,
"con... |
from docutils import nodes
from sphinx import addnodes
from sphinx.writers.html import SmartyPantsHTMLTranslator
from sphinx.builders.html import StandaloneHTMLBuilder
import os
def setup(app):
app.add_builder(PxBuilder)
BaseHtmlXlator = SmartyPantsHTMLTranslator
class PxTranslator(BaseHtmlXlator):
"""Adjust... | {
"repo_name": "jayhetee/coveragepy",
"path": "doc/_ext/px_xlator.py",
"copies": "2",
"size": "4069",
"license": "apache-2.0",
"hash": 8588709658853869000,
"line_mean": 33.7777777778,
"line_max": 99,
"alpha_frac": 0.5863848611,
"autogenerated": false,
"ratio": 3.878932316491897,
"config_test": t... |
from docutils import nodes
from sphinx.roles import XRefRole
import figtable
import subfig
from backports import OrderedDict, OrderedSet
# Element classes
class page_ref(nodes.reference):
pass
class num_ref(nodes.reference):
pass
# Visit/depart functions
def skip_page_ref(self, node):
raise nodes.Skip... | {
"repo_name": "jterrace/sphinxtr",
"path": "extensions/numfig.py",
"copies": "1",
"size": "6652",
"license": "bsd-2-clause",
"hash": -7336193971167737000,
"line_mean": 32.26,
"line_max": 90,
"alpha_frac": 0.527059531,
"autogenerated": false,
"ratio": 3.8584686774941996,
"config_test": false,
... |
from docutils import nodes
from sphinx.util.compat import Directive
import urllib
class issues(nodes.General, nodes.Element):
pass
class IssuesDirective(Directive):
has_content = True
required_arguments = 1
optional_arguments = 0
final_argument_whitespace = False
def run(self):
env = ... | {
"repo_name": "containerbook/containerbook",
"path": "_extensions/issues.py",
"copies": "2",
"size": "1760",
"license": "bsd-3-clause",
"hash": -5278019129432614000,
"line_mean": 32.2075471698,
"line_max": 71,
"alpha_frac": 0.6545454545,
"autogenerated": false,
"ratio": 3.295880149812734,
"conf... |
from docutils import nodes
from sphinx.util.compat import Directive
from openlego.docs._utils.docutil import get_source_code_of_class_or_method
class EmbedCodeDirective(Directive):
"""EmbedCodeDirective is a custom directive to allow blocks of
python code to be shown in feature docs. An example usage would... | {
"repo_name": "daniel-de-vries/OpenLEGO",
"path": "openlego/docs/_exts/embed_code.py",
"copies": "1",
"size": "1450",
"license": "apache-2.0",
"hash": 1242555803110904000,
"line_mean": 31.9545454545,
"line_max": 87,
"alpha_frac": 0.6662068966,
"autogenerated": false,
"ratio": 4.289940828402367,
... |
from docutils import nodes
from sphinx.util.compat import Directive
def mark_all_editable(app, doctree, docname):
"""If the `vcwebedit_all_editable` config entry is True, mark all documents
as editable that do have an *editable* file-wide metadata entry."""
env = doctree.settings.env
meta = env.metada... | {
"repo_name": "thewtex/vcwebedit",
"path": "src/vcwebedit.py",
"copies": "1",
"size": "4074",
"license": "apache-2.0",
"hash": -2774991714351877000,
"line_mean": 39.74,
"line_max": 79,
"alpha_frac": 0.5981836033,
"autogenerated": false,
"ratio": 3.627782724844167,
"config_test": false,
"has_n... |
from docutils import nodes
from sphinx.util.nodes import make_refnode
MATCH_RE_RAW = r'\b(([A-Z][A-Za-z0-9]+)+)\b'
def setup(app):
app.connect('missing-reference', _missing_ref)
def _missing_ref(app, env, node, contnode):
# skip non-elements
if not isinstance(contnode, nodes.Element):
return
... | {
"repo_name": "frozencemetery/python-gssapi",
"path": "docs/custom_extensions/gssapi_find_missing.py",
"copies": "2",
"size": "1721",
"license": "isc",
"hash": -2928694748812428000,
"line_mean": 26.3174603175,
"line_max": 72,
"alpha_frac": 0.5258570598,
"autogenerated": false,
"ratio": 3.64618644... |
from docutils import nodes
from sphinx.util.nodes import set_source_info
from sphinx.util.osutil import relative_uri
# node that will have its link that is relative to root be made relative to
# the referencing document
class sibling_ref(nodes.General, nodes.Inline, nodes.TextElement): pass
# This role interprets it... | {
"repo_name": "xeno-by/old-scalameta-sbt",
"path": "src/sphinx/_sphinx/exts/key.py",
"copies": "4",
"size": "1578",
"license": "bsd-3-clause",
"hash": -3920884472944106500,
"line_mean": 41.6486486486,
"line_max": 82,
"alpha_frac": 0.7224334601,
"autogenerated": false,
"ratio": 3.5863636363636364,... |
from docutils import nodes
from sphinx.util.nodes import set_source_info
class Struct:
def __init__(self, **keywordargs):
self.__dict__.update(keywordargs)
def process_node(node):
if isinstance(node, nodes.Text):
node = nodes.inline('', node.astext())
else:
node = nodes.inline('',... | {
"repo_name": "jaceklaskowski/sbt",
"path": "src/sphinx/_sphinx/exts/codeliteral.py",
"copies": "4",
"size": "1391",
"license": "bsd-3-clause",
"hash": -4034451501785572400,
"line_mean": 34.6666666667,
"line_max": 86,
"alpha_frac": 0.6520488857,
"autogenerated": false,
"ratio": 3.974285714285714,... |
from docutils import nodes
def add_em_class(name, rawtext, text, lineno, inliner, options={}, content=[]):
"""
Returns 2 part tuple containing list of nodes to insert into the
document and a list of system messages. Both are allowed to be
empty.
:param name: The role name used in the document.
... | {
"repo_name": "opendatasoft/ods-documentation",
"path": "source/elements.py",
"copies": "1",
"size": "1052",
"license": "mit",
"hash": 5642121074782474000,
"line_mean": 31.875,
"line_max": 79,
"alpha_frac": 0.6406844106,
"autogenerated": false,
"ratio": 3.7841726618705036,
"config_test": false,... |
from docutils import nodes
def setup(app):
app.add_config_value('todo_include_todos', False, 'html')
app.add_node(todolist)
app.add_node(todo,
html=(visit_todo_node, depart_todo_node),
latex=(visit_todo_node, depart_todo_node),
text=(visit_todo_node, depa... | {
"repo_name": "indigits/sparse-plex",
"path": "docs/extensions/todo.py",
"copies": "1",
"size": "3539",
"license": "apache-2.0",
"hash": 2612027584047033000,
"line_mean": 30.0438596491,
"line_max": 86,
"alpha_frac": 0.5945182255,
"autogenerated": false,
"ratio": 3.821814254859611,
"config_test"... |
from docutils import nodes
def setup(app):
app.add_role('bugref', bugref_role)
app.add_role('idebugref', idebugref_role)
app.add_role('docbugref', docbugref_role)
return {'version': '0.1'} # identifies the version of our extension
def bugref_role(name, rawtext, text, lineno, inliner, options={}... | {
"repo_name": "MiniZinc/libminizinc",
"path": "docs/utils/bugref.py",
"copies": "1",
"size": "1694",
"license": "mpl-2.0",
"hash": -8471953089402102000,
"line_mean": 42.4358974359,
"line_max": 136,
"alpha_frac": 0.6334120425,
"autogenerated": false,
"ratio": 3.232824427480916,
"config_test": fa... |
from docutils import nodes
from sphinx.environment import NoUri
from sphinx.util.nodes import make_refnode
APPATTRS = {
"amqp": "celery.app.amqp.AMQP",
"backend": "celery.backends.base.BaseBackend",
"control": "celery.app.control.Control",
"events": "celery.events.Events",
"loader": "celery.app.lo... | {
"repo_name": "ask/celery",
"path": "docs/_ext/celerydocs.py",
"copies": "2",
"size": "4081",
"license": "bsd-3-clause",
"hash": 4583639344528910300,
"line_mean": 26.5743243243,
"line_max": 73,
"alpha_frac": 0.551335457,
"autogenerated": false,
"ratio": 3.6568100358422937,
"config_test": false,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.