text stringlengths 0 1.05M | meta dict |
|---|---|
from .explorer import Explorer
import simuvex, claripy
class Callable(object):
"""
Callable is a representation of a function in the binary that can be
interacted with like a native python function.
"""
def __init__(self, project, addr, concrete_only=False, prototype=None, base_state=None, toc=Non... | {
"repo_name": "haylesr/angr",
"path": "angr/surveyors/caller.py",
"copies": "1",
"size": "10105",
"license": "bsd-2-clause",
"hash": 2951328943244622000,
"line_mean": 43.3201754386,
"line_max": 165,
"alpha_frac": 0.6125680356,
"autogenerated": false,
"ratio": 3.9273221919937815,
"config_test": ... |
from .explorer import Explorer
import simuvex, claripy
class Callable(object):
'''
Callable is a representation of a function in the binary that can be
interacted with like a native python function.
'''
def __init__(self, project, addr, concrete_only=False, prototype=None, base_state=None, toc=Non... | {
"repo_name": "terry2012/angr",
"path": "angr/surveyors/caller.py",
"copies": "7",
"size": "9919",
"license": "bsd-2-clause",
"hash": 5054511933797950000,
"line_mean": 42.889380531,
"line_max": 165,
"alpha_frac": 0.6178042141,
"autogenerated": false,
"ratio": 3.9174565560821484,
"config_test": ... |
from ..explorers import blockchain
from .base import BaseCoin
class Bitcoin(BaseCoin):
coin_symbol = "BTC"
display_name = "Bitcoin"
segwit_supported = True
explorer = blockchain
magicbyte = 0
script_magicbyte = 5
segwit_hrp = "bc"
client_kwargs = {
'server_file': 'bitcoin.json'... | {
"repo_name": "stamhe/pybitcointools",
"path": "cryptos/coins/bitcoin.py",
"copies": "1",
"size": "1085",
"license": "mit",
"hash": -5450234454060303000,
"line_mean": 24.8571428571,
"line_max": 50,
"alpha_frac": 0.5124423963,
"autogenerated": false,
"ratio": 2.9166666666666665,
"config_test": f... |
from explorer.tasks import execute_query
import six
from django.http.response import HttpResponseRedirect
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.views.generic.base import View
from django.views.generic import ListView
from django.views.... | {
"repo_name": "guilhermemaba/django-sql-explorer",
"path": "explorer/views.py",
"copies": "1",
"size": "12924",
"license": "mit",
"hash": -7335939967028877000,
"line_mean": 36.1379310345,
"line_max": 137,
"alpha_frac": 0.6501083256,
"autogenerated": false,
"ratio": 3.836153161175423,
"config_te... |
from explorer.utils import passes_blacklist, swap_params, extract_params, shared_dict_update, get_connection, get_s3_connection
from django.db import models, DatabaseError
from time import time
from django.core.urlresolvers import reverse
from django.conf import settings
from . import app_settings
import logging
import... | {
"repo_name": "tzangms/django-sql-explorer",
"path": "explorer/models.py",
"copies": "1",
"size": "7427",
"license": "mit",
"hash": 3118120196486836700,
"line_mean": 28.9475806452,
"line_max": 145,
"alpha_frac": 0.6119563754,
"autogenerated": false,
"ratio": 3.816546762589928,
"config_test": fa... |
from explorer.utils import passes_blacklist, swap_params, extract_params, shared_dict_update, get_connection
from django.db import models, DatabaseError
from time import time
from django.core.urlresolvers import reverse
from django.conf import settings
from . import app_settings
import logging
import six
MSG_FAILED_BL... | {
"repo_name": "22rostislav/django-sql-explorer",
"path": "explorer/models.py",
"copies": "5",
"size": "7565",
"license": "mit",
"hash": -7685346767870798000,
"line_mean": 29.3815261044,
"line_max": 145,
"alpha_frac": 0.6113681428,
"autogenerated": false,
"ratio": 3.7768347478781825,
"config_tes... |
from ex.plott import *
from common import *
class PCA:
'''wrapper for PCA related computations
'''
def __init__(self, filename = None):
'''Fields:
n: training samples.
dim: training dimensions.
U: principle components.
L: eigen values.
M: training mean.
... | {
"repo_name": "excelly/xpy-ml",
"path": "ex/ml/pca.py",
"copies": "1",
"size": "4814",
"license": "apache-2.0",
"hash": -8869258239820763000,
"line_mean": 25.306010929,
"line_max": 118,
"alpha_frac": 0.5045700042,
"autogenerated": false,
"ratio": 3.473304473304473,
"config_test": false,
"has_... |
from exp.nb_11 import *
from fastai.datasets import *
bs = 32
lr = 1e-2
mom=0.9
mom_sqr=0.99
eps = 1e-6
pct_start = 0.5
size = 128
mixup = 0
epochs = 5
pcts = create_phases(pct_start)
sched_lr = combine_scheds(pcts, cos_1cycle_anneal(lr/10., lr, lr/1e5))
sched_mom = combine_scheds(pcts, cos_1cycle_anneal(0.95, 0.85,... | {
"repo_name": "fastai/course-v3",
"path": "nbs/dl2/train_imagenette.py",
"copies": "1",
"size": "1267",
"license": "apache-2.0",
"hash": -7758716818660506000,
"line_mean": 33.2432432432,
"line_max": 95,
"alpha_frac": 0.7048145225,
"autogenerated": false,
"ratio": 2.3860640301318266,
"config_tes... |
from ExportDialog import ExportDialog
from global_vars import N_RECENT_FILES
import wx
class MenuCAIDFile(wx.Menu):
def __init__(self, parent):
wx.Menu.__init__(self)
self.parent = parent
self.initGUI()
self.currentFile = None
self.recentFiles = []
self.nRecentFil... | {
"repo_name": "ratnania/caid",
"path": "caid-gui/MenuCAIDFile.py",
"copies": "1",
"size": "2513",
"license": "mit",
"hash": 1389940901816223000,
"line_mean": 30.8101265823,
"line_max": 99,
"alpha_frac": 0.5961002786,
"autogenerated": false,
"ratio": 3.679355783308931,
"config_test": false,
"h... |
from exporter import DxfExporter
import symlib.contact as sc
import symlib.terminal as st
import symlib.ground as sg
import symlib.limit as sl
import symlib.generic as gen
import symlib.protect as protect
import symlib.coil as coil
import symlib.pilot as pilot
import inspect
import os
from entity import CodedSymbol
#... | {
"repo_name": "kozbot/kecb",
"path": "generate_dxf.py",
"copies": "1",
"size": "2641",
"license": "mit",
"hash": 5078890219770570000,
"line_mean": 29.3563218391,
"line_max": 120,
"alpha_frac": 0.6524043923,
"autogenerated": false,
"ratio": 3.2930174563591024,
"config_test": false,
"has_no_key... |
from .Exporter import Exporter
from ..parametertree import Parameter
from ..Qt import QtGui, QtCore, QtSvg
import re
__all__ = ['PrintExporter']
#__all__ = [] ## Printer is disabled for now--does not work very well.
class PrintExporter(Exporter):
Name = "Printer"
def __init__(self, item):
Exporter... | {
"repo_name": "hiuwo/acq4",
"path": "acq4/pyqtgraph/exporters/PrintExporter.py",
"copies": "2",
"size": "2672",
"license": "mit",
"hash": 6149897125444035000,
"line_mean": 38.2941176471,
"line_max": 145,
"alpha_frac": 0.5868263473,
"autogenerated": false,
"ratio": 3.675378266850069,
"config_tes... |
from .Exporter import Exporter
from ..parametertree import Parameter
from ..Qt import QtGui, QtCore, QtSvg, USE_PYSIDE
from .. import functions as fn
import numpy as np
__all__ = ['ImageExporter']
class ImageExporter(Exporter):
Name = "Image File (PNG, TIF, JPG, ...)"
allowCopy = True
def __init__(se... | {
"repo_name": "pmaunz/pyqtgraph",
"path": "pyqtgraph/exporters/ImageExporter.py",
"copies": "3",
"size": "4643",
"license": "mit",
"hash": -5096807243602486000,
"line_mean": 40.8288288288,
"line_max": 174,
"alpha_frac": 0.5640749515,
"autogenerated": false,
"ratio": 3.8245469522240527,
"config_... |
from .Exporter import Exporter
from ..parametertree import Parameter
from ..Qt import QtGui, QtCore, QtWidgets, QtSvg, USE_PYSIDE
from .. import functions as fn
import numpy as np
__all__ = ['ImageExporter']
class ImageExporter(Exporter):
Name = "Image File (PNG, TIF, JPG, ...)"
allowCopy = True
def ... | {
"repo_name": "mylxiaoyi/mypyqtgraph-qt5",
"path": "pyqtgraph/exporters/ImageExporter.py",
"copies": "1",
"size": "4319",
"license": "mit",
"hash": -2774894941855095300,
"line_mean": 41.3431372549,
"line_max": 174,
"alpha_frac": 0.5765223431,
"autogenerated": false,
"ratio": 3.873542600896861,
... |
from .Exporter import Exporter
from pyqtgraph.parametertree import Parameter
from pyqtgraph.Qt import QtGui, QtCore, QtSvg
import pyqtgraph as pg
import numpy as np
__all__ = ['ImageExporter']
class ImageExporter(Exporter):
Name = "Image File (PNG, TIF, JPG, ...)"
allowCopy = True
def __init__(self, ... | {
"repo_name": "ZhuangER/robot_path_planning",
"path": "gui/pyqtgraph/exporters/ImageExporter.py",
"copies": "1",
"size": "4122",
"license": "mit",
"hash": 5551377888260444000,
"line_mean": 41.0714285714,
"line_max": 174,
"alpha_frac": 0.5793304221,
"autogenerated": false,
"ratio": 3.8523364485981... |
from Exporter import Exporter
from pyqtgraph.parametertree import Parameter
from pyqtgraph.Qt import QtGui, QtCore, QtSvg
import pyqtgraph as pg
import numpy as np
__all__ = ['ImageExporter']
class ImageExporter(Exporter):
Name = "Image File (PNG, TIF, JPG, ...)"
def __init__(self, item):
Exporter.__i... | {
"repo_name": "robertsj/poropy",
"path": "pyqtgraph/exporters/ImageExporter.py",
"copies": "1",
"size": "2926",
"license": "mit",
"hash": -5874708567474242000,
"line_mean": 41.4202898551,
"line_max": 118,
"alpha_frac": 0.5762132604,
"autogenerated": false,
"ratio": 3.770618556701031,
"config_te... |
from .Exporter import Exporter
from pyqtgraph.parametertree import Parameter
from pyqtgraph.Qt import QtGui, QtCore, QtSvg
import pyqtgraph as pg
import re
import xml.dom.minidom as xml
import numpy as np
__all__ = ['SVGExporter']
class SVGExporter(Exporter):
Name = "Scalable Vector Graphics (SVG)"
allowCopy... | {
"repo_name": "ibressler/pyqtgraph",
"path": "pyqtgraph/exporters/SVGExporter.py",
"copies": "1",
"size": "18205",
"license": "mit",
"hash": -2570755669828170000,
"line_mean": 38.6623093682,
"line_max": 120,
"alpha_frac": 0.547651744,
"autogenerated": false,
"ratio": 3.9033018867924527,
"config... |
from .Exporter import Exporter
from pyqtgraph.parametertree import Parameter
from pyqtgraph.Qt import QtGui, QtCore, QtSvg
import re
__all__ = ['PrintExporter']
#__all__ = [] ## Printer is disabled for now--does not work very well.
class PrintExporter(Exporter):
Name = "Printer"
def __init__(self, item):
... | {
"repo_name": "ibressler/pyqtgraph",
"path": "pyqtgraph/exporters/PrintExporter.py",
"copies": "3",
"size": "2652",
"license": "mit",
"hash": 6521956706831800000,
"line_mean": 39.8,
"line_max": 145,
"alpha_frac": 0.5901206637,
"autogenerated": false,
"ratio": 3.673130193905817,
"config_test": f... |
from Exporter import Exporter
from pyqtgraph.parametertree import Parameter
from pyqtgraph.Qt import QtGui, QtCore, QtSvg
import re
#__all__ = ['PrintExporter']
__all__ = [] ## Printer is disabled for now--does not work very well.
class PrintExporter(Exporter):
Name = "Printer"
def __init__(self, item):
... | {
"repo_name": "robertsj/poropy",
"path": "pyqtgraph/exporters/PrintExporter.py",
"copies": "1",
"size": "2361",
"license": "mit",
"hash": -7640545449993875000,
"line_mean": 39.0169491525,
"line_max": 145,
"alpha_frac": 0.5916984329,
"autogenerated": false,
"ratio": 3.700626959247649,
"config_te... |
from Exporter import Exporter
from pyqtgraph.parametertree import Parameter
from pyqtgraph.Qt import QtGui, QtCore, QtSvg
import re
__all__ = ['SVGExporter']
class SVGExporter(Exporter):
Name = "Scalable Vector Graphics (SVG)"
def __init__(self, item):
Exporter.__init__(self, item)
tr = self.g... | {
"repo_name": "robertsj/poropy",
"path": "pyqtgraph/exporters/SVGExporter.py",
"copies": "1",
"size": "2775",
"license": "mit",
"hash": -7782812005108575000,
"line_mean": 39.8088235294,
"line_max": 103,
"alpha_frac": 0.5614414414,
"autogenerated": false,
"ratio": 3.790983606557377,
"config_test... |
from .Exporter import Exporter
from ..python2_3 import asUnicode
from ..parametertree import Parameter
from ..Qt import QtGui, QtCore, QtSvg
from .. import debug
from .. import functions as fn
import re
import xml.dom.minidom as xml
import numpy as np
__all__ = ['SVGExporter']
class SVGExporter(Exporter):
Name =... | {
"repo_name": "hiuwo/acq4",
"path": "acq4/pyqtgraph/exporters/SVGExporter.py",
"copies": "1",
"size": "18753",
"license": "mit",
"hash": -751004577270931600,
"line_mean": 38.5632911392,
"line_max": 123,
"alpha_frac": 0.5502586253,
"autogenerated": false,
"ratio": 4.009621552277101,
"config_test... |
from .Exporter import Exporter
from ..python2_3 import asUnicode
from ..parametertree import Parameter
from ..Qt import QtGui, QtCore, QtSvg, QT_LIB
from .. import debug
from .. import functions as fn
import re
import xml.dom.minidom as xml
import numpy as np
__all__ = ['SVGExporter']
class SVGExporter(Exporter):
... | {
"repo_name": "acq4/acq4",
"path": "acq4/pyqtgraph/exporters/SVGExporter.py",
"copies": "3",
"size": "17330",
"license": "mit",
"hash": -8105436662156982000,
"line_mean": 38.5662100457,
"line_max": 135,
"alpha_frac": 0.5563185228,
"autogenerated": false,
"ratio": 4.084374263492812,
"config_test... |
from ..exporter import Exporter
from ..renderers import FakeRenderer, FullFakeRenderer
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
from numpy.testing import assert_warns
def fake_renderer_output(fig, Renderer):
renderer = Renderer()
exporter = Exporter(renderer... | {
"repo_name": "sahat/bokeh",
"path": "bokeh/mplexporter/tests/test_basic.py",
"copies": "3",
"size": "6753",
"license": "bsd-3-clause",
"hash": 7012541974983825000,
"line_mean": 31.6231884058,
"line_max": 74,
"alpha_frac": 0.432992744,
"autogenerated": false,
"ratio": 5.604149377593361,
"config... |
from .exporter import Exporter
import ezdxf
from ezdxf.tools import standards as std
import entity
import config as cfg
class DxfExporter(Exporter):
def __init__(self):
super().__init__()
self.dwg = ezdxf.new(dxfversion='AC1015')
ezdxf.setup_linetypes(self.dwg)
self.msp = self.dwg... | {
"repo_name": "kozbot/kecb",
"path": "exporter/dxfexporter.py",
"copies": "1",
"size": "3331",
"license": "mit",
"hash": -4860651027253969000,
"line_mean": 35.2065217391,
"line_max": 88,
"alpha_frac": 0.5752026418,
"autogenerated": false,
"ratio": 3.5817204301075267,
"config_test": false,
"ha... |
from exporters.groupers.base_grouper import BaseGrouper
from exporters.python_interpreter import Interpreter, create_context
from exporters.utils import str_list
class PythonExpGrouper(BaseGrouper):
"""
Groups items depending on python expressions. It adds the group membership information to items.
-... | {
"repo_name": "scrapinghub/exporters",
"path": "exporters/groupers/python_exp_grouper.py",
"copies": "1",
"size": "1202",
"license": "bsd-3-clause",
"hash": -1597476927494586600,
"line_mean": 32.3888888889,
"line_max": 100,
"alpha_frac": 0.6247920133,
"autogenerated": false,
"ratio": 4.4354243542... |
from exporters.groupers.base_grouper import BaseGrouper
from exporters.utils import str_list
class FileKeyGrouper(BaseGrouper):
"""
Groups items depending on their keys. It adds the group membership information to items.
- keys (list)
A list of keys to group by
"""
supported_optio... | {
"repo_name": "scrapinghub/exporters",
"path": "exporters/groupers/file_key_grouper.py",
"copies": "1",
"size": "1187",
"license": "bsd-3-clause",
"hash": 2229044955289298000,
"line_mean": 31.0810810811,
"line_max": 92,
"alpha_frac": 0.5669755687,
"autogenerated": false,
"ratio": 4.09310344827586... |
from exporters.logger.base_logger import FilterLogger
from exporters.pipeline.base_pipeline_item import BasePipelineItem
class BaseFilter(BasePipelineItem):
"""
This module receives a batch, filter it according to some parameters, and returns it.
"""
log_at_every = 1000
def __init__(self, options... | {
"repo_name": "scrapinghub/exporters",
"path": "exporters/filters/base_filter.py",
"copies": "1",
"size": "1906",
"license": "bsd-3-clause",
"hash": 4877461982166504000,
"line_mean": 34.2962962963,
"line_max": 95,
"alpha_frac": 0.6002098636,
"autogenerated": false,
"ratio": 4.134490238611714,
"... |
from exporters.logger.base_logger import ReaderLogger
from exporters.pipeline.base_pipeline_item import BasePipelineItem
class BaseReader(BasePipelineItem):
"""
This module reads and creates a batch to pass them to the pipeline
"""
def __init__(self, options, metadata):
super(BaseReader, self... | {
"repo_name": "scrapinghub/exporters",
"path": "exporters/readers/base_reader.py",
"copies": "1",
"size": "2087",
"license": "bsd-3-clause",
"hash": -6678802690601652000,
"line_mean": 31.609375,
"line_max": 95,
"alpha_frac": 0.6224245328,
"autogenerated": false,
"ratio": 4.25050916496945,
"conf... |
from exporters.logger.base_logger import StatsManagerLogger
from exporters.pipeline.base_pipeline_item import BasePipelineItem
class BaseStatsManager(BasePipelineItem):
"""
Base class for stats managers
"""
def __init__(self, *args, **kwargs):
super(BaseStatsManager, self).__init__(*args, **k... | {
"repo_name": "scrapinghub/exporters",
"path": "exporters/stats_managers/base_stats_manager.py",
"copies": "1",
"size": "1123",
"license": "bsd-3-clause",
"hash": -7367902594863352000,
"line_mean": 33.0303030303,
"line_max": 70,
"alpha_frac": 0.6740872663,
"autogenerated": false,
"ratio": 4.05415... |
from exporters.logger.base_logger import TransformLogger
from exporters.pipeline.base_pipeline_item import BasePipelineItem
class BaseTransform(BasePipelineItem):
"""
This module receives a batch and writes it where needed. It can implement the following methods:
"""
def __init__(self, options, metad... | {
"repo_name": "scrapinghub/exporters",
"path": "exporters/transform/base_transform.py",
"copies": "1",
"size": "1200",
"license": "bsd-3-clause",
"hash": -6224929194056378000,
"line_mean": 35.3636363636,
"line_max": 100,
"alpha_frac": 0.6716666667,
"autogenerated": false,
"ratio": 4.2253521126760... |
from exporters.module_loader import ModuleLoader
from exporters.readers.s3_reader import S3BucketKeysFetcher
class S3BypassState(object):
def __init__(self, config, metadata, aws_key, aws_secret):
self.config = config
module_loader = ModuleLoader()
self.state = module_loader.load_persiste... | {
"repo_name": "scrapinghub/exporters",
"path": "exporters/bypasses/s3_bypass_state.py",
"copies": "1",
"size": "1531",
"license": "bsd-3-clause",
"hash": 2609416473365562400,
"line_mean": 35.4523809524,
"line_max": 90,
"alpha_frac": 0.6159372959,
"autogenerated": false,
"ratio": 3.895674300254453... |
from exporters.module_loader import ModuleLoader
class NotifiersList(object):
"""
This class is only used to support a list of notifications modules.
"""
def __init__(self, options, metadata):
self.options = options
self.module_loader = ModuleLoader()
self.notifiers = self._po... | {
"repo_name": "scrapinghub/exporters",
"path": "exporters/notifications/notifiers_list.py",
"copies": "1",
"size": "1258",
"license": "bsd-3-clause",
"hash": -2129474233340438800,
"line_mean": 33,
"line_max": 82,
"alpha_frac": 0.6406995231,
"autogenerated": false,
"ratio": 4.058064516129032,
"c... |
from exporters.pipeline.base_pipeline_item import BasePipelineItem
from exporters.logger.base_logger import FilterLogger
class BaseGrouper(BasePipelineItem):
"""
Base class fro groupers
"""
def __init__(self, options, metadata=None):
super(BaseGrouper, self).__init__(options, metadata)
... | {
"repo_name": "scrapinghub/exporters",
"path": "exporters/groupers/base_grouper.py",
"copies": "1",
"size": "1108",
"license": "bsd-3-clause",
"hash": -6584952799448588000,
"line_mean": 32.5757575758,
"line_max": 66,
"alpha_frac": 0.6588447653,
"autogenerated": false,
"ratio": 3.9430604982206408,... |
from exporters.pipeline.base_pipeline_item import BasePipelineItem
import sys
import zlib
import six
__all__ = ['BaseDecompressor', 'ZLibDecompressor', 'NoDecompressor']
class BaseDecompressor(BasePipelineItem):
def decompress(self):
raise NotImplementedError()
def create_decompressor():
# create z... | {
"repo_name": "scrapinghub/exporters",
"path": "exporters/decompressors.py",
"copies": "1",
"size": "1327",
"license": "bsd-3-clause",
"hash": 5280604740506210000,
"line_mean": 31.3658536585,
"line_max": 81,
"alpha_frac": 0.6360211002,
"autogenerated": false,
"ratio": 4.199367088607595,
"config... |
from exporters.pipeline.base_pipeline_item import BasePipelineItem
class BaseNotifier(BasePipelineItem):
"""
This module takes care of notifications delivery.
It has a slightly different architecture than the others due to the support
of multiple notification endpoints to be loaded at the same time.
... | {
"repo_name": "scrapinghub/exporters",
"path": "exporters/notifications/base_notifier.py",
"copies": "1",
"size": "1521",
"license": "bsd-3-clause",
"hash": 5168653052875961000,
"line_mean": 35.2142857143,
"line_max": 87,
"alpha_frac": 0.6870479947,
"autogenerated": false,
"ratio": 4.473529411764... |
from exporters.transform.base_transform import BaseTransform
from exporters.python_interpreter import Interpreter, create_context
from exporters.utils import str_list
class PythonexpTransform(BaseTransform):
"""
It applies python expressions to items.
- python_expression (str)
Valid pytho... | {
"repo_name": "scrapinghub/exporters",
"path": "exporters/transform/pythonexp_transform.py",
"copies": "1",
"size": "1401",
"license": "bsd-3-clause",
"hash": -2698998838479537700,
"line_mean": 35.8684210526,
"line_max": 91,
"alpha_frac": 0.6630977873,
"autogenerated": false,
"ratio": 4.433544303... |
from exporters.writers.base_writer import BaseWriter, ItemsLimitReached
class ConsoleWriter(BaseWriter):
"""
It is just a writer with testing purposes. It prints every item in console.
It has no other options.
"""
def __init__(self, options, *args, **kwargs):
super(ConsoleWriter, self)._... | {
"repo_name": "scrapinghub/exporters",
"path": "exporters/writers/console_writer.py",
"copies": "1",
"size": "1222",
"license": "bsd-3-clause",
"hash": -8153365664716999000,
"line_mean": 37.1875,
"line_max": 100,
"alpha_frac": 0.6194762684,
"autogenerated": false,
"ratio": 4.243055555555555,
"c... |
from ExportMLModel import main
from CommonServerPython import *
dummy_data = [i for i in range(10)]
def test_main(mocker):
mocker.patch.object(demisto, 'args', return_value={"modelName": 'model'})
def get_file_path(entry_id):
return {'path': './TestData/entry_file'}
def execute_command(command... | {
"repo_name": "demisto/content",
"path": "Packs/ML/Scripts/ExportMLModel/ExportMLModel_test.py",
"copies": "1",
"size": "1085",
"license": "mit",
"hash": -6718562307797241000,
"line_mean": 32.90625,
"line_max": 100,
"alpha_frac": 0.6304147465,
"autogenerated": false,
"ratio": 3.4444444444444446,
... |
from export_result import *
from generate_candidates import *
from generate_rules import *
from itertools import repeat
from load_database import *
from prune_itemsets import *
from timeit import default_timer
def apriori():
"""Performs the Apriori algorithm."""
# Load database and read in the support and co... | {
"repo_name": "christian-stephen/apriori-algorithm",
"path": "apriori/apriori.py",
"copies": "1",
"size": "1741",
"license": "mit",
"hash": 597535396113599400,
"line_mean": 37.6888888889,
"line_max": 122,
"alpha_frac": 0.7151062608,
"autogenerated": false,
"ratio": 3.665263157894737,
"config_te... |
from ExpressionAsserter import ExpressionAsserter
class Expression:
"""
This class takes in a boolean logic expression, and creates
a parsed expression that will be used to generate outputs.
Naming convention:
- ASA: replaces "as stated above". This is to make it apparent
that we're referencing a variable in ... | {
"repo_name": "robertvunabandi/DigitialInputer",
"path": "lib/Expression.py",
"copies": "1",
"size": "8578",
"license": "apache-2.0",
"hash": 1611362048810268400,
"line_mean": 35.6581196581,
"line_max": 127,
"alpha_frac": 0.7033107951,
"autogenerated": false,
"ratio": 3.319659442724458,
"config... |
from ExpressionConvert import *
from QuineMcCluskey import *
import sys
def ImplementBooleanFn():
''' An interactive function which takes in minterms/maxterms and
prints the Boolean Function and implementable form.
Don't Care Conditions can also be provided (optional)
Eg:
Enter the list of variabl... | {
"repo_name": "coder006/BinPy",
"path": "BinPy/Algorithms/ImplementBooleanFunction.py",
"copies": "1",
"size": "2519",
"license": "bsd-3-clause",
"hash": 6850992892967286000,
"line_mean": 33.5068493151,
"line_max": 79,
"alpha_frac": 0.5573640333,
"autogenerated": false,
"ratio": 3.720827178729689... |
from expression import core,Function,WrappedType,ReplacementMap
class Evaluator(object):
def __init__(self,evaluator,recursive = False,split_binary = True, split_binary_size = 2,S = None):
if S == None:
raise ValueError('missing argument S')
self._evaluator = evaluator
self._... | {
"repo_name": "TheLartians/Expresso",
"path": "expresso/evaluator.py",
"copies": "1",
"size": "5552",
"license": "mit",
"hash": 1153963003808257300,
"line_mean": 32.0476190476,
"line_max": 127,
"alpha_frac": 0.6104106628,
"autogenerated": false,
"ratio": 3.7437626432906272,
"config_test": false... |
from expression import core,WrappedExpression
import expression
import evaluator
import printer
import visitor
from expression import associative,non_associative,left_associative,right_associative,commutative,non_commutative,postfix,prefix
def create_object(data,unique_name=None):
'''
Create an atomic expression ... | {
"repo_name": "TheLartians/Expresso",
"path": "expresso/__init__.py",
"copies": "1",
"size": "2414",
"license": "mit",
"hash": -1835754213603839700,
"line_mean": 36.71875,
"line_max": 128,
"alpha_frac": 0.7195526098,
"autogenerated": false,
"ratio": 3.9315960912052117,
"config_test": false,
"... |
from Expression import Expression, CompositeExpression, has_head, Equal
from MatchAndSubstitute import Direction, is_equality
from ProofSystem import ExprAndParent, Exprs, ProofState
from typing import Sequence, List
from typing import cast
def try_rules(
context: Sequence[Expression],
goal: Expression,
... | {
"repo_name": "martincmartin/MathematiciansAssistant",
"path": "DeductionApril2018.py",
"copies": "1",
"size": "3329",
"license": "apache-2.0",
"hash": -3918850668860953000,
"line_mean": 31.637254902,
"line_max": 76,
"alpha_frac": 0.5458095524,
"autogenerated": false,
"ratio": 4.284427284427284,
... |
from .expression import Expression, Field, FieldOperators
from .datastructures import OrderedAttributes
# really its factory factory
def _attributed_field_factory(
attr_cls, doc_cls, dynamic_field, make_field_name=None
):
def _attr_field(name):
field = dynamic_field.clone()
field._name = m... | {
"repo_name": "anti-social/elasticmagic",
"path": "elasticmagic/attribute.py",
"copies": "1",
"size": "3842",
"license": "apache-2.0",
"hash": -5071612116253090000,
"line_mean": 30.7520661157,
"line_max": 75,
"alpha_frac": 0.5692347736,
"autogenerated": false,
"ratio": 4.100320170757738,
"confi... |
from .expression import Function,BinaryOperator,UnaryOperator,Symbol,Wildcard,Number,Expression,S
from .expression import One,Zero,NaN,I,addition,negative,multiplication,fraction,exponentiation,addition_group,multiplication_group,real_field,complex_field,Or,And,Xor,Not,mod,equal,unequal,In,NotIn,Less,LessEqual,Greater,... | {
"repo_name": "TheLartians/Expresso",
"path": "expresso/pycas/functions.py",
"copies": "1",
"size": "7357",
"license": "mit",
"hash": -27914244274544820,
"line_mean": 27.2961538462,
"line_max": 244,
"alpha_frac": 0.6376240315,
"autogenerated": false,
"ratio": 3.3840846366145354,
"config_test": ... |
from .expression import (
BitVec,
BitVecExtract,
BitVecSignExtend,
BitVecZeroExtend,
BitVecConstant,
BitVecConcat,
Bool,
BitVecITE,
BoolConstant,
BoolITE,
)
from . import issymbolic
import math
def ORD(s):
if isinstance(s, BitVec):
if s.size == 8:
return... | {
"repo_name": "montyly/manticore",
"path": "manticore/core/smtlib/operators.py",
"copies": "1",
"size": "6777",
"license": "apache-2.0",
"hash": 4510208851135483000,
"line_mean": 22.6132404181,
"line_max": 73,
"alpha_frac": 0.563523683,
"autogenerated": false,
"ratio": 3.368290258449304,
"confi... |
from Expression import *
from Identifier import *
from ValueList import *
from Utils import *
class SetExpression(Expression):
"""
Class representing a set in the AST
"""
def __init__(self, dimension = 0):
Expression.__init__(self)
self.dimension = dimension
def setDimension(self, ... | {
"repo_name": "rafaellc28/Latex2MiniZinc",
"path": "latex2minizinc/SetExpression.py",
"copies": "1",
"size": "12208",
"license": "mit",
"hash": 5862287824039866000,
"line_mean": 28.7756097561,
"line_max": 129,
"alpha_frac": 0.6242627785,
"autogenerated": false,
"ratio": 4.778082191780822,
"conf... |
from Expression import *
from ID import *
from Number import *
from NumericExpression import *
from Utils import *
class Identifier(Expression):
"""
Class representing an Identifier in the AST of the MLP
"""
def __init__(self, identifier, sub_indices = []):
"""
Set the identifier a... | {
"repo_name": "rafaellc28/Latex2MiniZinc",
"path": "latex2minizinc/Identifier.py",
"copies": "1",
"size": "4206",
"license": "mit",
"hash": 5886399120057220000,
"line_mean": 27.4189189189,
"line_max": 183,
"alpha_frac": 0.5993818355,
"autogenerated": false,
"ratio": 4.127576054955839,
"config_t... |
from Expression import *
from ID import *
from Number import *
from NumericExpression import *
class Variable(Expression):
"""
Class representing an Variable in the AST of the MLP
"""
def __init__(self, variable, sub_indices = []):
"""
Set the variable and the sub indices (if there... | {
"repo_name": "rafaellc28/Latex2MiniZinc",
"path": "latex2minizinc/Variable.py",
"copies": "1",
"size": "3304",
"license": "mit",
"hash": -2038554932316120600,
"line_mean": 26.0819672131,
"line_max": 181,
"alpha_frac": 0.5705205811,
"autogenerated": false,
"ratio": 4.058968058968059,
"config_te... |
from Expression import *
from MatchAndSubstitute import *
# from pprint import pprint
from typing import *
# from abc import ABCMeta, abstractmethod
from enum import Enum, auto
import heapq
# So we proved the first two problems, but using brute force. Would like to
# capture a more human method instead. For examp... | {
"repo_name": "martincmartin/MathematiciansAssistant",
"path": "DeductionOrig.py",
"copies": "1",
"size": "38678",
"license": "apache-2.0",
"hash": 3826495314081139700,
"line_mean": 35.6268939394,
"line_max": 80,
"alpha_frac": 0.6108899116,
"autogenerated": false,
"ratio": 3.927497969130788,
"c... |
from Expression import *
from SetExpression import *
from ValueList import *
class EntryIndexingExpression(Expression):
"""
Class representing an entry of indexing expression in the AST of the MLP
"""
def __init__(self):
Expression.__init__(self)
class EntryIndexingExpressionWithSet(EntryInde... | {
"repo_name": "rafaellc28/Latex2MiniZinc",
"path": "latex2minizinc/EntryIndexingExpression.py",
"copies": "1",
"size": "7218",
"license": "mit",
"hash": 1727234822447976400,
"line_mean": 32.5720930233,
"line_max": 175,
"alpha_frac": 0.6299528955,
"autogenerated": false,
"ratio": 4.618042226487524... |
from Expression import *
from tokenize import *
from typing import *
import io
import token
# Look! A yak! I think I'll shave it...
class Parser:
type: Union[int, str]
token: TokenInfo
tokens: List[TokenInfo]
keywords = {"in", "and", "or", "not", "==>", "<==>", "forall", "exists"}
class_map ... | {
"repo_name": "martincmartin/MathematiciansAssistant",
"path": "Parser.py",
"copies": "1",
"size": "7015",
"license": "apache-2.0",
"hash": 5583330131903338000,
"line_mean": 31.6279069767,
"line_max": 80,
"alpha_frac": 0.5014967926,
"autogenerated": false,
"ratio": 4.104739613809246,
"config_te... |
from Expression import *
from Utils import *
class DeclarationExpression(Expression):
"""
Class representing a declaration expression node in the AST of a MLP
"""
def __init__(self, identifiers, attributeList = None):
"""
Set the expressions being related
:param identi... | {
"repo_name": "rafaellc28/Latex2MiniZinc",
"path": "latex2minizinc/DeclarationExpression.py",
"copies": "1",
"size": "3727",
"license": "mit",
"hash": 5673873584660601000,
"line_mean": 28.1171875,
"line_max": 118,
"alpha_frac": 0.5972632144,
"autogenerated": false,
"ratio": 4.556234718826406,
"... |
from Expression import *
from Utils import *
class ExpressionList(Expression):
"""
Class representing an indexing expression in the AST
"""
# Get the MiniZinc code for a given constraint
@staticmethod
def _getCodePredicateEntry(entry): return entry.generatePredicateCode()
def __init__(sel... | {
"repo_name": "rafaellc28/Latex2MiniZinc",
"path": "latex2minizinc/ExpressionList.py",
"copies": "1",
"size": "3142",
"license": "mit",
"hash": -3569013351803394000,
"line_mean": 27.5636363636,
"line_max": 111,
"alpha_frac": 0.6422660726,
"autogenerated": false,
"ratio": 4.76783004552352,
"conf... |
from Expression import *
from Utils import *
class IndexingExpression(Expression):
"""
Class representing an indexing expression in the AST
"""
# Get the MiniZinc code for a given constraint
@staticmethod
def _getCodePredicateEntry(entry): return entry.generatePredicateCode()
def __init__... | {
"repo_name": "rafaellc28/Latex2MiniZinc",
"path": "latex2minizinc/IndexingExpression.py",
"copies": "1",
"size": "3113",
"license": "mit",
"hash": -23605907745044550,
"line_mean": 27.8240740741,
"line_max": 111,
"alpha_frac": 0.6447157083,
"autogenerated": false,
"ratio": 4.78923076923077,
"co... |
from Expression import *
from Utils import *
class LogicalExpression(Expression):
"""
Class representing an logical expression in the AST of the MLP
"""
def __init__(self, entriesLogicalExpression):
"""
Set the entries for the logical expression
"""
Expression.__init__(... | {
"repo_name": "rafaellc28/Latex2MiniZinc",
"path": "latex2minizinc/LogicalExpression.py",
"copies": "1",
"size": "2711",
"license": "mit",
"hash": 3347987600632899000,
"line_mean": 29.4606741573,
"line_max": 100,
"alpha_frac": 0.5912947252,
"autogenerated": false,
"ratio": 4.764499121265378,
"c... |
from Expression import *
from Utils import *
class Tuple(Expression):
"""
Class representing a tuple of values in the AST of the MLP
"""
def __init__(self, values):
"""
Set the values
:param values : [Identifier|Number]
"""
Expression.__init__(self)... | {
"repo_name": "rafaellc28/Latex2MiniZinc",
"path": "latex2minizinc/Tuple.py",
"copies": "1",
"size": "2207",
"license": "mit",
"hash": -7307986587076508000,
"line_mean": 24.0795454545,
"line_max": 104,
"alpha_frac": 0.5591300408,
"autogenerated": false,
"ratio": 4.504081632653061,
"config_test"... |
from Expression import *
from Utils import *
class TupleList(Expression):
"""
Class representing a list of values in the AST of the MLP
"""
def __init__(self, values):
"""
Set the values
:param values : [Identifier|NumericExpression|SymbolicExpression]
"""
... | {
"repo_name": "rafaellc28/Latex2MiniZinc",
"path": "latex2minizinc/TupleList.py",
"copies": "1",
"size": "2137",
"license": "mit",
"hash": 68479109959897130,
"line_mean": 24.1411764706,
"line_max": 104,
"alpha_frac": 0.5596630791,
"autogenerated": false,
"ratio": 4.556503198294243,
"config_test... |
from Expression import *
from Utils import *
class ValueList(Expression):
"""
Class representing a list of values in the AST of the MLP
"""
def __init__(self, values):
"""
Set the values
:param values : [Identifier|Number|SymbolicExpression]
"""
Express... | {
"repo_name": "rafaellc28/Latex2MiniZinc",
"path": "latex2minizinc/ValueList.py",
"copies": "1",
"size": "2284",
"license": "mit",
"hash": 15939030346084940,
"line_mean": 24.0989010989,
"line_max": 104,
"alpha_frac": 0.5446584939,
"autogenerated": false,
"ratio": 4.586345381526105,
"config_test... |
from Expression import *
class Array(Expression):
"""
Class representing a Array node in the AST of the MLP
"""
def __init__(self, value):
"""
Set the ValueList inside the array
:param value: ValueList
"""
Expression.__init__(self)
... | {
"repo_name": "rafaellc28/Latex2MiniZinc",
"path": "latex2minizinc/Array.py",
"copies": "1",
"size": "4343",
"license": "mit",
"hash": -2332411561823314000,
"line_mean": 24.1040462428,
"line_max": 113,
"alpha_frac": 0.5535344232,
"autogenerated": false,
"ratio": 4.600635593220339,
"config_test"... |
from Expression import *
class ConstraintExpression(Expression):
"""
Class representing a constraint expression node in the AST of a MLP
"""
EQ = "="
LE = "<="
GE = ">="
NEQ = "!="
LT = "<"
GT = ">"
def __init__(self):
Expression.__init__(self)
class ConstraintExp... | {
"repo_name": "rafaellc28/Latex2MiniZinc",
"path": "latex2minizinc/ConstraintExpression.py",
"copies": "1",
"size": "8157",
"license": "mit",
"hash": -3405145426554031600,
"line_mean": 32.7107438017,
"line_max": 192,
"alpha_frac": 0.6466838298,
"autogenerated": false,
"ratio": 4.949635922330097,
... |
from Expression import *
class EntryLogicalExpression(Expression):
"""
Class representing an entry of logical expression in the AST of the MLP
"""
def __init__(self):
Expression.__init__(self)
class EntryLogicalExpressionRelational(EntryLogicalExpression):
"""
Class representing an en... | {
"repo_name": "rafaellc28/Latex2MiniZinc",
"path": "latex2minizinc/EntryLogicalExpression.py",
"copies": "1",
"size": "11489",
"license": "mit",
"hash": -2603553556374714400,
"line_mean": 30.0513513514,
"line_max": 137,
"alpha_frac": 0.6505352946,
"autogenerated": false,
"ratio": 4.76919883769198... |
from Expression import *
class FunctionExpression(Expression):
"""
Class representing a function expression node in the AST
"""
def __init__(self, _type, name, arguments, expression = None, typeIsVariable = False, annotation = None):
"""
:param _type : ID | NaturalSet | Intege... | {
"repo_name": "rafaellc28/Latex2MiniZinc",
"path": "latex2minizinc/FunctionExpression.py",
"copies": "1",
"size": "2160",
"license": "mit",
"hash": 68913634800170990,
"line_mean": 29.4225352113,
"line_max": 112,
"alpha_frac": 0.6060185185,
"autogenerated": false,
"ratio": 4.685466377440347,
"co... |
from Expression import *
class LetExpression(Expression):
"""
Class representing a let expression node in the AST
"""
def __init__(self, arguments, expression):
"""
:param arguments : ArgumentList
:param expression : NumericExpression | SymbolicExpression | LetExpression
... | {
"repo_name": "rafaellc28/Latex2MiniZinc",
"path": "latex2minizinc/LetExpression.py",
"copies": "1",
"size": "1414",
"license": "mit",
"hash": 4682412944636604000,
"line_mean": 27.8571428571,
"line_max": 108,
"alpha_frac": 0.6315417256,
"autogenerated": false,
"ratio": 4.859106529209622,
"confi... |
from Expression import *
class LinearExpression(Expression):
"""
Class representing a linear expression node in the AST of a MLP
"""
def __init__(self):
Expression.__init__(self)
class ValuedLinearExpression(LinearExpression):
"""
Class representing a valued linear expression node in ... | {
"repo_name": "rafaellc28/Latex2MiniZinc",
"path": "latex2minizinc/LinearExpression.py",
"copies": "1",
"size": "8260",
"license": "mit",
"hash": -5000465024212564000,
"line_mean": 28.5,
"line_max": 123,
"alpha_frac": 0.6222760291,
"autogenerated": false,
"ratio": 4.931343283582089,
"config_tes... |
from Expression import *
class NumericExpression(Expression):
"""
Class representing a numeric expression node in the AST of a MLP
"""
def __init__(self):
Expression.__init__(self)
class NumericExpressionWithFunction(NumericExpression):
"""
Class representing a numeric expression with ... | {
"repo_name": "rafaellc28/Latex2MiniZinc",
"path": "latex2minizinc/NumericExpression.py",
"copies": "1",
"size": "15380",
"license": "mit",
"hash": -4320254528450504700,
"line_mean": 28.5201535509,
"line_max": 214,
"alpha_frac": 0.6138491547,
"autogenerated": false,
"ratio": 4.779366065879429,
... |
from .expression import *
class Parser:
"""The parser creates expression object trees from pattern strings.
"""
def __init__(self):
self._context = None
self._stack = []
self._group_count = 1
self._groupindex = {}
self._expression_cache = {}
@property
def _... | {
"repo_name": "elaru/python3-cre",
"path": "cre/parser.py",
"copies": "1",
"size": "9307",
"license": "isc",
"hash": -1246641101198817800,
"line_mean": 40.1814159292,
"line_max": 79,
"alpha_frac": 0.5039217793,
"autogenerated": false,
"ratio": 5.055404671374253,
"config_test": false,
"has_no_... |
from Expression import *
class PredicateExpression(Expression):
"""
Class representing a predicate expression node in the AST
"""
def __init__(self, name, arguments, expression = None):
"""
:param name : Identifier
:param arguments : Declarations
:param expressio... | {
"repo_name": "rafaellc28/Latex2MiniZinc",
"path": "latex2minizinc/PredicateExpression.py",
"copies": "1",
"size": "1722",
"license": "mit",
"hash": 601345117622745500,
"line_mean": 27.7,
"line_max": 102,
"alpha_frac": 0.6196283391,
"autogenerated": false,
"ratio": 4.850704225352112,
"config_te... |
from Expression import *
class Range(Expression):
"""
Class representing a range in the AST of the MLP
"""
def __init__(self, rangeInit, rangeEnd, by = None):
"""
Set the range init and end
:param rangeInit : NumericExpression | Identifier
:param rangeEnd ... | {
"repo_name": "rafaellc28/Latex2MiniZinc",
"path": "latex2minizinc/Range.py",
"copies": "1",
"size": "1864",
"license": "mit",
"hash": -9049413691505297000,
"line_mean": 27.2424242424,
"line_max": 106,
"alpha_frac": 0.5665236052,
"autogenerated": false,
"ratio": 4.625310173697271,
"config_test"... |
from Expression import *
class String(Expression):
"""
Class representing a number node in the AST of the MLP
"""
def __init__(self, string):
"""
Set the string
:param string: str
"""
Expression.__init__(self)
string = string.replace("\... | {
"repo_name": "rafaellc28/Latex2MiniZinc",
"path": "latex2minizinc/String.py",
"copies": "1",
"size": "1339",
"license": "mit",
"hash": -1777668979801185800,
"line_mean": 20.6129032258,
"line_max": 58,
"alpha_frac": 0.4861837192,
"autogenerated": false,
"ratio": 4.816546762589928,
"config_test"... |
from Expression import *
class SymbolicExpression(Expression):
"""
Class representing a numeric expression node in the AST of a MLP
"""
def __init__(self):
Expression.__init__(self)
class SymbolicExpressionWithFunction(SymbolicExpression):
"""
Class representing a numeric expression wi... | {
"repo_name": "rafaellc28/Latex2MiniZinc",
"path": "latex2minizinc/SymbolicExpression.py",
"copies": "1",
"size": "9050",
"license": "mit",
"hash": -7484011276747940000,
"line_mean": 29.3691275168,
"line_max": 139,
"alpha_frac": 0.6323756906,
"autogenerated": false,
"ratio": 4.9426542872747135,
... |
from .expression import _unary_ops, _binary_ops, reversable
from future.utils import with_metaclass
from vaex.expression import expression_namespace
from vaex.delayed import delayed
class Meta(type):
def __new__(upperattr_metaclass, future_class_name,
future_class_parents, attrs):
for op i... | {
"repo_name": "maartenbreddels/vaex",
"path": "packages/vaex-core/vaex/stat.py",
"copies": "1",
"size": "4237",
"license": "mit",
"hash": 1296111506213096400,
"line_mean": 34.0165289256,
"line_max": 132,
"alpha_frac": 0.5744630635,
"autogenerated": false,
"ratio": 3.789803220035778,
"config_tes... |
from ..expression_node import ExpressionNode
from .....vm.globals import nilObject, trueObject, falseObject
from .....vmobjects.block_ast import AstBlock
class IfTrueIfFalseNode(ExpressionNode):
_immutable_fields_ = ['_rcvr_expr?', '_true_expr?', '_false_expr?',
'_universe']
_chil... | {
"repo_name": "SOM-st/RTruffleSOM",
"path": "src/som/interpreter/ast/nodes/specialized/if_true_false.py",
"copies": "3",
"size": "3971",
"license": "mit",
"hash": -3606284419640660000,
"line_mean": 36.1121495327,
"line_max": 78,
"alpha_frac": 0.5802064971,
"autogenerated": false,
"ratio": 3.71121... |
from Expressions.Addresable import Addressable
from Expressions.Nil import Nil
class Array(Addressable):
def __init__(self, items):
self.items = items
def eval(self):
items = []
for i in self.items:
items.append(i.eval())
return items
def get(self, property):
... | {
"repo_name": "mathiasquintero/LlamaLang",
"path": "Expressions/Array.py",
"copies": "1",
"size": "1136",
"license": "mit",
"hash": 2816749022566007000,
"line_mean": 22.6875,
"line_max": 46,
"alpha_frac": 0.548415493,
"autogenerated": false,
"ratio": 3.9172413793103447,
"config_test": false,
... |
from Expressions.Expr import Expr
class IfThenElse(Expr):
def __init__(self, condition, then_block, else_block, context):
self.condition = condition
self.then_block = then_block
self.else_block = else_block
self.context = context
def eval(self):
result_of_condition = s... | {
"repo_name": "mathiasquintero/LlamaLang",
"path": "Expressions/Control/If.py",
"copies": "1",
"size": "1243",
"license": "mit",
"hash": -3642166270512875500,
"line_mean": 36.6666666667,
"line_max": 96,
"alpha_frac": 0.6564762671,
"autogenerated": false,
"ratio": 4.157190635451505,
"config_test... |
from ..expressions import BaseExpression, BaseIncludeExpression
from ..cache import Cache
import os
from ..utils import make_url_path
from ..appconf import AppConfHelper
import simplejson
class IncludeExpression(BaseIncludeExpression):
def __init__(self, settings):
super(IncludeExpression, self).__init__(... | {
"repo_name": "aspyatkin/assetoolz",
"path": "assetoolz/expressions/scripts.py",
"copies": "1",
"size": "2853",
"license": "mit",
"hash": -4980983766834446000,
"line_mean": 31.7931034483,
"line_max": 146,
"alpha_frac": 0.5951629863,
"autogenerated": false,
"ratio": 3.5440993788819877,
"config_t... |
from ..expressions import BaseExpression, BaseIncludeExpression
import os
from ..cache import Cache
from ..utils import make_url_path
class IncludeExpression(BaseIncludeExpression):
def __init__(self, settings):
super(IncludeExpression, self).__init__(
settings,
settings.asset._set... | {
"repo_name": "aspyatkin/assetoolz",
"path": "assetoolz/expressions/stylesheets.py",
"copies": "1",
"size": "2421",
"license": "mit",
"hash": -979324291143462700,
"line_mean": 31.7162162162,
"line_max": 93,
"alpha_frac": 0.5819909128,
"autogenerated": false,
"ratio": 3.7246153846153844,
"config... |
from expressions import Compiler, ExpressionError, default_dialect
class bubbles_dialect(default_dialect):
operators = {
# "^": (1000, RIGHT, BINARY),
"~": (1000, None, UNARY),
"¬": (1000, None, UNARY),
"*": (900, LEFT, BINARY),
"/": (900, LEFT, BINARY),
"%": (900, L... | {
"repo_name": "bijoyabraham/bubbles",
"path": "bubbles/expression.py",
"copies": "4",
"size": "2667",
"license": "mit",
"hash": 1575570276585982000,
"line_mean": 28.8876404494,
"line_max": 78,
"alpha_frac": 0.5669172932,
"autogenerated": false,
"ratio": 3.8550724637681157,
"config_test": false,... |
from .expressions import *
from .collections import *
from .split_apply_combine import *
from .broadcast import *
from .reductions import *
from ..dispatch import dispatch
def lean_projection(expr):
""" Insert projections to keep dataset as thin as possible
>>> t = Symbol('t', 'var * {a: int, b: int, c: int,... | {
"repo_name": "vitan/blaze",
"path": "blaze/expr/optimize.py",
"copies": "1",
"size": "3835",
"license": "bsd-3-clause",
"hash": -3200886062935420400,
"line_mean": 26.0070422535,
"line_max": 84,
"alpha_frac": 0.6393741851,
"autogenerated": false,
"ratio": 3.6247637051039696,
"config_test": fals... |
from expressions import rex, rex_commit
from transaction import Transaction
from variable import Variable
from utils import distinct, gerenerate_object
from operation import Operation
class Sheduler():
__expression = None
__transactions = None
__variables = None
def __init__(self, expression):
self.__expression... | {
"repo_name": "saraivaufc/TS-Basico",
"path": "sheduler.py",
"copies": "1",
"size": "2092",
"license": "mit",
"hash": -3777837377585116700,
"line_mean": 25.4810126582,
"line_max": 77,
"alpha_frac": 0.6577437859,
"autogenerated": false,
"ratio": 3.0764705882352943,
"config_test": false,
"has_n... |
from .expressions import Value
from ..exceptions import BuilderError
def get_param_store(paramstyle):
if paramstyle == "qmark":
return QmarkParamStore()
elif paramstyle == "numeric":
return NumericParamStore()
elif paramstyle == "named":
return NamedParamStore()
elif paramstyle ... | {
"repo_name": "modimore/BreezeBlocks",
"path": "package/breezeblocks/sql/param_store.py",
"copies": "1",
"size": "3955",
"license": "mit",
"hash": -6697936335751226000,
"line_mean": 30.8951612903,
"line_max": 78,
"alpha_frac": 0.613147914,
"autogenerated": false,
"ratio": 3.9788732394366195,
"c... |
from Expressions.Nil import Nil
from Expressions.Exception import ExceptionClass
class Parser(object):
def __init__(self, text, context):
self.text = text
self.context = context
self.sub_parsers = []
self.internal = [self.parse_brackets]
self.pos = 0
if len(text) > ... | {
"repo_name": "mathiasquintero/LlamaLang",
"path": "Parser/Parser.py",
"copies": "1",
"size": "3348",
"license": "mit",
"hash": 351086240287908100,
"line_mean": 28.8928571429,
"line_max": 80,
"alpha_frac": 0.5014934289,
"autogenerated": false,
"ratio": 4.359375,
"config_test": false,
"has_no_... |
from Expressions.Var import Var
from Expressions.Expr import Expr
from Expressions.Nil import Nil
from Context import Context
import re
class Function(Expr):
def __init__(self, parameters, context, code, change_code):
self.parameters = []
self.context = Context(context)
self.code = code + ... | {
"repo_name": "mathiasquintero/LlamaLang",
"path": "Expressions/Operations/Function.py",
"copies": "1",
"size": "2529",
"license": "mit",
"hash": 6676275654721993000,
"line_mean": 31.4358974359,
"line_max": 98,
"alpha_frac": 0.5824436536,
"autogenerated": false,
"ratio": 4.11219512195122,
"conf... |
from expr.feature import *
__author__ = 'Danyang'
class WeightedHS(SpatialHistogram): # per gabor
def __init__(self, lbp_operator=ExtendedLBP(3), sz=(8, 8), X=None, y=None):
super(WeightedHS, self).__init__(lbp_operator, sz) # must be placed before
self.weights = {}
self.Hs = {}
... | {
"repo_name": "idf/FaceReader",
"path": "expr/weighted_hs.py",
"copies": "1",
"size": "4759",
"license": "mit",
"hash": -1573009565819045600,
"line_mean": 32.7517730496,
"line_max": 114,
"alpha_frac": 0.5171254465,
"autogenerated": false,
"ratio": 3.004419191919192,
"config_test": false,
"has... |
from expr import Expr
from dsltools import Node
class Stmt(Node):
_members = ['source_info']
def block_to_str(stmts):
body_str = '\n'
body_str += '\n'.join([str(stmt) for stmt in stmts])
return body_str.replace('\n', '\n ')
def phi_nodes_to_str(phi_nodes):
parts = ["%s <- phi(%s, %s)" %
(va... | {
"repo_name": "pombredanne/parakeet",
"path": "parakeet/syntax/stmt.py",
"copies": "2",
"size": "3673",
"license": "bsd-3-clause",
"hash": -5064898286714935000,
"line_mean": 23.4933333333,
"line_max": 80,
"alpha_frac": 0.5711952083,
"autogenerated": false,
"ratio": 2.995921696574225,
"config_te... |
from expr import Expr
from evalf import EvalfMixin
from sympify import _sympify
def Rel(a, b, op):
"""
A handy wrapper around the Relational class.
Rel(a,b, op)
Example:
>>> from sympy import Rel
>>> from sympy.abc import x, y
>>> Rel(y, x+x**2, '==')
y == x**2 + x
"""
return ... | {
"repo_name": "jdsika/TUM_HOly",
"path": "openrave/sympy/core/relational.py",
"copies": "6",
"size": "4505",
"license": "mit",
"hash": 2170779129988213500,
"line_mean": 20.7632850242,
"line_max": 91,
"alpha_frac": 0.5358490566,
"autogenerated": false,
"ratio": 3.29312865497076,
"config_test": f... |
from expr import Expr
from sage.all import MixedIntegerLinearProgram
from sympy import Add, Mul, Integer, Symbol, StrictLessThan, LessThan, \
StrictGreaterThan, GreaterThan, Unequality, Equality
from operator import add, mul, lt, le, gt, ge, ne, eq
methods = {
StrictLessThan: lt,
LessThan: ... | {
"repo_name": "henry-nazare/llvm-sage",
"path": "Runtime/llvmsage/milp.py",
"copies": "1",
"size": "1363",
"license": "bsd-3-clause",
"hash": 7980416399331856000,
"line_mean": 30.6976744186,
"line_max": 78,
"alpha_frac": 0.6786500367,
"autogenerated": false,
"ratio": 3.1697674418604653,
"config... |
from expr import Expr
from stmt import Stmt
class Struct(Expr):
"""
Eventually all non-scalar data should be transformed to be created with this
syntax node, signifying explicit struct allocation
"""
def __init__(self, args, type = None, source_info = None):
self.args = tuple(args)
self.type = typ... | {
"repo_name": "pombredanne/parakeet",
"path": "parakeet/syntax/low_level.py",
"copies": "2",
"size": "2735",
"license": "bsd-3-clause",
"hash": 6048395259160712000,
"line_mean": 23.4285714286,
"line_max": 78,
"alpha_frac": 0.6263254113,
"autogenerated": false,
"ratio": 3.6034255599472993,
"conf... |
from expr import Expr
from sympify import _sympify
def Rel(a, b, op):
"""
A handy wrapper around the Relational class.
Rel(a,b, op)
Example:
>>> from sympy import Rel
>>> from sympy.abc import x, y
>>> Rel(y, x+x**2, '==')
y == x + x**2
"""
return Relational(a,b,op)
def Eq(a,... | {
"repo_name": "mattpap/sympy-polys",
"path": "sympy/core/relational.py",
"copies": "1",
"size": "4004",
"license": "bsd-3-clause",
"hash": -3740335256372647400,
"line_mean": 19.9633507853,
"line_max": 91,
"alpha_frac": 0.532967033,
"autogenerated": false,
"ratio": 3.2552845528455285,
"config_te... |
from expr import Expr
class SeqExpr(Expr):
def __init__(self, value, type = None, source_info = None):
self.value = value
self.type = type
self.source_info = source_info
def children(self):
yield self.value
class Enumerate(SeqExpr):
pass
class Zip(SeqExpr):
def __init__(self, values,... | {
"repo_name": "pombredanne/parakeet",
"path": "parakeet/syntax/seq_expr.py",
"copies": "2",
"size": "1295",
"license": "bsd-3-clause",
"hash": -1041925968793427700,
"line_mean": 22.9814814815,
"line_max": 91,
"alpha_frac": 0.6239382239,
"autogenerated": false,
"ratio": 3.6376404494382024,
"conf... |
from .expr import GeneExpression
from .hpa import HPA
from .. import id_mapping
from .. import sql
import csv
class HPA_All(HPA):
"""
A sub class from HPA which does not filter out any data based on
reliability (in contrast to the regular HPA class, which only
keeps reliable data in the pipeline)
... | {
"repo_name": "patflick/tsppi",
"path": "src/pappi/expr/hpa_all.py",
"copies": "1",
"size": "1248",
"license": "mit",
"hash": 6376742265438533000,
"line_mean": 31.8421052632,
"line_max": 73,
"alpha_frac": 0.6105769231,
"autogenerated": false,
"ratio": 3.961904761904762,
"config_test": false,
... |
from .expr import GeneExpression
from .. import id_mapping
from .. import sql
import csv
class Emtab(GeneExpression):
def __init__(self, filename, sql_connection):
"""
"""
# firstly initialize the superclass
GeneExpression.__init__(self, filename, sql_connection, "emtab")
... | {
"repo_name": "patflick/tsppi",
"path": "src/pappi/expr/emtab.py",
"copies": "1",
"size": "2662",
"license": "mit",
"hash": -8662113764044450000,
"line_mean": 35.9722222222,
"line_max": 79,
"alpha_frac": 0.5875281743,
"autogenerated": false,
"ratio": 3.8192252510760403,
"config_test": false,
... |
from .expr import GeneExpression
from .. import id_mapping
from .. import sql
import csv
class HPA(GeneExpression):
def __init__(self, filename, sql_connection):
"""
Constructs the Human Protein Atlas gene expression dataset
"""
# firstly initialize the superclass
GeneExpr... | {
"repo_name": "patflick/tsppi",
"path": "src/pappi/expr/hpa.py",
"copies": "1",
"size": "2957",
"license": "mit",
"hash": -3690869535985410600,
"line_mean": 36.9102564103,
"line_max": 78,
"alpha_frac": 0.502874535,
"autogenerated": false,
"ratio": 4.023129251700681,
"config_test": false,
"has... |
from .expr import GeneExpression
from .. import id_mapping
from .. import sql
import csv
class RnaSeqAtlas(GeneExpression):
def __init__(self, filename, sql_connection):
"""
"""
# firstly initialize the superclass
GeneExpression.__init__(self, filename, sql_connection, "rnaseq_atl... | {
"repo_name": "patflick/tsppi",
"path": "src/pappi/expr/rnaseq_atlas.py",
"copies": "1",
"size": "2252",
"license": "mit",
"hash": 4975218281676536000,
"line_mean": 35.3225806452,
"line_max": 79,
"alpha_frac": 0.5781527531,
"autogenerated": false,
"ratio": 3.791245791245791,
"config_test": fals... |
from .expr import GeneExpression
from .. import id_mapping
from .. import sql
import csv
# TODO remove this one a proper handleing of id_mapping tables is implemented
from .. import data_config
class GeneAtlas(GeneExpression):
def __init__(self, filename, sql_connection):
"""
"""
# first... | {
"repo_name": "patflick/tsppi",
"path": "src/pappi/expr/gene_atlas.py",
"copies": "1",
"size": "3347",
"license": "mit",
"hash": -1503454824246888000,
"line_mean": 38.8452380952,
"line_max": 79,
"alpha_frac": 0.5578129668,
"autogenerated": false,
"ratio": 3.9845238095238096,
"config_test": fals... |
from ..expr import *
from ..dispatch import dispatch
from operator import and_
from toolz import first, reduce
import inspect
__all__ = ['inject', 'Filter', 'desc', 'select', 'arrange', 'transform',
'group_by', 'summarize', 'n', 'mutate', 'n_distinct']
def inject(t, ns=None):
""" Inject columns into loca... | {
"repo_name": "vitan/blaze",
"path": "blaze/api/dplyr.py",
"copies": "1",
"size": "2100",
"license": "bsd-3-clause",
"hash": -6536231139768285000,
"line_mean": 19.1923076923,
"line_max": 72,
"alpha_frac": 0.5480952381,
"autogenerated": false,
"ratio": 3.0791788856304985,
"config_test": false,
... |
from ..expr.types import tstruct
class PlacementTree:
def __init__(self, name, width, height, children):
self.name = name
self.width = width
self.height = height
self.children = children
def __repr__(self):
return f'PlacementTree({self.name}, {self.width}, {self.height... | {
"repo_name": "cseed/hail",
"path": "hail/python/hail/utils/placement_tree.py",
"copies": "2",
"size": "1630",
"license": "mit",
"hash": 3644459977799545300,
"line_mean": 34.4347826087,
"line_max": 96,
"alpha_frac": 0.5441717791,
"autogenerated": false,
"ratio": 4.014778325123153,
"config_test"... |
from .expr_with_limits import ExprWithLimits
class ReorderError(NotImplementedError):
"""Exception raised when trying to reorder dependent limits."""
def __init__(self, expr, msg):
super().__init__(f'{expr} could not be reordered: {msg}.')
class ExprWithIntLimits(ExprWithLimits):
"""Represents ... | {
"repo_name": "skirpichev/omg",
"path": "diofant/concrete/expr_with_intlimits.py",
"copies": "2",
"size": "9591",
"license": "bsd-3-clause",
"hash": -5883128551401339000,
"line_mean": 31.5118644068,
"line_max": 106,
"alpha_frac": 0.4877489313,
"autogenerated": false,
"ratio": 3.3061013443640124,
... |
from exptools.core.session import EyelinkSession
from trial import LR_IMTrial
from psychopy import visual, clock
import numpy as np
import os
import exptools
import json
import glob
import random
class LR_IMSession(EyelinkSession):
def __init__(self, *args, **kwargs):
super(LR_IMSession, self).__init__(... | {
"repo_name": "tknapen/eyetracking_course",
"path": "experiments/LR_IM/session.py",
"copies": "1",
"size": "4800",
"license": "mit",
"hash": 2521123736533427000,
"line_mean": 36.7952755906,
"line_max": 107,
"alpha_frac": 0.50875,
"autogenerated": false,
"ratio": 4.332129963898917,
"config_test"... |
from exptools.core.session import EyelinkSession
from trial import MSTrial
from psychopy import clock
from psychopy.visual import ImageStim, MovieStim
import numpy as np
import os
import exptools
import json
import glob
class MSSession(EyelinkSession):
def __init__(self, *args, **kwargs):
super(MSSessio... | {
"repo_name": "tknapen/eyetracking_course",
"path": "experiments/MS/session.py",
"copies": "1",
"size": "2167",
"license": "mit",
"hash": 1059848008667787500,
"line_mean": 29.5211267606,
"line_max": 154,
"alpha_frac": 0.5643747116,
"autogenerated": false,
"ratio": 3.781849912739965,
"config_tes... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.