input
stringlengths
2.65k
237k
output
stringclasses
1 value
C . PRO A 1 66 ? 44.193 -1.538 12.100 1.00 10.80 ? 67 PRO A C 1 ATOM 309 O O . PRO A 1 66 ? 44.750 -2.270 11.328 1.00 13.57 ? 67 PRO A O 1 ATOM 310 C CB . PRO A 1 66 ? 42.074 -0.905 10.846 1.00 10.38 ? 67 PRO A CB 1 ATOM 311 C CG . PRO A 1 66 ? 42.256 -0.445 9.422 1.00 10.25 ? 67 PRO A CG 1 ATOM 312 C CD . PRO A 1 ...
2, 3, 4, 5, 6, 7, 8, 9, 10], " "but got 11") def test_printable_string(self): foo = asn1tools.compile_string( "Foo DEFINITIONS AUTOMATIC TAGS ::= " "BEGIN " "A ::= PrintableString " "B ::= PrintableString (SIZE (16)) " "C ::= PrintableString (SIZE (0..31)) " "END", 'uper') datas = [ ('A', (string.ascii_u...
<reponame>gokceneraslan/ProDy<filename>prody/dynamics/mode.py # -*- coding: utf-8 -*- # ProDy: A Python Package for Protein Dynamics Analysis # # Copyright (C) 2010-2012 <NAME> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published ...
# Copyright (c) Hikvision Research Institute. All rights reserved. import math import cv2 import numpy as np from numpy import random import mmcv from mmdet.datasets.pipelines import Resize as MMDetResize from mmdet.datasets.pipelines import RandomFlip as MMDetRandomFlip from mmdet.datasets.pipelines import RandomCrop...
example (Car) doesn't need to use this metaclass, as it doesn't have any properties that meet this condition. """ @dataclass class VehicleWithWheels(metaclass=property_wizard): _wheels: Union[int, str] = field(default=4) @property def wheels(self) -> int: return self._wheels @wheels.setter def wheels(self,...
r] = 1 r += 1 # reaction 86 # I5_out --> 0 N[I5_out, r] = -1 r += 1 # reaction 87 # I5_out --> 0 N[I5_out, r] = -1 """ # not S2: I5_S2 """ r += 1 # reaction 88 # 0 --> L_I5_S2 N[L_I5_S2, r] = 1 r += 1 # reaction 89 # L_I5_S2 --> 0 N[L_I5_S2, r] = -1 r += 1 # reaction 90 # 0 --> I5_out N[I5_o...
<gh_stars>10-100 # -*- coding: utf-8 -*- import json from datetime import datetime from unittest.mock import Mock import pytest from django.core.exceptions import ValidationError from django.db.models import Count from django.test import TestCase from django.urls import resolve, reverse from djiffy.models import Canva...
"""Type embeddings.""" import logging import os import time import pandas as pd import torch import ujson as json from bootleg import log_rank_0_debug, log_rank_0_info from bootleg.embeddings import EntityEmb from bootleg.layers.helper_modules import PositionAwareAttention from bootleg.utils import data_utils, model...
<reponame>AquaBindi/libsass-python-freebsd<filename>sass.py<gh_stars>0 """:mod:`sass` --- Binding of ``libsass`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This simple C extension module provides a very simple binding of ``libsass``, which is written in C/C++. It contains only one function and one exception type. >>> ...
0 needNodes[nexti][offset] = True # Will need this offset when variable evaluates to 1 noffset = esys.mbox.add(offset, nnz[previ]) needNodes[nexti][noffset] = True previ = nexti # Now build BDD from bottom up rilist = list(ilist) rilist.reverse() if esys.mbox.modulus <= modulusAuto: # Unbounded range. Need ...
# -*- coding: utf-8 -*- # Copyright (c) 2015-2016 MIT Probabilistic Computing Project # 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 r...
from unittest.mock import Mock from twisted.cred import portal from twisted.cred.checkers import AllowAnonymousAccess, InMemoryUsernamePasswordDatabaseDontUse from twisted.internet import reactor, defer from twisted.spread import pb from jasmin.interceptor.configs import InterceptorPBConfig, InterceptorPBClientConfig ...
import os import numpy as np import pandas as pd import six import csv from .core import pop_na, STReader, STBuffer from .core import SortOrder from .core import csv_headers from bmtk.utils.io import bmtk_world_comm """ class DiskBuffer(object): def __init__(self, cache_dir, **kwargs): self.cache_dir = cache_dir ...
# Copyright 2018-2021 Streamlit 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 writi...
def callback(response): current = response.context['upload_stream_current'] total = response.context['data_stream_total'] if current is not None: progress.append((current, total)) create_resp = await blob.upload_blob( data, blob_type=BlobType.PageBlob, raw_response_hook=callback) props = await blob.get_blob_pro...
r=experiment({'host_os':hos, 'target_os':tos, 'device_id':tdid, 'out':oo, 'program_uoa':cfg['programs_uoa']['hashjoin-ph-8'], 'env':{'CK_COMPILE_TYPE':'no'}, 'deps':deps, 'quiet':q, 'record':rec, 'record_repo_uoa':rruid, 'record_data_uoa':rduid, 'os_abi':os_abi, 'title':'', 'subtitle':'Validating hashjoin-ph-8 no...
of objects. Args: clean_magnitude1, clean_magnitude2 (list of floats) -- Objects with flag values of zero and/or quality cuts performed. error1, error2 (list of floats) -- 1 and 2 refer to the matched catalogs. Returns: binned_hax_mag_median (list of floats) -- List of medians of the horizontal axis magnitude in...
= vstruct.VArray([ v_uint32() for i in xrange(15) ]) self.SecondLevelCacheSize = v_uint32() self.HalReserved = vstruct.VArray([ v_uint32() for i in xrange(16) ]) self.Unused2 = v_uint32() self._pad0108 = v_bytes(size=4) self.KdVersionBlock = v_ptr64() self.Unused3 = v_ptr64() self.PcrAlign1 = vstruct.VArr...
<filename>nomic/proposal.py from collections import OrderedDict from dataclasses import dataclass from datetime import datetime from enum import Enum from typing import Optional, Set import discord import functools from .gameflags import GameFlagsManager from .playerdict import PlayerDict from .repoman import GameRepo...
or negative for a win by the minimizer player. Only needed for terminal states.""" jersi_rewards = self.__jersi_state.get_rewards() if jersi_rewards[self.__maximizer_player] == Reward.DRAW: mcts_reward = 0 elif jersi_rewards[self.__maximizer_player] == Reward.WIN: mcts_reward = 1 else: mcts_reward = -1 re...
* 2, y_offset * 2), special_flags=pygame.BLEND_RGB_ADD) pyimage_copy[i] = surf except Exception as error: messagebox.showerror( "Error", "An error occurred during the RGB split process\nError: %s\n" "The RGB split effect will be disregarded" % error) return pyimage_post_processing return pyimage_copy ...
import requests try: import elementtree.ElementTree as ET except ImportError: import xml.etree.ElementTree as ET class BasecampError(Exception): pass class Basecamp(): def __init__(self, url, apikey): self.baseURL = url if self.baseURL[-1] == '/': self.baseURL = self.baseURL[:-1] self.apikey = apikey def _...
from plotly import tools as ptools import plotly.io as pio import plotly.graph_objs as go import esppy.espapi.connections as connections import esppy.espapi.tools as tools import esppy.espapi.viewers as viewers from esppy.espapi.tools import Options import esppy.espapi.colors as colors from base64 import b64encode...
Ref: # https://wiki.python.org/moin/TimeComplexity # Algorithm Cheat Sheet: # http://bigocheatsheet.com/ # List: # index l[i] O(1) # store l[i]=1 O(1) # len len(l) O(1) # l.append(1) O(1) *avrg/amortized. # sort l.sort() O(n) # Set: # av worste # add O(1) # in O(1) O(n)? # pop O(1) pass def bit_wise...
<reponame>wwydmanski/Chemformer import torch from rdkit import Chem, RDLogger class DecodeSampler: def __init__( self, tokeniser, max_seq_len, length_norm=None ): self.tokeniser = tokeniser self.max_seq_len = max_seq_len self.length_norm = length_norm assert max_seq_len > 1, f"Max sequence must be at least...
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # @uthor : TheAsouka # BTC address : 16Jg3VFJsWVkip2c5yCHo2bEBustkxQZpW # ETH address : 0x3FF703Af55f5Ee0870f44A51d08f753A1f192Fcd # Feel free to be generous import re, sys, os, json, argparse, time from urllib.request import urlopen from random import randint def Argum...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import copy import json import logging import os import re try: import six except ImportError: from ansible.module_utils import six import sys imp...
#!/usr/bin/env python """The JIP Pipeline module contains the classs and functions used to create pipeline graphs """ import collections import os from jip.options import Option from jip.tools import Tool from jip.profiles import Profile from jip.logger import getLogger from jip.templates import render_template import...
<filename>logios/hyphenate.py<gh_stars>1-10 """ Hyphenation, using Frank Liang's algorithm. This module provides a single function to hyphenate words. hyphenate_word takes a string (the word), and returns a list of parts that can be separated by hyphens. >>> hyphenate_word("hyphenation") ['hy', 'phen', 'ati...
= gcp.compute.NetworkPeering("peering2", network=producer_network.id, peer_network=consumer_network.id, opts=pulumi.ResourceOptions(provider=google_beta)) hc = gcp.compute.HealthCheck("hc", check_interval_sec=1, timeout_sec=1, tcp_health_check=gcp.compute.HealthCheckTcpHealthCheckArgs( port=80, ), opts=pulumi...
# ****************************************************************************** # pysimm.forcefield.charmm module # ****************************************************************************** # # ****************************************************************************** # License # *****************************...
teams.session_id == session_id).first() tid = result.id new_student = students(id=id, tid=tid, session_id=session_id, name=name, email_address=email_address, is_lead=False, midterm_done=False, final_done=False, active="open") db.session.add(new_student) db.session.commit() except exc.SQLAlchemyError: hand...
cluster. remove_overlap If `True`, remove ambiguous samples. Otherwise, assign them to the most likely cluster. raise_threshold If a cluster is assigned less than ``raise_threshold x n_most_likely`` samples, raise an exception. Set to `None` if you only want to raise if there is an empty cluster. check_row_sums ...
import collections import fastzbarlight import itertools import logging from multiprocessing import pool import numpy as np import time import threading # import psutil import sys from collections import namedtuple from gym.utils import reraise import re from universe import error, pyprofile, spaces # TODO: prefix th...
get_redirected_drug_name(xml_tree) return get_drug_via_wikipedia(redirected_drug_name) else: pc_mol_uri = "http://pubchem.ncbi.nlm.nih.gov" + \ "/summary/summary.cgi?cid=" + \ mol_name + "&disopt=DisplaySDF" file_name = "pc-" + mol_name + ".mol" coot_get_url(pc_mol_uri, file_name) else: db_mol_uri = "http://...
<filename>zfit/_loss/binnedloss.py # Copyright (c) 2021 zfit from typing import Iterable, Optional, Set import numpy as np import tensorflow as tf from uhi.typing.plottable import PlottableHistogram from .. import z from ..core.interfaces import ZfitBinnedData, ZfitBinnedPDF from ..core.loss import BaseLoss from ..ut...
{} # self._cache_candidate = {} # if weights != -1: # self.electionData.weights = weights # self._cache_voter = {} # self._cache_candidate = {} # if order is not None: # self.electionData.order = order # if candidates is not None: # self.electionData.candidates = candidates # self._cache_candidate = {} ...
import json from datetime import datetime import hashlib import hmac from django.core.exceptions import ImproperlyConfigured from django.test import override_settings, tag from django.utils.timezone import utc from mock import ANY from anymail.exceptions import AnymailConfigurationError from anymail.signals import An...
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # 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 applicabl...
<filename>tests/test_cart.py import json from unittest.mock import MagicMock, Mock from uuid import uuid4 import pytest from django.contrib.auth.models import AnonymousUser from django.core import signing from django.core.exceptions import ObjectDoesNotExist from django.http import HttpResponse from django.urls impor...
contact.site i_visit_id, j_visit_id = contact.id_tup '''Check status of both individuals''' i_has_valid_status = ( # not dead (not (self.state['dead'][idxi] and self.state_started_at['dead'][idxi] <= start_contact)) and # not hospitalized at time of contact (not (self.state['hosp'][idxi] and self.state_starte...
<reponame>redwankarimsony/SSD-Mobilenet-People-Detection #!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Sat Jun 8 15:45:16 2019 @author: viswanatha """ import torch.nn as nn import torch.nn.functional as F from torch.nn import Conv2d, Sequential, ModuleList, ReLU import torch from mobilenet_ssd_priors i...
<gh_stars>100-1000 #// #//---------------------------------------------------------------------- #// Copyright 2007-2011 Mentor Graphics Corporation #// Copyright 2007-2011 Cadence Design Systems, Inc. #// Copyright 2010 Synopsys, Inc. #// Copyright 2019-2020 <NAME> (tpoikela) #// All Rights Reserved Worldwide #// #// ...
<reponame>gamtiq/leo-editor #@+leo-ver=5-thin #@+node:tbrown.20080613095157.2: * @file ../plugins/active_path.py #@+<< docstring >> #@+node:tbrown.20080613095157.3: ** << docstring >> (active_path) r'''Synchronizes \@path nodes with folders. If a node is named '\@path *<path_to_folder>*', the content (file and folder ...
text to long list keywords_text.extend(filter_dict_page(parsed_pagetext, all_keywords)) # Filter using keywords ideology_text.extend(filter_dict_page(parsed_pagetext, all_ideol)) # Filter using ideology words logging.info("Successfully parsed and filtered file " + str(file) + "...") return webtext,keywords_text,...
# The MIT License (MIT) # # Copyright (c) 2016 <NAME> & <NAME> for Adafruit Industries # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the ...
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import os from dataclasses import dataclass from pathlib import PurePath from typing import Optional, Sequence from pants.engine.engine_aware import EngineAwareParameter from pants.util.d...
the old positional version option and the new ue-version option if self.args.release is not None and self.args.ue_version is not None: raise RuntimeError( "specified both `--ue-version` and the old positional version option; please use only `--ue-version`!" ) # For the sake of a simpler pull request, we use self....
""" .. _twitter: Twitter Data API ================ """ import logging from functools import wraps from twython import Twython import pandas as pd from pandas.io.json import json_normalize TWITTER_LOG_FMT = ('%(asctime)s | %(levelname)s | %(filename)s:%(lineno)d ' '| %(funcName)s | %(message)s') logging.basicConfi...
from __future__ import with_statement import py try: set except NameError: from sets import Set as set, ImmutableSet as frozenset def compress_char_set(chars): """Take the character list and compress runs of adjacent characters; the result is a list of the first character in a run and the number of chars followi...
np.all(t1.right_sib_array == t2.right_sib_array) assert list(t1.sites()) == list(t2.sites()) def test_copy_seek(self): ts = msprime.simulate(10, recombination_rate=3, length=3, random_seed=42) assert ts.num_trees > 5 tree = tskit.Tree(ts) copy = tree.copy() self.verify_empty_tree(copy) while tree.next(): copy...
<gh_stars>1-10 """Kernel Tuner interface module This module contains the main functions that the Kernel Tuner offers to its users. Author ------ <NAME> <<EMAIL>> Copyright and License --------------------- * Copyright 2016 Netherlands eScience Center Licensed under the Apache License, Version 2.0 (the "License"); y...
def get_docker_constructs(cls, construct_type, *expected_constructs): '''Get a list of images, containers or volumes.''' return { 'image': cls.get_docker_image_list, 'container': cls.get_docker_container_list, 'volume': cls.get_docker_volume_list }[construct_type](*expected_constructs) # - - - - - - - - - - - -...
# Copyright 2020 University of Illinois Board of Trustees. All Rights Reserved. # Author: <NAME>, DPRG (https://dprg.cs.uiuc.edu) # This file is part of Baechi, which is released under specific terms. See file License.txt file for full license details. # =================================================================...
<filename>tests/test_export_sci.py # coding: utf-8 import unittest from lxml import etree as ET import json import os from lxml import etree from xylose.scielodocument import Article from articlemeta import export_sci from articlemeta import export class XMLCitationTests(unittest.TestCase): def setUp(self): sel...
# Copyright 2021 The Matrix.org Foundation C.I.C. # # 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 agree...
<gh_stars>10-100 #!/usr/bin/env python3 """ Colr - Progress - Frames A collection of frames for `colr.progress.Progress`. -<NAME> 3-12-17 The MIT License (MIT) Copyright (c) 2015-2017 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentat...
idx_term # & ~idx_j if np.any(idx): return np.where(idx)[0][0] # 3. Try to match H # If spec is 'H 1', then try to match conf with conf, # *or* try to match term with term, *or* try to match conf with term, # *or* try to match term with conf if level.species == "H 1": # TODO idx_term_conf = label.term == level...
""" CISCO_IPSEC_MIB The MIB module for modeling Cisco\-specific IPsec attributes Overview of Cisco IPsec MIB MIB description This MIB models the Cisco implementation\-specific attributes of a Cisco entity that implements IPsec. This MIB is complementary to the standard IPsec MIB proposed jointly by Tivoli and ...
neck) (default is 30 degrees from the straight neck position) roll_tresh: int Treshold of the roll angle for considering the person distracted/unconscious (not straight neck) (default is None: not considered) pose_time_tresh: float or int Maximum time allowable for consecutive distracted head pose (given the pi...
<gh_stars>10-100 import simplejson as json import urllib import urllib2 from datetime import datetime from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.db import transaction, connection from django.core.cache import cache from django.utils import timezone from dotastats....
<filename>mesonbuild/interpreter.py # Copyright 2012-2016 The Meson development team # 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 req...
"""This file contains code used in "Think DSP", by <NAME>, available from greenteapress.com Copyright 2013 <NAME> License: MIT License (https://opensource.org/licenses/MIT) """ import copy import math import numpy as np import random import scipy import scipy.stats import scipy.fftpack import subprocess import warni...
import json import os from sqlalchemy import ( Table, Column, Integer, String, UniqueConstraint, MetaData ) from sqlalchemy.types import UserDefinedType from twisted.trial.unittest import TestCase from aludel.database import ( get_engine, make_table, CollectionMissingError, _PrefixedTables, CollectionMetadata, Tab...
"""Implement pygmo optimizers.""" import warnings import numpy as np from estimagic import batch_evaluators from estimagic.config import IS_PYGMO_INSTALLED from estimagic.decorators import mark_minimizer from estimagic.exceptions import NotInstalledError from estimagic.optimization.algo_options import CONVERGENCE_RELA...
<gh_stars>1-10 import aiohttp import asyncio from botstory.ast import story_context from botstory.integrations.commonhttp import errors as commonhttp_errors from botstory.utils import answer import logging import unittest from unittest import mock import pytest from . import messenger from .. import commonhttp, mockdb...
[when ``match`` is not `None`]: number of matched sources * **'matched_ref_idx'** [when ``match`` is not `None`]: indices of the matched sources in the reference catalog * **'matched_input_idx'** [when ``match`` is not `None`]: indices of the matched sources in the "input" catalog (the catalog from image to be al...
0x58, 0xd0, 0x21, 0x31, 0x24, 0x1a, 0x84, 0x31, 0x14, 0x2a, 0xa1, 0x14, 0x00, 0x19, 0x02, 0x23, 0x34, 0xca, 0x40, 0x94, 0x42, 0x93, 0xaf, 0x24, 0xb0, 0x28, 0x44, 0xa1, 0x24, 0x7f, 0xdb, 0x02, 0x52, 0x13, 0x8c, 0xd2, 0x25, 0x11, 0x71, 0x41, 0x48, 0x98, 0x24, 0x29, 0xb3, 0x64, 0xb1, 0x24, 0x74, 0x12, 0xa1, 0x42, 0...
0.00435488, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228, 'Renaming Unit/Peak Dynamic': 3.58947, 'Renaming Unit/Runtime Dynamic': 0.123992, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic':...
<reponame>jaidevd/pgmpy from pgmpy.exceptions import CardinalityError from pgmpy.factors import Factor from pgmpy.models import MarkovModel from pgmpy.tests import help_functions as hf import numpy as np import unittest class TestMarkovModelCreation(unittest.TestCase): def setUp(self): self.graph = MarkovModel() ...
in IMS (VoLTE or WiFi Calling) call with PhoneC. Merge calls to conference on PhoneA (CEP enabled IMS conference). Hangup on PhoneC, check call continues between AB. Hangup on PhoneB, check A ends. Args: call_ab_id: call id for call_AB on PhoneA. call_ac_id: call id for call_AC on PhoneA. Returns: True if suc...
<reponame>lucaskotres/ElipseExamples # -*- coding: utf-8 -*- import epmsdk import epmsdk.communication as epmcomm import epmsdk.dataaccess as epmda import epmsdk.historicaldata as epmhda import epmsdk.opcua.core as core import datetime def status_air(): try: conn01 = epmcomm.epmConnect(hostname='kotres', username=...
#!/home/tortes/anaconda3/envs/ts/bin/python """ Change list: - Remove past action - adjust step output: remove arrived - Change python version to 3 - Add action space, observation space 8.17 - Change action space to discrete action """ import os import rospy import numpy as np import math from math import pi import ran...
-1) # -1 => Unknown self._max_mem_mb_usage = Value("i", -1) # -1 => Unknown # All values below are cumulative. self._num_queries_dequeued = Value("i", 0) self._num_queries_started = Value("i", 0) self._num_queries_finished = Value("i", 0) self._num_queries_exceeded_mem_limit = Value("i", 0) self._num_queries_ca...
<filename>unitracer/lib/windows/amd64/kernel32.py #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2009-2014, <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Re...
import unittest from oaipmh import ( entities, exceptions, ) class ResumptionTokenInterfaceTest: def test_responds_to_encode(self): self.assertTrue(hasattr(self.object, 'encode')) def test_responds_to_decode(self): self.assertTrue(hasattr(self.object, 'decode')) def test_responds_to_next(self): self.asser...
import pytest from tulius.forum.threads import models from tulius.forum.comments import signals def test_comments_api(client, superuser, admin, user): # create root room and thread in it response = superuser.put( '/api/forum/', { 'title': 'group', 'body': 'group description', 'room': True, 'default_rights': Non...
<gh_stars>1-10 # Copyright 2018 D-Wave Systems 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 agr...
# organization/views_admin.py # Brought to you by We Vote. Be good. # -*- coding: UTF-8 -*- from .controllers import organizations_import_from_master_server from .models import Organization from .serializers import OrganizationSerializer from admin_tools.views import redirect_to_sign_in_page from candidate.models impo...
372 , (3, 0, None, None) , 0 , )), (( 'SchedulePlusPriority' , 'SchedulePlusPriority' , ), 33071, (33071, (), [ (16392, 10, None, None) , ], 1 , 2 , 4 , 0 , 376 , (3, 0, None, None) , 0 , )), (( 'SchedulePlusPriority' , 'SchedulePlusPriority' , ), 33071, (33071, (), [ (8, 1, None, None) , ], 1 , 4 , 4 , 0 , 380 , (3,...
#!/usr/bin/env python3 import os import sys import time import argparse import re import subprocess import requests import shutil from bs4 import BeautifulSoup from termcolor import cprint from multiprocessing import Pool import traceback MARKDOWN_SEARCH_TERM = r'\.md$' # Regex to find a URL URL_SEARCH_TERM = r'(\b(h...
<filename>annulus/detector.py<gh_stars>1-10 import numpy as np import cv2 def _cross_ratio(z1, z2, z3, z4): """Calculate cross ratio between four values on a line""" nom = (z3 - z1) * (z4 - z2) den = (z3 - z2) * (z4 - z1) return nom / den def _cross_ratio_annulus(center, circle1, circle2): """Return a cross ra...
for and averaged across all markets. market_weights : `array-like, optional` Weights for averaging micro moments over specified ``market_ids``. By default, these are :math:`1 / T_m`. Examples -------- - :doc:`Tutorial </tutorial>` """ product_id1: Optional[Any] product_id2: Optional[Any] def __init__( se...
<reponame>qwghlm/WhensMyBus<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- #pylint: disable=W0142 """ When's My Transport? A Twitter bot that takes requests for a bus or Tube, and replies the real-time data from TfL on Twitter This is a parent classes used by all three bots, handling common functionalit...
set to False force_no_sim: `bool`, default False If True, prediction with no simulations is forced. This can be useful when speed is of concern or for validation purposes. na_fill_func : callable (`pd.DataFrame` -> `pd.DataFrame`) default:: lambda df: df.interpolate().bfill().ffill() A function which interpola...
<gh_stars>10-100 import asyncio import collections import logging import typing as T import discord from lifesaver.utils.timing import Ratelimiter from dog.formatting import represent from . import checks as checks_module from .core import Ban, Bounce, CheckFailure, Report, create_embed from .threshold import Thresh...
from gibson.envs.camera_env import VirtualCameraEnv from gibson.envs.env_bases import BaseEnv from gibson.utils.play import play from gibson.core.render.profiler import Profiler from scipy.signal import savgol_filter from multiprocessing import Pool, TimeoutError import gibson import argparse import os import trimesh i...
<filename>python/albireolib/image/general.py #!/usr/bin/env python # -*- coding: utf-8 -*- # # @Author: <NAME> (<EMAIL>) # @Date: 2017-10-012 # @Filename: general.py # @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause) # # @Last modified by: <NAME> (<EMAIL>) # @Last modified time: 2018-08-08 16:03...
<reponame>0xCAF2/calcium-py # Used for py3ca.py class Engine: def __init__(self, code_list): self.env = Environment(code_list) self.breakpoints = [] self.parser = Parser() def run(self): while True: result = self.step() if result == RESULT_EXECUTED: continue elif result == RESULT_BREAKPOINT: return False ...
tca_test_case_id=0)) self.assertEqual(client_result.tsr_error.e_code, 0, 'GetTestStatus') self.assertEqual(client_result.tsr_state, PASSED, 'PortStatus PASSED') self.assertEqual(client_result.tsr_type, CLIENT, 'PortStatus CLIENT') self.assertEqual(client_result.tsr_l4_proto, l4_proto, 'PortStatus L4') if l4_pr...
proceeding to shutdown to ensure worker0 RPCs make # it through to other workers. dist.barrier() rpc.shutdown(graceful=False) @dist_init def test_all_gather(self): info = rpc.get_worker_info() results = rpc.api._all_gather(info.id) expected = {} for info in rpc._get_current_rpc_agent().get_worker_infos(): ex...
{}'.format(j['message'])) return rest.internal_error('failed to call daemon process') obj = json.loads(resp.content) path = os.path.join(_get_project_dir_path(project_name), 'spacy_rules/' + field_name + '.json') data[project_name]['master_config']['fields'][field_name]['number_of_rules'] = len(obj['rules']) # d...
<gh_stars>1-10 #!/usr/bin/env python3 # Library installation notes: # plotly: # pip3 install chart_studio # pip3 install plotly # or, for updates # pip3 install plotly --upgrade # scikit-learn: # ref: https://www.kaggle.com/c/titanic/discussion/6801 # python3 -m pip install scikit-learn # this might be necessary: pip...
Wipe old installation, otherwise qwt refuses to install cmd = ['rm', '-vf'] + glob(P.join(installDir, 'lib/', 'libqwt.*')) self.helper(*cmd) cmd = [installDir + '/bin/qmake','-spec'] if self.arch.os == 'osx': cmd.append(P.join(installDir,'mkspecs','macx-clang')) else: cmd.append(P.join(installDir,'mkspecs','lin...
def exportChildren(self, outfile, level, namespace_='', name_='headType', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for MEDIA_DESCRIPTOR_ in self.MEDIA_DESCRIPTOR: MEDIA_DESCRIPTOR_.export(outfile, level, namespace_, name_='MEDIA_DESCRIPTOR', pretty_print=pretty_print) ...
import logging from pathlib import Path import uuid import numpy as np import matplotlib.pyplot as plt from scipy import interpolate from brainbox.core import Bunch import ibllib.exceptions as err import ibllib.plots as plots import ibllib.io.spikeglx import ibllib.dsp as dsp import alf.io from ibllib.io.spikeglx im...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import torch import torch.optim as optim import torch.nn as nn import torch.nn.functional as f from torch.autograd import Variable from utils import * import numpy as np import pandas as pd from tqdm import tqdm import json import random import argparse import datetime im...
assert False, "Database type not recognised." @step(r'Add IPv6 address reservation (\S+) with iaid (\S+) to (\S+) record id (\d+).') def ipv6_address_db_backend_reservation(reserved_address, reserved_iaid, db_type, reservation_record_id): if db_type == 'MySQL': mysql_reservation.ipv6_address_db_backend_reservation(...
lean only, trimmed to 1/8" fat, select, cooked, grilled 23250: [], # Beef, top loin petite roast, boneless, separable lean only, trimmed to 1/8" fat, all grades, cooked, roasted 23251: [], # Beef, top loin petite roast, boneless, separable lean only, trimmed to 1/8" fat, choice, cooked, roasted 23252: [], # Beef, to...
8px;" line = "<td {} style='{}'>".format(td_arg, css) line = line + str(content) line = line + " </td>\n" #logging.debug(line) return line ############################################# ### Vector graphics/animation ### Select objects def select_checks_and_clears(self, object_id, n, check): oid = ...