text
stringlengths
0
1.05M
meta
dict
"""Build documentation from quattor sources.""" import os import sys import re from template import Template, TemplateException from sourcehandler import get_source_files from markdownhandler import generate_markdown, cleanup_content from config import build_repository_map from vsc.utils import fancylogger logger = f...
{ "repo_name": "jouvin/release", "path": "src/documentation_builder/lib/quattordocbuild/builder.py", "copies": "1", "size": "6702", "license": "apache-2.0", "hash": -3942519583676649000, "line_mean": 35.6229508197, "line_max": 110, "alpha_frac": 0.6111608475, "autogenerated": false, "ratio": 3.951...
"""Build documentation from quattor sources.""" import os import sys import re import codecs from multiprocessing import Pool from vsc.utils import fancylogger from sourcehandler import get_source_files from rsthandler import generate_rst_from_repository from config import build_repository_map logger = fancylogger.ge...
{ "repo_name": "quattor/release", "path": "src/documentation_builder/lib/quattordocbuild/builder.py", "copies": "2", "size": "5872", "license": "apache-2.0", "hash": -2238536480915079400, "line_mean": 35.0245398773, "line_max": 102, "alpha_frac": 0.6234673025, "autogenerated": false, "ratio": 3.91...
"""Build documentation from quattor sources.""" import os import sys import re import codecs from sourcehandler import get_source_files from rsthandler import generate_rst, cleanup_content from config import build_repository_map from vsc.utils import fancylogger from multiprocessing import Pool logger = fancylogger.g...
{ "repo_name": "wdpypere/release", "path": "src/documentation_builder/lib/quattordocbuild/builder.py", "copies": "1", "size": "8178", "license": "apache-2.0", "hash": -4107238950470070000, "line_mean": 35.5089285714, "line_max": 136, "alpha_frac": 0.6029591587, "autogenerated": false, "ratio": 3.9...
''' builddt.py # Author : Shivam Chaturvedi # Last Modified : 01:49 AM, 10th September 2013 # Purpose : ID3 Implementation [Machine Learning](Decision classifier) # Copyright : (C) 2013 ''' ''' NOTE: The builddt.py or the file that it is used in should call attribute.data file and instances.data file as comma...
{ "repo_name": "devs4v/DecisionTreeAndRDF", "path": "builddt.py", "copies": "1", "size": "12423", "license": "mit", "hash": 7734930373988942000, "line_mean": 47.7215686275, "line_max": 232, "alpha_frac": 0.6940352572, "autogenerated": false, "ratio": 3.5043723554301835, "config_test": false, "...
from os import listdir from os.path import join, basename from model.classifier import Classifier from model.docreader import DocReader from model.sample import SampleGenerator from cPickle import load import gzip def main(fmodel, fvocab, rpath, wpath): clf = Classifier() dr = DocReader() clf.loadmodel(f...
{ "repo_name": "jiyfeng/DPLP", "path": "discoseg/buildedu.py", "copies": "1", "size": "2619", "license": "mit", "hash": 4590848990911214000, "line_mean": 29.8117647059, "line_max": 86, "alpha_frac": 0.5643375334, "autogenerated": false, "ratio": 3.3151898734177214, "config_test": false, "has_n...
## Build environment # Passed to buildInfo(..) in build.clbs class Env: def __init__(self): self.os= "" ## "windows" or "linux" self.arch= "x64" ## @todo Auto-detect self.verbose= False ## Contains information on how to build a project # `buildInfo` in build.clbs should return a `Project` object class Project: ...
{ "repo_name": "crafn/clbs", "path": "src/interface.py", "copies": "1", "size": "1027", "license": "mit", "hash": 1807150693848414500, "line_mean": 33.2333333333, "line_max": 69, "alpha_frac": 0.6533592989, "autogenerated": false, "ratio": 3.169753086419753, "config_test": false, "has_no_keywo...
"""Build Environment used for isolation during sdist building """ import contextlib import logging import os import pathlib import sys import textwrap import zipfile from collections import OrderedDict from sysconfig import get_paths from types import TracebackType from typing import TYPE_CHECKING, Iterable, Iterator,...
{ "repo_name": "pypa/pip", "path": "src/pip/_internal/build_env.py", "copies": "4", "size": "9746", "license": "mit", "hash": -7222735430806462000, "line_mean": 33.0769230769, "line_max": 86, "alpha_frac": 0.5548943156, "autogenerated": false, "ratio": 4.138428874734608, "config_test": false, ...
"""Build Environment used for isolation during sdist building """ import logging import os import sys from distutils.sysconfig import get_python_lib from sysconfig import get_paths from pip._internal.utils.misc import call_subprocess from pip._internal.utils.temp_dir import TempDirectory from pip._internal.utils.ui i...
{ "repo_name": "RonnyPfannschmidt/pip", "path": "src/pip/_internal/build_env.py", "copies": "1", "size": "3986", "license": "mit", "hash": -7600693534214280000, "line_mean": 31.1451612903, "line_max": 76, "alpha_frac": 0.5935775213, "autogenerated": false, "ratio": 3.978043912175649, "config_tes...
"""Build Environment used for isolation during sdist building """ import logging import os import sys from distutils.sysconfig import get_python_lib from sysconfig import get_paths from pip._vendor.pkg_resources import Requirement, VersionConflict, WorkingSet from pip._internal.utils.misc import call_subprocess from...
{ "repo_name": "FlintHill/SUAS-Competition", "path": "env/lib/python2.7/site-packages/pip/_internal/build_env.py", "copies": "8", "size": "4797", "license": "mit", "hash": -9151386999326548000, "line_mean": 32.7816901408, "line_max": 78, "alpha_frac": 0.5861997082, "autogenerated": false, "ratio":...
"""Build Environment used for isolation during sdist building """ import logging import os import sys import textwrap from collections import OrderedDict from distutils.sysconfig import get_python_lib from sysconfig import get_paths from pip._vendor.pkg_resources import Requirement, VersionConflict, WorkingSet from ...
{ "repo_name": "nataddrho/DigiCue-USB", "path": "Python3/src/venv/Lib/site-packages/pip/_internal/build_env.py", "copies": "1", "size": "8081", "license": "mit", "hash": -9099098399798460000, "line_mean": 32.3925619835, "line_max": 79, "alpha_frac": 0.543620839, "autogenerated": false, "ratio": 4....
"""Build Environment used for isolation during sdist building """ import os from distutils.sysconfig import get_python_lib from sysconfig import get_paths from pip._internal.utils.temp_dir import TempDirectory class BuildEnvironment(object): """Creates and manages an isolated environment to install build deps ...
{ "repo_name": "kushalbhola/MyStuff", "path": "venv/Lib/site-packages/pip/_internal/build_env.py", "copies": "6", "size": "2681", "license": "apache-2.0", "hash": -4372502190501273600, "line_mean": 28.1413043478, "line_max": 72, "alpha_frac": 0.5930622902, "autogenerated": false, "ratio": 3.863112...
"""Build Environment used for isolation during sdist building """ import os from sysconfig import get_paths from pip._internal.utils.temp_dir import TempDirectory class BuildEnvironment(object): """Creates and manages an isolated environment to install build deps """ def __init__(self, no_clean): ...
{ "repo_name": "zvezdan/pip", "path": "src/pip/_internal/build_env.py", "copies": "1", "size": "2485", "license": "mit", "hash": -6424037369069481000, "line_mean": 27.2386363636, "line_max": 72, "alpha_frac": 0.5790744467, "autogenerated": false, "ratio": 3.8828125, "config_test": false, "has_...
"""Build Environment used for isolation during sdist building """ # The following comment should be removed at some point in the future. # mypy: strict-optional=False # mypy: disallow-untyped-defs=False import logging import os import sys import textwrap from collections import OrderedDict from distutils.sysconfig im...
{ "repo_name": "kennethreitz/pipenv", "path": "pipenv/patched/notpip/_internal/build_env.py", "copies": "1", "size": "7733", "license": "mit", "hash": 6341669613603042000, "line_mean": 33.8333333333, "line_max": 96, "alpha_frac": 0.5612310875, "autogenerated": false, "ratio": 4.063583815028902, ...
"""Builder Base Classes""" import os from xonsh.lib import subprocess from glob import glob from itertools import groupby from jinja2 import Environment, FileSystemLoader from regolith.sorters import doc_date_key, category_val, level_val, date_key from regolith.tools import ( date_to_rfc822, rfc822now, g...
{ "repo_name": "scopatz/regolith", "path": "regolith/helpers/basehelper.py", "copies": "1", "size": "4781", "license": "cc0-1.0", "hash": -1561623410851282400, "line_mean": 28.1524390244, "line_max": 78, "alpha_frac": 0.4963396779, "autogenerated": false, "ratio": 3.7705047318611986, "config_tes...
"""Builder Base Classes""" import os from xonsh.lib import subprocess from glob import glob from itertools import groupby from jinja2 import Environment, FileSystemLoader try: from bibtexparser.bwriter import BibTexWriter from bibtexparser.bibdatabase import BibDatabase HAVE_BIBTEX_PARSER = True except I...
{ "repo_name": "scopatz/regolith", "path": "regolith/builders/basebuilder.py", "copies": "1", "size": "4715", "license": "cc0-1.0", "hash": 6134727315399092000, "line_mean": 28.8417721519, "line_max": 85, "alpha_frac": 0.5058324496, "autogenerated": false, "ratio": 3.808562197092084, "config_tes...
""" Builder Class """ import os import sys import pathlib import json from collections import OrderedDict import click class GinXBuilder: """GinXBuilder""" def __init__(self): """__init__""" self.__new_project_data = None self.from_file = None self.__user_home = pathlib.Path....
{ "repo_name": "dimddev/ginx", "path": "ginx/ginxcli/api/common.py", "copies": "1", "size": "6847", "license": "bsd-3-clause", "hash": 2117418841125265200, "line_mean": 30.4082568807, "line_max": 123, "alpha_frac": 0.5289907989, "autogenerated": false, "ratio": 3.997081144191477, "config_test": ...
"""Builder for a BCube Topology Copyright 2015 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applica...
{ "repo_name": "USC-NSL/CondorTDL", "path": "bcube_tdl/topo.py", "copies": "1", "size": "4164", "license": "apache-2.0", "hash": -5709512578196840000, "line_mean": 35.5263157895, "line_max": 78, "alpha_frac": 0.6772334294, "autogenerated": false, "ratio": 3.598962834917891, "config_test": false,...
"""Builder for Current and Pending Reports.""" import datetime as dt import sys import time from argparse import RawTextHelpFormatter import nameparser from regolith.helpers.basehelper import SoutHelperBase, DbHelperBase from regolith.dates import month_to_int, month_to_str_int from regolith.fsclient import _id_key f...
{ "repo_name": "scopatz/regolith", "path": "regolith/helpers/a_grppub_readlisthelper.py", "copies": "1", "size": "3032", "license": "cc0-1.0", "hash": 1857431081947877000, "line_mean": 31.9565217391, "line_max": 80, "alpha_frac": 0.5590369393, "autogenerated": false, "ratio": 3.7571251548946716, ...
"""Builder for Current and Pending Reports.""" import datetime as dt import time from copy import copy from nameparser import HumanName from regolith.builders.basebuilder import LatexBuilderBase from regolith.dates import is_current, get_dates from regolith.fsclient import _id_key from regolith.sorters import position...
{ "repo_name": "scopatz/regolith", "path": "regolith/builders/cpbuilder.py", "copies": "1", "size": "5399", "license": "cc0-1.0", "hash": -3723692618840217600, "line_mean": 36.2344827586, "line_max": 78, "alpha_frac": 0.4665678829, "autogenerated": false, "ratio": 4.130833970925784, "config_test...
"""Builder for Current and Pending Reports.""" import datetime import time from argparse import RawTextHelpFormatter from regolith.helpers.basehelper import SoutHelperBase from regolith.dates import month_to_int from regolith.fsclient import _id_key from regolith.sorters import position_key from regolith.tools import ...
{ "repo_name": "scopatz/regolith", "path": "regolith/helpers/hellohelper.py", "copies": "1", "size": "2388", "license": "cc0-1.0", "hash": -6364890700975145000, "line_mean": 32.6338028169, "line_max": 82, "alpha_frac": 0.5540201005, "autogenerated": false, "ratio": 4.040609137055838, "config_tes...
"""Builder for Current and Pending Reports.""" import datetime import time from regolith.builders.basebuilder import LatexBuilderBase from regolith.dates import month_to_int from regolith.fsclient import _id_key from regolith.sorters import position_key from regolith.tools import ( all_docs_from_collection, fi...
{ "repo_name": "scopatz/regolith", "path": "regolith/builders/manuscriptreviewbuilder.py", "copies": "1", "size": "2189", "license": "cc0-1.0", "hash": 4197629909938949000, "line_mean": 34.8852459016, "line_max": 78, "alpha_frac": 0.5600730927, "autogenerated": false, "ratio": 4.009157509157509, ...
"""Builder for CVs.""" from regolith.builders.basebuilder import LatexBuilderBase from regolith.fsclient import _id_key from regolith.sorters import ene_date_key, position_key from regolith.tools import ( all_docs_from_collection, filter_publications, filter_projects, filter_grants, awards_grants_ho...
{ "repo_name": "scopatz/regolith", "path": "regolith/builders/cvbuilder.py", "copies": "1", "size": "3276", "license": "cc0-1.0", "hash": -791551107223573900, "line_mean": 33.8510638298, "line_max": 81, "alpha_frac": 0.5158730159, "autogenerated": false, "ratio": 3.710079275198188, "config_test"...
"""Builder for CVs.""" import datetime as dt from dateutil import parser as date_parser from dateutil.relativedelta import relativedelta from copy import copy, deepcopy from regolith.builders.basebuilder import LatexBuilderBase from regolith.fsclient import _id_key from regolith.dates import month_to_int, is_current f...
{ "repo_name": "scopatz/regolith", "path": "regolith/builders/activitylogbuilder.py", "copies": "1", "size": "16166", "license": "cc0-1.0", "hash": 2094030400007613200, "line_mean": 39.5162907268, "line_max": 91, "alpha_frac": 0.4584312755, "autogenerated": false, "ratio": 4.310933333333334, "co...
"""Builder for CVs.""" import datetime as dt import os import sys from copy import copy, deepcopy from regolith.builders.basebuilder import LatexBuilderBase from regolith.fsclient import _id_key from regolith.dates import month_to_int, is_current from regolith.sorters import position_key, doc_date_key from regolith.st...
{ "repo_name": "scopatz/regolith", "path": "regolith/builders/appraisalbuilder.py", "copies": "1", "size": "15644", "license": "cc0-1.0", "hash": 1620906566925665800, "line_mean": 39.2159383033, "line_max": 86, "alpha_frac": 0.454167732, "autogenerated": false, "ratio": 4.310829429594929, "confi...
"""Builder for Grade Reports.""" import os import pdb import sys import traceback from itertools import groupby try: import numpy as np except ImportError: np = None try: import scipy.stats as st except ImportError: st = None from regolith.builders.basebuilder import LatexBuilderBase from regolith.to...
{ "repo_name": "scopatz/regolith", "path": "regolith/builders/gradebuilder.py", "copies": "1", "size": "10471", "license": "cc0-1.0", "hash": -5684152483662705000, "line_mean": 34.6156462585, "line_max": 78, "alpha_frac": 0.4935536243, "autogenerated": false, "ratio": 3.9453654860587792, "config...
"""Builder for Lists of Presentations. This builder will build a presentation list for each group-member in each group listed in groups.yml. Group members are indicated in the employment and education sections of the individual in people.yml. There are a number of filtering options, i.e., for presentation-type (invi...
{ "repo_name": "scopatz/regolith", "path": "regolith/builders/preslistbuilder.py", "copies": "1", "size": "10202", "license": "cc0-1.0", "hash": 305999237434438800, "line_mean": 42.7854077253, "line_max": 93, "alpha_frac": 0.4376592825, "autogenerated": false, "ratio": 5.101, "config_test": fals...
"""Builder for manuscript reviews.""" import datetime as dt import sys from dateutil import parser as dateparser import nameparser from regolith.helpers.basehelper import DbHelperBase from regolith.dates import month_to_str_int from regolith.fsclient import _id_key from regolith.tools import ( all_docs_from_colle...
{ "repo_name": "scopatz/regolith", "path": "regolith/helpers/a_manurevhelper.py", "copies": "1", "size": "5252", "license": "cc0-1.0", "hash": 527127450494559700, "line_mean": 36.7841726619, "line_max": 119, "alpha_frac": 0.5093297791, "autogenerated": false, "ratio": 4.08715953307393, "config_t...
''' Builder for mason documents. ''' try: import bottle except ImportError: pass class Builder(object): def __init__(self, namespaces=None): self.namespaces = namespaces or {} def build_for_bottle(self, doc): accept = bottle.request.get_header('Accept', '') prefer = bottle.re...
{ "repo_name": "wrapp/pymason", "path": "mason/builder.py", "copies": "1", "size": "5723", "license": "mit", "hash": -5824854410269989000, "line_mean": 27.0539215686, "line_max": 76, "alpha_frac": 0.5668355757, "autogenerated": false, "ratio": 4.002097902097902, "config_test": false, "has_no_k...
"""Builder for Proposal Reivews.""" import datetime import time from nameparser import HumanName from regolith.builders.basebuilder import LatexBuilderBase from regolith.dates import month_to_int from regolith.fsclient import _id_key from regolith.sorters import position_key from regolith.tools import ( all_docs_f...
{ "repo_name": "scopatz/regolith", "path": "regolith/builders/proposalreviewbuilder.py", "copies": "1", "size": "3244", "license": "cc0-1.0", "hash": 9217800189637569000, "line_mean": 38.5609756098, "line_max": 81, "alpha_frac": 0.5585696671, "autogenerated": false, "ratio": 3.8896882494004794, ...
"""Builder for publication lists.""" import os import datetime as dt try: from bibtexparser.bwriter import BibTexWriter from bibtexparser.bibdatabase import BibDatabase HAVE_BIBTEX_PARSER = True except ImportError: HAVE_BIBTEX_PARSER = False from regolith.tools import all_docs_from_collection from re...
{ "repo_name": "scopatz/regolith", "path": "regolith/builders/publistbuilder.py", "copies": "1", "size": "5875", "license": "cc0-1.0", "hash": -4300338145348778500, "line_mean": 34.6060606061, "line_max": 80, "alpha_frac": 0.5028085106, "autogenerated": false, "ratio": 3.66729088639201, "config_...
"""Builder for Recent Collaborators. For the specified person it returns the name and institution of all graduate student and post-doc advisors, all graduate student advisees, all post-doc advisees in the past 60 monts and all coauthors in the past 48 months. """ import datetime as dt import os import sys from copy im...
{ "repo_name": "scopatz/regolith", "path": "regolith/builders/coabuilder.py", "copies": "1", "size": "18048", "license": "cc0-1.0", "hash": -2275762117601883400, "line_mean": 36.212371134, "line_max": 108, "alpha_frac": 0.5653257979, "autogenerated": false, "ratio": 3.568208778173191, "config_te...
"""Builder for Resumes.""" from regolith.builders.basebuilder import LatexBuilderBase from regolith.sorters import ene_date_key, position_key from regolith.tools import ( all_docs_from_collection, month_and_year, filter_publications, filter_projects, filter_grants, awards_grants_honors, lat...
{ "repo_name": "scopatz/regolith", "path": "regolith/builders/resumebuilder.py", "copies": "1", "size": "3061", "license": "cc0-1.0", "hash": 2476724649458510300, "line_mean": 34.183908046, "line_max": 91, "alpha_frac": 0.5194380921, "autogenerated": false, "ratio": 3.7148058252427183, "config_t...
"""Builder for Resumes.""" import os import openpyxl from regolith.builders.basebuilder import BuilderBase from regolith.dates import get_dates from regolith.sorters import position_key from regolith.tools import all_docs_from_collection, month_and_year, \ fuzzy_retrieval class ReimbursementBuilder(BuilderBase):...
{ "repo_name": "scopatz/regolith", "path": "regolith/builders/reimbursementbuilder.py", "copies": "1", "size": "7084", "license": "cc0-1.0", "hash": 5456475817411943000, "line_mean": 41.1666666667, "line_max": 96, "alpha_frac": 0.397515528, "autogenerated": false, "ratio": 4.639161755075311, "co...
"""Builder for the plan of beamtimes. The plan contains a summary of the information for the experiments in during a beamtime and details about how to carry out the experiments. """ from datetime import datetime import pandas as pd from regolith.builders.basebuilder import LatexBuilderBase from regolith.tools import ...
{ "repo_name": "scopatz/regolith", "path": "regolith/builders/beamplanbuilder.py", "copies": "1", "size": "6049", "license": "cc0-1.0", "hash": 1577882419532195800, "line_mean": 39.3266666667, "line_max": 117, "alpha_frac": 0.5514961151, "autogenerated": false, "ratio": 3.910148674854557, "confi...
"""Builder for websites.""" import os import shutil from itertools import groupby from jinja2 import Environment, FileSystemLoader try: from bibtexparser.bwriter import BibTexWriter from bibtexparser.bibdatabase import BibDatabase HAVE_BIBTEX_PARSER = True except ImportError: HAVE_BIBTEX_PARSER = False...
{ "repo_name": "hodger/regolith", "path": "regolith/htmlbuilder.py", "copies": "1", "size": "7629", "license": "cc0-1.0", "hash": 9202826657740577000, "line_mean": 36.5812807882, "line_max": 90, "alpha_frac": 0.5528902871, "autogenerated": false, "ratio": 3.36079295154185, "config_test": false, ...
"""Builder for websites.""" import os import shutil import datetime as dt from regolith.builders.basebuilder import BuilderBase from regolith.fsclient import _id_key from regolith.sorters import doc_date_key, position_key, ene_date_key from regolith.tools import ( all_docs_from_collection, filter_publications,...
{ "repo_name": "scopatz/regolith", "path": "regolith/builders/internalhtmlbuilder.py", "copies": "1", "size": "9420", "license": "cc0-1.0", "hash": 8921000268963610000, "line_mean": 34.8174904943, "line_max": 120, "alpha_frac": 0.494373673, "autogenerated": false, "ratio": 3.7233201581027666, "c...
"""Builder for websites.""" import os import shutil from regolith.builders.basebuilder import BuilderBase from regolith.fsclient import _id_key from regolith.sorters import ene_date_key, position_key from regolith.tools import ( all_docs_from_collection, filter_publications, filter_projects, make_bibte...
{ "repo_name": "scopatz/regolith", "path": "regolith/builders/htmlbuilder.py", "copies": "1", "size": "6768", "license": "cc0-1.0", "hash": 6374632599595033000, "line_mean": 31.854368932, "line_max": 79, "alpha_frac": 0.4923167849, "autogenerated": false, "ratio": 3.8129577464788733, "config_tes...
"""Builder for websites.""" import string from regolith.dates import date_to_float doc_date_key = lambda x: date_to_float( x.get("year", 1970), x.get("month", "jan") ) ene_date_key = lambda x: date_to_float( x.get("end_year", 4242), x.get("end_month", "dec") ) category_val = lambda x: x.get("category", "<unca...
{ "repo_name": "scopatz/regolith", "path": "regolith/sorters.py", "copies": "1", "size": "2389", "license": "cc0-1.0", "hash": -4502427478738422000, "line_mean": 27.4404761905, "line_max": 79, "alpha_frac": 0.5876935956, "autogenerated": false, "ratio": 2.885265700483092, "config_test": false, ...
"""Builder module A builder connect a :class:`umongo.document.Template` with a :class:`umongo.instance.BaseInstance` by generating an :class:`umongo.document.Implementation`. """ import re from copy import copy import marshmallow as ma from .abstract import BaseSchema from .template import Template, Implementation f...
{ "repo_name": "Scille/umongo", "path": "umongo/builder.py", "copies": "1", "size": "10490", "license": "mit", "hash": -3251895744625263600, "line_mean": 38.7348484848, "line_max": 99, "alpha_frac": 0.6299332698, "autogenerated": false, "ratio": 4.3239901071723, "config_test": false, "has_no_k...
"""Builder of string feature space represented as sparse matrix""" __author__ = 'amelie' from collections import Counter import numpy from scipy.sparse import csr_matrix from preimage.utils.alphabet import get_n_gram_to_index from preimage.exceptions.n_gram import InvalidNGramError def build_feature_space_without...
{ "repo_name": "a-ro/preimage", "path": "preimage/features/string_feature_space.py", "copies": "1", "size": "4914", "license": "bsd-2-clause", "hash": -30133194591789988, "line_mean": 36.8076923077, "line_max": 117, "alpha_frac": 0.6597476597, "autogenerated": false, "ratio": 3.15, "config_test"...
"""Builder pattern The Builder pattern separates the construction of a complex object from its representation so that the same construction process can create different representations. """ from abc import ABC, abstractmethod class IceCream(ABC): """Abstract Product.""" @property def need_spoon(self): ...
{ "repo_name": "jackaljack/design-patterns", "path": "builder.py", "copies": "1", "size": "3663", "license": "mit", "hash": -5575808877231405000, "line_mean": 24.7957746479, "line_max": 86, "alpha_frac": 0.6251706252, "autogenerated": false, "ratio": 3.905117270788913, "config_test": false, "h...
"""Builder picker. Initialise and return the appropriate builder for the given language. """ import importlib from pathlib import Path # a builder for every language; key: language; value: builder class _builders = {} def init(): """Import all the modules in the builders directory to register the available ...
{ "repo_name": "montefra/dodocs", "path": "dodocs/mkdoc/builders/__init__.py", "copies": "1", "size": "1821", "license": "mit", "hash": -8234488893115827000, "line_mean": 26.5909090909, "line_max": 81, "alpha_frac": 0.6441515651, "autogenerated": false, "ratio": 4.32541567695962, "config_test": ...
"""builder.py Modified June 26 2015 James Houghton james.p.houghton@gmail.com This submodule contains everything that is needed to construct a system dynamics model in python, using syntax that is compatible with the pysd model simulation functionality. These functions could be used to construct a system dynamics mod...
{ "repo_name": "bpowers/pysd", "path": "pysd/builder/builder.py", "copies": "1", "size": "17927", "license": "mit", "hash": 411463720763840000, "line_mean": 40.5939675174, "line_max": 100, "alpha_frac": 0.5708707536, "autogenerated": false, "ratio": 4.349102377486657, "config_test": false, "ha...
"""builder.py Refactored May 26 2016 James Houghton james.p.houghton@gmail.com This is code to assemble a pysd model once all of the elements have been translated from their native language into python compatible syntax. There should be nothing in this file that has to know about either vensim or xmile specific syntax...
{ "repo_name": "alexprey/pysd", "path": "pysd/py_backend/builder.py", "copies": "1", "size": "20972", "license": "mit", "hash": 7450174381481747000, "line_mean": 34.5457627119, "line_max": 110, "alpha_frac": 0.5650390998, "autogenerated": false, "ratio": 4.34742951907131, "config_test": false, ...
import cStringIO import exceptions import glob import gzip import os import re import shutil import subprocess import farb from farb import utils # make(1) path MAKE_PATH = '/usr/bin/make' # chroot(8) path CHROOT_PATH = '/usr/sbin/chroot' # cvs(1) path CVS_PATH = '/usr/bin/cvs' # mdconfig(8) path MDCONFIG_PATH = ...
{ "repo_name": "threerings/farbot", "path": "farb/builder.py", "copies": "1", "size": "35389", "license": "bsd-3-clause", "hash": 5361049795804998000, "line_mean": 34.8551165147, "line_max": 146, "alpha_frac": 0.6131001159, "autogenerated": false, "ratio": 4.041224163526322, "config_test": true,...
"""Builders and communicators necessary for serial/USB communication. """ import collections import nengo import numpy as np import serial import threading import struct from pacman103.front import common from nengo_spinnaker.utils import fp from .ethernet import stop_on_keyboard_interrupt import serial_vertex from ...
{ "repo_name": "ctn-archive/nengo_spinnaker_2014", "path": "nengo_spinnaker/spinn_io/uart.py", "copies": "1", "size": "13880", "license": "mit", "hash": -7464875974020065000, "line_mean": 35.7195767196, "line_max": 81, "alpha_frac": 0.5775216138, "autogenerated": false, "ratio": 4.294554455445544,...
''' builders/__init__.py @authon ashon @date 2014-08-26 ~ ''' import json import traceback class HighchartJsonBuilderException(Exception): ''' HighchartJsonBuilderException ''' def __init__(self, code, msg=''): super(HighchartJsonBuilderException, self).__init__(code) ...
{ "repo_name": "Ashon/highchart-export", "path": "src/client_module/python/chart_export/builders/__init__.py", "copies": "1", "size": "6997", "license": "mit", "hash": -7122720798193928000, "line_mean": 28.3991596639, "line_max": 93, "alpha_frac": 0.5640988995, "autogenerated": false, "ratio": 4.6...
"""Builders to generate in memory representation of model and fields tree.""" from __future__ import absolute_import from collections import defaultdict import six from . import errors from .fields import NotSet class Builder(object): def __init__(self, parent=None, nullable=False, default=NotSet): s...
{ "repo_name": "beregond/jsonmodels", "path": "jsonmodels/builders.py", "copies": "1", "size": "6397", "license": "bsd-3-clause", "hash": 5602621850737304000, "line_mean": 26.8130434783, "line_max": 78, "alpha_frac": 0.5791777396, "autogenerated": false, "ratio": 4.170143415906128, "config_test"...
# Build exe and nsis installer import contextlib import hashlib import os import importlib.util import subprocess import shutil # -- CHANGE PROJECT_FOLDER_NAME = 'neuron' MAKENSIS_PATH = '"D:\\Program Files (x86)\\NSIS\\makensis.exe"' # -- BUILD_PATH = os.getcwd() ROOT_PATH = os.path.dirname(BUILD_PATH) SRC_PATH = ...
{ "repo_name": "Andrew-Shay/Neuron", "path": "build/build.py", "copies": "1", "size": "6373", "license": "mit", "hash": -4020211468452989000, "line_mean": 28.9201877934, "line_max": 93, "alpha_frac": 0.5473089597, "autogenerated": false, "ratio": 3.2252024291497974, "config_test": true, "has_n...
"""Build factory instances.""" import collections from . import declarations, enums, errors, utils DeclarationWithContext = collections.namedtuple( 'DeclarationWithContext', ['name', 'declaration', 'context'], ) class DeclarationSet: """A set of declarations, including the recursive parameters. At...
{ "repo_name": "FactoryBoy/factory_boy", "path": "factory/builder.py", "copies": "1", "size": "12396", "license": "mit", "hash": -7016496675660087000, "line_mean": 32.593495935, "line_max": 89, "alpha_frac": 0.5832526621, "autogenerated": false, "ratio": 4.53235831809872, "config_test": false, ...
"""Build factory instances.""" import collections from . import declarations from . import enums from . import errors from . import utils DeclarationWithContext = collections.namedtuple( 'DeclarationWithContext', ['name', 'declaration', 'context'], ) PostGenerationContext = collections.namedtuple( 'Po...
{ "repo_name": "rbarrois/factory_boy", "path": "factory/builder.py", "copies": "1", "size": "12958", "license": "mit", "hash": -8062416849975360000, "line_mean": 31.9720101781, "line_max": 89, "alpha_frac": 0.5809538509, "autogenerated": false, "ratio": 4.580417108518911, "config_test": false, ...
"""Build factory instances.""" import collections from . import declarations from . import errors DeclarationWithContext = collections.namedtuple( 'DeclarationWithContext', ['name', 'declaration', 'context'], ) PostGenerationContext = collections.namedtuple( 'PostGenerationContext', ['value_provid...
{ "repo_name": "kamotos/factory_boy", "path": "factory/builder.py", "copies": "1", "size": "11201", "license": "mit", "hash": -8275755246952635000, "line_mean": 31.4666666667, "line_max": 84, "alpha_frac": 0.5836086064, "autogenerated": false, "ratio": 4.562525458248473, "config_test": false, ...
"""build_failures_build_only Revision ID: 14f53101b654 Revises: 16414a5b4ed9 Create Date: 2020-03-02 15:01:16.684848 """ import zeus from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision = "14f53101b654" down_revision = "16414a5b4e...
{ "repo_name": "getsentry/zeus", "path": "zeus/migrations/14f53101b654_build_failures_build_only.py", "copies": "1", "size": "1554", "license": "apache-2.0", "hash": 2086481239878802000, "line_mean": 30.7142857143, "line_max": 88, "alpha_frac": 0.6640926641, "autogenerated": false, "ratio": 3.3563...
""" Support for identifying the location of the ``XXX.xpybuild.py`` file currently being parsed. """ import traceback, inspect, os, sys def formatFileLocation(path: str, lineNumber: int) -> str: """ Formats a file and a line number for output. Uses a format that works in vim and is easy to adapt for other ed...
{ "repo_name": "xpybuild/xpybuild", "path": "xpybuild/utils/buildfilelocation.py", "copies": "1", "size": "3506", "license": "apache-2.0", "hash": -2728670058707087400, "line_mean": 33.3725490196, "line_max": 110, "alpha_frac": 0.7053622362, "autogenerated": false, "ratio": 3.603288797533402, "c...
"""build fips project build build [config] """ from mod import log, util, project, settings #------------------------------------------------------------------------------- def run(fips_dir, proj_dir, args) : """build fips project""" if not util.is_valid_project_dir(proj_dir) : log.error('must be run...
{ "repo_name": "code-disaster/fips", "path": "verbs/build.py", "copies": "1", "size": "1137", "license": "mit", "hash": 1623709039033446100, "line_mean": 32.4411764706, "line_max": 88, "alpha_frac": 0.489885664, "autogenerated": false, "ratio": 3.8805460750853245, "config_test": false, "has_no...
# build for the iphone/ipad # A lot of code here is just copy/pasted from the main SConstruct file. # Refactor this all out. from SCons.Environment import Environment from SCons.Script import Exit import os def isPlatform(platform): import sys return platform in sys.platform def isWindows(): return isPl...
{ "repo_name": "scristopher/paintown", "path": "scons/iphone.py", "copies": "4", "size": "9366", "license": "bsd-3-clause", "hash": -5541668760005716000, "line_mean": 42.7710280374, "line_max": 409, "alpha_frac": 0.6291906897, "autogenerated": false, "ratio": 3.1064676616915423, "config_test": f...
# BuildFox deploy script # compiles multiple files into one python script import re from pprint import pprint re_lib_import = re.compile(r"^from (lib_\w+) import \w+((, \w+)+)?$", flags = re.MULTILINE) re_import = re.compile(r"^import (\w+)$", flags = re.MULTILINE) # return prepared text of BuildFox module def file_...
{ "repo_name": "beardsvibe/buildfox", "path": "tools/deploy.py", "copies": "1", "size": "2270", "license": "mit", "hash": -8306909938192733000, "line_mean": 27.024691358, "line_max": 99, "alpha_frac": 0.6660792952, "autogenerated": false, "ratio": 2.8880407124681935, "config_test": false, "has...
# BuildFox ninja generator import os import platform from lib_util import which def discover(): vars = { "variation": "debug" } if which("cl") and which("link") and which("lib"): vars["toolset_msc"] = "true" if os.environ.get("VS140COMNTOOLS"): vars["toolset_msc_ver"] = "2015" elif os.environ.get("VS13...
{ "repo_name": "beardsvibe/buildfox", "path": "lib_environment.py", "copies": "1", "size": "1115", "license": "mit", "hash": 5673154663956027000, "line_mean": 23.2391304348, "line_max": 82, "alpha_frac": 0.6349775785, "autogenerated": false, "ratio": 2.918848167539267, "config_test": false, "h...
# BuildFox ninja generator import os import re import sys import copy import collections from lib_parser import parse from lib_util import rel_dir, wildcard_regex, find_files from lib_version import version_check if sys.version_info[0] < 3: string_types = basestring else: string_types = str # match and capture var...
{ "repo_name": "beardsvibe/buildfox", "path": "lib_engine.py", "copies": "1", "size": "16304", "license": "mit", "hash": 6719901742420222000, "line_mean": 30.84375, "line_max": 150, "alpha_frac": 0.6521099117, "autogenerated": false, "ratio": 3.0361266294227187, "config_test": false, "has_no_k...
# BuildFox ninja generator import os import re import sys import shlex import shutil re_folder_part = re.compile(r"^((?:\(\[\^\\\/\]\*\)(?:\(\?\![\w\|]+\))?\(\[\^\\\/\]\*\)|(?:[^\r\n(\[\"\\]|\\.))+)(\\\/|\/|\\).*$") # match folder part in filename regex re_non_escaped_char = re.compile(r"(?<!\\)\\(.)") # looking for ...
{ "repo_name": "beardsvibe/buildfox", "path": "lib_util.py", "copies": "1", "size": "11485", "license": "mit", "hash": -7468988400417721000, "line_mean": 32.9822485207, "line_max": 168, "alpha_frac": 0.6106225512, "autogenerated": false, "ratio": 3.137121005189839, "config_test": false, "has_n...
# BuildFox ninja generator import re # parser regexes re_newline_escaped = re.compile("\$+$") re_identifier = re.compile("[a-zA-Z0-9\${}_.-]+") re_path = re.compile(r"(r?\"(?:\\\"|.)*?\")|((\$\||\$ |\$:|[^ :|\n])+)") class Parser: def __init__(self, engine, filename, text = None): self.engine = engine self.file...
{ "repo_name": "beardsvibe/buildfox", "path": "lib_parser.py", "copies": "1", "size": "11433", "license": "mit", "hash": 8985905067971524000, "line_mean": 26.2863961814, "line_max": 116, "alpha_frac": 0.6533718184, "autogenerated": false, "ratio": 3.037460148777896, "config_test": false, "has_...
# Build GodotSharpTools solution import os from SCons.Script import Builder, Dir def find_nuget_unix(): import os if 'NUGET_PATH' in os.environ: hint_path = os.environ['NUGET_PATH'] if os.path.isfile(hint_path) and os.access(hint_path, os.X_OK): return hint_path hint_pa...
{ "repo_name": "okamstudio/godot", "path": "modules/mono/build_scripts/godotsharptools_build.py", "copies": "3", "size": "8471", "license": "mit", "hash": -2543163459045206500, "line_mean": 31.2091254753, "line_max": 134, "alpha_frac": 0.6097273049, "autogenerated": false, "ratio": 3.3681908548707...
# Build GodotTools solution import os from SCons.Script import Dir def build_godot_tools(source, target, env): # source and target elements are of type SCons.Node.FS.File, hence why we convert them to str module_dir = env["module_dir"] solution_path = os.path.join(module_dir, "editor/GodotTools/GodotT...
{ "repo_name": "DmitriySalnikov/godot", "path": "modules/mono/build_scripts/godot_tools_build.py", "copies": "22", "size": "1196", "license": "mit", "hash": -1652182398315968000, "line_mean": 30.4736842105, "line_max": 98, "alpha_frac": 0.6914715719, "autogenerated": false, "ratio": 3.276712328767...
# Build graph from pairs of word with its weight # Produce function to get all paths from one node to other node # minhvvu 2017-05-25 import networkx as nx import graph_utils as gutil def create_from_pairs(pairs): """ Build graph from `pairs` of words. Accumulate weight for the edges that appear multiple...
{ "repo_name": "minhvvu/writing_ass", "path": "build_graph.py", "copies": "1", "size": "2429", "license": "mit", "hash": -7560695351984422000, "line_mean": 24.8404255319, "line_max": 75, "alpha_frac": 0.5401399753, "autogenerated": false, "ratio": 3.0746835443037974, "config_test": false, "has...
"""Build Helper Functions """ import os VERSION = (1, 0) __version__ = '.'.join(str(i) for i in VERSION) def reachable_nodes_in_order(start_node, graph): """Returns a new list with all reachable nodes of the graph starting from start_node. The returned list contains nodes in order of visit and doe...
{ "repo_name": "ferhensil/bhf", "path": "bhf.py", "copies": "1", "size": "2612", "license": "mit", "hash": -4016415890088675300, "line_mean": 30.0952380952, "line_max": 77, "alpha_frac": 0.6301684533, "autogenerated": false, "ratio": 4.240259740259741, "config_test": false, "has_no_keywords": ...
""" Build HTML examples for the Zoof to WASM compiler. """ import wasmfun as wf from zf_tokenizer import tokenize from zf_parser import parse from zf_codegen import compile, STD # todo: use special char (that is invalid in Zoof itself) instead of underscore EXAMPLE = """ func find_nt_prime(n) { count = 0 i...
{ "repo_name": "almarklein/wasmfun", "path": "zoof/build.py", "copies": "2", "size": "1102", "license": "bsd-2-clause", "hash": -983912348024691100, "line_mean": 19.0363636364, "line_max": 79, "alpha_frac": 0.5408348457, "autogenerated": false, "ratio": 3.2507374631268435, "config_test": false, ...
build_id="219" # may optionally include a ".{patchno}" suffix. # Putting buildno at the top prevents automatic __doc__ assignment, and # I *want* the build number at the top :) __doc__="""This is a distutils setup-script for the pywin32 extensions To build the pywin32 extensions, simply execute: python setup.py -q b...
{ "repo_name": "mollstam/UnrealPy", "path": "UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/pywin32-219/setup.py", "copies": "2", "size": "122861", "license": "mit", "hash": 732731400450382800, "line_mean": 46.1454336147, "line_max": 131, "alpha_frac": 0.55943...
build_id="220" # may optionally include a ".{patchno}" suffix. # Putting buildno at the top prevents automatic __doc__ assignment, and # I *want* the build number at the top :) __doc__="""This is a distutils setup-script for the pywin32 extensions To build the pywin32 extensions, simply execute: python setup.py -q b...
{ "repo_name": "DavidGuben/rcbplayspokemon", "path": "app/pywin32-220/setup.py", "copies": "1", "size": "123730", "license": "mit", "hash": 6744375099924661000, "line_mean": 46.2251908397, "line_max": 131, "alpha_frac": 0.5597349067, "autogenerated": false, "ratio": 3.843501491053678, "config_te...
"""Build IDF geometry from minimal inputs.""" from typing import Any, Dict, List, Tuple, Union # noqa from six.moves import zip from .geom.polygons import Polygon, Polygon3D # noqa from .geom.segments import Segment # noqa from .geom.vectors import Vector3D class Zone(object): """Represents a single zone for...
{ "repo_name": "jamiebull1/geomeppy", "path": "geomeppy/builder.py", "copies": "1", "size": "7552", "license": "mit", "hash": -6831037347259818000, "line_mean": 29.5748987854, "line_max": 118, "alpha_frac": 0.5644862288, "autogenerated": false, "ratio": 3.7778889444722363, "config_test": false, ...
"""Build in connectors. Connectors have to implement `process_request`. """ from .errors import HTTPError def _bad_import_class(msg): class _BadImportClass: def __init__(self, *args, **kwargs): raise NotImplementedError(msg) return _BadImportClass try: import aiohttp import asyn...
{ "repo_name": "khazhyk/osuapi", "path": "osuapi/connectors.py", "copies": "1", "size": "4240", "license": "mit", "hash": -1791807387667987000, "line_mean": 34.041322314, "line_max": 74, "alpha_frac": 0.5186320755, "autogenerated": false, "ratio": 4.840182648401827, "config_test": false, "has_...
"""Build in connectors. Connectors have to implement `process_request`. """ from .errors import HTTPError try: import aiohttp import asyncio class AHConnector: """Connector implementation using aiohttp.""" def __init__(self, sess=None, loop=None): self.loop = loop or asyncio....
{ "repo_name": "Phxntxm/osuapi", "path": "osuapi/connectors.py", "copies": "1", "size": "2424", "license": "mit", "hash": 4185747229375233000, "line_mean": 28.5609756098, "line_max": 83, "alpha_frac": 0.5297029703, "autogenerated": false, "ratio": 4.781065088757397, "config_test": false, "has_...
""" Build index from directory listing From: https://stackoverflow.com/questions/39048654/how-to-enable-directory-indexing-on-github-pages make_index.py </path/to/directory> """ INDEX_TEMPLATE = r""" <html> <title>Links for lief</title> <body> <h1>Links for lief</h1> % for name in names: <a href="${base_url}/${ba...
{ "repo_name": "lief-project/LIEF", "path": ".github/make_index.py", "copies": "1", "size": "1052", "license": "apache-2.0", "hash": 5020174302830917000, "line_mean": 24.0476190476, "line_max": 99, "alpha_frac": 0.6587452471, "autogenerated": false, "ratio": 3.121661721068249, "config_test": fal...
# build_index.py import lxml.html from lxml.cssselect import CSSSelector import time import urlparse import cStringIO from PIL import Image import base64 from bvgs.serialization.json import load_data_from_json_file from bvgs.storage.filesystem import load_data_from_file FILE_URL = "http://apps.sloanahrens.com/qbox-b...
{ "repo_name": "adandan01/contmon", "path": "contmon/content/scripts/build_search_index.py", "copies": "1", "size": "8084", "license": "bsd-3-clause", "hash": 7030746747360798000, "line_mean": 31.7287449393, "line_max": 118, "alpha_frac": 0.507174666, "autogenerated": false, "ratio": 3.74086071263...
# build_index.py FILE_URL = "http://apps.sloanahrens.com/qbox-blog-resources/kaggle-titanic-data/test.csv" ES_HOST = { "host" : "10.0.0.158", "port" : 9200 } INDEX_NAME = 'titanic' TYPE_NAME = 'passenger' ID_FIELD = 'passengerid' import csv import urllib2 from elasticsearch import Elasticsearch response...
{ "repo_name": "yuecong/tools", "path": "mk_index1.py", "copies": "1", "size": "1701", "license": "mit", "hash": 8310199418066542000, "line_mean": 21.3815789474, "line_max": 89, "alpha_frac": 0.60670194, "autogenerated": false, "ratio": 2.89778534923339, "config_test": false, "has_no_keywords"...
# build_index.py FILE_URL = "http://apps.sloanahrens.com/qbox-blog-resources/kaggle-titanic-data/test.csv" ES_HOST = { "host" : "3ba3272253eba2b6000.qbox.io", "port" : 80 } INDEX_NAME = 'titanic' TYPE_NAME = 'passenger' ID_FIELD = 'passengerid' import csv import urllib2 from elasticsearch import Elastics...
{ "repo_name": "sloanahrens/qbox-blog-code", "path": "ch_3_deploy_spark_es/build_index_qbox.py", "copies": "1", "size": "1710", "license": "apache-2.0", "hash": -8832610187784462000, "line_mean": 21.8, "line_max": 89, "alpha_frac": 0.6081871345, "autogenerated": false, "ratio": 2.9432013769363166,...
# build_index.py FILE_URL = "http://apps.sloanahrens.com/qbox-blog-resources/kaggle-titanic-data/test.csv" ES_HOST = { "host" : "localhost", "port" : 9200 } INDEX_NAME = 'titanic' TYPE_NAME = 'passenger' ID_FIELD = 'passengerid' import csv import urllib2 from elasticsearch import Elasticsearch response ...
{ "repo_name": "sloanahrens/toy-sass-spark-celery-elasticsearch", "path": "build_titanic_index.py", "copies": "2", "size": "1694", "license": "mit", "hash": 500944525044395000, "line_mean": 21.5866666667, "line_max": 89, "alpha_frac": 0.6056670602, "autogenerated": false, "ratio": 2.98239436619718...
__author__ = 'Kevin Wurster' __copyright__ = 'Copyright (c) 2014, SkyTruth' __version__ = '0.1' __release__ = '2014/04/08' __license__ = """ Copyright (c) 2014, SkyTruth All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following condi...
{ "repo_name": "SkyTruth/CrowdProjects", "path": "crowdtools/__init__.py", "copies": "1", "size": "1648", "license": "bsd-3-clause", "hash": 7698258662980562000, "line_mean": 47.5, "line_max": 78, "alpha_frac": 0.7882281553, "autogenerated": false, "ratio": 4.527472527472527, "config_test": fals...
# Building: A basic building. It does nothing besides burn down. Other Buildings inherit from this class. # DO NOT MODIFY THIS FILE # Never try to directly create an instance of this class, or modify its member variables. # Instead, you should only be reading its variables and calling its functions. from typing impor...
{ "repo_name": "siggame/Joueur.py", "path": "games/anarchy/building.py", "copies": "1", "size": "4121", "license": "mit", "hash": 1964199747584001300, "line_mean": 37.8773584906, "line_max": 152, "alpha_frac": 0.653239505, "autogenerated": false, "ratio": 4.100497512437811, "config_test": false,...
# Building a hierarchical edge bundling graph for the Belgian Startup landscape. from codecs import open from json import dumps from openpyxl import load_workbook import sys import collections class Network: def __init__(self, path, sheet): self.people = {} # people = dict {name, [other names]} ...
{ "repo_name": "sirris/startupmaffia", "path": "heb.py", "copies": "1", "size": "1786", "license": "mit", "hash": 8687920914101170000, "line_mean": 34.0196078431, "line_max": 122, "alpha_frac": 0.6041433371, "autogenerated": false, "ratio": 3.447876447876448, "config_test": false, "has_no_keyw...
"""Building a red black search tree.""" from que_ import Queue class Node(object): """Build a node object.""" def __init__(self, val=None): """Constructor for the Node object.""" self.val = val self.left = None self.right = None self.parent = None self.red = Tr...
{ "repo_name": "adriennekarnoski/data-structures", "path": "python/data_structures/rbt.py", "copies": "1", "size": "3124", "license": "mit", "hash": 6922242739818242000, "line_mean": 27.6605504587, "line_max": 56, "alpha_frac": 0.5012804097, "autogenerated": false, "ratio": 4.314917127071824, "c...
# Building a SoC in python with Migen # http://brandonhamilton.github.io/building-a-soc-with-migen from mibuild.generic_platform import * from mibuild.xilinx_ise import XilinxISEPlatform, CRG_DS _io = [ # System clock (Differential 200MHz) ("clk200", 0, Subsignal("p", Pins("J9"), IOStandard("LVDS_25")...
{ "repo_name": "brandonhamilton/building-a-soc-with-migen", "path": "platform.py", "copies": "1", "size": "1592", "license": "bsd-2-clause", "hash": -818799036168421400, "line_mean": 38.825, "line_max": 82, "alpha_frac": 0.6005025126, "autogenerated": false, "ratio": 2.6098360655737705, "config_...
"""Building a spider - grab a link from the waiting list and connect to that page, grab all the HTML and throw into linkFinder (where it will be parsed) take link from waiting list into crawled file""" import urllib2 #connect webpages from python from general_function import * from link_finder import linkFinder from ...
{ "repo_name": "benevolentprof/fb-notification-mail", "path": "spider_class.py", "copies": "1", "size": "3969", "license": "mit", "hash": 6576716269974815000, "line_mean": 45.6941176471, "line_max": 152, "alpha_frac": 0.658856135, "autogenerated": false, "ratio": 4.091752577319587, "config_test"...
"""Building blocks for writing modular callbacks for plotly""" import dash_html_components as html import pandas as pd CONFIG_DICT = {'modeBarButtonsToRemove': ['sendDataToCloud', 'pan2d', 'zoomIn2d', ...
{ "repo_name": "czbiohub/singlecell-dash", "path": "singlecell_dash/apps/base.py", "copies": "1", "size": "1217", "license": "mit", "hash": 1141808517619038300, "line_mean": 31.9189189189, "line_max": 74, "alpha_frac": 0.4560394412, "autogenerated": false, "ratio": 4.868, "config_test": false, ...
"""Building blocks to use in your deployment script""" from contextlib import contextmanager import os from os import chdir, O_CREAT, O_EXCL, remove, getcwd from os.path import join from pipes import quote from subprocess import check_output from tempfile import gettempdir def run(command, **kwargs): """Return t...
{ "repo_name": "erikrose/shiva", "path": "shiva_deployer/tools.py", "copies": "1", "size": "1876", "license": "mit", "hash": -2974853408270103000, "line_mean": 27.4242424242, "line_max": 79, "alpha_frac": 0.6551172708, "autogenerated": false, "ratio": 4.087145969498911, "config_test": false, "...
"""Building commands.""" from functools import partial from gsb.intercept import Menu, MenuItem, Reader, YesOrNo from gsb.permissions import or_, and_ from db import SpacialObject, Gender, Hull, StarshipDrive, \ WormholeDrive, Battery, Wall, Types from parsers import parser from permissions...
{ "repo_name": "chrisnorman7/game", "path": "commands/building.py", "copies": "1", "size": "13886", "license": "mpl-2.0", "hash": -5970082511838099000, "line_mean": 32.4565756824, "line_max": 79, "alpha_frac": 0.4726343079, "autogenerated": false, "ratio": 4.765271105010295, "config_test": false...
"""BuildingDepot helper Provides helper methods to post data to Building Depot via its REST APIs """ import requests import time import json import time import calendar from json_setting import JsonSetting class BuildingDepotHelper: '''Building Depot Helpe Class''' def __init__(self, settingFilePath="./knocki...
{ "repo_name": "IoT-Expedition/Edge-Analytics", "path": "BuildingDepotHelper.py", "copies": "1", "size": "4153", "license": "apache-2.0", "hash": 5507107869756133000, "line_mean": 35.1130434783, "line_max": 86, "alpha_frac": 0.5429809776, "autogenerated": false, "ratio": 4.357817418677859, "conf...
""" Building emails to send asynchronously, via cron job or scheduler """ # THIS IS A DEMO WHICH LIMITS THE NUMBER OF EMAILS SENT, and is rate limited for mailtrap from portality import app_email from portality.core import app from portality.tasks import async_workflow_notifications import time # Replace the async ...
{ "repo_name": "DOAJ/doaj", "path": "doajtest/demo_scripts/async_workflow_notifications_demo.py", "copies": "1", "size": "1803", "license": "apache-2.0", "hash": 8153244434447034000, "line_mean": 36.5625, "line_max": 107, "alpha_frac": 0.6727676095, "autogenerated": false, "ratio": 3.8857758620689...
"""building_fee_account Revision ID: c11d3d8b16ae Revises: 3ec1d29bfd10 Create Date: 2020-02-26 23:05:46.376751 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. from pycroft.model.facilities import Building from pycroft.model.types import DateTimeTz from pycroft.model.user ...
{ "repo_name": "agdsn/pycroft", "path": "pycroft/model/alembic/versions/c11d3d8b16ae_building_fee_account.py", "copies": "1", "size": "6148", "license": "apache-2.0", "hash": -4555206477124564500, "line_mean": 35.5952380952, "line_max": 115, "alpha_frac": 0.5735198439, "autogenerated": false, "rat...
"""Building functions""" from functools import wraps as _wraps from distutils.command.build_ext import build_ext as _build_ext from compilertools._config_build import ConfigBuild from compilertools._core import ( suffix_from_args, get_compile_args, get_compiler, log_exception as _log_exception, ) __a...
{ "repo_name": "JGoutin/compilertools", "path": "compilertools/build.py", "copies": "1", "size": "12301", "license": "bsd-2-clause", "hash": -4881846688867686000, "line_mean": 29.6758104738, "line_max": 88, "alpha_frac": 0.6239330136, "autogenerated": false, "ratio": 3.9951282884053265, "config_...
# Building the CNN import keras from keras.models import Sequential from keras.layers import Convolution2D # 3D is for video from keras.layers import MaxPooling2D from keras.layers import Flatten from keras.layers import Dense # init classifier = Sequential() # Step 1 Convolution classifier.add( Convolution2D( 32, ...
{ "repo_name": "jigargandhi/UdemyMachineLearning", "path": "Machine Learning A-Z Template Folder/Part 8 - Deep Learning/Section 40 - Convolutional Neural Networks (CNN)/j_cnn.py", "copies": "1", "size": "1630", "license": "mit", "hash": 1049155208793462400, "line_mean": 33.7021276596, "line_max": 129, ...
# Build-in libs import sys # Third-part libs from pyqtgraph.Qt import QtGui, QtCore import pyqtgraph as pg import time from som import * class SomVisualization: def __init__(self, som): """ Initialization of class SomVisualization, build basic app and window using Qt :param som: Self-or...
{ "repo_name": "ogvalt/saturn", "path": "visualization.py", "copies": "1", "size": "5135", "license": "mit", "hash": -7248710095747994000, "line_mean": 30.6975308642, "line_max": 108, "alpha_frac": 0.582083739, "autogenerated": false, "ratio": 3.8638073739653875, "config_test": false, "has_no_...
"""Build instructions for packaging and installing""" import io import os import sys from shutil import rmtree from setuptools import Command, find_packages, setup # Package meta-data. NAME = "scout-browser" DESCRIPTION = "Clinical DNA variant visualizer and browser." URL = "https://github.com/Clinical-Genomics/scou...
{ "repo_name": "Clinical-Genomics/scout", "path": "setup.py", "copies": "1", "size": "2848", "license": "bsd-3-clause", "hash": -6103614387864390000, "line_mean": 32.4941176471, "line_max": 94, "alpha_frac": 0.6484018265, "autogenerated": false, "ratio": 3.905349794238683, "config_test": false, ...
"""Build Jinja2 latex template, compile latex, and clean up environment This module contains one class, Latex Build, which builds latex documents from Jinja2 templates. The most useful, dynamic method is run_latex, which handles the complex process of building a latex document with any available system binary. All met...
{ "repo_name": "pappasam/latexbuild", "path": "latexbuild/build.py", "copies": "1", "size": "6152", "license": "mit", "hash": -9074193819980083000, "line_mean": 41.4275862069, "line_max": 79, "alpha_frac": 0.6412548765, "autogenerated": false, "ratio": 4.1993174061433445, "config_test": false, ...
#buildkeywords.py import json # import sys from topia.termextract import tag from topia.termextract import extract #set path=%path%;c:python27 #http://pypi.python.org/pypi/topia.termextract #http://www.peterbe.com/plog/uniqifiers-benchmark ######################## Get Wiki Summary ########################### from se...
{ "repo_name": "amol-mandhane/konnactivity", "path": "sorter/views.py", "copies": "1", "size": "15426", "license": "mit", "hash": -1920577167458751500, "line_mean": 33.4330357143, "line_max": 968, "alpha_frac": 0.5373395566, "autogenerated": false, "ratio": 3.5642329020332717, "config_test": fal...
"""Build libusb.""" import cffi ffibuilder = cffi.FFI() ffibuilder.set_source("robotd.native._usb", """ #include <libusb.h> """, libraries=[ 'usb-1.0', ], include_dirs=[ '/usr/local/include/libusb-1.0', '/usr/include/libusb-1.0', ], library_dirs=[ '/lib/arm-linux-gnueabihf', ]) ffibuilder.cdef("...
{ "repo_name": "sourcebots/robotd", "path": "robotd/native/libusb_build.py", "copies": "1", "size": "1808", "license": "mit", "hash": -7427484778760577000, "line_mean": 18.8681318681, "line_max": 59, "alpha_frac": 0.5658185841, "autogenerated": false, "ratio": 3.245960502692998, "config_test": f...
'''Build like you want to distribute on GitHub''' from scipy import signal import numpy as np import matplotlib.pyplot as plt from astropy.stats import * from scipy.interpolate import interp1d def sncalc(redshift,wave,gal_flux): line_halfwidth = 10 #angstroms Hline = 3968.5*(1+redshift) #angstroms Kline =...
{ "repo_name": "giffordw/OSMOSreduce", "path": "sncalc.py", "copies": "1", "size": "1272", "license": "bsd-3-clause", "hash": 4831164681288420000, "line_mean": 30.8, "line_max": 99, "alpha_frac": 0.6580188679, "autogenerated": false, "ratio": 2.7121535181236673, "config_test": false, "has_no_k...
'''Build like you want to distribute on GitHub''' import numpy as np import matplotlib.pyplot as plt class DragSpectra: def __init__(self,spectra,ydata,ax5): self.ax5 = ax5 print 'begin shift' self.spectra = spectra self.ydata = ydata self.pressed = False self.dx_tot...
{ "repo_name": "giffordw/OSMOSreduce", "path": "redshift_checker.py", "copies": "1", "size": "1285", "license": "bsd-3-clause", "hash": -7824923912150990000, "line_mean": 31.9487179487, "line_max": 74, "alpha_frac": 0.5719844358, "autogenerated": false, "ratio": 3.510928961748634, "config_test":...
# buildlist/__init__.py """ Object for verifying integrity of description of directory structure. """ import base64 import binascii import shutil import time import os try: from os import scandir except ImportError: from scandir import scandir import hashlib from Crypto.PublicKey import RSA from Crypto.Has...
{ "repo_name": "jddixon/buildList", "path": "src/buildlist/__init__.py", "copies": "1", "size": "23416", "license": "mit", "hash": -6439940106274775000, "line_mean": 30.8152173913, "line_max": 78, "alpha_frac": 0.5608985309, "autogenerated": false, "ratio": 3.922278056951424, "config_test": fals...
#build list of available data import os, sys #available_regions[build][uids] available_regions = {} loc_file = "/cache/regions/regions.loc" try: for line in open( loc_file ): if line[0:1] == "#" : continue fields = line.split('\t') #read each line, if not enough fiel...
{ "repo_name": "jmchilton/galaxy-central", "path": "tools/encode/random_intervals_code.py", "copies": "1", "size": "1334", "license": "mit", "hash": -2206701506637004800, "line_mean": 31.35, "line_max": 92, "alpha_frac": 0.5854572714, "autogenerated": false, "ratio": 3.822349570200573, "config_t...
#build list of available data import os, sys encode_sets= {} try: for line in open( "/cache/encode_datasets/encode_datasets.loc" ): if line[0:1] == "#" : continue fields = line.split('\t') #read each line, if not enough fields, go to next line try: en...
{ "repo_name": "jmchilton/galaxy-central", "path": "tools/data_source/encode_import_code.py", "copies": "1", "size": "6166", "license": "mit", "hash": 7604003599553161000, "line_mean": 39.9455782313, "line_max": 129, "alpha_frac": 0.5063250081, "autogenerated": false, "ratio": 4.523844460748349, ...