input
stringlengths
2.65k
237k
output
stringclasses
1 value
<reponame>ttumkaya/WALiSuite_V2.0<filename>WALiSuite_GenerateSummaryPlots.py # coding: utf-8 # In[1]: import os import seaborn as sns import pandas as pd from scipy import stats import scipy as sp import numpy as np import datetime as dt get_ipython().magic('matplotlib inline') import matplotlib # matplotlib.use('A...
of metrics means aggregation of metrics across all results, here aggregation could be sum, average, rate, etc. """ @property def raw_page(self): return self results = proto.RepeatedField( proto.MESSAGE, number=1, message="GoogleAdsRow", ) next_page_token = proto.Field(proto.STRING, number=2,) total_results...
<filename>berryimu.py #!/usr/bin/python # # This program includes a number of calculations to improve the # values returned from a BerryIMU. If this is new to you, it # may be worthwhile first to look at berryIMU-simple.py, which # has a much more simplified version of code which is easier # to read. # # # The BerryIMU...
float(nav_line[3 + i*19:3 + (i + 1)*19]) # Reading Cuc/e Eccentricity/Cus/Sqrt(A) elif cnt1 == 2: for i in xrange(0, 4): cnt3 += 1 temp[cnt2][cnt3] = float(nav_line[3 + i*19:3 + (i + 1)*19]) # Reading Toe/Cic/OMEGA/Cis elif cnt1 == 3: for i in xrange(0, 4): cnt3 += 1 temp[cnt2][cnt3] = float(nav_line[3 + i*19...
import base64 import json import warnings from collections import defaultdict, namedtuple from enum import Enum, EnumMeta from types import FunctionType from typing import Any, Generator, NamedTuple, Tuple, Union import lpipe.exceptions import lpipe.logging from lpipe import normalize, signature, utils from lpipe.acti...
of the solution for D. The default is False niter : int, optional If N-R refinement is to be done, niter is how many iterations to compute. The default is 3. grid : boolean, optional whether or not to show the axes grids. The default is False. FVaverage : boolean, optional Whether or not to average the abund...
<reponame>rcasteran/jarvis4se<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- """Module containing all object's class, i.e. all objects that will be manipulated by Systems engineers""" # Libraries from enum import Enum # Modules from . import util class BaseType(Enum): """BaseType class""" DATA = 0 FU...
= os.path.abspath(os.path.dirname(__file__)) trex_path = os.path.join(cur_path, 'automation', 'trex_control_plane', 'interactive') if trex_path not in sys.path: sys.path.insert(1, trex_path) from trex.astf.trex_astf_profile import ASTFProfile from trex.astf.sim import decode_tunables tunables = {} if pa().tunab...
# A set of helper functions for the NSBL codebase from py_db import db db = db('NSBL') def random_sql_helpers(): sql_dict = { } def get_team_abb(team_name, year): qry = db.query("SELECT team_abb FROM teams WHERE year = %s AND team_name = '%s';" % (year, team_name)) if qry != (): team_abb = qry[0][0] else: prin...
"""Module used to store riven-related data and means to calculate it. Logic and data should be separated but I'm too mongolic to do it yet""" import settings import utils import rating_profile class Riven: """class used to store all riven-related data and means to calculate it.""" def __init__( self,...
import slicer from RVXLiverSegmentationLib import removeNodeFromMRMLScene from .RVXLiverSegmentationLogic import RVXLiverSegmentationLogic from .RVXLiverSegmentationUtils import getMarkupIdPositionDictionary, createLabelMapVolumeNodeBasedOnModel class VesselSeedPoints(object): """Helper class containing the differe...
<gh_stars>0 #!/usr/bin/env python """ conference.py -- Udacity conference server-side Python App Engine API; uses Google Cloud Endpoints $Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $ created by wesc on 2014 apr 21 """ from datetime import datetime import endpoints from protorpc import messages fr...
1), (6, 3, -5, -5): (0, 1), (6, 3, -5, -4): (0, 1), (6, 3, -5, -3): (0, 0), (6, 3, -5, -2): (-1, -1), (6, 3, -5, -1): (0, 1), (6, 3, -5, 0): (0, 1), (6, 3, -5, 1): (0, 1), (6, 3, -5, 2): (0, 1), (6, 3, -5, 3): (0, 1), (6, 3, -5, 4): (0, 1), (6, 3, -5, 5): (0, 1), (6, 3, -4, -5): (-1, 1), (6, 3, -4, -4): (-...
import time import pymysql # for pulling UCSC data import pandas as pd from pathlib import Path import logging # app from .progress_bar import * # tqdm, context-friendly LOGGER = logging.getLogger(__name__) logging.basicConfig(level=logging.INFO) logging.getLogger('numexpr').setLevel(logging.WARNING) # these login st...
import datetime import os from typing import TYPE_CHECKING, Iterable, Optional, Union from uuid import uuid4 from django.conf import settings from django.contrib.postgres.aggregates import StringAgg from django.db import models from django.db.models import JSONField # type: ignore from django.db.models import Case, Co...
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- """ @author: <NAME> @<EMAIL> """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import math import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torc...
"""builder.py Modified June 26 2015 <NAME> <EMAIL> This module contains everything that is needed to construct a system dynamics model in python, using syntax that is compatible with the pysd model simulation functionality. These functions could be used to construct a system dynamics model from scratch, in a pinch. D...
a_drop_cols2: columns to drop in the seconda dataframe after the join :param a_where: where condition to apply after the join :param a_cache: if True, the resulting dataframe will be cached :param a_unpersist1: if True, the first dataframe will be unpersisted :param a_unpersist2: if True, the second :param a_...
range(nspin): for iat in range(strc.nat): print >> fout, "----- Calc radfunc for atom ",iat print >> fout, "-- (L)APW states --" print >> fout, (' '*10+'POTENTIAL PARAMETERS FOR JATOM=%-3d name=%-10s') % (iat,strc.aname[iat]) print >> fout, ' '*11+'L'+(' '*7)+'U(R)'+(' '*11)+"U'(R)",(' '*9)+'DU/DE'+(' '*10)+"DU'/D...
<gh_stars>0 # -*- coding: utf-8 -*- """ Author - <NAME> Class - CPS 470 Assignment - Homework 2: Simulation of Memory Allocation Strategies Creation Date - Tuesday June 23 10:11:47 2020 Due Date - Thursday June 25 13:59:59 2020 Purpose: Study the performances of the memory allocation strategies first-fit, next...
""" # Integrating Authorize.Net ### 1. Validate Currency Support Example: from frappe.integration_broker.doctype.integration_service.integration_service import get_integration_controller controller = get_integration_controller("AuthorizeNet") controller().validate_transaction_currency(currency) ### 2. Redirect ...
<reponame>TheSin-/terracoin-masternode-tool #!/usr/bin/env python3 # -*- coding: utf-8 -*- # Author: Bertrand256 # Created on: 2017-03 import argparse import datetime import json import os import re import copy from configparser import ConfigParser from os.path import expanduser from random import randint from shutil i...
are bearings without a z location for b in cycle(self.bearing_elements): if bearings_no_zloc: if b in bearings_no_zloc: # first check if b.n is on list, if not, check for n_link node_l = df.loc[(df.n_l == b.n) & (df.tag != b.tag), "nodes_pos_l"] node_r = df.loc[(df.n_r == b.n) & (df.tag != b.tag), "nodes_pos_r"] ...
import tkinter as tk from tkinter import ttk from matplotlib.pyplot import close from matplotlib.figure import Figure from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg, NavigationToolbar2Tk) from matplotlib.mathtext import math_to_image from io import BytesIO from PIL import ImageTk, Image from sympy im...
""" <h2>Sobolev Alignment</h2> @author: <NAME> Example ------- :: from anndata import AnnData import numpy as np import pandas as pd from sobolev_alignment import SobolevAlignment # Generate data n_source = 100 n_target = 200 n_features = 500 X_source = np.random.normal(size=(n_source, n_features)) X_sou...
flattened: if video_id in phrase_intrvllists: phrase_intrvllists[video_id].append((t1, t2, 0)) else: phrase_intrvllists[video_id] = [(t1, t2, 0)] for video_id, intrvllist in phrase_intrvllists.items(): phrase_intrvllists[video_id] = IntervalList(intrvllist) phrase_intrvlcol = VideoIntervalCollection(phrase_int...
<filename>tools/bismark/bismark_wrapper.py #!/usr/bin/env python import argparse import os import shutil import subprocess import sys import shlex import tempfile import fileinput import fileinput from glob import glob def stop_err( msg ): sys.stderr.write( "%s\n" % msg ) sys.exit() def __main__(): print 'tempfi...
<filename>src/classes/server.py import json from classes.gamemodes import getGamemode, isValidGamemode from classes.items import Barrels, Gear, Grips, Lists, Magazines, Muzzles, Receivers, Scopes, Stocks, Tactical from classes.loadouts import Player, PlayerLoadouts from classes.playlists import getPlaylist, isValidPlay...
# -*- coding: utf-8 -*- """ Contains all possible non-ASCII unicode numbers. """ from __future__ import ( print_function, division, unicode_literals, absolute_import ) # Std. lib imports. import unicodedata # Local imports. from natsort.compat.py23 import py23_unichr # Rather than determine this on the fly, whi...
+ m.x254 + m.x257 + m.x268 + m.x271 + m.x338 + m.x341 <= 12) m.c4036 = Constraint(expr= 12*m.b58 + 12*m.b62 - m.x170 - m.x174 + m.x240 + m.x244 + m.x254 + m.x258 + m.x268 + m.x272 + m.x338 + m.x342 <= 12) m.c4037 = Constraint(expr= 12*m.b59 + 12*m.b63 - m.x171 - m.x175 + m.x241 + m.x245 + m.x255 + m.x259 + m.x269 +...
""" fftmap library: This library can be used to create 2D maps. Map here means a large "virtual" array of floating point numbers, which is virtual in the sense that the array is filled procedurally, block by block, as needed. The map can be defined to contain different spatial frequencies in different proporti...
grasp)[what] # \} def event (self, gripper, handle, what, default): if handle is None: ee = self._buildGripper ("open", gripper, handle) else: ee = self._buildGripper ("close", gripper, handle) if hasattr(ee, "events"): return ee.events.get(what, default) return default ## Create a set of controllers for a ...
#!/usr/bin/env python # # @author: <NAME> # <NAME> """ nimsdata.medimg.nimspfile ========================= This module provides functions, classes and errors for fully minimally parsing and reconstructing pfiles. Additional modules are required to enable full parsing of pfiles, spiral reconstruction, and mux_epi reco...
works properly with float32 data.""" p = np.asarray([940.85083008, 923.78851318, 911.42022705, 896.07220459, 876.89404297, 781.63330078], np.float32) * units('hPa') hgt = np.asarray([563.671875, 700.93817139, 806.88098145, 938.51745605, 1105.25854492, 2075.04443359], dtype=np.float32) * units.meter true_p_layer =...
<filename>advntr/plot.py # -*- coding: utf-8 -*- import matplotlib matplotlib.use('Agg') def plot1(): stat_files = ['0_size_related_reads.txt', '1_size_sensitivity.txt', '2_size_blast_selected.txt', '3_sim_read_coverage__gc_content.txt'] x_label = {0: 'Pattern Size', 1: 'Pattern Size', 2: 'Pattern Size', 3: 'Sim...
<filename>sparclur/_spotlight.py from __future__ import annotations import copy import os import shutil import tempfile from collections import defaultdict from typing import List, Union, Dict, Any, Tuple import numpy as np from tqdm import tqdm from concurrent.futures import ThreadPoolExecutor as Executor from inspe...
<gh_stars>1-10 # -*- coding: utf-8 -*- import os, sys, time, datetime import xbmc, xbmcgui import re, urllib, urlparse, random, json import openscrapers from resources.lib.modules import client, cleantitle, control, workers from resources.lib.modules import trakt, tvmaze, source_utils, log_utils from resources.lib.mo...
<reponame>induane/stomp.py3<gh_stars>0 import math import random import re import socket import sys import threading import time import types import xml.dom.minidom import errno try: from cStringIO import StringIO except ImportError: from io import StringIO protocols = frozenset([ 'PROTOCOL_SSLv3', 'PROTOCOL_TLSv...
""" pass def Initialize(self, *args): #cannot find CLR method """ Initialize(self: UnmanagedMemoryStream, buffer: SafeBuffer, offset: Int64, length: Int64, access: FileAccess) Initializes a new instance of the System.IO.UnmanagedMemoryStream class in a safe buffer with a specified offset, length, and f...
<reponame>Vinicius-Tanigawa/Undergraduate-Research-Project<gh_stars>0 ## @ingroup Methods-Aerodynamics-AVL #create_avl_datastructure.py # # Created: Oct 2014, <NAME> # Modified: Jan 2016, <NAME> # Apr 2017, <NAME> # Jul 2017, <NAME> # Aug 2019, <NAME> # Mar 2020, <NAME> # ---------------------------------------------...
<reponame>clauswilke/epistasis_evolution<gh_stars>0 #!/usr/bin/python ''' The script creates a class population. ''' import numpy as np import sys import os.path class population: def __init__(self, L, N, s, q, mu, k_start): self.L = L self.N = N self.s = s self.q = q self.mu = mu self.k_start = k_start s...
or offsetting the brush (like the 'b' and 'm' default hotkeys). The string argument is one of: radius, lowradius, opacity, value, depth, displacement, uvvectoror none. C: Default is none. - dynclonemode : dcm (bool) [] - exists : ex (bool) [create] Returns true or false depending upon whether the specified obje...
(data) = self.view_addressv3_with_http_info(orcid, put_code, **kwargs) # noqa: E501 return data def view_addressv3_with_http_info(self, orcid, put_code, **kwargs): # noqa: E501 """Fetch an address # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please p...
def _get_diag_blocks(self, module, diag_blocks): """Helper method for determining number of diag_blocks to use Overrides `diag_blocks` if the `module` does not support `diag_blocks>1`. I.e. for a Linear layer, we do not want to use a `diag_blocks>1`. Args: module: module diag_blocks (int): default number of di...
respectively). It returns ``True`` if the first interval ends at the same time as the second interval (+/- ``epsilon``), and the first interval starts after the second interval. Args: epsilon: The maximum difference between the end time of the first interval and the end time of the second interval. Returns: An...
import sys from thread import get_ident from peak.util.decorators import rewrap, cache_source, classy, decorate __all__ = [ 'Service', 'replaces', 'setting', 'InputConflict', 'DynamicRuleError', 'State', 'Action', 'resource', 'registry', 'new', 'empty', 'lookup', 'manager', 'reraise', 'with_', 'call_with', 'ScopeEr...
test_errors_for_non_accesspoint_arn(self): params = { 'Bucket': 'arn:aws:s3:us-west-2:123456789012:unsupported:resource' } context = {} with self.assertRaises(UnsupportedS3ArnError): self.arn_handler.handle_arn(params, self.model, context) def test_ignores_bucket_names(self): params = {'Bucket': 'mybucket'} c...
<gh_stars>10-100 import datetime import hashlib import re from mopidy import backend from mopidy.models import Album, Artist, Image, Ref, SearchResult, Track from urllib.parse import quote from mopidy_bandcamp import logger class BandcampLibraryProvider(backend.LibraryProvider): root_directory = Ref.directory(uri=...
# Copyright 2014 Scalyr Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, soft...
import datetime import email import email.parser import glob import mailbox import os import re import subprocess import time import urllib import warnings from email.header import Header from email.message import Message from email.mime.text import MIMEText from typing import Dict, List, Optional, Tuple, Union import...
15 if self.grating == "580V": print(" For 580V we use bright skyline at 5578 AA ...") sky_line = 5578 sky_line_2 = 0 if self.grating == "1000R": # print " For 1000R we use skylines at 6300.5 and 6949.0 AA ..." ### TWO LINES GIVE WORSE RESULTS THAN USING ONLY 1... print(" For 1000R we use skyline at 6949.0 AA ......
import enum from os import name from typing import List, Dict, Optional, Tuple import torch from torch import nn, einsum from einops import rearrange, repeat from comvex.vit import ViTBase from comvex.utils import FeedForward, PathDropout, ProjectionHead, PatchEmbeddingXd from comvex.utils.helpers import name_with_ms...
various architectures tensor_h = 320 tensor_w = 320 x = tf.placeholder(tf.float32, [None, tensor_h * tensor_w, 1], name="x") y = tf.placeholder(tf.float32, [None, 6], name="y") # keep_prob = tf.placeholder(tf.float32, name="keep_prob") # dropout (keep probability) keep_prob = tf.placeholder(tf.float32, len(...
######################################################################################################### #----------This class represents the nnUNet Multiple Head Trainer. Implementation-----------------------# #----------inspired by original implementation (--> nnUNetTrainerV2), copied code is marked as such.----# ##...
import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.model_selection import StratifiedKFold from sklearn.linear_model import Perceptron from sklearn.neighbors import KNeighborsClassifier from sklearn.svm import SVC from sklearn.tree import DecisionTreeClassifier from sklearn.naive...
""" Provides class Hiarrchy for the analysis of multiple segementations orgainized in a hierarchy (each segmentation is a subset of the next one). # Author: <NAME> (Max Planck Institute for Biochemistry) # $Id$ """ from __future__ import unicode_literals from __future__ import absolute_import from __future__ import ...
# fixture components --------------------------------------------- @pytest.fixture def ColorFormat_from_colorchoice_parent_(self, request): return method_mock(request, ColorFormat, "from_colorchoice_parent") @pytest.fixture def color_(self, request): return instance_mock(request, ColorFormat) class Describe...
x10 * x48 + x102 - x25 * x53 - x27 * x53 - x29 * x53 - x46 * x6 - x47 * x8 x104 = self.p.r1 * w_1_dot_z * x12 x105 = r_xx * self.p.r2 - r_zx * x14 x106 = w_2_dot_x * x105 x107 = r_xy * self.p.r2 - r_zy * x14 x108 = w_2_dot_y * x107 x109 = r_xz * self.p.r2 - r_zz * x14 x110 = w_2_dot_z * x109 x111 = self.p.m1 * ...
from rdflib.namespace import RDF, SKOS, DCTERMS, RDFS, OWL, DC from rdflib import URIRef, Namespace, Literal, Graph import markdown from flask import url_for import requests from config import Config from skos.concept_scheme import ConceptScheme, ConceptSchemeRenderer from skos.concept import Concept, ConceptRenderer ...
<filename>POVME/packages/clustering/cluster.py #!python # Implementation of Clustering Algorithms in POVME # By <NAME> # Advised by <NAME> # Amaro Lab, UCSD import scipy.cluster.vq, scipy.cluster.hierarchy import argparse import numpy import sys import os import csv import copy import itertools import collections #imp...
#!/usr/bin/env python3 """pdoc's CLI interface and helper functions.""" import argparse import ast import importlib import inspect import os import os.path as path import json import re import sys import warnings from contextlib import contextmanager from functools import lru_cache from http.server import BaseHTTPRequ...
<gh_stars>1-10 # Created on 11/9/21 at 11:02 AM # Author: <NAME> import os import scipy.stats # import scipy.io.wavfile # import soundfile as sf import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torchvision.utils import torchvision from torch.autograd import Variab...
<filename>a10_octavia/controller/worker/flows/a10_member_flows.py # Copyright 2019, A10 Networks # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0...
to which the messages have to be retrieved, defaults to the current time on the gateway. :param limit: Using this optional parameter you can limit the number of messages retrieved in total. :return: Returns three values. 1: the status of the operation, 2: the number of messages, 3: the list of retrieved messages. :r...
tuple: if value in range(i[0], i[1]): return True else: if value == i: return True return False class BooleanLeaf(Leaf): """ Class defining Leaf with boolean extensions (e.g., True or False) """ def __init__(self, tag, parent=None, value=None, units="", mandatory=False): super(BooleanLeaf, self).__init__(ta...
import numpy as np import matplotlib.pyplot as plt import warnings class DistributionSampler: def __init__( self, size=None, dist=None, mean=None, sd=None, lam=None, trials=None, prob=None ): ''' Overview -------- Selects a random sample from a given distribution, based upon the input parameters, and retur...
for case 2 name1: str, Default 'N1' Phrase to append to keys of the resulting dataframe for case 1 name2: str, Default 'N2' Phrase to append to keys of the resulting dataframe for case 2 saveName: str, Default 'saveName' Name of file to save result dataframe to Returns: None Usage: an = Analysis() an...
is_null ( ) ) : return ( lisp_ipc_map_cache_entry ( mc , jdata ) ) if 95 - 95: I1Ii111 * o0oOOo0O0Ooo + OoO0O00 % OoOoOO00 - ooOoO0o / OoOoOO00 if ( mc . source_cache == None ) : return ( [ True , jdata ] ) if 45 - 45: OoooooooOO / oO0o / o0oOOo0O0Ooo + Ii1I + O0 . iII111i if 34 - 34: iIii1I11I1II1 . o0oOOo0O0Ooo +...
<filename>xen/xen-4.2.2/tools/ocaml/libs/xl/genwrap.py #!/usr/bin/python import sys,os import idl # typename -> ( ocaml_type, c_from_ocaml, ocaml_from_c ) builtins = { "bool": ("bool", "%(c)s = Bool_val(%(o)s)", "Val_bool(%(c)s)" ), "int": ("int", "%(c)s = Int_val(%(o)s)", "Val_int(%(c)s)" ), "char *": ("string",...
product.variants.get() url = reverse( 'dashboard:variant-delete', kwargs={'product_pk': product.pk, 'variant_pk': variant.pk}) response = admin_client.get(url) assert response.status_code == 200 assert ProductVariant.objects.filter(pk=variant.pk).exists() def test_view_variant_images(admin_client, product_wit...
<filename>bin/smrtsv.py<gh_stars>1-10 #!/bin/env python import argparse import logging import subprocess import sys import os import re # Set logging logging.basicConfig(filename="smrtsv.log", level=logging.DEBUG) # Set cluster parameters CLUSTER_SETTINGS = ' -V -cwd -e ./log -o ./log {cluster.params} -w n -S /bin/ba...
from __future__ import print_function, division import os from datetime import datetime import copy import warnings warnings.filterwarnings("ignore",category=UserWarning) from .pyemu_warnings import PyemuWarning import math import numpy as np import pandas as pd from pyemu.mat.mat_handler import get_common_elements,Ma...
<reponame>CloudReactor/task_manager from typing import Any, FrozenSet, TYPE_CHECKING import logging import random import string from django.utils import timezone from rest_framework.exceptions import APIException from botocore.exceptions import ClientError from ..common.aws import * if TYPE_CHECKING...
S3OptionsFilter("case_details.registered", cols = 2, hidden = True, options = opt_yes_no, ), S3OptionsFilter("case_details.enrolled_in_school", cols = 2, hidden = True, options = opt_yes_no, ), S3DateFilter("date_of_birth", #label = T("Date of Birth"), hidden = True, ), S3DateFilter("dvr_case.date", #lab...
task=HELLO_WORLD, health_check_config=HealthCheckConfig( health_checker=HealthCheckerConfig(shell=shell_config), interval_secs=interval_secs, initial_interval_secs=initial_interval_secs, max_consecutive_failures=max_consecutive_failures, min_consecutive_successes=min_consecutive_successes, timeout_secs=timeout_s...
<reponame>bshafi/StockMomentum from datetime import date, datetime, timedelta, timezone, tzinfo, time from types import CellType from typing import Any, Tuple, List from sm_util import historical_database from enum import Enum import psycopg2 class StockAction(Enum): BUY = 0 SELL = 1 def sentiment_trader_antivix(c...
<filename>ready_patterns.py # -*- coding: utf-8 -*- from ast_helper import * import idaapi import ida_name import ida_bytes import ida_struct import ida_typeinf import idc strlen_global = """Patterns.ChainPattern([ Patterns.ExprInst(Patterns.AsgnExpr(Patterns.VarBind("t1"), Patterns.ObjBind("strlenarg"))), Patterns...
<gh_stars>0 """Solve cube using Thistlethwaite's algorithm.""" from .ida_star import ida_star from cube.functions import orient def g1(self) -> tuple: """ Solve edge orientation. Returns ------- tuple of (list of str, dict of {'G1': int}) Moves to solve edge orientation, statistics (move count in...
trueSolarTime > 1440: trueSolarTime = trueSolarTime - 1440 hourangle = trueSolarTime / 4.0 - 180.0 # Thanks to <NAME> for the next line: if hourangle < -180: hourangle = hourangle + 360.0 harad = radians(hourangle) csz = sin(radians(latitude)) * sin(radians(solarDec)) + cos( radians(latitude) ) ...
<filename>core/ErrorCodes.py ''' Created on Jun 29, 2009 @author: <NAME> ''' import logging class ErrorCodes: errorFields = ('pilot','exe','sup','ddm','brokerage','jobdispatcher','taskbuffer') errorCodes = {} errorStages = {} def __init__(self): for f in self.errorFields: self.errorCodes['%serrorcode'%f] = {...
for n2 in nodes2: if n2 not in nodes: maps = False if maps: if not e in train2all: train2all[e] = [e2] else: train2all[e].append(e2) test_edges = all_pt_edges.intersection(set(itertools.chain.from_iterable(train2all.values()))) return train2all, test_edges def join_edges(self, x_r, train2all, likelihood_...
<filename>get_work.py #!/usr/bin/python3 import sys import re import time import urllib3 import datetime import math http = urllib3.PoolManager(headers={"User-Agent":"keisentraut/prime95-optimal-worktodo"}) # print error message and exit hard def FATAL(msg): print(f"FATAL: {msg}") sys.exit(1) PRINT_DEBUG=1 def DEB...
of the channels as a percentage of range; The value of the offset (range * percentage) is ALWAYS substracted from the signal No offset can be used for 1000 mV and 10000 mV range in Buffered mode Input: digitizer_offset('CH0', '1', 'CH1', '50') Default: '0'; '0' Output: 'CH0: 10' """ if self.test_flag != 'test': ...
Map"]) # # plt.subplot(2, 1, 2) # p22, = plt.plot(number_of_robots, path_planning_time2) # plt.title("Computation Time \n for Various Robot Populations") # plt.xlabel("Robot Population Size") # plt.ylabel("Computation \n Time (Seconds)") # plt.grid() # # plt.legend([p12, p22], ["Large Map", "Medium Ma...
<reponame>div-B-equals-0/dust-wave-case-studies # -*- coding: utf-8 -*- # --- # jupyter: # jupytext_format_version: '1.2' # kernelspec: # display_name: Python 3 # language: python # name: python3 # language_info: # codemirror_mode: # name: ipython # version: 3 # file_extension: .py # mimetype: text/x-python # name: pyt...
/ (0.0001 + 0.9999 * m.b24) + 9.92855620143344)**2 + (-m.x355 / (0.0001 + 0.9999 * m.b24) + 5.74951319729978)**2 + (-m.x356 / (0.0001 + 0.9999 * m.b24) + 3.53637928232447)**2 - 1) * (0.0001 + 0.9999 * m.b24) + 0.0144073937673116 * m.b24 <= 0.0144073937673116) m.e105 = Constraint(expr= ((-m.x357 / (0.0001 + 0.9999 *...
<reponame>Federico-PizarroBejarano/safe-control-gym import os import matplotlib.pyplot as plt import numpy as np from safe_control_gym.utils.utils import mkdirs from safe_control_gym.controllers.mpc.mpc_utils import compute_state_rmse def get_cost(test_runs): num_epochs = len(test_runs) num_episodes = len(test_run...
# -*- coding: utf-8 -*- """ The a module sets up three objects from class functions. - input_data() establishes where data is loaded from. - configuration() establishes various configuration variables used in the rest of the code. - output_data() establishes where data is written to. These are intended to be chang...
With QtWebEngine, this setting also controls # other features with tracking capabilities similar to those of cookies; # including IndexedDB, DOM storage, filesystem API, service workers, and # AppCache. Note that with QtWebKit, only `all` and `never` are # supported as per-domain values. Setting `no-3rdparty` or `no- #...
<filename>cage/core.py<gh_stars>0 # Encoding: utf-8 import json import math import numpy as np import pymatgen as pmg import cage.utils as utils import pymatgen.symmetry.analyzer as syman from itertools import combinations from monty.io import zopen from monty.json import MSONable from pymatgen.core.structure import...
<filename>code/proteomics_preprocessing.py '''Preparing datasets for language modelling, classification and sequence annotation ''' import fire # This needs to be called in order to load local implemented submodules import os import sys #module_path = os.path.abspath(os.path.join('../')) #if module_path not in sys.pat...
<filename>otter/test/rest/test_application.py # encoding: utf-8 """ Tests for :mod:`otter.rest.application` """ import json import mock from twisted.internet.defer import succeed from twisted.trial.unittest import TestCase from otter.rest.application import Otter from otter.rest.otterapp import OtterApp from otter.r...
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests for concurrency libraries.""" import glob import os import random import re import sys import threading import time from flaky import flaky import pytest...
<filename>GNN/train.py import sys sys.path.append("..") import os import time import json import torch import argparse import numpy as np import torch.nn as nn from tqdm import tqdm from GNN.dataset import DataSet from itertools import product from gnn import HierarchicalGNN, MLP, Linear, CustomizedGNN from torch.nn i...
<filename>lib/helpers/pvrartwork.py #!/usr/bin/python # -*- coding: utf-8 -*- """ script.module.metadatautils pvrartwork.py Get metadata for Kodi PVR programs """ import os, sys if sys.version_info.major == 3: from .utils import get_clean_image, DialogSelect, log_msg, extend_dict, ADDON_ID, download_artwork, norm...
= self.get_common_message_string(ticket) Trace.log(level, "FINISHED %s returned %s" % (common_message, status)) # log the new work list self.log_work_list(ticket) # report back to original client - probably a mover # # Some functions need to handle the reply directly (list_volumes). # They, should set 'no_reply...
BRICK_COLOR3 brick.color = BRICK_COLOR3 elif i <= 7: brick.fill_color = BRICK_COLOR4 brick.color = BRICK_COLOR4 elif i <= 9: brick.fill_color = BRICK_COLOR5 brick.color = BRICK_COLOR5 else: brick.fill_color = 'black' self.window.add(brick, x=j * (BRICK_WIDTH + BRICK_SPACING), y=BRICK_OFFSET + i * (BRICK_HEIG...
<filename>tests/test_archiver.py import logging import os import shutil import tempfile from functools import wraps import json import mock from urllib import quote_plus from pylons import config from nose.tools import assert_raises, assert_equal from ckan import model from ckan import plugins from ckan.logic import ...
<gh_stars>0 """ Set of objects that implement different kinds of random noise generators. """ from __future__ import absolute_import """ Copyright 2009-2015 <NAME> This file is part of pyo, a python module to help digital signal processing script creation. pyo is free software: you can redistribute it and/or modify...
<filename>Chatbot.py from chatterbot import ChatBot from chatterbot.trainers import ListTrainer from chatterbot.trainers import ChatterBotCorpusTrainer import discord import base64 from Crypto import Random from Crypto.Hash import SHA256 from Crypto.Cipher import AES def cipherAES(password, iv): key = S...