text
stringlengths
0
1.05M
meta
dict
from .element import * from .mrow import MRow _default_math_attributes = { "fontsize": "12pt", "scriptlevel": "0", "scriptsizemultiplier": "0.71", "scriptminsize": "8pt", "veryverythinmathspace": "0.0555556em", "verythinmathspace": "0.111111em", "thinmathspace": "0.166667em", ...
{ "repo_name": "ahjulstad/mathdom-python3", "path": "mathml/pmathml/mmath.py", "copies": "1", "size": "1443", "license": "mit", "hash": 1050324977279602000, "line_mean": 27.2941176471, "line_max": 73, "alpha_frac": 0.6687456687, "autogenerated": false, "ratio": 3.0636942675159236, "config_test":...
from .element import * from .mrow import * import math class MRoot(Element): def __init__(self, plotter, children): assert len(children) == 2 Element.__init__(self, plotter) for child in children: self.addChild(child) self.row_strategy = MRow.Strategy() def _layout(self, base, index=None): self.bas...
{ "repo_name": "ahjulstad/mathdom-python3", "path": "mathml/pmathml/mroot.py", "copies": "1", "size": "2529", "license": "mit", "hash": -6176240619750255000, "line_mean": 29.1071428571, "line_max": 68, "alpha_frac": 0.6714116251, "autogenerated": false, "ratio": 2.797566371681416, "config_test":...
from element import * import datetime from netCDF4 import date2num class Register(object): pass class Conditional(object): pass class RowBounds(Register,VariablePolyElement,SpatialTranslationalElement): _names = ['bounds_latitude', 'bnds_latitude', 'latitude_bounds', ...
{ "repo_name": "mapping/OpenClimateGIS", "path": "src/openclimategis/util/ncconv/experimental/ocg_meta/models.py", "copies": "7", "size": "3997", "license": "bsd-3-clause", "hash": -4932971534161920000, "line_mean": 24.2974683544, "line_max": 82, "alpha_frac": 0.6534901176, "autogenerated": false, ...
from element import * import gui from grid import * class container(element): child_elements = None child_ids = None focused_id = 0 def __init__(self): self.child_elements = [] self.child_ids = {} self.focus_grid = [] element.__init__(self) self.focus_grid = grid() def add(self, elem): elem.parent =...
{ "repo_name": "jurassic-c/Pynterface", "path": "Pynterface/container.py", "copies": "1", "size": "2309", "license": "bsd-3-clause", "hash": 5968327460761268000, "line_mean": 23.0520833333, "line_max": 54, "alpha_frac": 0.6899090515, "autogenerated": false, "ratio": 2.8158536585365854, "config_t...
from .element import * import warnings from . import msubsup _ACCENT_SPACING = 0.05 _LIMIT_SPACING = 0.20 class MOver(Element): class Strategy: def modify_children(elem, base, over): if base.embellished_core is not None: elem.setAttributeWeak( "accent", base.embellished_core.getAttribute("ac...
{ "repo_name": "ahjulstad/mathdom-python3", "path": "mathml/pmathml/munderover.py", "copies": "1", "size": "7531", "license": "mit", "hash": -5896148748660915000, "line_mean": 27.9653846154, "line_max": 71, "alpha_frac": 0.6669764971, "autogenerated": false, "ratio": 3.3030701754385965, "config_...
from .element import * import warnings from . import munderover _SUB_MAX_POSITION = 1/3.0 # relative to the base height _SUP_MIN_POSITION = 2/3.0 # relative to the base height _SUBSUP_MIN_DISTANCE = 1/3.0 # relative to base's font size _SCRIPT_HORIZONTAL_SPACING = 0.02 # relative to base's fon...
{ "repo_name": "ahjulstad/mathdom-python3", "path": "mathml/pmathml/msubsup.py", "copies": "1", "size": "5221", "license": "mit", "hash": -6282027421280109000, "line_mean": 25.2361809045, "line_max": 72, "alpha_frac": 0.6646236353, "autogenerated": false, "ratio": 3.13950691521347, "config_test"...
from .element import * import warnings from . import opdict import re # --- FONT NAMES --- if 1: # experimental fonts... MI_FONT_REGULAR = ('Sans', 'Regular') MI_FONT_ITALIC = ('Sans', 'Italic') MO_FONT_REGULAR = ('Sans', 'Regular') MO_FONT_ITALIC = ('Sans', 'Italic') MN_FONT = ('Sans...
{ "repo_name": "ahjulstad/mathdom-python3", "path": "mathml/pmathml/mtoken.py", "copies": "1", "size": "11612", "license": "mit", "hash": 6181604826156087000, "line_mean": 32.2722063037, "line_max": 100, "alpha_frac": 0.6285738891, "autogenerated": false, "ratio": 2.9494538989077976, "config_tes...
from .element import * import warnings import sys class MFrac(Element): def __init__(self, plotter, children): assert len(children) == 2 Element.__init__(self, plotter) for child in children: self.addChild(child) def update(self): numerator, denominator = self.children for child in numerator, denomi...
{ "repo_name": "ahjulstad/mathdom-python3", "path": "mathml/pmathml/mfrac.py", "copies": "1", "size": "2124", "license": "mit", "hash": -6309812769335645000, "line_mean": 28.5, "line_max": 72, "alpha_frac": 0.6944444444, "autogenerated": false, "ratio": 3.267692307692308, "config_test": false, ...
from .element import SigTemplateElement from .include import HeaderInclude from .trace import trace header_const = 'ackward::core::ROProperty<$type> $property_name;' header_non_const = 'ackward::core::Property<$type> $property_name;' constructor_initializer = '$property_name(obj(), "$python_name")' class Property(S...
{ "repo_name": "abingham/ackward", "path": "site_scons/ackward/property.py", "copies": "1", "size": "1564", "license": "mit", "hash": 1867581201449180200, "line_mean": 29.6666666667, "line_max": 68, "alpha_frac": 0.5185421995, "autogenerated": false, "ratio": 4.405633802816902, "config_test": fa...
from .element import SigTemplateElement from .include import ImplInclude from .signature import parse from .trace import trace header_template = '$return_type $name($header_signature);' impl_template = ''' $return_type $name($impl_signature) { try { return boost::python::extract<$return_type>( module().at...
{ "repo_name": "abingham/ackward", "path": "site_scons/ackward/function.py", "copies": "1", "size": "1967", "license": "mit", "hash": -3538712916536792600, "line_mean": 26.3194444444, "line_max": 86, "alpha_frac": 0.5394001017, "autogenerated": false, "ratio": 4.211991434689508, "config_test": f...
from .element import SigTemplateElement from .include import ImplInclude from .signature import parse from .trace import trace header_template = '$virtual $return_type $method_name($header_signature) \ $const $virtual_tail;' impl_template = ''' $return_type $class_name::$method_name($impl_signature) $const { try...
{ "repo_name": "abingham/ackward", "path": "site_scons/ackward/method.py", "copies": "1", "size": "3096", "license": "mit", "hash": 7446504790850590000, "line_mean": 27.6666666667, "line_max": 76, "alpha_frac": 0.5439276486, "autogenerated": false, "ratio": 4.28808864265928, "config_test": false...
from .element import SigTemplateElement from .include import ImplInclude from .signature import parse from .trace import trace header_template = 'static $return_type $method_name($header_signature);' impl_template = ''' $return_type $class_name::$method_name($impl_signature) { try { return boost::python:...
{ "repo_name": "abingham/ackward", "path": "site_scons/ackward/class_method.py", "copies": "1", "size": "2328", "license": "mit", "hash": -5956212505656188000, "line_mean": 28.4683544304, "line_max": 77, "alpha_frac": 0.564862543, "autogenerated": false, "ratio": 4.303142329020333, "config_test"...
from .element import SigTemplateElement from .include import ImplInclude from .trace import trace header_template = '${class_name}($header_signature);' impl_template = ''' ${class_name}::${class_name}($impl_signature) try : core::Object ( ${class_name}::cls()($parameters) ) $constructor_initializers { } TRANS...
{ "repo_name": "abingham/ackward", "path": "site_scons/ackward/constructor.py", "copies": "1", "size": "1151", "license": "mit", "hash": -666414424887220700, "line_mean": 24.5777777778, "line_max": 65, "alpha_frac": 0.5299739357, "autogenerated": false, "ratio": 4.444015444015444, "config_test":...
from .element import TemplateElement from .include import HeaderInclude, ImplInclude from .trace import trace header_template = 'boost::python::object $module_function();' impl_template = ''' boost::python::object $module_function() { static boost::python::object mod; static bool initialized = false; if (!init...
{ "repo_name": "abingham/ackward", "path": "site_scons/ackward/module.py", "copies": "1", "size": "1439", "license": "mit", "hash": -7377831750051247000, "line_mean": 24.2631578947, "line_max": 69, "alpha_frac": 0.532314107, "autogenerated": false, "ratio": 4.496875, "config_test": false, "has...
from .element import TemplateElement from .include import HeaderInclude, ImplInclude from .trace import trace open_header_template = ''' class $class_name $bases { public: /** Construct a new $class_name from an existing Python object. */ $class_name(boost::python::object); ''' close_header_template = ''' u...
{ "repo_name": "abingham/ackward", "path": "site_scons/ackward/cls.py", "copies": "1", "size": "2945", "license": "mit", "hash": 2895468143932530000, "line_mean": 26.2685185185, "line_max": 79, "alpha_frac": 0.5334465195, "autogenerated": false, "ratio": 4.350073855243722, "config_test": false, ...
from .element import TemplateElement from .include import ImplInclude from .trace import trace header_template = '$type $module_property_name();' impl_template = ''' $type $module_property_name() { using namespace boost::python; try { object prop = $module_function().attr("$python_name"); ...
{ "repo_name": "abingham/ackward", "path": "site_scons/ackward/module_property.py", "copies": "1", "size": "1855", "license": "mit", "hash": -9213540906774480000, "line_mean": 28.4444444444, "line_max": 77, "alpha_frac": 0.5245283019, "autogenerated": false, "ratio": 4.51338199513382, "config_te...
from element import Vertex, Element class MeshIterator(object): def __init__(self, mesh): self.mesh = mesh self.cur_element_idx = 0 self.cur_element = mesh.elements[0] def next(self): self.cur_element_idx += 1 if self.cur_element_idx > self.mesh.n_elements: ...
{ "repo_name": "tbenthompson/codim1", "path": "codim1/core/mesh.py", "copies": "1", "size": "5173", "license": "mit", "hash": 5066317823433118000, "line_mean": 39.1007751938, "line_max": 76, "alpha_frac": 0.6147303306, "autogenerated": false, "ratio": 4.188663967611336, "config_test": false, "...
from .element import WMTS # Mapping between patterns to match specified as tuples and tuples containing attributions _ATTRIBUTIONS = { ('openstreetmap',) : ( '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' ), ('cartodb',) : ( '&copy; <a href="https:...
{ "repo_name": "ioam/geoviews", "path": "geoviews/tile_sources.py", "copies": "1", "size": "5333", "license": "bsd-3-clause", "hash": 1574883532088115200, "line_mean": 57.6043956044, "line_max": 163, "alpha_frac": 0.6555409713, "autogenerated": false, "ratio": 2.715376782077393, "config_test": f...
from Elements.G.Populators.Base.IElementPopulator import IElementPopulator class AllParametersListPopulator(IElementPopulator): def __init__(self, sectionName, templates, settingsObject): super(AllParametersListPopulator, self).__init__(sectionName, templates, settingsObject) self.separator = "\n|\n" def getTyp...
{ "repo_name": "afronski/grammar-generator", "path": "grammar-generator/Elements/G/Populators/AllParametersListPopulator.py", "copies": "1", "size": "1116", "license": "mit", "hash": -4775847040890074000, "line_mean": 31.8235294118, "line_max": 94, "alpha_frac": 0.7464157706, "autogenerated": false,...
from Elements.G.Populators.Base.IElementPopulator import IElementPopulator class AllParametersListWithOneNamePopulator(IElementPopulator): def __init__(self, sectionName, templates, settingsObject): super(AllParametersListWithOneNamePopulator, self).__init__(sectionName, templates, settingsObject) self.separator ...
{ "repo_name": "afronski/grammar-generator", "path": "grammar-generator/Elements/G/Populators/AllParametersListWithOneNamePopulator.py", "copies": "1", "size": "1335", "license": "mit", "hash": -4918204214633557000, "line_mean": 35.0810810811, "line_max": 101, "alpha_frac": 0.7617977528, "autogenera...
from Elements.G.Populators.Base.IElementPopulator import IElementPopulator class OneEntryForTemplateWithNamePopulator(IElementPopulator): def __init__(self, sectionName, templates, settingsObject): super(OneEntryForTemplateWithNamePopulator, self).__init__(sectionName, templates, settingsObject) self.mainName = s...
{ "repo_name": "afronski/grammar-generator", "path": "grammar-generator/Elements/G/Populators/OneEntryForTemplateWithNamePopulator.py", "copies": "1", "size": "1044", "license": "mit", "hash": -285890156860583230, "line_mean": 30.6666666667, "line_max": 100, "alpha_frac": 0.7605363985, "autogenerate...
from Elements.G.Populators.OnlyEntriesPopulator import OnlyEntriesPopulator from Elements.G.Populators.ParameterListPopulator import ParameterListPopulator from Elements.G.Populators.OnlyMainEntryPopulator import OnlyMainEntryPopulator from Elements.G.Populators.OnlyBooleanEntriesPopulator import OnlyBooleanEntriesPopu...
{ "repo_name": "afronski/grammar-generator", "path": "grammar-generator/Elements/G/Factories/ElementsPopulatorFactory.py", "copies": "1", "size": "2153", "license": "mit", "hash": -3959570813717054000, "line_mean": 66.3125, "line_max": 109, "alpha_frac": 0.8569437993, "autogenerated": false, "rati...
from Elements.G.Transformers.Base.ITransformer import ITransformer from Elements.G.Factories.ElementsPopulatorFactory import ElementsPopulatorFactory class ForEachModuleSectionTransformer(ITransformer): def __init__(self, sectionName, templates, modules): super(ForEachModuleSectionTransformer, self).__init__(sectio...
{ "repo_name": "afronski/grammar-generator", "path": "grammar-generator/Elements/G/Transformers/ForEachModuleSectionTransformer.py", "copies": "1", "size": "1340", "license": "mit", "hash": -5185401737067618000, "line_mean": 31.7073170732, "line_max": 88, "alpha_frac": 0.75, "autogenerated": false, ...
from Elements.G.Transformers.Base.ITransformer import ITransformer from Elements.G.Factories.ElementsPopulatorFactory import ElementsPopulatorFactory class ForEachModuleSectionTransformerWithComma(ITransformer): def __init__(self, sectionName, templates, modules): super(ForEachModuleSectionTransformerWithComma, sel...
{ "repo_name": "afronski/grammar-generator", "path": "grammar-generator/Elements/G/Transformers/ForEachModuleSectionTransformerWithComma.py", "copies": "1", "size": "1409", "license": "mit", "hash": -1722050583696044800, "line_mean": 31.0454545455, "line_max": 97, "alpha_frac": 0.7444996451, "autoge...
from Elements.G.Transformers.Base.ITransformer import ITransformer from Elements.G.Factories.ElementsPopulatorFactory import ElementsPopulatorFactory class ForEachModuleSectionTransformerWithPipe(ITransformer): def __init__(self, sectionName, templates, modules): super(ForEachModuleSectionTransformerWithPipe, self)...
{ "repo_name": "afronski/grammar-generator", "path": "grammar-generator/Elements/G/Transformers/ForEachModuleSectionTransformerWithPipe.py", "copies": "1", "size": "1408", "license": "mit", "hash": 7422640157168537000, "line_mean": 31.0227272727, "line_max": 96, "alpha_frac": 0.7436079545, "autogene...
from Elements.G.Transformers.ForEachModuleSectionTransformer import ForEachModuleSectionTransformer from Elements.G.Transformers.ForEachModuleSectionTransformerWithPipe import ForEachModuleSectionTransformerWithPipe from Elements.G.Transformers.ForEachModuleSectionTransformerWithComma import ForEachModuleSectionTransfo...
{ "repo_name": "afronski/grammar-generator", "path": "grammar-generator/Elements/G/Factories/SectionTransformerFactory.py", "copies": "1", "size": "1315", "license": "mit", "hash": -4959013075421778000, "line_mean": 58.8181818182, "line_max": 117, "alpha_frac": 0.8509505703, "autogenerated": false, ...
from elements import Element, IntegerElement, Attribute import sys import logging logging.basicConfig(level=logging.WARNING) xml_string = """ <message version="1.2"> <integer version="1.2">12</integer> </message> """ class MyInteger(IntegerElement): version = Attribute() class Message(Element): _tag = ...
{ "repo_name": "dbrattli/python-elements", "path": "tests/test_attributes.py", "copies": "1", "size": "1186", "license": "bsd-3-clause", "hash": 2165146117277220600, "line_mean": 20.9814814815, "line_max": 56, "alpha_frac": 0.5775716695, "autogenerated": false, "ratio": 3.457725947521866, "confi...
from elements import ELEMENTS import networkx as nx from collections import OrderedDict import openbabel import matplotlib.pyplot as plt class chem_graph(): def __init__(self, OBMol = None, graph = None, is_fragment = False, parent = None): G = None if OBMol: G = chem_graph.graph_from_OBMol(OBMol) ...
{ "repo_name": "benjiec/pychemy", "path": "pychemy/chem_structure.py", "copies": "2", "size": "6626", "license": "mit", "hash": -6137092496211298000, "line_mean": 28.1894273128, "line_max": 100, "alpha_frac": 0.5261092665, "autogenerated": false, "ratio": 3.3600405679513186, "config_test": false...
from elements import elements import numpy as np import time from MNIST.loader import MNIST import os network_path = os.path.dirname(os.path.realpath(__file__)) dir_path = "C:\\" mnist = MNIST(dir_path) img, label = mnist.load_training() imgbin = [[0 for i in range(784)] for j in range(len(img))] labelten = [[0 for i ...
{ "repo_name": "joel2411/neural_nets", "path": "demo_mnist.py", "copies": "1", "size": "1625", "license": "mit", "hash": -8090920637762267000, "line_mean": 28.0178571429, "line_max": 84, "alpha_frac": 0.6516923077, "autogenerated": false, "ratio": 2.6639344262295084, "config_test": false, "has...
from elements import elements import numpy as np import time eNN = elements() ninput = 2 noutput = 1 eNN.makelayers([ninput, 5, 3, noutput]) #makelayer eNN.setlearningrate(0.05) eNN.setRPropParam(dec=0.99, inc=1.01) eNN.updatemomentum(0.0001) eNN.setactivation('sigmoid') eNN.setDecay(0.95) x_in = [] y_in = [] start ...
{ "repo_name": "joel2411/neural_nets", "path": "demo.py", "copies": "1", "size": "1491", "license": "mit", "hash": 8755755487058151000, "line_mean": 24.7068965517, "line_max": 87, "alpha_frac": 0.6418511066, "autogenerated": false, "ratio": 2.4165316045380876, "config_test": false, "has_no_key...
from elements import Elements # Import ElementTree API. You can override it by setting the ET class member try: from xml.etree import cElementTree as ET except ImportError: try: import cElementTree as ET except ImportError: from elementtree import ET xml_string = """ <name> <middle>R</mi...
{ "repo_name": "dbrattli/python-elements", "path": "tests/test_ordering.py", "copies": "1", "size": "1093", "license": "bsd-3-clause", "hash": 5241789416740776000, "line_mean": 21.7916666667, "line_max": 76, "alpha_frac": 0.6010978957, "autogenerated": false, "ratio": 3.503205128205128, "config_...
from elements import Elements NS1 = "ns1" NS2 = "ns2" xml_string = """ <message xmlns="ns1"> <datastore1 xmlns="ns2"> <name>Contacts</name> <id>c085403c-eb41-11dc-a5cd-0017f2c50bd8</id> </datastore1> <datastore2 xmlns="ns2"> <name>Calendar</name> <id>c8175380-eb41-11dc-a5cd-0017f2c50bd8</id> ...
{ "repo_name": "dbrattli/python-elements", "path": "tests/test_dictionaries.py", "copies": "1", "size": "1854", "license": "bsd-3-clause", "hash": 4012398114721427500, "line_mean": 24.7638888889, "line_max": 90, "alpha_frac": 0.6089536138, "autogenerated": false, "ratio": 2.9711538461538463, "co...
from elements import Element, TextElement, TextAttribute, DateTimeElement ATOM_NAMESPACE = 'http://www.w3.org/2005/Atom' APP_NAMESPACE = 'http://www.w3.org/2007/app' class Link(Element): """The atom:link element""" _tag = 'link' _namespace = ATOM_NAMESPACE rel = TextAttribute() href = TextAt...
{ "repo_name": "dbrattli/python-elements", "path": "elements/formats/atom.py", "copies": "1", "size": "4169", "license": "bsd-3-clause", "hash": -2871461286900311600, "line_mean": 22.4269662921, "line_max": 80, "alpha_frac": 0.5929479491, "autogenerated": false, "ratio": 4.198388721047332, "conf...
from .elements.translate import toArrayOfSizes, toBoolean from .message import catch, ERROR, WARNING, OK from .rect import Rect import os import sys import ctypes import time as ti import pkg_resources LIB_PATH = pkg_resources.resource_filename('antlia', 'lib/') os.environ["PYSDL2_DLL_PATH"] = LIB_PATH try: import s...
{ "repo_name": "Romaingin/Antlia", "path": "antlia/renderer.py", "copies": "1", "size": "4428", "license": "mit", "hash": -2058938987924190500, "line_mean": 24.0169491525, "line_max": 68, "alpha_frac": 0.7091237579, "autogenerated": false, "ratio": 2.905511811023622, "config_test": false, "has...
from elementtree.ElementTree import Element from galaxy import web from galaxy.tools.parameters import DataToolParameter, DummyDataset, RuntimeValue, check_param, visit_input_values from galaxy.tools import DefaultToolState from galaxy.tools.parameters.grouping import Repeat, Conditional from galaxy.util.bunch import ...
{ "repo_name": "dbcls/dbcls-galaxy", "path": "lib/galaxy/workflow/modules.py", "copies": "2", "size": "11295", "license": "mit", "hash": 4681284741116176000, "line_mean": 37.8144329897, "line_max": 129, "alpha_frac": 0.5873395308, "autogenerated": false, "ratio": 4.191094619666048, "config_test"...
from elementtree import ElementTree as et import os ROOT_PATH = '' def get_js_files(): """Returns a list of all the javascript files listed in media/js_includes.xml""" files = [] path = os.path.dirname(os.path.abspath(__file__)) tree = et.parse(path+'/../../media/js_includes.xml') for f in tr...
{ "repo_name": "google-code-export/marinemap", "path": "lingcod/common/assets.py", "copies": "3", "size": "1089", "license": "bsd-3-clause", "hash": 6992519585624153000, "line_mean": 31.0294117647, "line_max": 65, "alpha_frac": 0.6134067952, "autogenerated": false, "ratio": 3.5016077170418005, "...
#from elementtree import ElementTree import xml.etree.ElementTree as ET # We only need to import this module import os.path import sys import glob def xml_files(path): filelist = glob.glob("/home/ankitshah/Downloads/nels/NELS_annotations/*.xml") count = len(filelist) print count i = 0; l = [] w...
{ "repo_name": "ankitshah009/Python_code_writtten_by_me", "path": "xml_parser_to_parse_using_python.py", "copies": "1", "size": "1203", "license": "apache-2.0", "hash": 6597895103883956000, "line_mean": 26.3409090909, "line_max": 81, "alpha_frac": 0.5644222776, "autogenerated": false, "ratio": 3.5...
from elenco import ControllerElenco from ator import ControllerAtor ##from filme import ControllerFilme def AdicionarAtor(): cod_elenco = int(input("Código: ")) cod_ator = int(input("Código Ator: ")) r = ControllerAtor.BuscarAtor(cod_ator) if (r == None): print ("Ator não existe") retur...
{ "repo_name": "ygorclima/apd", "path": "Elenco/Elenco.py", "copies": "1", "size": "1157", "license": "apache-2.0", "hash": -3950194460531992000, "line_mean": 27.7, "line_max": 70, "alpha_frac": 0.6803135889, "autogenerated": false, "ratio": 2.6574074074074074, "config_test": false, "has_no_ke...
from elephantblog.models import Entry from feincms.module.page.models import Page from feincms.content.application.models import ApplicationContent from feincms.content.medialibrary.v2 import MediaFileContent from feincms.content.raw.models import RawContent from feincms.content.video.models import VideoContent from fo...
{ "repo_name": "richardbolt/django-photographer", "path": "photographer/models.py", "copies": "2", "size": "2244", "license": "bsd-3-clause", "hash": 5631499090279758000, "line_mean": 28.9333333333, "line_max": 80, "alpha_frac": 0.6515151515, "autogenerated": false, "ratio": 3.625201938610662, "...
from elephas.ml.params import * def test_has_keras_model_config(): param = HasKerasModelConfig() conf = {"foo": "bar"} param.set_keras_model_config(conf) assert conf == param.get_keras_model_config() def test_has_optimizer_config(): param = HasKerasOptimizerConfig() conf = {"foo": "bar"} ...
{ "repo_name": "maxpumperla/elephas", "path": "tests/ml/test_params.py", "copies": "1", "size": "2171", "license": "mit", "hash": -2438966117943133000, "line_mean": 23.9540229885, "line_max": 55, "alpha_frac": 0.6596038692, "autogenerated": false, "ratio": 3.490353697749196, "config_test": true,...
from elephunk.database import Row class Bloat(Row): @property def table_id(self): return (self.schemaname, self.tablename) @property def full_table_name(self): return "%s.%s" % self.table_id @staticmethod def sql(): return """ SELECT schemaname, tablename, reltu...
{ "repo_name": "pitluga/elephunk", "path": "elephunk/records/bloat.py", "copies": "1", "size": "2664", "license": "mit", "hash": 2907124185914613000, "line_mean": 36.5211267606, "line_max": 159, "alpha_frac": 0.6482732733, "autogenerated": false, "ratio": 2.953436807095344, "config_test": false,...
from ElevatorConstants import * from direct.directnotify import DirectNotifyGlobal from direct.distributed import DistributedObjectAI from direct.distributed.ClockDelta import * from direct.fsm.FSM import FSM from direct.task import Task from otp.ai.AIBase import * from toontown.toonbase import ToontownGlobals class ...
{ "repo_name": "ToonTownInfiniteRepo/ToontownInfinite", "path": "toontown/building/DistributedElevatorFSMAI.py", "copies": "1", "size": "8637", "license": "mit", "hash": -5366735867468371000, "line_mean": 29.411971831, "line_max": 102, "alpha_frac": 0.5893249971, "autogenerated": false, "ratio": 3...
from ELF import ELF32_Ehdr, ELF32_Shdr, ELF32_Phdr, ELF32_Sym from enums import EI_CLASS, EI_DATA, e_machine, p_type class ELF32: def __init__(self, fname: str): self.fname = fname self.file = open(self.fname, 'rb') self.hdr = ELF32_Ehdr(self.file) ident = self.hdr.e_ident...
{ "repo_name": "ForceBru/PyVM", "path": "VM/ELF/analyze.py", "copies": "1", "size": "5529", "license": "mit", "hash": 5086951219290565000, "line_mean": 31.1453488372, "line_max": 138, "alpha_frac": 0.5154639175, "autogenerated": false, "ratio": 3.4150710315009265, "config_test": false, "has_no...
from .elf import ELF from ..patched_stream import PatchedStream ELF_HEADER = "7f45 4c46 0101 0100 0000 0000 0000 0000".replace(" ","").decode('hex') CGC_HEADER = "7f43 4743 0101 0143 014d 6572 696e 6f00".replace(" ","").decode('hex') class CGC(ELF): """ Backend to support the CGC elf format used by the Cyber...
{ "repo_name": "chubbymaggie/cle", "path": "cle/backends/cgc.py", "copies": "1", "size": "1177", "license": "bsd-2-clause", "hash": 3862342342995227600, "line_mean": 35.78125, "line_max": 94, "alpha_frac": 0.6193712829, "autogenerated": false, "ratio": 3.2969187675070026, "config_test": false, ...
from ELF import * class ELFDumper: def __init__(self, elf_file): self.elf = elf_file def _dump_rela_entry(self, rel, prefix="\t\t\t"): rel_sect = rel.section sect_txt = "%s (%d) + %d" % (rel_sect.name_str, rel_sect.idx, rel.section_addend) rel_symbol = rel.symbol if rel_symbol is not None: ...
{ "repo_name": "alpine9000/amiga_examples", "path": "tools/external/amitools/amitools/binfmt/elf/ELFDumper.py", "copies": "1", "size": "3652", "license": "bsd-2-clause", "hash": -4868627004997531000, "line_mean": 31.0350877193, "line_max": 112, "alpha_frac": 0.5662650602, "autogenerated": false, "...
from .ELF_structs import ELF32_Ehdr, ELF32_Shdr, ELF32_Phdr, ELF32_Sym from .ELF_enums import EI_CLASS, EI_DATA, e_machine, e_type, p_type __all__ = 'ELF32', class ELF32: def __init__(self, fname: str): self.fname = fname self.file = open(self.fname, 'rb') self.hdr = ELF32_Ehdr(self.file...
{ "repo_name": "ForceBru/PyVM", "path": "VM/ELF/ELF_impl.py", "copies": "1", "size": "1363", "license": "mit", "hash": 3343447074868402000, "line_mean": 32.243902439, "line_max": 138, "alpha_frac": 0.5707997065, "autogenerated": false, "ratio": 3.0492170022371363, "config_test": false, "has_no...
from elftools.dwarf.ranges import RangeEntry, BaseAddressEntry from elftools.dwarf import constants def get_die_offset_by_reference(referer_die, attrname, use_abstract_origin=True): '''Return the offset of the DIE referred by the given attribute in the referrer DIE.''' ref = referer_die.attributes.get(attrname...
{ "repo_name": "Samsung/ADBI", "path": "idk/cachebuilder/dwarftools.py", "copies": "1", "size": "6162", "license": "apache-2.0", "hash": -2517238408976809000, "line_mean": 38.5, "line_max": 113, "alpha_frac": 0.6170074651, "autogenerated": false, "ratio": 3.8754716981132074, "config_test": false...
from elftools.elf.elffile import ELFFile from elftools.common.py3compat import iteritems from disasm_demangler import demangle # Get all top-level members of a given DIE def get_members(die): global die_list members = [] for child in die.iter_children(): if child.tag == 'DW_TAG_member': ...
{ "repo_name": "mongodb-labs/disasm", "path": "app/symbol_lookup.py", "copies": "1", "size": "3735", "license": "apache-2.0", "hash": 2838080856886492700, "line_mean": 35.2621359223, "line_max": 100, "alpha_frac": 0.6535475234, "autogenerated": false, "ratio": 3.6474609375, "config_test": false,...
from elftools.elf.elffile import ELFFile from elftools.elf.enums import * from elftools.elf.constants import * from elftools.elf.sections import SymbolTableSection import logging from .base_executable import * from .section import * INJECTION_SIZE = 0x1000 class ELFExecutable(BaseExecutable): def __init__(self, ...
{ "repo_name": "isislab/dispatch", "path": "dispatch/formats/elf_executable.py", "copies": "1", "size": "14682", "license": "mit", "hash": 5898869752373521000, "line_mean": 47.4554455446, "line_max": 147, "alpha_frac": 0.573831903, "autogenerated": false, "ratio": 4.11030235162374, "config_test"...
from elftools.elf.enums import ENUM_ST_INFO_TYPE from ..symbol import Symbol, SymbolType from ...address_translator import AT from .symbol_type import ELFSymbolType def maybedecode(string): return string if type(string) is str else string.decode() class ELFSymbol(Symbol): """ Represents a symbol for th...
{ "repo_name": "angr/cle", "path": "cle/backends/elf/symbol.py", "copies": "1", "size": "2387", "license": "bsd-2-clause", "hash": -2977057014664739300, "line_mean": 37.5, "line_max": 116, "alpha_frac": 0.5894428152, "autogenerated": false, "ratio": 3.6166666666666667, "config_test": false, "h...
from elftools.elf.sections import SymbolTableSection from common.enums import InsnKinds class InsnSet: def __init__(self, debug_info): def get_kind(sym): if sym.name.startswith(('$x', '__dl_$x')): return InsnKinds.arm64 elif sym.name.startswith(('$a', '__dl...
{ "repo_name": "Samsung/ADBI", "path": "idk/cachebuilder/insnset.py", "copies": "1", "size": "1804", "license": "apache-2.0", "hash": 6854451793327698000, "line_mean": 33.7115384615, "line_max": 98, "alpha_frac": 0.4772727273, "autogenerated": false, "ratio": 4.476426799007444, "config_test": fa...
from elifetools.utils import first, firstnn, extract_nodes, node_contents_str """ rawParser.py extracts and returns the nodes from the article xml using BeautifulSoup so that functionality at higher levels may use and combine them as neccessary. """ def article_meta(soup): return first(extract_nodes(soup, "arti...
{ "repo_name": "elifesciences/elife-tools", "path": "elifetools/rawJATS.py", "copies": "1", "size": "13500", "license": "mit", "hash": 6586346091562869000, "line_mean": 21.1674876847, "line_max": 163, "alpha_frac": 0.6633333333, "autogenerated": false, "ratio": 3.3632286995515694, "config_test":...
from eliot import ActionType, Field, fields _SEARCH_CLASS = Field( u'searchClass', lambda c: c.value, u'The search class') LOG_LOOKUP_GET = ActionType( u'fusion_index:lookup:get', fields(environment=unicode, indexType=unicode, key=unicode), [Field.for_types('value', [bytes, None], u'Value i...
{ "repo_name": "fusionapp/fusion-index", "path": "src/fusion_index/logging.py", "copies": "1", "size": "1545", "license": "mit", "hash": -3259583951781744000, "line_mean": 26.5892857143, "line_max": 77, "alpha_frac": 0.6737864078, "autogenerated": false, "ratio": 3.418141592920354, "config_test"...
from elixir import (Entity, OneToMany, Field, Unicode, Integer, Enum, Float) from draughtcraft.model.deepcopy import ShallowCopyMixin class InvalidStatistic(Exception): pass class Style(Entity, ShallowCopyMixin): TYPES = [ 'LAGER', 'ALE', 'MEAD', 'CIDER' ] uid = Fie...
{ "repo_name": "ryanpetrello/draughtcraft", "path": "draughtcraft/model/styles.py", "copies": "1", "size": "2702", "license": "bsd-3-clause", "hash": 5875494434459132000, "line_mean": 24.4905660377, "line_max": 76, "alpha_frac": 0.5355292376, "autogenerated": false, "ratio": 3.6562922868741543, ...
from elixir import Field, Unicode, Entity, ManyToOne, Boolean, Text, Integer from elixir.events import after_insert, before_insert, after_update import json from astral.models import session, Node from astral.models.ticket import TUNNEL_QUEUE from astral.models.base import BaseEntityMixin, slugify from astral.models.e...
{ "repo_name": "peplin/astral", "path": "astral/models/stream.py", "copies": "1", "size": "2293", "license": "mit", "hash": 4965941550254715000, "line_mean": 32.7205882353, "line_max": 81, "alpha_frac": 0.6122982992, "autogenerated": false, "ratio": 3.9263698630136985, "config_test": false, "h...
from elixir import (Field, Unicode, Integer, Entity, Boolean, using_table_options, ManyToOne) from elixir.events import after_insert from sqlalchemy import UniqueConstraint import uuid import json from astral.exceptions import RequestError from astral.models.base import BaseEntityMixin from astral.models.event...
{ "repo_name": "peplin/astral", "path": "astral/models/node.py", "copies": "1", "size": "5258", "license": "mit", "hash": 4634709867985423000, "line_mean": 34.527027027, "line_max": 79, "alpha_frac": 0.5998478509, "autogenerated": false, "ratio": 3.8156748911465894, "config_test": false, "has_...
from elixir import ManyToOne, Entity, Boolean, Field, DateTime, Integer from elixir.events import after_insert, before_insert, after_update import json import datetime import Queue from astral.conf import settings from astral.models.base import BaseEntityMixin from astral.models.event import Event from astral.models.n...
{ "repo_name": "peplin/astral", "path": "astral/models/ticket.py", "copies": "1", "size": "3368", "license": "mit", "hash": 4083380635182570000, "line_mean": 37.7126436782, "line_max": 80, "alpha_frac": 0.645783848, "autogenerated": false, "ratio": 3.9670200235571262, "config_test": false, "ha...
from elixir import metadata, Entity, Field from elixir import Unicode, UnicodeText, Integer from elixir import setup_all, session from sqlalchemy import create_engine, pool from config import * metadata.bind = create_engine( TEST_MYSQL_STR, pool_recycle=3600, pool_size=50, poolclass=pool.SingletonThreadPool) metad...
{ "repo_name": "peggygao1988/LemonPy", "path": "model/model.py", "copies": "1", "size": "1151", "license": "apache-2.0", "hash": -6647512317931583000, "line_mean": 27.0731707317, "line_max": 106, "alpha_frac": 0.6715899218, "autogenerated": false, "ratio": 3.737012987012987, "config_test": false...
from elixir import ( Entity, Field, Integer, Float, Unicode, UnicodeText, Boolean, Enum, using_options, OneToMany ) from draughtcraft.model.deepcopy import ShallowCopyMixin from draughtcraft.lib.units import UNITS ORIGINS = [ 'AUSTRALIAN', 'BELGIAN', 'CANADIAN', 'CZECH', 'FRENCH', '...
{ "repo_name": "ryanpetrello/draughtcraft", "path": "draughtcraft/model/ingredients.py", "copies": "1", "size": "3959", "license": "bsd-3-clause", "hash": 6304967746509557000, "line_mean": 20.9944444444, "line_max": 72, "alpha_frac": 0.5589795403, "autogenerated": false, "ratio": 3.612226277372262...
from elixir import * from elixir.compat import u from elixir.ext.perform_ddl import perform_ddl, preload_data def setup(): metadata.bind = "sqlite://" class TestPerformDDL(object): def teardown(self): cleanup_all(True) def test_one(self): class Movie(Entity): title = Field(U...
{ "repo_name": "gjhiggins/elixir", "path": "tests/test_perform_ddl.py", "copies": "1", "size": "1739", "license": "mit", "hash": 7568773019331619000, "line_mean": 28.9827586207, "line_max": 75, "alpha_frac": 0.5135135135, "autogenerated": false, "ratio": 4.006912442396313, "config_test": false, ...
from elixir import * from elixir.events import * from sqlalchemy import Table, Column class TestEvents(object): def teardown(self): cleanup_all(True) def test_events(self): # initialize counters stateDict = { 'reconstructor_called': 0, 'before_insert_called': ...
{ "repo_name": "gjhiggins/elixir", "path": "tests/test_events.py", "copies": "2", "size": "4173", "license": "mit", "hash": 3038267246786781700, "line_mean": 27.7793103448, "line_max": 69, "alpha_frac": 0.524323029, "autogenerated": false, "ratio": 4.328838174273859, "config_test": false, "has...
from elixir import * from elixir.ext.encrypted import acts_as_encrypted def setup(): global Person, Pet class Person(Entity): name = Field(String(50)) password = Field(String(40)) ssn = Field(String(40)) pets = OneToMany('Pet') acts_as_encrypted(for_fields=['password',...
{ "repo_name": "pylover/elixir", "path": "tests/test_encryption.py", "copies": "1", "size": "2530", "license": "mit", "hash": 1172678587673258000, "line_mean": 24.3, "line_max": 79, "alpha_frac": 0.5505928854, "autogenerated": false, "ratio": 3.2435897435897436, "config_test": false, "has_no_k...
from elixir import * from elixir.ext.perform_ddl import perform_ddl, preload_data def setup(): metadata.bind = "sqlite://" class TestPerformDDL(object): def teardown(self): cleanup_all(True) def test_one(self): class Movie(Entity): title = Field(Unicode(30), primary_key=True...
{ "repo_name": "pylover/elixir", "path": "tests/test_perform_ddl.py", "copies": "1", "size": "1703", "license": "mit", "hash": 1335280140503443700, "line_mean": 28.8771929825, "line_max": 75, "alpha_frac": 0.5108631826, "autogenerated": false, "ratio": 4.0165094339622645, "config_test": false, ...
from elixir import * import os dbfile="regioni.sql" class Regione(Entity): """ A task for your TODO list. """ using_table_options(useexisting=True) using_options(tablename='regione') nome = Field(Unicode,required=True) id = Field(Integer, colname="id", primary_key=True) def __r...
{ "repo_name": "arpho/mmasgis5", "path": "mmasgis/entities.py", "copies": "1", "size": "1916", "license": "mit", "hash": 4623734732109299000, "line_mean": 21.5411764706, "line_max": 66, "alpha_frac": 0.632045929, "autogenerated": false, "ratio": 3.1154471544715445, "config_test": false, "has_n...
from elixir.statements import Statement from elixir import Entity, has_field, using_options, Integer, Unicode from sqlalchemy import and_ import types class Tag(Entity): has_field('target_id', Integer) has_field('target_table', Unicode) has_field('tagname', Unicode) using_options(tablename='tags') cl...
{ "repo_name": "gjhiggins/elixir", "path": "elixir/ext/taggable.py", "copies": "1", "size": "2136", "license": "mit", "hash": 8813628334617399000, "line_mean": 34.0327868852, "line_max": 77, "alpha_frac": 0.5987827715, "autogenerated": false, "ratio": 3.714782608695652, "config_test": false, "...
from elixir.statements import Statement from sqlalchemy.orm import MapperExtension import types def proxy_to_instance(name): def new_func(self, mapper, connection, instance): if hasattr(instance, name): getattr(instance, name)() return new_func def mapper_extension_statement(name): d...
{ "repo_name": "gjhiggins/elixir", "path": "examples/callbacks.py", "copies": "1", "size": "2925", "license": "mit", "hash": 8658057883948147000, "line_mean": 33.011627907, "line_max": 75, "alpha_frac": 0.6458119658, "autogenerated": false, "ratio": 4.001367989056088, "config_test": true, "has...
from elixir.statements import Statement from sqlalchemy.orm import MapperExtension import types class MapperExtensionProxy(MapperExtension): def after_delete(self, mapper, connection, instance): if hasattr(instance, '__after_delete__'): instance.__after_delete__() def after_insert(self,...
{ "repo_name": "gjhiggins/elixir", "path": "examples/elixir_statements.py", "copies": "1", "size": "2738", "license": "mit", "hash": -344571407906434240, "line_mean": 31.2117647059, "line_max": 77, "alpha_frac": 0.6764061359, "autogenerated": false, "ratio": 4.161094224924012, "config_test": fal...
from elizabeth import Datetime, Personal, Text from hashlib import pbkdf2_hmac import binascii import csv import io import random class FakeEmail(object): def __init__(self): self.num_attachments = random.randint(0, 20) def attachments(self): for x in range(0, self.num_attachments): ...
{ "repo_name": "wikkiewikkie/free-discovery", "path": "freediscovery/utils.py", "copies": "1", "size": "2867", "license": "mit", "hash": 4932520811572964000, "line_mean": 27.1078431373, "line_max": 110, "alpha_frac": 0.5493547262, "autogenerated": false, "ratio": 4.119252873563219, "config_test"...
from ella.api import object_serializer, response_serializer, FULL from ella.api.conf import api_settings from ella.core.models import Category, Publishable, Listing, Author, Source from ella.photos.models import FormatedPhoto, Photo from ella.core.conf import core_settings from django.core.paginator import Page, Pagin...
{ "repo_name": "hamsavardhini09/AWSLearning", "path": "ella/api/serializers.py", "copies": "2", "size": "4071", "license": "bsd-3-clause", "hash": 7758272114617301000, "line_mean": 35.3482142857, "line_max": 143, "alpha_frac": 0.7177597642, "autogenerated": false, "ratio": 3.7009090909090907, "c...
from ella.core.signals import content_published, content_unpublished from ella.core.models import Publishable, Listing from ella.utils import timezone def regenerate_publish_signals(now=None): if now is None: now = timezone.now() qset = Publishable.objects.filter(publish_from__lt=now, published=True)...
{ "repo_name": "petrlosa/ella", "path": "ella/core/management/__init__.py", "copies": "4", "size": "1380", "license": "bsd-3-clause", "hash": 2307704747840128000, "line_mean": 35.3157894737, "line_max": 120, "alpha_frac": 0.7144927536, "autogenerated": false, "ratio": 3.424317617866005, "config_...
from ella.utils.settings import Settings from ella.utils.timezone import utc_localize from django.utils.datetime_safe import datetime gettext = lambda s: s # Caching-related CACHE_TIMEOUT = 10 * 60 CACHE_TIMEOUT_LONG = 60 * 60 DOUBLE_RENDER = False DOUBLE_RENDER_EXCLUDE_URLS = None APP_DATA_CLASSES = {} # Box BOX_...
{ "repo_name": "hamsavardhini09/AWSLearning", "path": "ella/core/conf.py", "copies": "4", "size": "1447", "license": "bsd-3-clause", "hash": -8051485238561083000, "line_mean": 21.9682539683, "line_max": 63, "alpha_frac": 0.7180373186, "autogenerated": false, "ratio": 2.977366255144033, "config_t...
from ellison import validators from copy import copy from pymongo.son_manipulator import SONManipulator import logging import inspect, functools log = logging.getLogger('ellison') global _classes_registry _classes_registry = {} __all__ = ['ClassInjectorManipulator','Document','Builder','query','Repository','UnitOfWo...
{ "repo_name": "theorm/ellison", "path": "ellison/base.py", "copies": "1", "size": "16159", "license": "apache-2.0", "hash": 2151614531025238500, "line_mean": 35.5588235294, "line_max": 136, "alpha_frac": 0.5425459496, "autogenerated": false, "ratio": 4.382695958774071, "config_test": false, "...
from elma.constants import END_OF_DATA_MARKER from elma.constants import END_OF_FILE_MARKER from elma.constants import END_OF_REPLAY_FILE_MARKER from elma.constants import TOP10_MULTIPLAYER from elma.constants import TOP10_SINGLEPLAYER from elma.models import Frame from elma.models import GroundTouchEvent from elma.mod...
{ "repo_name": "sigvef/elma", "path": "elma/packing.py", "copies": "1", "size": "14130", "license": "mit", "hash": 2724360235868132000, "line_mean": 36.68, "line_max": 77, "alpha_frac": 0.5523000708, "autogenerated": false, "ratio": 3.604591836734694, "config_test": false, "has_no_keywords": f...
from elma.lgr import LGR_Image from elma.constants import LGR_MANDATORY_FILES from elma.constants import LGR_LIMITED_SIZE_FILES import io LGR_PCX_MIN = 10 # unused as practically never important LGR_PCX_MAX = 3500 # unused as practically never important LGR_PCX_FILESIZE_MIN = 1 # unused as practically never i...
{ "repo_name": "sigvef/elma", "path": "elma/error.py", "copies": "1", "size": "14862", "license": "mit", "hash": -4147672726667051500, "line_mean": 40.5139664804, "line_max": 79, "alpha_frac": 0.4331853048, "autogenerated": false, "ratio": 4.042981501632209, "config_test": false, "has_no_keywo...
from elma.lgr import LGR from elma.lgr import LGR_Image from elma.lgr import pack_LGR from elma.lgr import unpack_LGR import elma.error from elma.error import check_LGR_error from elma.constants import LGR_DEFAULT_PALETTE import unittest from PIL import Image from PIL import ImageDraw import os import shutil class Te...
{ "repo_name": "sigvef/elma", "path": "tests/test_lgr.py", "copies": "1", "size": "19701", "license": "mit", "hash": 1966862475949458400, "line_mean": 42.2039473684, "line_max": 78, "alpha_frac": 0.578955383, "autogenerated": false, "ratio": 3.146621945376138, "config_test": true, "has_no_keyw...
from elma.models import Point, Polygon import unittest from math import pi class TestPolygon(unittest.TestCase): def test_move_by(self): poly1 = Polygon([Point(1, 2), Point(1, 3), Point(2, 2)]) poly2 = Polygon([Point(0, 0), Point(0, 1), Point(1, 0)]) poly2.move_by(1, 2) for p1, p2...
{ "repo_name": "sigvef/elma", "path": "tests/test_polygon.py", "copies": "1", "size": "1852", "license": "mit", "hash": 3881568367602877000, "line_mean": 36.7959183673, "line_max": 76, "alpha_frac": 0.5647948164, "autogenerated": false, "ratio": 2.944356120826709, "config_test": true, "has_no_...
from elmbonsai import * from gamebonsai import * import pygame, time, sys, math, random import operator def simple_button(x, y, width, height, click=False): def _hover_(x, y, width, height, (px, py)): return 0 <= px - x < width and 0 <= py - y < height hover = lift(_hover_, x, y, width, height, mouse_p...
{ "repo_name": "cheery/elm-bonsai", "path": "main.py", "copies": "1", "size": "3009", "license": "bsd-3-clause", "hash": -8411279168990222000, "line_mean": 33.988372093, "line_max": 82, "alpha_frac": 0.5769358591, "autogenerated": false, "ratio": 3.284934497816594, "config_test": false, "has_n...
from elmbonsai import * import pygame def key_input(keycode): def _key_intro_(reaction): return pygame.key.get_pressed()[keycode] def _key_input_(cell, event): if (event.type == pygame.KEYDOWN and event.key == keycode): cell.value = True return True i...
{ "repo_name": "cheery/elm-bonsai", "path": "gamebonsai.py", "copies": "1", "size": "4124", "license": "bsd-3-clause", "hash": -6665915409508186000, "line_mean": 27.4413793103, "line_max": 73, "alpha_frac": 0.5601357905, "autogenerated": false, "ratio": 3.879586077140169, "config_test": false, ...
from ELMCommands import ELMCommands from OBDParameters import OBDParameters class ELMDevice: def __init__(self, adapter): self.adapter = adapter self.pidflags = '' def __configure(self): self.__getRaw(ELMCommands.HardReset) self.__getRaw(ELMCommands.EnableAdaptiveTiming) self.__getRaw(ELMCommands.Disable...
{ "repo_name": "Max-Might/Elmo-Scan", "path": "ELMDevice.py", "copies": "1", "size": "4200", "license": "mit", "hash": 112217775023225580, "line_mean": 24, "line_max": 106, "alpha_frac": 0.6604761905, "autogenerated": false, "ratio": 3, "config_test": false, "has_no_keywords": false, "few_as...
from elm_doc import elm_codeshift def test_elm_codeshift_strips_ports_from_single_line_port_module_declaration(): source = 'port module Main exposing (main)' actual = elm_codeshift.strip_ports_from_string(source) expected = 'module Main exposing (main)' assert actual == expected def test_elm_codeshi...
{ "repo_name": "ento/elm-doc", "path": "tests/test_elm_codeshift.py", "copies": "1", "size": "2273", "license": "bsd-3-clause", "hash": 530197836681485400, "line_mean": 18.2627118644, "line_max": 81, "alpha_frac": 0.6401231852, "autogenerated": false, "ratio": 3.2104519774011298, "config_test": ...
from elm import * import numpy as np from utils import * def elmclassifier(): train_in, train_tar, val_in, val_tar = load_data() ELMClas = ELMClassifier() ELMClas.fit(train_in, train_tar) accuracy = ELMClas.score(val_in, val_tar) print 'elm unit accuracy', accuracy def elmclass_list(size): t...
{ "repo_name": "Takonan/csc411_a3", "path": "basicELM.py", "copies": "1", "size": "1663", "license": "bsd-3-clause", "hash": -3808788044382928000, "line_mean": 33.6458333333, "line_max": 76, "alpha_frac": 0.6151533373, "autogenerated": false, "ratio": 3.0018050541516246, "config_test": false, ...
from EloClass import Elo import time accuracy = 0 class Prediction: def __init__(self): self.predictedGames = {} self.correct = 0 self.wrong = 0 # we add the week as an error check for missing games def addPrediction(self, team1, team2, week, winningTeam): if(team1 < team2): firstTeam = team1 secon...
{ "repo_name": "bfish510/FootballEloTest", "path": "hockeyElo.py", "copies": "1", "size": "1973", "license": "mit", "hash": 6733486420628006000, "line_mean": 27.2, "line_max": 86, "alpha_frac": 0.7034972124, "autogenerated": false, "ratio": 2.9403874813710877, "config_test": false, "has_no_key...
from elo_game import GetGame from season import Season from standings import Standings class SimulationError(Exception): pass class SeasonSimulator: """ """ def __init__(self, season: Season, standings: Standings): self.season = season self.standings = standings @classmethod ...
{ "repo_name": "lbianch/nfl_elo", "path": "season_simulator.py", "copies": "1", "size": "1978", "license": "mit", "hash": -3017945424039404000, "line_mean": 27.6666666667, "line_max": 106, "alpha_frac": 0.5813953488, "autogenerated": false, "ratio": 3.739130434782609, "config_test": false, "ha...
from eloqua import settings from eloqua.exceptions import ObjectNotFound import requests import base64 import json class EloquaBaseClient(object): headers = '' base_url = settings.BASE_URL def __init__(self): key = '{site}\\{username}:{password}'.format(site=settings.SITE, username=settings.USERN...
{ "repo_name": "svdgraaf/django-eloqua", "path": "eloqua/clients.py", "copies": "1", "size": "5776", "license": "mit", "hash": 8225699976179272000, "line_mean": 28.9274611399, "line_max": 190, "alpha_frac": 0.5770429363, "autogenerated": false, "ratio": 3.9185888738127543, "config_test": false, ...
from elphie.sxml import Xml import lxml.etree as et import subprocess class RendererSVG: def __init__(self): self.xml = None def begin(self, width, height): self.width = width self.height = height self.xml = Xml() self.xml.element("svg") self.xml.set("xmlns",...
{ "repo_name": "spirali/elphie", "path": "elphie/svg.py", "copies": "1", "size": "5770", "license": "bsd-2-clause", "hash": -6597256680206035000, "line_mean": 28.4387755102, "line_max": 75, "alpha_frac": 0.5162911612, "autogenerated": false, "ratio": 3.658845909955612, "config_test": false, "h...
from em2.protocol.auth import Authenticator from em2.protocol.push import Pusher from tests.fixture_classes import DNSMockedPusher async def test_setup_check_pass(settings, loop, setup_check_server): settings.EXTERNAL_DOMAIN = f'127.0.0.1:{setup_check_server.port}' pusher = DNSMockedPusher(settings, loop=loop...
{ "repo_name": "em-2/em2", "path": "tests/protocol/push/test_check.py", "copies": "1", "size": "1452", "license": "mit", "hash": 6091623283053826000, "line_mean": 32.7674418605, "line_max": 76, "alpha_frac": 0.6962809917, "autogenerated": false, "ratio": 3.550122249388753, "config_test": false, ...
from em2.protocol.auth import Authenticator from .dns_resolver import TIMESTAMP, MockDNSResolver, get_public_key class SimpleAuthenticator(Authenticator): def __init__(self, settings, **kwargs): super().__init__(settings, **kwargs) self.key_added = False self.public_key_value = get_public...
{ "repo_name": "em-2/em2", "path": "tests/fixture_classes/auth.py", "copies": "1", "size": "1601", "license": "mit", "hash": -1128432973147505200, "line_mean": 33.0638297872, "line_max": 81, "alpha_frac": 0.6695815116, "autogenerated": false, "ratio": 3.9727047146401984, "config_test": false, ...
from email.base64mime import body_encode as encode_base64 try: from rfc822 import parseaddr except ImportError: from email.utils import parseaddr import pickle import time, os import mimetypes from hashlib import md5 import shutil class DefaultSMTPServer: server = None user = None password = None ssl = False cl...
{ "repo_name": "hansroh/aquests", "path": "aquests/protocols/smtp/composer.py", "copies": "1", "size": "5695", "license": "mit", "hash": 2578537957490697700, "line_mean": 24.0881057269, "line_max": 90, "alpha_frac": 0.6317822651, "autogenerated": false, "ratio": 2.753868471953578, "config_test":...
from email.encoders import encode_base64 import unittest from mox3.mox import MoxTestBase, IsA from gevent.socket import socket, error as socket_error from gevent.event import AsyncResult from slimta.util import pycompat from slimta.util.deque import BlockingDeque from slimta.smtp import ConnectionLost from slimta.re...
{ "repo_name": "slimta/python-slimta", "path": "test/test_slimta_relay_smtp_lmtpclient.py", "copies": "1", "size": "9400", "license": "mit", "hash": -2415123213643392000, "line_mean": 48.4736842105, "line_max": 165, "alpha_frac": 0.6455319149, "autogenerated": false, "ratio": 2.969046114971573, ...
from ..emailer import sendemail import subprocess notifytext = """ Děkujeme za registraci na LinuxDays. Ještě je potřeba registraci potvrdit. Jméno: {name[0]} Odebírat oznámení: {announces[0]} Účast: {days[0]} Oběd sobota: {mealsat[0]} Oběd neděle: {mealsun[0]} Svou registraci prosím potvrďte kliknutím na následujíc...
{ "repo_name": "oskar456/ldform", "path": "ldform/handlers/reg2016.py", "copies": "1", "size": "2302", "license": "mit", "hash": 8154362899874272000, "line_mean": 26.5731707317, "line_max": 108, "alpha_frac": 0.6678460858, "autogenerated": false, "ratio": 2.663133097762073, "config_test": false,...
from ..emailer import sendemail import subprocess notifytext = """ Děkujeme za registraci na LinuxDays. Jméno: {name[0]} Odebírat oznámení: {announces[0]} Účast: {days[0]} Budete-li chtít svou registraci zrušit, použijte následující odkaz: https://www.linuxdays.cz/cgi-bin/ldform.py?formid=unreg2015&r={regid}&n={nonc...
{ "repo_name": "oskar456/ldform", "path": "ldform/handlers/reg2015.py", "copies": "1", "size": "2313", "license": "mit", "hash": -4203218469314329000, "line_mean": 26.5421686747, "line_max": 79, "alpha_frac": 0.6207349081, "autogenerated": false, "ratio": 2.8049079754601225, "config_test": false...
from ..emailer import sendemail import subprocess notifytext = """ Nová přihláška na OpenRoom: Jméno: {name[0]} E-mail: {email[0]} Telefon: {phone[0]} Den: {day[0]} Čas: {from[0]} - {to[0]} Název: {title[0]} Popis: {abstract[0]} Veřejné: {open[0]} Výpis všech registrací je k nalezení příkazem /srv/www/ldform/export....
{ "repo_name": "oskar456/ldform", "path": "ldform/handlers/openroom2015.py", "copies": "1", "size": "1039", "license": "mit", "hash": 8681014453825058000, "line_mean": 24.2, "line_max": 89, "alpha_frac": 0.6795634921, "autogenerated": false, "ratio": 2.3773584905660377, "config_test": false, "...
from ..emailer import sendemail import subprocess notifytext = """ Nová přihláška na OpenRoom: Jméno: {name[0]} E-mail: {email[0]} Telefon: {phone[0]} Den: {day[0]} Čas: {time[0]} Délka: {length[0]} Název: {title[0]} Popis: {abstract[0]} Veřejné: {open[0]} Výpis všech registrací je k nalezení příkazem /srv/www/ldfor...
{ "repo_name": "oskar456/ldform", "path": "ldform/handlers/om2016.py", "copies": "1", "size": "1034", "license": "mit", "hash": -1161294011005045000, "line_mean": 23.512195122, "line_max": 87, "alpha_frac": 0.6805970149, "autogenerated": false, "ratio": 2.4216867469879517, "config_test": false, ...
from ..emailer import sendemail import subprocess notifytext = """ Nový CfP odeslán: Typ: {type[0]} Název: {title[0]} Jazyk: {langpref[0]} Obtížnost: {difficulty[0]} Délka: {time[0]} OpenAlt: {openalt[0]} Jméno: {name[0]} E-mail: {email[0]} Telefon: {phone[0]} Twitter: {twitter[0]} Tričko: {tshirt[0]} Den: {reqday[0]...
{ "repo_name": "oskar456/ldform", "path": "ldform/handlers/cfp2017.py", "copies": "1", "size": "1219", "license": "mit", "hash": -2451653935785499000, "line_mean": 23, "line_max": 171, "alpha_frac": 0.68, "autogenerated": false, "ratio": 2.5531914893617023, "config_test": false, "has_no_keywor...
from ..emailer import sendemail import subprocess notifytext = """ Nový CfP odeslán: Typ: {type[0]} Název: {title[0]} Obtížnost: {difficulty[0]} Délka: {time[0]} OpenAlt: {openalt[0]} Jméno: {name[0]} E-mail: {email[0]} Telefon: {phone[0]} Twitter: {twitter[0]} Tričko: {tshirt[0]} Den: {day[0]} Party: {social[0]} Ab...
{ "repo_name": "oskar456/ldform", "path": "ldform/handlers/cfp2016.py", "copies": "1", "size": "1157", "license": "mit", "hash": -2824497310218920000, "line_mean": 22.2244897959, "line_max": 154, "alpha_frac": 0.6818980668, "autogenerated": false, "ratio": 2.592255125284738, "config_test": false...
from email_extras.utils import send_mail_template from django.contrib.sites.models import Site from system.models import Configuration class EmailHelper(object): extra_explanation_action_map = { 'restart_database': ("Restart is necessary to change the database's " "log path....
{ "repo_name": "globocom/database-as-a-service", "path": "dbaas/dbaas/helpers.py", "copies": "1", "size": "2103", "license": "bsd-3-clause", "hash": -6341535630158063000, "line_mean": 36.5535714286, "line_max": 79, "alpha_frac": 0.6081787922, "autogenerated": false, "ratio": 4.399581589958159, "...
from email_from_template import send_mail from django import forms from django.utils.crypto import get_random_string from django.contrib.auth.models import User class NewUserForm(forms.ModelForm): class Meta: model = User fields = ( 'username', 'email', ) def s...
{ "repo_name": "lamby/musicdb", "path": "musicdb/account/account_admin/forms.py", "copies": "1", "size": "1087", "license": "bsd-3-clause", "hash": 4815726832815061000, "line_mean": 21.1836734694, "line_max": 67, "alpha_frac": 0.5768169273, "autogenerated": false, "ratio": 4.24609375, "config_te...
from email_from_template import send_mail from django import forms from django.utils.http import int_to_base36 from django.contrib.auth import get_user_model from django.contrib.auth.tokens import default_token_generator from django.contrib.auth.password_validation import validate_password User = get_user_model() cl...
{ "repo_name": "takeyourmeds/takeyourmeds-web", "path": "takeyourmeds/account/forgot_password/forms.py", "copies": "1", "size": "1348", "license": "mit", "hash": -5387815127592698000, "line_mean": 27.6808510638, "line_max": 75, "alpha_frac": 0.6379821958, "autogenerated": false, "ratio": 3.9300291...
from email.header import decode_header from html import escape from bs4 import BeautifulSoup #from base64 import b64encode def _decode_header(v): ret = '' for part in decode_header(v): if isinstance(part[0], str): ret += part[0] else: ret += part[0].decode(part[1]) ...
{ "repo_name": "Bun/netwatch", "path": "netwatch/mail.py", "copies": "1", "size": "4447", "license": "mit", "hash": -2472629086930691000, "line_mean": 31.4598540146, "line_max": 122, "alpha_frac": 0.5079829098, "autogenerated": false, "ratio": 3.6721717588769613, "config_test": false, "has_no_...
from email.header import decode_header DEFAULT_CODEC = 'utf-8' def ensure_encoded(some_str): """ :param some_str: :return: Try to encode the string with a series of encodings, returning the successfully encoded string. Uses ascii, then utf-8, then latin-1. If neither works, force a default. ""...
{ "repo_name": "wilbertom/gmail_client", "path": "gmail_client/codecs/__init__.py", "copies": "2", "size": "1360", "license": "mit", "hash": 7385517271141262000, "line_mean": 35.7837837838, "line_max": 73, "alpha_frac": 0.6676470588, "autogenerated": false, "ratio": 4.096385542168675, "config_te...