query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Return a list of pairs (script name & docstring header).
def scripts_in_dir(path): introwords = [' ', '\n', '#', 'import', 'from'] listing = sorted(os.listdir(path)) scripts = [] for name in listing: ################################################### # RETRIEVE SCRIPT NAME # ################################...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_help_strings():\n info = {}\n header = \"\"\n with open(\"opsbot/helpdoc.md\") as f:\n content = f.readlines()\n\n for line in content:\n line = line.strip()\n if line.startswith(\"#\"):\n header = line.replace(\"#\", \"\").strip().lower()\n elif not line....
[ "0.6720133", "0.6423718", "0.63382757", "0.63293564", "0.632392", "0.6314456", "0.6085679", "0.60660034", "0.6002245", "0.59871614", "0.59766227", "0.5948891", "0.5947135", "0.59462535", "0.59429747", "0.59323627", "0.5918623", "0.58851224", "0.5884682", "0.58789515", "0.5870...
0.62281835
6
Return a list of pairs (function name & docstring header).
def funcs_in_script(filename): f = open(filename, 'r') lines = f.readlines() f.close() N = len(lines) funcs = [] for n in range(N): line = lines[n] ################################################### # RETRIEVE FUNCTION NAME # ########...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def docstring(func):\n try:\n lines = func.__doc__.strip().split(\"\\n\")\n return [line.strip() for line in lines]\n except AttributeError:\n return None", "def docstring(func: Callable) -> list[str] | None:\n try:\n lines = func.__doc__.strip().split(\"\\n\") # type: ignor...
[ "0.7144321", "0.7080762", "0.70055676", "0.6925417", "0.69090545", "0.68283", "0.6470269", "0.6468826", "0.6404072", "0.6395883", "0.63674814", "0.6360474", "0.63150096", "0.63108826", "0.63014483", "0.62945926", "0.6265253", "0.62603074", "0.6258753", "0.62337863", "0.621717...
0.6647425
6
Return list of subdirectories not starting with '.' .
def dirs_in_dir(path): listing = sorted(os.listdir(path)) dirs = [] for name in listing: longname = path + '/' + name if name[0] == '.': continue if not os.path.isdir(longname): continue dirs.append(name) return dirs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mylistdir(directory):\n filelist = os.listdir(directory)\n return [x for x in filelist\n if not (x.startswith('.'))]", "def mylistdir(directory):\n filelist = os.listdir(directory)\n return [x for x in filelist\n if not (x.startswith('.'))]", "def mylistdir(directory):\n ...
[ "0.73139125", "0.73139125", "0.73139125", "0.73139125", "0.72058433", "0.71622854", "0.7131562", "0.7026044", "0.6960873", "0.6906436", "0.68938756", "0.688624", "0.6819984", "0.6783173", "0.6750145", "0.6742553", "0.673654", "0.6732434", "0.672395", "0.6694297", "0.6580935",...
0.6647289
20
Return a str (one line for each function).
def text_for_funcs_in_script(filename, prefix): funcs = funcs_in_script(filename) ################################################### # FIND LENGTH OF LONGEST FUNCTION NAME # ################################################### maxlen = 0 for func in funcs: name, header = func...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self) -> str:\n return f\"<Function[{self.name}](line:{self.line})>\"", "def __str__(self):\n header = [\n ' ObjectiveFunction:']\n header += [('Function: {}').format(self.func.__name__)]\n header += [('Objective: {}').format(self.objective)]\n return ('\\...
[ "0.67271453", "0.6665395", "0.6479111", "0.6360932", "0.6307341", "0.6295157", "0.6287792", "0.62198514", "0.62004966", "0.6192446", "0.61677325", "0.6148869", "0.6146638", "0.61425155", "0.6135748", "0.61207575", "0.6108479", "0.6081794", "0.6076851", "0.6067959", "0.6054603...
0.7050024
0
Return a str (one line exactly).
def text_for_script(script, prefix, headerpos): filename, header = script name = filename[:-3] text = (prefix + name).ljust(headerpos - 1) text = text + ' > ' + header + '\n' return text
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def string(self) -> str:\n if self._string is None:\n self._string = self.string_with_newline(self.newline)\n return self._string", "def to_portable_text( line ):\n \n # in case it's zero-length, don't add chars\n if not len(line):\n return ''\n\n return strip_line_end...
[ "0.6697755", "0.6560074", "0.64449155", "0.64010245", "0.63873035", "0.6309058", "0.62780553", "0.6171928", "0.6153172", "0.61454713", "0.61002374", "0.60904455", "0.60727566", "0.6045275", "0.60137784", "0.60054994", "0.6004422", "0.59751123", "0.5952247", "0.5940756", "0.59...
0.0
-1
Return a str (one line for script and each function).
def text_for_file(script, filename, prefix, last=False): sprefix = prefix + '+-{S} ' if last: fprefix = prefix + ' +-[F] ' else: fprefix = prefix + '| +-[F] ' ################################################### # SCRIPT HEADER # #############...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def text_for_funcs_in_script(filename, prefix):\n funcs = funcs_in_script(filename)\n\n ###################################################\n # FIND LENGTH OF LONGEST FUNCTION NAME #\n ###################################################\n maxlen = 0\n for func in funcs:\n name, ...
[ "0.7303611", "0.6286587", "0.6221039", "0.6151164", "0.6143013", "0.6134248", "0.6124986", "0.61206853", "0.6037011", "0.6010389", "0.5960895", "0.59513116", "0.5928502", "0.59244084", "0.5921758", "0.58872145", "0.5861094", "0.58580256", "0.58306026", "0.57690144", "0.575912...
0.5844216
18
Print colorcoded text on screen.
def print_text(text): colors = [ ['<D>', '\n', '01;31'], # directory ['{S}', '\n', '01;33'], # script ['[F]', '>', '01;34'], # function # [' >', '\n', '10;39'], # header ] ncol = '00;31' CSI = '\x1B[' lines = text.split('\n') newtext = '' N = l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def color_print(txt, foreground=PALETTE['white'], background=PALETTE['black']):\n print(color_text(txt, foreground, background))", "def printcolor(color, text):\r\n pushcolor()\r\n setcolor(color)\r\n print text\r\n popcolor()", "def printc(text, color='black', style='normal', **kwargs):\n\n ...
[ "0.8015446", "0.776578", "0.7452376", "0.73056746", "0.7267108", "0.72310424", "0.71869147", "0.71509874", "0.71038926", "0.70698655", "0.7024896", "0.69895977", "0.69446874", "0.69243824", "0.6815526", "0.6782726", "0.67139834", "0.6694427", "0.66682565", "0.66650987", "0.66...
0.6557827
24
Returns the path to the configuration file specified. If there is a file at the path specified, it is returned as is; if not, the conf/ directory of the installed package is checked. If that fails as well, ValueError is raised.
def get_config_file(config_file): if os.path.isfile(config_file): return config_file elif resource_exists('pytorch_lm.conf', config_file): return resource_filename('pytorch_lm.conf', config_file) else: raise ValueError('Could not find configuration file {}'.format(config_file))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_configuration_file():\n path = os.path.abspath(os.curdir)\n while path != os.sep:\n config_path = os.path.join(path, CONFIG_FILE_NAME)\n if os.path.exists(config_path):\n return config_path\n path = os.path.dirname(path)\n return None", "def _cfg_path(argv):\n ...
[ "0.7365118", "0.71757233", "0.71701115", "0.7160776", "0.71146214", "0.7033531", "0.6950744", "0.6920347", "0.6855532", "0.6850377", "0.6788834", "0.6787784", "0.67747295", "0.67671376", "0.67382795", "0.6719308", "0.6704874", "0.6688712", "0.66616666", "0.6629168", "0.661700...
0.6304383
36
Creates an object from the specified configuration dictionary.
def create_object(config, base_module=None, args=None, kwargs=None): try: cls, args, kwargs = __clsfn_args_kwargs(config, 'class', base_module, args, kwargs) return cls(*args, **kwargs) except Exception as e: raise Exception( 'C...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_config(config: dict):\n pass", "def from_config(cls, config):\n return cls(**config)", "def from_config(cls, config):\n return cls(**config)", "def from_config(cls, config: Dict):\n res = cls()\n res.validate_config(config)\n for k, v in config.items():\n ...
[ "0.7576743", "0.7491255", "0.7491255", "0.74420494", "0.7376429", "0.7341104", "0.73334914", "0.7317437", "0.7207449", "0.71187824", "0.7053521", "0.7053521", "0.7012224", "0.70090747", "0.70010585", "0.6958523", "0.6938643", "0.6925775", "0.6907422", "0.6886036", "0.68261015...
0.0
-1
Creates a zeroparameter function from the specified configuration dictionary.
def create_function(config, base_module=None, args=None, kwargs=None): try: fun, args, kwargs = __clsfn_args_kwargs(config, 'function', base_module, args, kwargs) return partial(fun, *args, **kwargs) except Exception as e: raise Exception( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_config(func):\n\t\n\tdef decorator(filename):\n\t\twith open(filename, 'r') as file_in:\n\t\t\tconfig = json.load(file_in)\n\n\t\t#'**' takes a dict and extracts its contents and passes them as parameters to a function.\n\t\t#returns the intial function with new arguments????\n\t\treturn func(**config)\n\...
[ "0.5940637", "0.5463128", "0.5432406", "0.52039313", "0.51201224", "0.50930494", "0.50807434", "0.5038867", "0.50207514", "0.4972701", "0.49464762", "0.4940924", "0.49071813", "0.49036568", "0.4877582", "0.48682946", "0.48465356", "0.48246568", "0.47884876", "0.478831", "0.47...
0.4542732
46
Utility function called by both create_object and create_function. It implements the code that is common to both.
def __clsfn_args_kwargs(config, key, base_module=None, args=None, kwargs=None): logger = logging.getLogger('pytorch_lm.utils.config') logger.config('config: {}, key: {}, base_module: {}, args: {}, kwargs: {}'.format( config, key, base_module, args, kwargs)) args = args or [] kwargs = kwargs or {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(fun_name):", "def __call__(object):", "def _create_impl(self):", "def __call__(obj):", "def create_function(self, function):\n if function.body:\n self.create_function_internal(function)\n else:\n self.create_function_external(function)", "def __call__():"...
[ "0.64084566", "0.6119181", "0.6092251", "0.5957324", "0.5912294", "0.58969796", "0.58969796", "0.58969796", "0.58969796", "0.58969796", "0.57878953", "0.577008", "0.5768729", "0.5686809", "0.5656731", "0.56472236", "0.56431586", "0.56403965", "0.5634076", "0.5620957", "0.5620...
0.0
-1
Take the addressLocality field in each object, tokenize it by space and comma, lower case it and convert to set of words. use each token in that set as a 'key' for the cluster. We'll start by analyzing those.
def cluster_by_addressLocality(input_file, output_file=None): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assignment(self, addresses, centroids, k):\n newClusters = {}\n print centroids\n for (lat, long) in addresses:\n minDistance = float('Inf')\n minIndex = 0\n for i in range(k):\n if pow(self.euclideanDistance((lat, long), centroids[i]),2) < m...
[ "0.5454766", "0.5336172", "0.5156881", "0.49238616", "0.49154887", "0.4913995", "0.49080405", "0.4892176", "0.4884314", "0.48810974", "0.48677456", "0.48650676", "0.48480317", "0.48207906", "0.48084152", "0.47848007", "0.47784892", "0.47779834", "0.4769221", "0.4753887", "0.4...
0.6299373
0
Walks the tree and creates the data structures. Creates the functions to stuff and unstuff the matrices.
def __init__(self): super(OperatorCodegen, self).__init__()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _initialize_trees(self):", "def _build_micro_tree_tables(self):\n # A mapping that associates micro tree encoding with its corresponding table.\n self._micro_tables = {}\n\n # A mapping that stores the encoding of each micro tree.\n self._codes = {}\n\n # For every micro tr...
[ "0.6267662", "0.60259235", "0.59869826", "0.5921073", "0.58857435", "0.5882541", "0.5876579", "0.580982", "0.57775646", "0.57715905", "0.5767376", "0.573859", "0.5738266", "0.572246", "0.5721447", "0.5694942", "0.5686689", "0.568482", "0.56786877", "0.5619537", "0.5613771", ...
0.0
-1
Access the fA Function object
def fA(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getFunction(self) -> ghidra.program.model.listing.Function:\n ...", "def fun_a(self):\n pass", "def f(self):\n return self._f", "def getFunction(self, name: unicode) -> ghidra.program.model.listing.Function:\n ...", "def _function_class(self):\n return FriCASExpectFun...
[ "0.7123425", "0.68525356", "0.64563775", "0.64336723", "0.639151", "0.63692874", "0.62956244", "0.61945254", "0.61939263", "0.6183318", "0.6174362", "0.6169994", "0.6164318", "0.61532414", "0.61523753", "0.61212516", "0.61144304", "0.6113079", "0.6110896", "0.6106164", "0.610...
0.7363549
0
Access the fAT Function object
def fAT(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getFunction(self) -> ghidra.program.model.listing.Function:\n ...", "def _function_class(self):\n return FriCASExpectFunction", "def _func(self):\n return self._get_flint_func(self.domain)", "def getFunction(self, name: unicode) -> ghidra.program.model.listing.Function:\n ..."...
[ "0.7442082", "0.6662068", "0.6623393", "0.6567047", "0.65216845", "0.6444521", "0.643786", "0.64078254", "0.63968444", "0.6320934", "0.62078595", "0.62051314", "0.6176589", "0.6172265", "0.6146051", "0.6146051", "0.6146051", "0.61392206", "0.61384785", "0.61301565", "0.612650...
0.71219444
1
Access the fG Function object
def fG(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getFunction(self) -> ghidra.program.model.listing.Function:\n ...", "def get_function(self):\n return Gumtree.gumtree.getFunction()", "def f(self):\n return self._f", "def _func(self):\n return self._get_flint_func(self.domain)", "def getFunction(self, name: unicode) -> ghid...
[ "0.76139027", "0.6928935", "0.6813307", "0.6666093", "0.6652074", "0.6623601", "0.6622213", "0.6612022", "0.6381208", "0.6379428", "0.6367264", "0.6351534", "0.6351534", "0.6345019", "0.6327853", "0.6263485", "0.62374866", "0.62359047", "0.62125313", "0.6190691", "0.6170642",...
0.7354346
1
Access the fGT Function object
def fGT(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getFunction(self) -> ghidra.program.model.listing.Function:\n ...", "def get_function(self):\n return Gumtree.gumtree.getFunction()", "def getFunction(self, name: unicode) -> ghidra.program.model.listing.Function:\n ...", "def get_function(self):\n return SSAFunction(self.get_...
[ "0.7529171", "0.70914054", "0.6587597", "0.65838206", "0.6514846", "0.6487289", "0.64291376", "0.63369465", "0.6333028", "0.6299524", "0.62685436", "0.6160553", "0.61599755", "0.615025", "0.6115229", "0.61057097", "0.60911024", "0.60837597", "0.60678166", "0.60626704", "0.604...
0.7073566
2
This code stuffs a function. Compare to base_codegen, where this code is supposed to stuff a matrix.
def stuff_G(self, row_start, row_end, col_start, col_end, expr, row_stride = None): yield ""
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def jit(func):\n return func", "def compile_function(self, function, arguments):", "def set_make_matrix(function: Callable) -> None:\n utilities.make_matrix = function", "def func():", "def map(self, function):\n pass", "def code(self, func, diag=None):\n for y,x in self.coords(di...
[ "0.6206203", "0.6069809", "0.60686535", "0.5979395", "0.59720325", "0.5954085", "0.5873997", "0.58682764", "0.580154", "0.57967407", "0.5762687", "0.5753701", "0.5724385", "0.57081884", "0.5694894", "0.56873566", "0.5684051", "0.56736594", "0.56475306", "0.5591397", "0.558095...
0.0
-1
This code stuffs a function. Compare to base_codegen, where this code is supposed to stuff a matrix.
def stuff_A(self, row_start, row_end, col_start, col_end, expr, row_stride = None): yield ""
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def jit(func):\n return func", "def compile_function(self, function, arguments):", "def set_make_matrix(function: Callable) -> None:\n utilities.make_matrix = function", "def func():", "def map(self, function):\n pass", "def code(self, func, diag=None):\n for y,x in self.coords(di...
[ "0.620657", "0.6069161", "0.60688525", "0.59804285", "0.5972526", "0.59551513", "0.58750457", "0.5868704", "0.58021444", "0.57956773", "0.57629275", "0.5753725", "0.5724397", "0.57087976", "0.56946266", "0.56889766", "0.5683858", "0.5672918", "0.56487095", "0.55898994", "0.55...
0.0
-1
Decorator (function wrapper) that profiles a single function () def func1(...) do something pass
def profileit(func): def wrapper(*args, **kwargs): func_name = func.__name__ + ".pfl" prof = cProfile.Profile() retval = prof.runcall(func, *args, **kwargs) prof.dump_stats(func_name) return retval return wrapper
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decorator(func):\n\n pass", "def _func1_decorated(arg1=None, arg2=None, arg3=None):\n pass", "def decorator(func):\n\t\treturn push_aspect(name or func.__name__, func)", "def profiled(func):\n @functools.wraps(func)\n def inner(*args, **kwargs):\n inner.ncalls += 1\n ret...
[ "0.7450988", "0.72620785", "0.70126975", "0.6972264", "0.68408704", "0.67850906", "0.6736624", "0.67286193", "0.6720863", "0.6684259", "0.651569", "0.65106136", "0.64774334", "0.64649385", "0.6460179", "0.64421695", "0.64346194", "0.6433996", "0.643185", "0.63904345", "0.6386...
0.7052236
2
Function to perform initial MongoDB connection
def mongo_connect(url): try: conn = pymongo.MongoClient(url) logging.info('MongoDB Connected successfully!') return conn except pymongo.errors.ConnectionFailure as e: logging.critical('Could not connect to MongoDB: %s', e)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mongodb_init(cls, host=\"127.0.0.1\", port=27017, username=\"\", password=\"\", dbname=\"admin\"):\n if username and password:\n uri = \"mongodb://{username}:{password}@{host}:{port}/{dbname}\".format(username=quote_plus(username),\n ...
[ "0.80655086", "0.79757553", "0.7897347", "0.7695548", "0.7619804", "0.74800676", "0.74635464", "0.7431229", "0.7418486", "0.7399879", "0.7372623", "0.73360026", "0.7335811", "0.7262686", "0.7192985", "0.7151397", "0.7147047", "0.71425", "0.71320355", "0.7105219", "0.70805097"...
0.65730053
53
Return 404 if page not found
def page_not_found(e): return render_template("404.html"), 404
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def page_not_found(e):\n return 'Sorry, nothing at this URL.', 404", "def page_not_found(e):\n return 'Sorry, nothing at this URL.', 404", "def page_not_found(e):\n return 'Sorry, nothing at this URL.', 404", "def page_not_found(e):\n return 'Sorry, nothing at this URL.', 404", "def page_not_fo...
[ "0.84974337", "0.84974337", "0.84974337", "0.84974337", "0.84974337", "0.84974337", "0.84974337", "0.8477702", "0.8477702", "0.8477702", "0.8477702", "0.8477702", "0.8477702", "0.8477702", "0.8477702", "0.8476172", "0.8475856", "0.84114265", "0.84114265", "0.83721465", "0.834...
0.84348255
17
Return 500 if internal error
def page_not_found(e): return render_template("500.html"), 500
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def internal_error():\n return HttpError(500)", "def internal_error(e):\n return render_template(\"errors/500.html\"), 500", "def internal_server_error(e):\n return render_template(\"error/500.html\"), 500", "def internal_server_error(e):\n return render_template('500.html', error=repr(e)), 5...
[ "0.8590186", "0.79369235", "0.7850166", "0.7727178", "0.77079475", "0.76383144", "0.7637521", "0.762921", "0.7604491", "0.75676584", "0.74954003", "0.7472091", "0.7468832", "0.74648255", "0.7432994", "0.7422329", "0.7403545", "0.7395526", "0.7388409", "0.73620564", "0.7354973...
0.66699046
64
End User Index Page
def index(): mongo_collection = mongo_database["settings"] doc_instructions = mongo_collection.find_one({"id": "instructions"}) instructions = markdown.markdown(doc_instructions['text']) return render_template("index.html", instructions=instructions)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index(self):\n raise cherrypy.HTTPRedirect('/user')", "def index():\n user_list = Users.query.all()\n return render_template('users/index.html'\n ,user_list=user_list\n ,t=t\n ,m=m)", "def show_index():\r\n if 'username' in fl...
[ "0.6812836", "0.67224455", "0.6445621", "0.6424488", "0.6305062", "0.6299848", "0.628896", "0.6261485", "0.62194353", "0.62149787", "0.61903226", "0.61827826", "0.61436796", "0.61418504", "0.6131434", "0.61289495", "0.61160076", "0.60735434", "0.60566485", "0.60406965", "0.60...
0.0
-1
End User Start the Game Page
def start(): mongo_collection = mongo_database["questions"] all_cards = mongo_collection.find({"visible": "Yes"}) objects = [] for object in all_cards: objects.append(object) random.shuffle(objects) return render_template("start.html", cards=objects)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def endGame(self):\n pass", "def endGame():\n return render_template(\"endGame.html\")", "def end_game(self):\n self.game.stop_running()", "def quit_game(self):\n self.done = True", "def end_game(self):\n pygame.event.clear()\n self.screen.fill(BLACK)\n self.sho...
[ "0.8098383", "0.7868887", "0.7788624", "0.7566608", "0.75079966", "0.749887", "0.73686355", "0.73505205", "0.7229242", "0.7220134", "0.7217969", "0.72059", "0.71858746", "0.71403724", "0.71024656", "0.70547473", "0.7050847", "0.7045369", "0.70381325", "0.70274603", "0.6999086...
0.0
-1
Questions Card Update Form
def admin_card_update(card_id): mongo_collection = mongo_database["questions"] card = mongo_collection.find_one({"id": card_id}) return render_template( "admin_card_update.html", card=card, datetime=date_today.strftime("%x"), admin_logged=session.get('logged_in'), adm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _edit_question(request, question):\n latest_revision = question.get_latest_revision()\n preview = None\n revision_form = None\n if request.method == 'POST':\n if 'select_revision' in request.POST:\n # The user submitted to change the revision to start editing from\n rev...
[ "0.6444939", "0.6333186", "0.6309494", "0.61862105", "0.6130509", "0.611069", "0.60459816", "0.601469", "0.5895587", "0.5894713", "0.58369786", "0.5770874", "0.5741646", "0.56520283", "0.5640494", "0.5598499", "0.5576267", "0.55752164", "0.5573383", "0.55517626", "0.55438817"...
0.68466634
0
Questions Card Update Form
def admin_card_delete(card_id): if request.method == "GET": if session.get('logged_in') is True: mongo_collection = mongo_database["questions"] mongo_collection.delete_one({"_id": ObjectId(card_id)}) flash("Questions Card with _id %s been deleted." % card_id) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def admin_card_update(card_id):\n mongo_collection = mongo_database[\"questions\"]\n card = mongo_collection.find_one({\"id\": card_id})\n return render_template(\n \"admin_card_update.html\",\n card=card,\n datetime=date_today.strftime(\"%x\"),\n admin_logged=session.get('logg...
[ "0.68466634", "0.6444939", "0.6333186", "0.6309494", "0.61862105", "0.6130509", "0.611069", "0.60459816", "0.601469", "0.5895587", "0.5894713", "0.58369786", "0.5770874", "0.5741646", "0.56520283", "0.5640494", "0.5598499", "0.5576267", "0.55752164", "0.5573383", "0.55517626"...
0.0
-1
End User Question Card Search
def search(): if request.method == "GET": mongo_collection = mongo_database["questions"] query = request.args.get("keyword") result = mongo_collection.find({"$text": {"$search": query}}) objects = [] for object in result: objects.append(object) return rend...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def question_new_search():", "def QAsearch():\n question = ''\n form = QuestionForm()\n question = form.question.data\n if form.validate_on_submit():\n return redirect(url_for('answer',word=question))\n return render_template(\n 'QAsearch.html',\n title = 'QAsearch Page',\n ...
[ "0.7027612", "0.63900065", "0.63064504", "0.59347034", "0.58513224", "0.5816086", "0.575496", "0.5733428", "0.5699164", "0.56847155", "0.5682055", "0.5622756", "0.56206", "0.559459", "0.5571258", "0.555727", "0.55424446", "0.55356634", "0.5503231", "0.54955155", "0.54665864",...
0.58490396
5
Generate the closest possible SEO friendly path for this campaign. Note that these paths are only generated for campaigns which are already published.
def generate_seo_friendly_path(self, base_pathname_string='', campaignx_we_vote_id='', campaignx_title=None): from politician.controllers_generate_seo_friendly_path import generate_seo_friendly_path_generic return generate_seo_friendly_path_generic( base_pathname_string=base_pathname_string,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _build_url(self):\n u = urlparse.urljoin(settings.SITE_URL, '/#/')\n\n m = self.object.__class__.__name__\n\n if m == 'Workspace':\n return urlparse.urljoin(\n u, 'workspaces/w/{}'.format(self.object.slug)\n )\n elif m == 'Vault':\n re...
[ "0.64412355", "0.6416239", "0.622437", "0.5910468", "0.589471", "0.58929414", "0.58899176", "0.58650005", "0.5810434", "0.578214", "0.57725555", "0.5756489", "0.5720189", "0.5715019", "0.5710717", "0.57071894", "0.56893915", "0.5652677", "0.5633637", "0.56251574", "0.56203246...
0.67637473
0
Initializes database connection and sessionmaker. Creates deals table.
def __init__(self): initialize_db() self.ids_seen = set()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n engine = db_connect()\n create_tables(engine)\n self.Session = sessionmaker(bind=engine)", "def __init__(self):\n engine = db_connect()\n create_reals_table(engine)\n self.Session = sessionmaker(bind=engine)", "def __init__(self):\n engine ...
[ "0.79380476", "0.79118645", "0.7893102", "0.7893102", "0.78095114", "0.7770919", "0.7620192", "0.7543357", "0.7543153", "0.7463215", "0.7461668", "0.739664", "0.7387695", "0.7386896", "0.7386896", "0.73819315", "0.7368666", "0.73659945", "0.73425156", "0.73309356", "0.7312813...
0.0
-1
Save deals in the database. This method is called for every item pipeline component.
def process_item(self, item, spider): if item['id'] in self.ids_seen: raise DropItem("Duplicate item found: {0}".format(item)) else: self.ids_seen.add(item['id']) session = Session() if 'sex' in item: friends = item.pop('friends') for friend in friends: try: s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _store(self):\n self._post_item.save()\n self._attachment_item.save()\n self._marshaller.marshall(self._post_item)", "def save_item(self):\r\n raise NotImplementedError(\"Function not implemented, please implement in sub class\")", "def save_items(self):\n raise NotImplem...
[ "0.67143923", "0.6090062", "0.60548824", "0.59846765", "0.59350044", "0.59109473", "0.58898133", "0.5873593", "0.58670074", "0.5857064", "0.58495605", "0.584549", "0.58348924", "0.5829195", "0.58244884", "0.5822356", "0.58019894", "0.5798544", "0.5765874", "0.57562083", "0.57...
0.0
-1
Determines the color of the traffic light in the image
def get_classification(self, image, light): #TODO implement light color prediction self.counter += 1 # Hack to reduce processing to every second image if self.skip >= 3: # Wrap in lock - (assumption that threading causing stuck classification) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lightness(self):\n min_component = min(self.red, self.green, self.blue)\n max_component = max(self.red, self.green, self.blue)\n avg = (max_component + min_component) / 2\n light = avg / 255\n return light", "def lightness(color):\n\n strongest = max(color.red, color.gre...
[ "0.7198706", "0.7025889", "0.70083666", "0.6910758", "0.68641305", "0.6849346", "0.6840223", "0.6826582", "0.68160725", "0.6730158", "0.6688403", "0.66786885", "0.66235894", "0.65820056", "0.6544322", "0.65343744", "0.6531804", "0.6476259", "0.64725053", "0.64530194", "0.6450...
0.0
-1
Loads a frozen inference graph
def _load_graph(self, graph_file): graph = tf.Graph() with graph.as_default(): od_graph_def = tf.GraphDef() with tf.gfile.GFile(graph_file, 'rb') as fid: serialized_graph = fid.read() od_graph_def.ParseFromString(serialized_graph) t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_frozen_graph(frozen_graph_path, graph=None, session=None):\n from diplomacy_research.utils.tensorflow import tf, tf_logging\n\n # Making sure the path exists\n if not os.path.exists(frozen_graph_path):\n LOGGER.error('The frozen graph %s does not exist.', frozen_graph_path)\n raise ...
[ "0.7145618", "0.71300054", "0.6952633", "0.64996564", "0.6480352", "0.64554673", "0.6437847", "0.6419772", "0.6419772", "0.63925844", "0.638914", "0.63779676", "0.6364601", "0.6306616", "0.6300151", "0.627973", "0.6269959", "0.6266776", "0.6258529", "0.62003803", "0.6152927",...
0.60292816
29
Return boxes with a confidence >= `min_score`
def _filter_boxes(self, min_score, boxes, scores, classes): n = len(classes) idxs = [] for i in range(n): if scores[i] >= min_score: idxs.append(i) filtered_boxes = boxes[idxs, ...] filtered_scores = scores[idxs, ...] filtered_classes ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_boxes(self, min_score, boxes, scores, classes):\n n = len(classes)\n idxs = []\n for i in range(n):\n if scores[i] >= min_score:\n idxs.append(i)\n \n filtered_boxes = boxes[idxs, ...]\n filtered_scores = scores[idxs, ...]\n filt...
[ "0.7317321", "0.72886777", "0.72492224", "0.72279024", "0.6647105", "0.6314491", "0.63112724", "0.61915874", "0.6165219", "0.61569124", "0.6156313", "0.61135215", "0.6062302", "0.5995685", "0.59620845", "0.5960607", "0.5950879", "0.59485", "0.5940718", "0.5940718", "0.5936835...
0.72855526
2
The original box coordinate output is normalized, i.e [0, 1]. This converts it back to the original coordinate based on the image size.
def _to_image_coords(self, boxes, height, width): box_coords = np.zeros_like(boxes) box_coords[:, 0] = boxes[:, 0] * height box_coords[:, 1] = boxes[:, 1] * width box_coords[:, 2] = boxes[:, 2] * height box_coords[:, 3] = boxes[:, 3] * width return box_coords
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __normalizeBox(self):\n self.currentBox = normalizeBox(self.currentBox)", "def normalizeBox(box):\n x, y, w, h = box\n if w < 0:\n x += (w+1)\n w *= -1\n if h < 0:\n y += (h+1)\n h *= -1\n return (x, y, w, h)", "def _normalize(self, x):\n # TODO: imagen...
[ "0.723292", "0.69921345", "0.6769942", "0.6717981", "0.67165715", "0.6675579", "0.6533904", "0.65049106", "0.649512", "0.6349747", "0.6328071", "0.62339395", "0.6228529", "0.6210784", "0.6193241", "0.61773187", "0.61722386", "0.6128335", "0.61150855", "0.6075824", "0.6071684"...
0.5815705
49
Draw bounding boxes on the image
def _draw_boxes(self, image, boxes, classes, thickness=4): for i in range(len(boxes)): bot, left, top, right = boxes[i, ...] class_id = int(classes[i]) - 1 color = self.COLOR_LIST[class_id] cv2.rectangle(image, (left, top), (right, bot), color=color, thickness=thi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_bounding_boxes(self, image_path):\n img = cv.imread(image_path, cv.IMREAD_ANYDEPTH)\n bboxes = np.zeros((img.shape[0], img.shape[1], 3), dtype=np.uint8)\n unique, counts = np.unique(img, return_counts=True)\n for uni in unique:\n if uni == 0:\n continu...
[ "0.80207103", "0.7730494", "0.7663894", "0.75815976", "0.75812364", "0.7569874", "0.7564505", "0.7560773", "0.74707085", "0.74676245", "0.7462541", "0.7429634", "0.7386207", "0.73359627", "0.73075604", "0.73066705", "0.73026776", "0.72940755", "0.7275691", "0.72722554", "0.72...
0.6929667
41
This function calculates the information gain, where ig(f1, f2) = H(f1) H(f1\f2)
def information_gain(f1, f2): ig = ee.entropyd(f1) - conditional_entropy(f1, f2) return ig
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def su_calculation(f1, f2):\n # calculate information gain of f1 and f2, t1 = ig(f1, f2)\n t1 = information_gain(f1, f2)\n # calculate entropy of f1\n t2 = ee.entropyd(f1)\n # calculate entropy of f2\n t3 = ee.entropyd(f2)\n\n su = 2.0 * t1 / (t2 + t3)\n\n return su", "def info_gain(left,...
[ "0.6145874", "0.6053615", "0.58665586", "0.58400637", "0.5828656", "0.5826964", "0.58186895", "0.5816665", "0.579917", "0.5762117", "0.5662728", "0.5646631", "0.563621", "0.55903405", "0.55712414", "0.5564625", "0.5501128", "0.5493852", "0.547589", "0.54473156", "0.54442096",...
0.7910877
0
This function calculates the conditional entropy, where ce = H(f1) I(f1;f2)
def conditional_entropy(f1, f2): ce = ee.entropyd(f1) - ee.midd(f1, f2) return ce
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conditional_entropy_hyper(self) -> float:\n pass", "def conditional_entropy(self) -> float:\n pass", "def information_gain(f1, f2):\n\n ig = ee.entropyd(f1) - conditional_entropy(f1, f2)\n return ig", "def _conditional_entropy_compute(confmat: Tensor) ->Tensor:\n confmat = _drop_em...
[ "0.75129586", "0.74474317", "0.7124733", "0.70022875", "0.6818115", "0.6687272", "0.66868997", "0.6578242", "0.6539494", "0.6472258", "0.6470226", "0.64497244", "0.63971204", "0.63714343", "0.6354874", "0.63437366", "0.6324555", "0.6300499", "0.62546587", "0.6242879", "0.6210...
0.85797334
0
This function calculates the symmetrical uncertainty, where su(f1,f2) = 2IG(f1,f2)/(H(f1)+H(f2))
def su_calculation(f1, f2): # calculate information gain of f1 and f2, t1 = ig(f1, f2) t1 = information_gain(f1, f2) # calculate entropy of f1 t2 = ee.entropyd(f1) # calculate entropy of f2 t3 = ee.entropyd(f2) su = 2.0 * t1 / (t2 + t3) return su
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uncertainty_mm(self,m1,m2):\n # ID and isolation uncertainty (TO BE FIXED)\n unc = (self._muIDISOWeight.value(m1.pt(),m1.eta(),'+1')/self._muIDISOWeight.value(m1.pt(),m1.eta(),'+1')+ \\\n self._muIDISOWeight.value(m2.pt(),m2.eta(),'+1')/self._muIDISOWeight.value(m2.pt(),m2.eta(),'+1'))**2...
[ "0.60060245", "0.58210576", "0.5776708", "0.5709511", "0.56543845", "0.5593671", "0.55274516", "0.5487926", "0.54671097", "0.54472774", "0.54185194", "0.53845024", "0.53705823", "0.5368508", "0.53540176", "0.533016", "0.5324873", "0.5292968", "0.52852327", "0.52852046", "0.52...
0.69187057
0
Return Number of book of people can read
def bookworm(people): for _ in xrange(people): tme, bok, r_t, r_b = input(), [input() for _ in xrange(input())], 0, 0 bok.sort() for i in xrange(len(bok)): if (r_t + bok[i]) <= tme: r_t, r_b = r_t + bok[i], r_b + 1 print r_b
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_books_read(self):\n return len(self.books)", "def count(self):\n return Library.functions.count(self._book)", "def read_library_count(self):\n\t\tprint(\"You have \" + str(self.library_count) + \" books in your kindle library.\")", "def book_count(self):\n\n try:\n ...
[ "0.75218487", "0.73555714", "0.7018053", "0.6586076", "0.65792924", "0.624993", "0.620515", "0.61456853", "0.60552526", "0.6046573", "0.6046573", "0.6046573", "0.6046573", "0.60137206", "0.5944732", "0.59011215", "0.58729774", "0.58672094", "0.58239466", "0.57992905", "0.5798...
0.0
-1
Calls the object, possibly a document template, or just returns it if not callable. (From DT_Util.py)
def render(ob, ns): if hasattr(ob, '__render_with_namespace__'): ob = call_with_ns(ob.__render_with_namespace__, ns) else: base = aq_base(ob) if callable(base): try: if getattr(base, 'isDocTemp', 0): ob = call_with_ns(ob, ns, 2) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self, doc):\n return doc", "def call(self, **kwargs):\n return getattr(self.resource, self.function)(**kwargs)", "def call(self, command, *args, **kwargs):\n\n\tif command in self.command_table:\n\t cmdopts = self.command_table[command]\n\t function = cmdopts.get('function', No...
[ "0.64074135", "0.6054545", "0.59280133", "0.5861802", "0.5852094", "0.5804003", "0.5799347", "0.576929", "0.57642585", "0.57579875", "0.5752793", "0.5752793", "0.5721103", "0.5708474", "0.56446683", "0.56381077", "0.56299543", "0.5622736", "0.5622736", "0.5622736", "0.5622736...
0.5304446
45
Chooses the appropriate rpc class based on the address format. Does not work for EtherscanRPC because there is no good way to check if an api_key is valid. If you know you have an apikey for Etherscan, instantiate the EtherscanRPC client directly.
def rpc_factory(address, verbose): if not isinstance(address, str): raise RPCError('The address must be a string: {!r}'.format(address)) if _os.path.exists(address) and _stat.S_ISSOCK(_os.stat(address).st_mode): return IPCRPC(address, verbose) elif _HTTP.match(address): return HTTPR...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_str(cls, address: str) -> Optional[Address]:\n if len(address) < 26 or len(address) > 35:\n return None\n # decode\n data = base58_decode(address)\n if data is None or len(data) != 25:\n return None\n # check code\n prefix = data[:21]\n ...
[ "0.571346", "0.5449916", "0.52416897", "0.5139773", "0.5136199", "0.5135899", "0.51007897", "0.5040956", "0.49199766", "0.47267127", "0.4723684", "0.46901482", "0.46455255", "0.4626003", "0.4620554", "0.46186823", "0.45921576", "0.45775348", "0.4561937", "0.45299584", "0.4527...
0.6459828
0
Configure access to the GoogleMaps API.
def configure(api_key=None): configuration = {'api_key': api_key} global _default_configuration _default_configuration = configuration
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def google_map_api(request):\n\treturn {\n\t\t'GOOGLE_MAPS_API' : settings.GOOGLE_MAPS_API,\n\t}", "def google_maps(request):\n gmaps_api_key = getattr(settings, 'GOOGLE_MAPS_API', False)\n return {\n 'GOOGLE_MAPS_API': gmaps_api_key,\n 'google_maps': gmaps_api_key\n }", "def googlemaps(...
[ "0.7176968", "0.69526654", "0.67283636", "0.6054561", "0.5614792", "0.55939734", "0.55913144", "0.5556244", "0.5494511", "0.54394203", "0.5355115", "0.5353662", "0.533633", "0.5334305", "0.5283023", "0.52326", "0.5202898", "0.51674587", "0.51564026", "0.5147683", "0.5143249",...
0.4817151
51
Create a viewport centered on the map's data. Most of the time, you should rely on the defaults provided by the
def from_data_bounds(): return 'DATA_BOUNDS'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_viewport(self, map_image):\r\n map_rect = map_image.get_rect()\r\n return loader.SCREEN.get_rect(bottomright=map_rect.bottomright)", "def initialize_viewport(self):\n self.add_uniform('viewport', vartype=\"float\", ndim=2, data=(1., 1.))\n self.add_uniform('window_size', vart...
[ "0.6806686", "0.66610825", "0.66521204", "0.66054314", "0.6515302", "0.6397702", "0.635322", "0.61429834", "0.60167086", "0.5904271", "0.587093", "0.58365846", "0.5782477", "0.5678875", "0.56785387", "0.5670684", "0.56641525", "0.5654538", "0.56266165", "0.5620645", "0.559610...
0.0
-1
Create a viewport by explicitly setting the zoom and center Most of the time, you should rely on the defaults provided by the
def from_zoom_center(zoom_level, center): return _ZoomCenter(zoom_level=zoom_level, center=center)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_viewport(self):\n self.add_uniform('viewport', vartype=\"float\", ndim=2, data=(1., 1.))\n self.add_uniform('window_size', vartype=\"float\", ndim=2)#, data=(600., 600.))\n if self.constrain_ratio:\n self.add_vertex_main(\"gl_Position.xy = gl_Position.xy / viewport;\"...
[ "0.74855995", "0.7082154", "0.68325174", "0.6820349", "0.6316099", "0.6212094", "0.6185196", "0.6166468", "0.61370635", "0.605381", "0.6039698", "0.5931121", "0.5919572", "0.5858992", "0.5854786", "0.5837154", "0.5831794", "0.5830599", "0.58125806", "0.5789635", "0.57353127",...
0.581819
18
Locates the specified datafiles and returns the matches in a data_files compatible format. source is the root of the source data tree. Use '' or '.' for current directory. target is the root of the target data tree. Use '' or '.' for the distribution directory. patterns is a sequence of globpatterns for the files you w...
def find_data_files(source, target, patterns): if glob.has_magic(source) or glob.has_magic(target): raise ValueError("Magic not allowed in src, target") ret = {} for pattern in patterns: pattern = os.path.join(source, pattern) for filename in glob.glob(pattern): if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _DataSourceFromFilePattern(self,\n file_pattern,\n input_source_weights=None,\n **extra_input_kwargs):\n del input_source_weights # Unused.\n return py_utils.NestedMap(data=tf.constant(file_pattern))", "def...
[ "0.61576617", "0.6129363", "0.5919765", "0.5905183", "0.58921427", "0.5833857", "0.58126956", "0.5732098", "0.5684496", "0.5594679", "0.558987", "0.5580824", "0.5559924", "0.55368453", "0.5534052", "0.5506687", "0.53464913", "0.52918094", "0.5241423", "0.52367634", "0.5205368...
0.7973076
0
Matches template image in a target grayscaled image
def match_template(img, template, threshold=0.9): #print(img) #print(template) res = cv2.matchTemplate(img, template, cv2.TM_CCOEFF_NORMED) matches = np.where(res >= threshold) return matches
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def matchTemplate(image, template):\n match_hmap = cvCreateImage(\n cvSize(image.width-template.width+1, image.height-template.height+1),\n IPL_DEPTH_32F,\n 1\n )\n cvMatchTemplate(image, template, match_hmap, CV_TM_SQDIFF_NORMED)\n return match_hmap", "def templateMatchSingle(im...
[ "0.7127601", "0.7048085", "0.70070684", "0.6867089", "0.67477554", "0.6726216", "0.66068804", "0.6604652", "0.6569852", "0.6569769", "0.654987", "0.64846456", "0.6334263", "0.6333618", "0.6229734", "0.6184669", "0.6158788", "0.60949856", "0.60808086", "0.59501326", "0.5947968...
0.741164
0
Try to load the part this method is called by the connect method of this object and by cltremote.RemoteBase RemoteBase
def load_part(self, partname, remoteclassname): success = False logger.info(u"{} Loading of part: {}".format(self.uid, partname)) try: module = importlib.import_module("parts.{p}.{p}Remote".format( p=partname)) logger.info( le2mtrans(u"{j}...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load(self, pkgpart, part_dict):\n # call parent to do generic aspects of load\n super(SlideMaster, self)._load(pkgpart, part_dict)\n\n # selectively unmarshal relationships for now\n for rel in self._relationships:\n # log.debug(\"SlideMaster Relationship %s\", rel._relt...
[ "0.59609467", "0.5939916", "0.58889776", "0.581184", "0.57881945", "0.5732381", "0.5723686", "0.5715784", "0.567733", "0.5595642", "0.55748475", "0.555035", "0.5547567", "0.5536446", "0.5526269", "0.5427431", "0.54074895", "0.54074895", "0.54074895", "0.54074895", "0.539921",...
0.7296799
0
Load the rlhuboplus model and a scene into openhubo. Returns a servocontroller and a reference robot to show desired movements vs. actual pose. The returned tuple contains the robots, controller, and a nametojointindex converter.
def load_rlhuboplus(env,scenename=None,stop=False): return _oh.load_scene(env,'rlhuboplus.robot.xml',scenename,stop)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\r\n\t\t# Publishers\r\n\t\tself._pub_rate = rospy.Publisher('robot/joint_state_publish_rate', UInt16, queue_size=10)\r\n\t\tself.image_pub = rospy.Publisher(\"baxter_view\",Image,queue_size=4)\r\n\t\tself._obj_state = rospy.ServiceProxy(\"/gazebo/set_model_state\",SetModelState)\r\n\t\t\r\n\t\t...
[ "0.53342927", "0.5223863", "0.51131403", "0.50385404", "0.5028461", "0.495816", "0.49522844", "0.4951688", "0.48854965", "0.48458624", "0.4845302", "0.4821964", "0.47963774", "0.47869748", "0.47868013", "0.47747764", "0.4767754", "0.4742408", "0.473562", "0.47332805", "0.4684...
0.62102795
0
A closure to easily convert from a string joint name to the robot's actual DOF index.
def makeNameToIndexConverter(robot,autotranslate=True): return _oh.make_name_to_index_converter(robot,autotranslate)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_index(identify):\n\n pedaco = identify.replace('/', '')\n return int(pedaco)", "def index2word(index_word, index_dict):\n if index_word == -1 or index_word not in index_dict.keys():\n return '_eps_'\n else:\n return index_dict[index_word]", "def make_dof_value_map(robot):\n ...
[ "0.5482621", "0.5456526", "0.5411834", "0.5256262", "0.52252036", "0.5196534", "0.51575613", "0.5150166", "0.5116707", "0.50905156", "0.5075703", "0.50337106", "0.4960798", "0.49572524", "0.4953177", "0.4950627", "0.49415132", "0.4921745", "0.49088845", "0.49038202", "0.49000...
0.55940926
0
Deprecated. Use Pose class instead, or index converter
def make_dof_value_map(robot): names = [j.GetName() for j in robot.GetJoints()] indices = [j.GetDOFIndex() for j in robot.GetJoints()] def get_dofs(): pose={} values=robot.GetDOFValues() for (i,n) in zip(indices,names): pose.setdefault(n,values[i]) return pose ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __index__(self, *args, **kwargs): # real signature unknown\n pass", "def __index__(self, *args, **kwargs): # real signature unknown\n pass", "def __index__(self, *args, **kwargs): # real signature unknown\n pass", "def __index__(self, *args, **kwargs): # real signature unknown\n ...
[ "0.5235879", "0.5235879", "0.5235879", "0.5235879", "0.5235879", "0.5235879", "0.5235879", "0.5235879", "0.5235879", "0.5235879", "0.5235879", "0.5235879", "0.5235879", "0.5235879", "0.5235879", "0.5235879", "0.5203413", "0.52029854", "0.51038265", "0.5099113", "0.50781137", ...
0.0
-1
Load up and configure the simpleFloor environment for hacking with physics. Sets some useful defaults.
def load_simplefloor(env): return _oh.load_scene(env,None,'simpleFloor.env.xml',True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def InitEnvironment(self):\r\n\t\t\r\n\t\t# Turn antialiasing on\r\n\t\trender.setAntialias(AntialiasAttrib.MMultisample,1)\r\n\t\t\r\n\t\t# load the falcon model\r\n\t\tfalcon = loader.loadModel(\"Content/falcon/falcon.bam\")\r\n\t\tfalcon.setScale(30)\r\n\t\tfalcon.setPos(0, 0, 28.5)\r\n\t\tfalcon.reparentTo(ren...
[ "0.6248853", "0.60405487", "0.57158166", "0.56440204", "0.558289", "0.55495113", "0.55436087", "0.5526429", "0.55164933", "0.5507159", "0.54870534", "0.5484633", "0.5480351", "0.5469515", "0.5452306", "0.5410114", "0.5379484", "0.53766954", "0.5355727", "0.5351993", "0.534364...
0.6798784
0
Set tweaked finger torque for grasping experiment. Deprecated due to new torquebased servo control.
def set_finger_torque(robot,maxT,fingers): #Super kludgy... for f in fingers: if robot.GetJoint(f): robot.GetJoint(f).SetTorqueLimits([maxT]) robot.GetJoint(f).SetVelocityLimits([3]) robot.GetJoint(f).SetAccelerationLimits([30])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setMotorTorque(self, torque):\r\n if torque < 0.0:\r\n torque = 0.0\r\n elif torque > 1.0:\r\n torque = 1.0\r\n torque *= self.maxTorque\r\n if self.reverse:\r\n torque *= -1\r\n dTorque = 2\r\n if self.torque < torque:\r\n s...
[ "0.630241", "0.5443808", "0.54325783", "0.5350345", "0.5200339", "0.5137968", "0.5102211", "0.5079462", "0.50652754", "0.50623274", "0.5060927", "0.5049635", "0.5045565", "0.50452226", "0.5034421", "0.50263256", "0.50193846", "0.5009361", "0.49941224", "0.49921134", "0.498266...
0.70379955
0
Yield successive nsized chunks from lst.
def chunks(lst, n): for i in range(0, len(lst), n): yield lst[i:i + n]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def chunks(self, lst, n):\n for i in range(0, len(lst), n):\n yield lst[i:i + n]", "def chunks(lst: list, n: int):\n for i in range(0, len(lst), n):\n yield lst[i : i + n]", "def chunks(lst, n):\n for i in range(0, len(lst), n):\n yield lst[i:i + n]", "de...
[ "0.83071756", "0.81939614", "0.81910837", "0.81910837", "0.8190213", "0.81267184", "0.81218547", "0.81218547", "0.80773693", "0.80526286", "0.80526286", "0.80526286", "0.80526286", "0.80526286", "0.80042696", "0.7871678", "0.7845623", "0.7828392", "0.7827006", "0.78138447", "...
0.80533457
22
Convert reStructuredText to iatom.IEntry.
def convertString(rst, filename=None, **kw): html = publish_string(source=rst, source_path=filename, writer_name='html', settings_overrides={'input_encoding': 'utf-8', 'output_encoding': 'utf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hentry2atom(entry_mf):\n\n\t# generate fall backs or errors for the non-existing required properties ones.\n\n\tif 'properties' in entry_mf:\n\t\tprops = entry_mf['properties']\n\telse:\n\t\treturn None, 'properties of entry not found.'\n\n\tentry = {'title': '', 'subtitle': '', 'link': '', 'uid': '', 'publis...
[ "0.5728751", "0.57016593", "0.55765855", "0.54030704", "0.53249466", "0.5324336", "0.5289105", "0.5200286", "0.51862633", "0.5131307", "0.5053356", "0.4993755", "0.49765882", "0.49617437", "0.49348027", "0.49173948", "0.49003944", "0.48977062", "0.48954588", "0.48838046", "0....
0.48307905
27
Overrides transport.send(). kwargs is the dictionary with keyword arguments which will be passed to
def send(self, kwargs): self.logger.log_struct(**kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_data(self, **kwargs):", "def build_send(self, *args, **kwargs):\n raise NotImplementedError(\"Implement in subclass\")", "def _send(self, raw, addr):\n raise NotImplementedError('implement using any Transport Layer')", "async def async_send(self, **kwargs):\n return await super(...
[ "0.7508871", "0.7191169", "0.7053003", "0.6876582", "0.67228067", "0.6693991", "0.6679416", "0.6589817", "0.65258956", "0.65102744", "0.63962144", "0.6369798", "0.63177675", "0.63005596", "0.61535984", "0.61451703", "0.6104375", "0.6079555", "0.6063258", "0.604878", "0.603963...
0.6478663
10
Obtaining an instance of this model.
def get_model(*args): return Model()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def instance(self):\n return self.__instance", "def model(self) -> Model:\n return self._model", "def initialize_model(self):\n model = self.model_class()\n return model", "def Model(self):\n return self._model", "def instance(self):\n return self._instance", "de...
[ "0.76886255", "0.7653045", "0.7581586", "0.7455388", "0.7439965", "0.73666734", "0.73666734", "0.7365761", "0.73432136", "0.73407096", "0.7310342", "0.7310342", "0.7310342", "0.7310342", "0.7310342", "0.73055476", "0.73055476", "0.73055476", "0.73055476", "0.73055476", "0.730...
0.7339638
10
Returns recipe does not exist message
def _does_not_exist(): response_payload = dict( message="Recipe does not exist!" ) response_payload = jsonify(response_payload) return make_response(response_payload, 404)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def non_existing_recipe_error_test(self):\n client = TestClient()\n error = client.run(\"upload Pkg/0.1@user/channel\", ignore_error=True)\n self.assertTrue(error)\n self.assertIn(\"ERROR: There is no local conanfile exported as Pkg/0.1@user/channel\",\n client.user...
[ "0.67053497", "0.638858", "0.6320744", "0.63052964", "0.609179", "0.60616803", "0.6032747", "0.6016889", "0.6012378", "0.5950096", "0.5946541", "0.5898837", "0.5846728", "0.582731", "0.58167356", "0.5800994", "0.5702433", "0.56634784", "0.56365335", "0.5624497", "0.5620596", ...
0.7538943
0
Create a recipe in the specified category
def post(current_user, self, category_id): if not current_user: return is_unauthorized() request_payload = request.get_json() request_payload['name'] = _clean_name(request_payload['name']) # initialize schema object for input validation recipe_schema = RecipeSchema(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def create_recipe_category(category: CategoryIn, session: Session = Depends(generate_session)):\n\n try:\n return db.categories.create(session, category.dict())\n except Exception:\n raise HTTPException(status.HTTP_400_BAD_REQUEST)", "def test_create_recipe_category(self):\n self...
[ "0.77270746", "0.7099106", "0.696709", "0.689072", "0.6684276", "0.6684075", "0.6623549", "0.6572003", "0.6560149", "0.6545429", "0.6496758", "0.6490506", "0.642099", "0.63963753", "0.6379677", "0.6358601", "0.6306815", "0.62977666", "0.6285652", "0.6278332", "0.6268309", "...
0.69111466
3
Retrives a list of the recipes for the category
def get(current_user, self, category_id): if not current_user: return is_unauthorized() category = current_user.categories.filter_by(id=category_id).first() if category: recipes = category.recipes.all() if not recipes: response_payload = dic...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recipes(category):\n # if statements to display the recipes base on category name\n if category == \"Pre Workout Meal\":\n recipe = mongo.db.recipes.find({\"category_name\": \"Pre Workout Meal\"})\n elif category == \"Post Workout Meal\":\n recipe = mongo.db.recipes.find({\"category_name...
[ "0.7759228", "0.72796977", "0.72548294", "0.72117364", "0.71575874", "0.7090091", "0.7055739", "0.702791", "0.70112234", "0.6930698", "0.69277155", "0.68971646", "0.67213726", "0.6692026", "0.66214687", "0.6587075", "0.65312093", "0.6527134", "0.65117097", "0.6507539", "0.649...
0.6739778
12
This returns a specific recipe from the specified category
def get(current_user, self, category_id, recipe_id): if not current_user: return is_unauthorized() category = current_user.categories.filter_by(id=category_id).first() if category: selected_recipe = category.recipes.filter_by(id=recipe_id).first() # When th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recipes(category):\n # if statements to display the recipes base on category name\n if category == \"Pre Workout Meal\":\n recipe = mongo.db.recipes.find({\"category_name\": \"Pre Workout Meal\"})\n elif category == \"Post Workout Meal\":\n recipe = mongo.db.recipes.find({\"category_name...
[ "0.69672334", "0.68877625", "0.67251134", "0.6703789", "0.66577137", "0.6613105", "0.65161556", "0.64320064", "0.63747", "0.6368462", "0.6272986", "0.6233325", "0.6229314", "0.6214276", "0.6177036", "0.61754215", "0.61095464", "0.60774076", "0.6077382", "0.6069036", "0.606605...
0.6824372
2
This returns a specific recipe from the specified category
def put(current_user, self, category_id, recipe_id): if not current_user: return is_unauthorized() category = current_user.categories.filter_by(id=category_id).first() if category: selected_recipe = category.recipes.filter_by(id=recipe_id).first() # When the...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recipes(category):\n # if statements to display the recipes base on category name\n if category == \"Pre Workout Meal\":\n recipe = mongo.db.recipes.find({\"category_name\": \"Pre Workout Meal\"})\n elif category == \"Post Workout Meal\":\n recipe = mongo.db.recipes.find({\"category_name...
[ "0.69672334", "0.68877625", "0.6824372", "0.67251134", "0.6703789", "0.66577137", "0.6613105", "0.65161556", "0.64320064", "0.63747", "0.6368462", "0.6272986", "0.6233325", "0.6229314", "0.6214276", "0.6177036", "0.61754215", "0.61095464", "0.60774076", "0.6077382", "0.606903...
0.5589687
54
This returns a specific recipe from the specified category
def delete(current_user, self, category_id, recipe_id): if not current_user: return is_unauthorized() category = current_user.categories.filter_by(id=category_id).first() if category: selected_recipe = category.recipes.filter_by(id=recipe_id).first() # When t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recipes(category):\n # if statements to display the recipes base on category name\n if category == \"Pre Workout Meal\":\n recipe = mongo.db.recipes.find({\"category_name\": \"Pre Workout Meal\"})\n elif category == \"Post Workout Meal\":\n recipe = mongo.db.recipes.find({\"category_name...
[ "0.6967603", "0.6888342", "0.6825305", "0.67257166", "0.6705349", "0.66586435", "0.66138285", "0.65166634", "0.6432671", "0.6374673", "0.6370007", "0.6273805", "0.6234116", "0.6229021", "0.6216877", "0.6179154", "0.617553", "0.6111596", "0.6078365", "0.6078129", "0.60686135",...
0.0
-1
Shows basic usage of the Google Calendar API. Prints the start and name of the next 10 events on the user's calendar.
def cal(userEvent): # def cal(userEvent): creds = None # The file token.pickle stores the user's access and refresh tokens, and is # created automatically when the authorization flow completes for the first # time. if os.path.exists('token.pickle'): with open('token.pickle', 'rb') as to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\r\n credentials = get_credentials()\r\n http = credentials.authorize(httplib2.Http())\r\n service = discovery.build('calendar', 'v3', http=http)\r\n\r\n now = datetime.datetime.utcnow().isoformat() + 'Z' # 'Z' indicates UTC time\r\n print('Getting the upcoming 10 events')\r\n eventsRe...
[ "0.77553767", "0.77222127", "0.6953661", "0.69312745", "0.6389393", "0.62446064", "0.61508113", "0.6148761", "0.60643077", "0.59336543", "0.5862322", "0.5812911", "0.579054", "0.5748724", "0.570085", "0.56895924", "0.5631956", "0.5464854", "0.5456646", "0.5424956", "0.5365372...
0.5249358
23
Returns a list of (hash, string, indices)tuples.
def parse_korpus(self, korpus): words = {} index = 0 longest_word = 0 line = korpus.readline() while line != []: line = line[0].translate(TRANSLATE).decode(ENCODING) if not och % 15000: print(line) for word in line...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_indexes(self, x):\n indexes = []\n for index_hashes in self.hash_functions:\n combined_index = []\n for idx_spec, hash_func in zip(self.config.index_specs, index_hashes):\n combined_index.append(idx_spec.distribution.get_index(hash_func(x)))\n indexes.append(tuple(combined_index...
[ "0.7082873", "0.6868651", "0.6675677", "0.6668114", "0.66508657", "0.6611046", "0.6400265", "0.6339773", "0.630122", "0.6298387", "0.6250481", "0.6225739", "0.61895305", "0.6184987", "0.6110571", "0.6100887", "0.60534286", "0.6052246", "0.59962", "0.5987231", "0.5984801", "...
0.0
-1
Parse the ping result
def parsePing(self,stdoutputdata): print(stdoutputdata) res = {} # hostname = re.search("\b(([a-zA-Z0-9]\w{0,61}?[a-zA-Z0-9]|[a-zA-Z0-9])\.){0,1}?([a-zA-Z0-9]\w{0,61}?[a-zA-Z0-9]|[a-zA-Z0-9])\.(com|edu|gov|int|mil|net|org|biz|info|name|museum|coop|aero|[a-z][a-z])(\.[a-z][a-z]){0,1}\b", stdoutputdata, re.M|re.I) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse(self, ping_message):\n\n try:\n # accept PingResult instance as an input\n if typepy.is_not_null_string(ping_message.stdout):\n ping_message = ping_message.stdout\n except AttributeError:\n pass\n\n logger.debug(\"parsing ping result: {...
[ "0.7485418", "0.7425062", "0.6933723", "0.6367453", "0.63407385", "0.63365275", "0.6236269", "0.622112", "0.6147747", "0.614375", "0.6049113", "0.6049113", "0.6049113", "0.6049113", "0.60489875", "0.6048609", "0.6011314", "0.5999072", "0.59661037", "0.58914095", "0.58571297",...
0.71158326
2
Parse the traceroute result
def parseTraceroute(self, stdoutputdata): itemlist = stdoutputdata.split("\n") res = defaultdict(list) for item in itemlist: re_ip = re.search(r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}', item) if re_ip: ip = re_ip.group(0) res["route"].append(ip) res["route"].append(self.task["destination"]) res["des...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_traceroute_output(self):\n url = self.source['url']\n if 'post_data' in self.source:\n context = self.source['post_data']\n else:\n context = None\n status_code, content = self.urlopen(url, context=context)\n content = content.strip()\n regex ...
[ "0.6905173", "0.6265325", "0.6184163", "0.6166134", "0.60980153", "0.6027709", "0.6013491", "0.59370697", "0.5883287", "0.5868269", "0.5859081", "0.58563274", "0.5829786", "0.5819288", "0.5764864", "0.56720495", "0.5631726", "0.5578696", "0.5578418", "0.5531463", "0.5482655",...
0.7362002
0
Returns a list of tuples (ECO code, Name). The ECO code is A00.0 for example, appended number is to ensure that all ECO codes given are unique. There are fiew openings with two names (and two extension numbers), but you can just use the first result of the list. An opening without any matches is considered "", "No move...
def from_moves(moves): if type(moves) is str or type(moves) is unicode: moves = moves.split() branch = tree prev = branch[None] for move in moves: if branch.has_key(move): branch = branch[move] if branch.has_key(None): prev = branch[None] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_eco_details(self, pgn_data):\n result = eco_mapping['unknown']\n\n try:\n moves = self.get_moves(pgn_data)\n current_sequence = ''\n\n for move in moves:\n half_move = '.'.join([move[0], move[1]])\n current_sequence += half_move\n...
[ "0.60535836", "0.57993615", "0.5630843", "0.5293672", "0.5219934", "0.5204166", "0.52014595", "0.5178507", "0.51215345", "0.5110811", "0.50751036", "0.5012852", "0.49670127", "0.49634838", "0.4961916", "0.49592012", "0.4948032", "0.4925771", "0.49251977", "0.48929176", "0.487...
0.0
-1
Return the information on an eco, or return a list of all ecos, ordered by variation number.
def eco(code): code = code.split('.') if len(code) == 1: return ecos[code[0]] else: return ecos[code[0]][int(code[1])]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getEcosystems(self):\n return self.__getColumnData(Q_ECOSYSTEMS, 'ecosystem')", "def get_eco_details(self, pgn_data):\n result = eco_mapping['unknown']\n\n try:\n moves = self.get_moves(pgn_data)\n current_sequence = ''\n\n for move in moves:\n ...
[ "0.62090003", "0.57365745", "0.55645776", "0.5427978", "0.536389", "0.5236414", "0.5220468", "0.51422614", "0.51316696", "0.5114531", "0.5103598", "0.509314", "0.50615853", "0.5059387", "0.50560975", "0.50086546", "0.5003647", "0.4966216", "0.49440318", "0.4943433", "0.486108...
0.5472271
3
Orthonormalize w wrt the first j rows of W.
def _gs_decorrelation(w, W, j): w -= np.linalg.multi_dot([w, W[:j].T, W[:j]]) return w
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def orthonormalize_inplace(self):\n Q = np.linalg.qr(self.components.T)[0].T\n self.components[...] = Q", "def ortho_weight(ndim):\n W = numpy.random.randn(ndim, ndim)\n u, s, v = numpy.linalg.svd(W)\n return u.astype('float32')", "def ortho_weight(ndim):\n W = rng_np.randn(ndim, ndim...
[ "0.6324573", "0.6105133", "0.6058103", "0.59785753", "0.58964455", "0.58957833", "0.584563", "0.58372056", "0.5805225", "0.5753632", "0.565067", "0.5585861", "0.55199057", "0.5518894", "0.5518703", "0.55181456", "0.5447319", "0.543783", "0.54195243", "0.5419175", "0.5414969",...
0.5838102
7
Symmetric decorrelation i.e. W < (W W.T) ^{1/2} W
def _sym_decorrelation(W): s, u = linalg.eigh(np.dot(W, W.T)) # Avoid sqrt of negative values because of rounding errors. Note that # np.sqrt(tiny) is larger than tiny and therefore this clipping also # prevents division by zero in the next step. s = np.clip(s, a_min=np.finfo(W.dtype).tiny, a_max=No...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _gs_decorrelation(w, W, j):\n w -= np.linalg.multi_dot([w, W[:j].T, W[:j]])\n return w", "def _symmetric(updates):\n sym_updates = updates[:-1] + [updates[-1]] + updates[:-1][::-1]\n coeff = [0.5]*(len(updates)-1) + [1.0] + [0.5]*(len(updates) - 1)\n return ExplicitIntegrator(coeff...
[ "0.68297875", "0.58642405", "0.5714483", "0.56672794", "0.56156206", "0.55587417", "0.5539916", "0.55214864", "0.54957104", "0.548836", "0.54881096", "0.5487721", "0.54838127", "0.54819167", "0.5476712", "0.54497755", "0.54356843", "0.5432515", "0.5406844", "0.53943413", "0.5...
0.7474815
0
Deflationary FastICA using fun approx to negentropy function Used internally by FastICA.
def _ica_def(X, tol, g, fun_args, max_iter, w_init): n_components = w_init.shape[0] W = np.zeros((n_components, n_components), dtype=X.dtype) n_iter = [] # j is the index of the extracted component for j in range(n_components): w = w_init[j, :].copy() w /= np.sqrt((w**2).sum()) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def desp_inicial(x): #Definición del desplazamiento inicial de la cuerda\r\n return np.exp(-1000*(x - longitud/2)**2)", "def entropy(temp,pres):\n g_t = liq_g(1,0,temp,pres)\n s = -g_t\n return s", "def supgen(f, INTER):\n\n A,Bc = INTER\n y = intersec(erode(f,A),\n ...
[ "0.5618577", "0.55968726", "0.5551095", "0.54165673", "0.51325923", "0.5085699", "0.50736064", "0.5061459", "0.50526327", "0.50431603", "0.5040815", "0.50358117", "0.50346965", "0.50299203", "0.5029509", "0.50014377", "0.4971331", "0.49668884", "0.49663356", "0.49641323", "0....
0.0
-1
Parallel FastICA. Used internally by FastICA main loop
def _ica_par(X, tol, g, fun_args, max_iter, w_init): W = _sym_decorrelation(w_init) del w_init p_ = float(X.shape[1]) for ii in range(max_iter): gwtx, g_wtx = g(np.dot(W, X), fun_args) W1 = _sym_decorrelation(np.dot(gwtx, X.T) / p_ - g_wtx[:, np.newaxis] * W) del gwtx, g_wtx ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ParallelToserial(self):\n pass", "def fastica(data,ncomp,maxiter=1000,g=g,gp=gp,eps=1e-2):\n result = []\n for comp in range(ncomp):\n w = fastica1(data,maxiter=maxiter,g=g,gp=gp,eps=eps)\n result.append(w)\n project_perp(data,w)\n if verbose: print comp,amin(data),am...
[ "0.6321232", "0.5981751", "0.5892802", "0.58718485", "0.5849772", "0.5752029", "0.57264894", "0.5723748", "0.55793536", "0.5525404", "0.5522874", "0.54918855", "0.54594654", "0.54278815", "0.5411758", "0.53863066", "0.53530407", "0.5336936", "0.533356", "0.532538", "0.5323421...
0.53506446
17
Perform Fast Independent Component Analysis. The implementation is based on [1]_.
def fastica( X, n_components=None, *, algorithm="parallel", whiten="unit-variance", fun="logcosh", fun_args=None, max_iter=200, tol=1e-04, w_init=None, whiten_solver="svd", random_state=None, return_X_mean=False, compute_sources=True, return_n_iter=False, ): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute(self): \n Ex=np.zeros((self.nx,self.ny+1))\n Ey=np.zeros((self.nx+1,self.ny))\n Hz=np.zeros((self.nx,self.ny))\n Hzx=np.zeros((self.nx,self.ny))\n Hzy=np.zeros((self.nx,self.ny))\n \n imx = []\n #eps, mu = self.makeenv()\n mu=np.ones((self.nx,s...
[ "0.57916284", "0.5624844", "0.56228405", "0.5564176", "0.5505107", "0.547632", "0.54677695", "0.5465829", "0.54463005", "0.54311836", "0.5427996", "0.5426059", "0.5400718", "0.53883564", "0.5385696", "0.53842014", "0.5383459", "0.5366033", "0.5349941", "0.5326625", "0.531283"...
0.0
-1
Fit the model and recover the sources from X.
def fit_transform(self, X, y=None): return self._fit_transform(X, compute_sources=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fit(self, X):", "def fit(self, X):\n raise NotImplementedError", "def fit(self, X, Y):\n ...", "def fit(self, X, y):", "def fit(self, X, y):", "def fit(self, X, y):", "def fit(self, X,y):\n pass", "def fit(self, X, y):\n self.model_x = X\n self.model_y = y", "...
[ "0.71828854", "0.7131891", "0.70738715", "0.6930304", "0.6930304", "0.6930304", "0.6920551", "0.6919335", "0.69156164", "0.69156164", "0.69156164", "0.69156164", "0.69156164", "0.69156164", "0.69156164", "0.69156164", "0.69156164", "0.69156164", "0.6842253", "0.68180287", "0....
0.6429482
44
Fit the model to X.
def fit(self, X, y=None): self._fit_transform(X, compute_sources=False) return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fit(self, X):\n raise NotImplementedError", "def fit(self, X):", "def fit(self, x):\n pass", "def fit(self, X):\n self._fit_X = X", "def fit(self, X, y):", "def fit(self, X, y):", "def fit(self, X, y):", "def fit(self, X):\n\n return self._fit(X)", "def fit(self, X,y...
[ "0.86109823", "0.85562426", "0.8386011", "0.8362479", "0.83299166", "0.83299166", "0.83299166", "0.82888246", "0.82833415", "0.8263655", "0.82600415", "0.82600415", "0.82600415", "0.82600415", "0.82600415", "0.82600415", "0.82600415", "0.82600415", "0.82600415", "0.82600415", ...
0.73968095
84
Recover the sources from X (apply the unmixing matrix).
def transform(self, X, copy=True): check_is_fitted(self) X = self._validate_data( X, copy=(copy and self.whiten), dtype=[np.float64, np.float32], reset=False ) if self.whiten: X -= self.mean_ return np.dot(X, self.components_.T)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_preprocess_x(self,X):\n X = super(Diff_Generator, self).apply_preprocess_x(X)\n# X = X[:,:,1:]\n return X", "def _untransform(self, X: Tensor) -> Tensor:\n pass # pragma: no cover", "def inverse_transform(self, X, copy=...):\n ...", "def unspool(X):\n # Size o...
[ "0.60349", "0.596874", "0.57456887", "0.57034415", "0.5691026", "0.5691026", "0.5680359", "0.5675039", "0.5662702", "0.56594723", "0.56594723", "0.56594723", "0.56594723", "0.56594723", "0.5628206", "0.5626419", "0.55316085", "0.55048573", "0.5479553", "0.5477283", "0.5477150...
0.0
-1
Transform the sources back to the mixed data (apply mixing matrix).
def inverse_transform(self, X, copy=True): check_is_fitted(self) X = check_array(X, copy=(copy and self.whiten), dtype=[np.float64, np.float32]) X = np.dot(X, self.mixing_.T) if self.whiten: X += self.mean_ return X
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getitem_augmentation(self):\n n_tracks = len(self.tracks)\n track_indices = random.choices(range(n_tracks), k=len(self.sources))\n\n sources = []\n\n for _source, trackID in zip(self.sources, track_indices):\n track = self.tracks[trackID]\n source_path = track...
[ "0.60374314", "0.59974146", "0.59725815", "0.59124637", "0.58937544", "0.5798907", "0.57819873", "0.5763059", "0.5716492", "0.5712373", "0.5667678", "0.56550163", "0.5590219", "0.5546867", "0.5538174", "0.5503033", "0.54643875", "0.54517704", "0.5437956", "0.54246485", "0.541...
0.0
-1
Number of transformed output features.
def _n_features_out(self): return self.components_.shape[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_feature_outputs(self):\n pass", "def num_feature_outputs(self):\n return 1", "def n_outputs(self):\n return len(self._output_labels)", "def n_outputs(self):\n return len(self._output_labels)", "def n_outputs(self):\n return len(self.output_names())", "def get_num_featur...
[ "0.8322205", "0.807562", "0.71430194", "0.71430194", "0.7094638", "0.7077732", "0.6879042", "0.68722844", "0.6820914", "0.67977905", "0.6791031", "0.6733315", "0.6701946", "0.6688401", "0.6683104", "0.6630553", "0.66125596", "0.6599746", "0.6585268", "0.6575148", "0.6532884",...
0.7545085
2
Grab the name of the binary we're running in.
def get_binary_name(): return os.path.basename(inspect.stack()[-1][1])[:16]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _compute_program_name():\n program_path = os.path.abspath(sys.argv[0])\n if os.path.exists(program_path):\n return os.path.basename(program_path)\n else:\n match = re.match(r\"^.*(?:\\.egg|\\.tar|\\.tar\\.gz)(?=/)\", program_path, re.IGNORECASE)\n if (match is not None) and os.pat...
[ "0.72268015", "0.72012603", "0.7187184", "0.7005614", "0.69355136", "0.67844146", "0.67611265", "0.6756073", "0.66813314", "0.66522294", "0.6628342", "0.6627381", "0.6627222", "0.6603379", "0.6576827", "0.65747535", "0.6540388", "0.6478583", "0.64458454", "0.6427517", "0.6400...
0.8264518
0
Adds a named chain to the table. The chain name is wrapped to be unique for the component creating it, so different components of Nova can safely create identically named chains without interfering with one another. At the moment, its wrapped name is , so if novacompute creates a chain named 'OUTPUT', it'll actually en...
def add_chain(self, name, wrap=True): if wrap: self.chains.add(name) else: self.unwrapped_chains.add(name) self.dirty = True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def chain_name(self) -> str:\n return pulumi.get(self, \"chain_name\")", "def addChain(self, chain):\n\n\t\tself.chain.append(chain)\n\t\tchain.parentMolecule = self", "def add_chain(self, chain, delay_sort = True):\n assert isinstance(chain, Chain)\n\n try:\n model = self.model...
[ "0.65356433", "0.6292502", "0.5971866", "0.58491284", "0.5739743", "0.56037813", "0.5452546", "0.5436754", "0.5386792", "0.5381447", "0.52454704", "0.5211677", "0.51958865", "0.51822054", "0.5169344", "0.5091612", "0.50894535", "0.50690097", "0.5043837", "0.5038757", "0.50186...
0.7146354
0
Remove named chain. This removal "cascades". All rule in the chain are removed, as are all rules in other chains that jump to it. If the chain is not found, this is merely logged.
def remove_chain(self, name, wrap=True): if wrap: chain_set = self.chains else: chain_set = self.unwrapped_chains if name not in chain_set: return self.dirty = True # non-wrapped chains and rules need to be dealt with specially, # so...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove(ctx, schain_name):\n skale = ctx.obj['skale']\n skale.manager.delete_schain(schain_name, wait_for=True,\n gas_price=4500000000)\n print(f'sChain {schain_name} removed!')", "def removeChain(self, mychain):\n\n\t\tichain = self.getChain(mychain)\t\n\t\tif ichain =...
[ "0.66127115", "0.6543583", "0.65178925", "0.63441426", "0.6132853", "0.5970545", "0.59696996", "0.59487593", "0.59189224", "0.5915002", "0.5893214", "0.58134645", "0.5795842", "0.57516927", "0.5745285", "0.5725543", "0.5719747", "0.56921446", "0.55726975", "0.54871327", "0.54...
0.7302495
0
Add a rule to the table. This is just like what you'd feed to iptables, just without the 'A ' bit at the start. However, if you need to jump to one of your wrapped chains, prepend its name with a '$' which will ensure the wrapping is applied correctly.
def add_rule(self, chain, rule, wrap=True, top=False): if wrap and chain not in self.chains: raise ValueError(_('Unknown chain: %r') % chain) if '$' in rule: rule = ' '.join(map(self._wrap_target_chain, rule.split(' '))) rule_obj = IptablesRule(chain, rule, wrap, top) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_rule(self, rule):\n self.rule.append(rule)", "def add_rule(self, rule) -> None:\n self.add_rules([rule])", "def add_rule(self, rule):\n \n self.rules.append(rule)", "def add_rule(self, rule: Rule):\n self.rules.append(rule)", "def add_rule(self, rule: interpreter....
[ "0.69831085", "0.6929167", "0.69029045", "0.6722005", "0.66983014", "0.6664679", "0.66394943", "0.66027844", "0.65009797", "0.647024", "0.64614254", "0.62848955", "0.6235584", "0.61647195", "0.6121893", "0.6088669", "0.6055803", "0.59040135", "0.58810866", "0.5879263", "0.587...
0.72605485
0
Remove a rule from a chain.
def remove_rule(self, chain, rule, wrap=True, top=False): try: self.rules.remove(IptablesRule(chain, rule, wrap, top)) if not wrap: self.remove_rules.append(IptablesRule(chain, rule, wrap, top)) self.dirty = True except ValueError: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def removeRule(self, *args):\n return _libsbml.Model_removeRule(self, *args)", "def remove_chain(self, chain):\n assert isinstance(chain, Chain)\n self.model_dict[chain.model_id].remove_chain(chain)", "def remove_chain(self, chain):\n assert isinstance(chain, Chain)\n self.ch...
[ "0.7424913", "0.74110746", "0.73149914", "0.6947874", "0.6896175", "0.6762595", "0.6747168", "0.66540754", "0.65364784", "0.65273917", "0.6346213", "0.6327616", "0.6307949", "0.62569445", "0.6254516", "0.62401545", "0.62105507", "0.61818945", "0.613633", "0.61205137", "0.6113...
0.8184237
0
Remove all rules matching regex.
def remove_rules_regex(self, regex): if isinstance(regex, six.string_types): regex = re.compile(regex) num_rules = len(self.rules) self.rules = filter(lambda r: not regex.match(str(r)), self.rules) removed = num_rules - len(self.rules) if removed > 0: self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eliminateRules(self):\n deleteKey = []\n for key,value in self._rules.items():\n if value[0] < self._minConfidence:\n deleteKey.append(key)\n \n for key in deleteKey:\n del self._rules[key]", "def _remove_regex(regex, text) -> StyledStr:\n t...
[ "0.64303595", "0.616448", "0.6031216", "0.6028709", "0.602167", "0.6004168", "0.59537715", "0.59090513", "0.5879021", "0.57283556", "0.57130945", "0.56602484", "0.56581986", "0.5656981", "0.56460613", "0.5560527", "0.55123913", "0.551106", "0.55080414", "0.550569", "0.5490603...
0.8198133
0
Remove all rules from a chain.
def empty_chain(self, chain, wrap=True): chained_rules = [rule for rule in self.rules if rule.chain == chain and rule.wrap == wrap] if chained_rules: self.dirty = True for rule in chained_rules: self.rules.remove(rule)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear(self):\n\n\t\tfor chain in self.chain:\n\t\t\tchain.clear()\n\n\t\tself.chain = []\n\t\tself.remark = []", "def remove_chain(self, chain):\n assert isinstance(chain, Chain)\n self.model_dict[chain.model_id].remove_chain(chain)", "def flushRules(self):\n self.chain.flush()", "de...
[ "0.6976301", "0.67297375", "0.6681245", "0.6644196", "0.6428264", "0.6263099", "0.6163615", "0.6119698", "0.60656494", "0.60592926", "0.59872264", "0.59622675", "0.59342986", "0.5900307", "0.5847478", "0.58297676", "0.58181685", "0.5774099", "0.57378364", "0.5725818", "0.5698...
0.8091868
0
Apply the current inmemory set of iptables rules. This will blow away any rules left over from previous runs of the same component of Nova, and replace them with our current set of rules. This happens atomically, thanks to iptablesrestore.
def _apply(self): s = [(iptables_save, iptables_restore, self.ipv4)] if self.use_ipv6: s += [(ip6tables_save, ip6tables_restore, self.ipv6)] for save, restore, tables in s: all_tables, _err = save() all_lines = all_tables.split('\n') for table_nam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iptables_apply():\n\n with settings(warn_only=True):\n run(\"sudo iptables-restore < /etc/iptables.rules\")", "def update_rules():\n update_all_rules()\n return \"OK\"", "def update_all_rules():\n try:\n for i in range(1, len(RULES_FOR_BRANCHES)):\n set_next_rule_to_red...
[ "0.74310803", "0.6443475", "0.6198638", "0.61369956", "0.58547723", "0.5850812", "0.575473", "0.57367265", "0.5676085", "0.5482839", "0.5477452", "0.5454835", "0.5432685", "0.5365001", "0.53534245", "0.53432953", "0.5276151", "0.5262996", "0.5246209", "0.52433085", "0.5233582...
0.7693331
0
Instantiates a finite grid. The limits are specified as a list of tuples of (low, high) values, one for each grid vector.
def __init__(self, origin, grid_vectors, limits): assert len(grid_vectors) == len(limits) Grid.__init__(self, origin, grid_vectors) self._Limits = limits
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grid(gmin, gmax, gstep):\n n_vals = int((gmax - gmin)/gstep + 1)\n my_grid = linspace(gmin, gmax, n_vals)\n return my_grid", "def create_grid(xlim, ylim, step):\n x_range = np.arange(xlim[0], xlim[1], step)\n y_range = np.arange(ylim[0], ylim[1], step)\n return x_range, y_range", "def mak...
[ "0.6845707", "0.68128675", "0.6641913", "0.6626282", "0.64288163", "0.63951415", "0.63662404", "0.6347766", "0.63329864", "0.63275075", "0.63241917", "0.63241917", "0.6310568", "0.6308185", "0.6199303", "0.6160781", "0.61287147", "0.60951614", "0.60779905", "0.6064125", "0.60...
0.6917152
0
Returns the number of grid intervals in each direction.
def grid_point_counts(self): return [high-low for low, high in self._Limits]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grid_point_count(self):\n return pytools.product(self.grid_point_counts())", "def get_num_tiles(grid_bbox, dxy): \r\n xmin, xmax, ymin, ymax = grid_bbox\r\n return (int(np.abs(ymax-ymin)/dxy), int(np.abs(xmax-xmin)/dxy))", "def getNumGrids(self):\n c = list(self.gridVars.keys())\n ...
[ "0.7425757", "0.7288028", "0.7220315", "0.71976143", "0.7153773", "0.7093915", "0.70244455", "0.699841", "0.6895317", "0.6884431", "0.68792003", "0.682364", "0.68076724", "0.6794618", "0.67854273", "0.67430496", "0.67146546", "0.66846365", "0.6660248", "0.66210544", "0.662085...
0.6802487
13
Returns the number of grid intervals in each direction.
def grid_point_count(self): return pytools.product(self.grid_point_counts())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_num_tiles(grid_bbox, dxy): \r\n xmin, xmax, ymin, ymax = grid_bbox\r\n return (int(np.abs(ymax-ymin)/dxy), int(np.abs(xmax-xmin)/dxy))", "def getNumGrids(self):\n c = list(self.gridVars.keys())\n return len(list(self.gridVars[c[0]].values()))", "def getNumTiles(self):\n retur...
[ "0.72868717", "0.72172505", "0.71965694", "0.7155208", "0.70913154", "0.7022597", "0.6997481", "0.6893928", "0.68832994", "0.6877992", "0.6820697", "0.68062395", "0.6802767", "0.679377", "0.6784351", "0.6742068", "0.67137444", "0.6681955", "0.66590667", "0.6619721", "0.661945...
0.74237925
0
Updates text on the widget.
def update_text(self): def update_by_filter(all_text, widget, text_filters): new_text = "\n".join([line for line in all_text.split("\n") if any(s in line for s in text_filters)]) widget.setPlainText(new_text) widget.verticalScrollBar().setValue(widget.verticalScrollBar().max...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_text(self: object, widget: Text, new_text: str) -> None:\n widget.delete(\"1.0\", END) #Clear the text window so we can write.\n widget.insert(END,new_text)", "def text_changed(self, text):\n self.lbl.setText(text)", "def refresh(self, event):\n self.updatetext(self.tex...
[ "0.83063483", "0.78364015", "0.783295", "0.77531064", "0.7669465", "0.76663154", "0.75950205", "0.75080395", "0.7499207", "0.74578285", "0.74524784", "0.7422658", "0.73744977", "0.73354834", "0.7283326", "0.71985674", "0.71925974", "0.71680844", "0.7127832", "0.7101879", "0.7...
0.65085506
69
Const method for initializing the applet
def init(self): # Configuration interface support comes with plasma self.setHasConfigurationInterface(False) # Aspect ratio defined in Plasma self.setAspectRatioMode(Plasma.IgnoreAspectRatio) # Theme is a const variable holds Applet Theme self.theme = Plasma.Svg(self) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init():", "def init():\n pass", "def do_init(self):\n\n pass", "def Init(self, config):\r\n pass", "def initialize(self, application):", "def init(self):\n pass", "def init(self):\n pass", "def init(self):\n pass", "def init(self):\n pass", "def init(s...
[ "0.6560639", "0.64750546", "0.63915706", "0.62873834", "0.62607515", "0.621026", "0.621026", "0.621026", "0.621026", "0.621026", "0.621026", "0.621026", "0.621026", "0.619076", "0.6180176", "0.6179248", "0.61707896", "0.6163452", "0.6160528", "0.6155465", "0.6152029", "0.61...
0.7120899
0
Adds a data point to the logger object. Datapoints are added sequentially, so add your variables in the same sequence that you want them to show up in on the CSV
def addDataPoint(self, variableName): if self.initialized == False: if str(variableName) in self.currentLog: raise IndexError("datapoiont already initialized") else: self.variables += 1 self.variableDescriptions.append(variableName) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recordVariable(self, variableName, data):\n if str(variableName) in self.currentLog:\n # if self.currentLog[str(variableName)] != None:\n # raise Warning(f'data point {str(variableName)} is being overwritten!')\n self.currentLog[str(variableName)] = data\n els...
[ "0.6582924", "0.6551948", "0.6459278", "0.6246846", "0.6219666", "0.6097625", "0.60864437", "0.5971872", "0.59315133", "0.58834726", "0.5853392", "0.5843727", "0.5807153", "0.57972455", "0.57885456", "0.5764661", "0.5758678", "0.5758131", "0.5752304", "0.57509875", "0.5749811...
0.70670587
0
records a variable to the current log, DOES NOT LOG AUTOMATICALLY
def recordVariable(self, variableName, data): if str(variableName) in self.currentLog: # if self.currentLog[str(variableName)] != None: # raise Warning(f'data point {str(variableName)} is being overwritten!') self.currentLog[str(variableName)] = data else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_example(var):\n\n log.info('example code started')\n log.debug('calling settings')\n test_settings()\n log2.error('there is no error this is example ')\n log2.info('finished')", "def log_debug(var):\n\n GPS.Logger('testsuite').log(\"%s\" % (var, ))", "def logger(self, value):\n ...
[ "0.6800775", "0.67926866", "0.67613137", "0.673412", "0.66907656", "0.6625186", "0.6596223", "0.6494363", "0.6444782", "0.6422716", "0.64064705", "0.6392706", "0.6374291", "0.6330466", "0.63255125", "0.6305311", "0.6288462", "0.62827843", "0.6263191", "0.6250232", "0.6246383"...
0.70800555
0
Initializes the CSV file and prepares it for writing.
def initCSV(self, makeFile, overWrite): self.initialized = True os.chdir(os.path.dirname(os.path.abspath(__file__))) if os.path.exists(str(self.fileName)): f = open(str(self.fileName), "r") if not f.read(): f.close() f = open(str(self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __open_csv(self):\n self.__csv_file = open(self.__csv_file_name, 'w', encoding='utf-8')\n self.__csv_writer = csv.writer(self.__csv_file, delimiter=',', )", "def init_csv_file(self):\n folder = \"/home/pi/data/\" + datetime.now().strftime(\"%Y_%m_%d\") + \"/\"\n if not os.path.isdir(folde...
[ "0.76741135", "0.74255097", "0.7329993", "0.7243945", "0.7048726", "0.7034279", "0.6956366", "0.673258", "0.67240673", "0.6676092", "0.6603313", "0.6579222", "0.65732867", "0.65732867", "0.6540106", "0.6471683", "0.6458733", "0.64487153", "0.64303035", "0.6368172", "0.6349897...
0.78837293
0
Test that a line holds a string, file, and line number
def test_line(): lines = [] for _x in range(100): l_str = random_str(10, 20) l_file = random_str(10, 20) l_num = randint(1, 10000) lines.append((Line(l_str, l_file, l_num), l_str, l_file, l_num)) while len(lines) > 0: entry = choice(lines) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_line_in(filename, line):\n with open(filename, \"r\") as f:\n for l in f:\n if l.rstrip() == line:\n break\n else:\n assert False, \"Could not find {} in {}:\\n{}\".format(\n repr(line), filename, content_of(filename)\n )", ...
[ "0.69585425", "0.6931738", "0.6854182", "0.6810021", "0.6797748", "0.6797748", "0.66369987", "0.65322787", "0.6526846", "0.6506827", "0.6487942", "0.6429897", "0.63600194", "0.62503994", "0.62250286", "0.6216428", "0.6179639", "0.61630183", "0.61193603", "0.6115619", "0.60968...
0.67012906
6
Test that an encased string carries the same file and number
def test_line_encase(): for _x in range(100): l_file = random_str(10, 20) l_num = randint(1, 10000) line = Line(random_str(10, 20), l_file, l_num) for _y in range(20): sub_str = random_str(10, 20) sub_line = line.encase(sub_str) assert isinstan...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _filename_comparator(a_str, b_str):\n if a_str.lower() < b_str.lower():\n return -1\n if a_str.lower() > b_str.lower():\n return 1\n return 0", "def test_get_original_file_name_match_regex(self):\n test_file_name = \"uploaded_file_name_%s_abcd123\" % settings.FILE_DUPLICATION_MA...
[ "0.6443291", "0.6209897", "0.61721045", "0.6078706", "0.6052035", "0.60423845", "0.6017639", "0.6004279", "0.59569526", "0.593605", "0.58959645", "0.5895161", "0.58745116", "0.57874805", "0.5774112", "0.5765002", "0.57483685", "0.5745821", "0.5730069", "0.5717228", "0.5715554...
0.55506366
33
Test retrieval of characters and ranges from string
def test_line_substring(): for _x in range(100): l_str = random_str(50, 100) line = Line(l_str, random_str(10, 20), randint(1, 10000)) # Try a single charater c_idx = randint(0, len(l_str)-1) sub_line = line[c_idx] assert sub_line == l_str[c_idx] assert is...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_visual_range__scan__character(self, coord, expected):\n mapstr = self.map.get_visual_range(coord, dist=4, mode=\"scan\", character=\"@\")\n self.assertEqual(expected, mapstr.replace(\"||\", \"|\"))", "def test_get_visual_range__scan__character(self, coord, expectstr, expectlst):\n ...
[ "0.610639", "0.6038184", "0.6026712", "0.5970901", "0.5908719", "0.5801437", "0.57843846", "0.57394814", "0.56980556", "0.5654949", "0.5650799", "0.55994284", "0.5591236", "0.5566312", "0.554305", "0.55042243", "0.5499806", "0.5492547", "0.5480804", "0.5468994", "0.5464701", ...
0.50426906
98
Test splitting the line on a delimiter
def test_line_split(): for _x in range(100): delim = choice(("=", "|", ",", "$", ".", "/")) l_str = delim.join([random_str(5, 10) for x in range(30)]) line = Line(l_str, random_str(10, 20), randint(1, 10000)) # Split the string l_parts = line.split(delim) exp_parts...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_splitDelimiters(self):\n r = irc.split(\"xx yyz\", 2)\n self.assertEqual([\"xx\", \"yy\", \"z\"], r)\n r = irc.split(\"xx\\nyyz\", 2)\n self.assertEqual([\"xx\", \"yy\", \"z\"], r)", "def test_missing_delim(self):", "def test_separators_only():\n assert my_splitter(\",ad...
[ "0.73270494", "0.70250404", "0.68041414", "0.6702957", "0.66659194", "0.66542345", "0.6602388", "0.65903723", "0.6489964", "0.6464224", "0.64220285", "0.6415962", "0.63997453", "0.6323227", "0.62965256", "0.6243838", "0.62103975", "0.61743695", "0.61724603", "0.6158313", "0.6...
0.6852707
2
Test stripping the line
def test_line_strip(): for _x in range(100): l_str = " ".join([random_str(5, 10) for x in range(30)]) l_str = (" " * randint(0, 10)) + l_str + (" " * randint(0, 10)) line = Line(l_str, random_str(10, 20), randint(1, 10000)) # Strip the string l_stripped = line.strip() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_line(line):\r\n if not line.strip():\r\n return False # if the last line is blank\r\n if line.startswith(\"#\"):\r\n return False # comment line\r\n if line.startswith(\" #\"):\r\n return False # comment line\r\n return line", "def rstrip_line(line):\n return li...
[ "0.7250562", "0.71768016", "0.7084123", "0.6787665", "0.6771485", "0.67688704", "0.6600255", "0.65247554", "0.65227586", "0.6483088", "0.64529765", "0.6417862", "0.6400912", "0.6377311", "0.6369888", "0.6362237", "0.6348878", "0.6332042", "0.62773633", "0.6241648", "0.6229595...
0.7533331
0