input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
= from.style;
/** @type {string} */
style.left = labelPos.x + "px";
/** @type {string} */
style.top = labelPos.y + "px";
/** @type {string} */
style.display = this.fitsInCanvas(labelPos, canvas) ? "" : "none";
options.onPlaceLabel(from, lab);
}
});
Hypertree.Plot.NodeTypes = new Class({
none : {
/** @type {... | |
<reponame>tweak-com-public/tweak-api-client-python<gh_stars>0
# coding: utf-8
"""
tweak-api
Tweak API to integrate with all the Tweak services. You can find out more about Tweak at <a href='https://www.tweak.com'>https://www.tweak.com</a>, #tweak.
OpenAPI spec version: 1.0.8-beta.0
Generated by: https://github... | |
: 4,
ToontownCentral : 4, # TT streets are in 5
MyEstate : 5.5,
DonaldsDock : 6,
MinniesMelodyland: 6,
GoofySpeedway : 6,
TheBrrrgh : 8,
DaisyGardens : 8,
FunnyFarm : 8,
DonaldsDreamland : 8,
OutdoorZone : 8,
BossbotHQ : 12,
SellbotHQ : 9,
CashbotHQ : 10,
LawbotHQ : 11,
GolfZone : 8,
PartyHood : 13,
}
... | |
def get_context_data(self, **kwargs):
courselet_pk = self.kwargs.get('courselet_pk')
course = self.get_course()
if courselet_pk:
courselet = CourseUnit.objects.get(id=courselet_pk)
else:
courselet = CourseUnit.objects.filter(course=course).first()
# TODO: Cover this
kwargs['invites'] = Invite.objects.my_invites... | |
if len(self.for_dequeue) == 0:
self._carry_over(self.for_enqueue, self.for_dequeue)
return self.for_dequeue.pop()
def _carry_over(self, src, dest):
while len(src) != 0:
dest.push(src.pop())
return MyQueue
def problem_3_6(stack):
""" Write a program to sort a stack in ascending order. You should not make
any ... | |
and(8), python(7), a(4), programming(3), has(3), and the(3)
encoder = TokenSequenceEncoder(default_length=10, limit_vocabulary=10)
encoder.prepare(corpus, show_progress=False)
# encode test sentence
encoded_test_sentences = encoder.encode([test_sentence, "and"], show_progress=False)
# padding to size 10 and two ... | |
-2740321. 0.0000000E+00 012104
6047375. 2297095. 0.0000000E+00 0.0000000E+00 63642.55 003104
-433045.5 -78139.93 0.0000000E+00 0.0000000E+00 -99830.28 300005
-258204.9 -6963.864 0.0000000E+00 0.0000000E+00 -150071.3 210005
932631.4 252438.4 0.0000000E+00 0.0000000E+00 -41604.31 120005
572208.1 139320.7 0.0000000E+... | |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | |
if not self.tunables:
self.tunables = dict()
assert index not in self.tunables
self.tunables[index] = (value,size)
def add_operation_index(self, index, uid):
if not self.operation_indexes:
self.operation_indexes = dict()
self.operation_indexes[index] = uid
def add_close_index(self, index, uid):
if not self.c... | |
<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import six, json
from ..util import text, unicode_obj, unicode_list
__author__ = "nebula"
class Term(object):
def __init__(self, left, op, right, remark="", scope="rt"):
if not isinstance(left, Exp):
left = Exp.g... | |
in attributes.items():
setattr(instance.collection_attributes, name, value)
else:
raise Exception("{0} not supported, only 'memory' savepoint supported".format(format))
instance._private.previous = self._private.previous
instance._private.version = 0
self._private.previous = instance
return instance
def new_wo... | |
# Copyright 2018 Google 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... | |
<reponame>dlasecki/z-quantum-core
"""General-purpose utilities."""
import warnings
import numpy as np
from scipy.linalg import expm
import random
import math
import operator
import sys
import json
import openfermion
import sympy
from openfermion import hermitian_conjugated
from openfermion import InteractionRDM
from o... | |
already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
return self
def buildAttributes(self, node, attrs, already_processed):
pass
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, ... | |
exact-matching
:return: tuple(newENname, translate_type)
"""
# first, if en name is already good (not blank and not JP and not a known exception), just keep it
if PREFER_EXISTING_ENGLISH_NAME and en and not en.isspace() and en.lower() not in FORBIDDEN_ENGLISH_NAMES \
and not translation_tools.needs_translate(en)... | |
from client import exception, embed_creator, discord_manager, ini_manager, json_manager, permissions, origin, server_timer
from client.external import admin, dc_bank, organizer, rsn_register, vote, xp_tracker, kc_tracker
from client.config import config as c, language as l
from discord.ext import commands
import discor... | |
<reponame>Ibrahim2595/virtual_learning_softrobotics
import cv2
import mediapipe as mp
import numpy as np
import json
import time
import socket
import sys
# color in BGR
text_color = (255, 255, 255)
arrow_color = (0, 0, 255)
arrow_thickness = 6 #px
arrow_length = 200
cmd_text_position = [50,50]
last_cmd_expire_time = {... | |
from __future__ import print_function
import inspect
from math import pi, sqrt, factorial
import qutip
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import patches as mpatches
from matplotlib.gridspec import GridSpec
from os import path
from scipy.special import genlaguerre
from scipy.linalg import... | |
from fontTools.misc.fixedTools import floatToFixedToFloat
from fontTools.misc.testTools import stripVariableItemsFromTTX
from fontTools.misc.textTools import Tag
from fontTools import ttLib
from fontTools import designspaceLib
from fontTools.feaLib.builder import addOpenTypeFeaturesFromString
from fontTools.ttLib.table... | |
from pathlib import Path
import sqlalchemy as sa
from spinta.core.config import RawConfig
from spinta.testing.cli import SpintaCliRunner
from spinta.testing.config import configure
from spinta.testing.datasets import Sqlite
from spinta.testing.manifest import compare_manifest
from spinta.testing.tabular import create... | |
"""
Minewalker is a game where the player aims to cross a field without
a mine.
"""
import msvcrt, random, os, time, ast, sys
from random import randint
from termcolor import colored
class Main():
"""
Minewalker
"""
def __init__(self, x=10, y=10, mines=15, player=' 0 ', colour=None, trail=' # ', wait=3, climit=3, ... | |
User,
on_delete=models.CASCADE,
related_name='%(class)s_change_user'
)
is_deleted = models.BooleanField(
default=False,
)
class Meta:
db_table = "email_contact"
class email_content(models.Model):
email_content_id = models.AutoField(primary_key=True)
email_subject = models.CharField(max_length=255)
email_c... | |
--pol ipsec -j ACCEPT ',
top=True),
mock.call.add_rule(
'POSTROUTING',
'-s 192.168.3.11/24 -d 172.16.17.32/24 -m policy '
'--dir out --pol ipsec -j ACCEPT ',
top=True)
])
self.router.iptables_manager.apply.assert_called_once_with()
def test_sync(self):
fake_vpn_service = FAKE_VPN_SERVICE
self.driver.agent_r... | |
<reponame>Bhanditz/spyder<gh_stars>1-10
# -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""Mix-in classes
These classes were created to be able to provide Spyder's regular text and
console widget features... | |
"03-016",
"nombre_ref": "CANTIL DEL PEDREGAL",
"pob_2010": 660
},
{
"id_ref": 449,
"del_ref": "COYOACAN",
"cve_col": "03-017",
"nombre_ref": "CARM<NAME>",
"pob_2010": 8198
},
{
"id_ref": 450,
"del_ref": "COYOACAN",
"cve_col": "03-155",
"nombre_ref": "CENTRO URBANO (U HAB)",
"pob_2010": 437
},
{
"id_r... | |
<reponame>filemaster/aihwkit
# -*- coding: utf-8 -*-
# (C) Copyright 2020 IBM. All Rights Reserved.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2... | |
# -*- coding: utf-8 -*-
from load import *
from fft import *
from plots import *
print('\nplotting fields\n')
outdir = './fig_fields/'
# Load 2D cut
ncfile = netcdf.netcdf_file(input_dir+runname+'.out.2D.nc'+restart_num, 'r')
tt_fld = np.copy(ncfile.variables['tt' ][:]); tt_fld = np.delete(tt_fld , ignored_points_f... | |
side='left')
res = self.executor.execute_tensor(t9, concat=True)[0]
expected = np.searchsorted(raw, raw2, side='left')
np.testing.assert_array_equal(res, expected)
# test tensor, side right
t10 = searchsorted(arr, tensor(raw2, chunk_size=2), side='right')
res = self.executor.execute_tensor(t10, concat=True)[0]... | |
= self.getalleventtypes()
self.eventtype = ""
# setlayer
# make 800 lines of code, or make an unreadable cinderblock of chaos
# this seems more fun. But I definitely won't do it at work.
cond = "conditions"
# cons = "type"
# doc = "documentation"
name = 'layer'
assert name in self.tiposdisponiveis... | |
a row is inserted, these values will be taken
self.with_index = with_index # display index; also provide the original indices to the owner when updating value
self.col_defs = cols
self.immediate = immediate # e.g. for notebook pages immediate is False
self.can_add = can_add
self.can_remove = can_remove
self.can_i... | |
<filename>test/test_tree.py
__copyright__ = "Copyright (C) 2012 <NAME>"
__license__ = """
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 righ... | |
PHP 123,456.79),
* `multicurrency.pound.PoundSterling` (£123,456.79 | £123,456.79 | GBP 123,456.79),
* `multicurrency.pound.PoundSterlingGB` (£123,456.79 | GB£123,456.79 | GBP 123,456.79),
* `multicurrency.pound.PoundSterlingGG` (£123,456.79 | GG£123,456.79 | GBP 123,456.79),
* `multicurrency.pound.PoundSterlingIM` (£1... | |
<gh_stars>10-100
# -*- coding: utf-8 -*-
# pylint: disable-msg=E0202, E0102, E1101, E1103, E1001
"""
Created on Fri Jan 24 09:46:28 2014
This module contains the definition of the interpretation class, which is the
basic unit of the search process which tries to solve interpretation problems.
@author: <NAME>
"""
from... | |
#!/usr/bin/env python3
import argparse
import datetime
import gzip
import multiprocessing
import os
import subprocess
import sys
import tarfile
import urllib.request
import about
import check
import shared
import tax
def parse_arguments():
date = str(datetime.datetime.now().date())
parser = argparse.ArgumentPar... | |
# Copyright 2021 Alibaba, Inc. and its affiliates. 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... | |
localctx = SBHasmParser.StepContext(self, self._ctx, self.state)
self.enterRule(localctx, 8, self.RULE_step)
try:
self.enterOuterAlt(localctx, 1)
self.state = 101
self.match(SBHasmParser.STEP)
self.state = 104
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [SBHasmParser.DIRECTION]:
self.sta... | |
<gh_stars>1-10
import pytest
import numpy as np
from opentrons.deck_calibration import endpoints
from opentrons.config import robot_configs
from opentrons import types
# Note that several tests in this file have target/expected values that do not
# accurately reflect robot operation, because of differences between r... | |
if r < 0:
if self.console:
print("Found bad r", r, r_dry, sp)
raised = True
if np.abs(ss-S0) > 1e-4:
if self.console:
print("Found S discrepancy", ss, S0, r_dry)
raised = True
if raised:
raise ParcelModelError("Couldn't calculate initial aerosol population wet sizes.")
out['r0s'] = r0s
# c) compute equilibr... | |
# long time
sage: G.shortest_path_lengths(0, by_weight=True)
{0: 0, 1: 1, 2: 2, 3: 3, 4: 2}
Using a weight function::
sage: D = DiGraph([(0,1,{'weight':1}),(1,2,{'weight':3}),(0,2,{'weight':5})])
sage: weight_function = lambda e:e[2]['weight']
sage: D.shortest_path_lengths(1, algorithm='Dijkstra_NetworkX', by_w... | |
<reponame>losek1/Sounder5<gh_stars>1-10
try:
from tkinter import Tk, ttk, StringVar, BooleanVar, DoubleVar, Canvas, Event, IntVar, PhotoImage
from tkinter.filedialog import askdirectory, askopenfilename, asksaveasfile
from tkinter.messagebox import askyesno
from os.path import isfile, join, isdir, basename, abspath... | |
#!/usr/bin/env python
################################################################################
# _ ____ ___ _ _ _ #
# / \ / ___|_ _| | | (_)_ __ | |_ #
# / _ \| | | | | | | | '_ \| __| #
# / ___ \ |___ | | | |___| | | | | |_ #
# /_/ \_\____|___| |_____|_|_| |_|\__| #
# #
########################################... | |
fig = plt.figure(figsize=(20, 12))
gs = gridspec.GridSpec(30, 1) #縦,横
ax1 = plt.subplot(gs[0:16, 0])
ax2 = plt.subplot(gs[16:21, 0])
ax3 = plt.subplot(gs[21:26, 0])
ax4 = plt.subplot(gs[26:31, 0])
time = tohlc[TIME]
open = tohlc[OPEN]
high = tohlc[HIGH]
low = tohlc[LOW]
close = tohlc[CLOSE]
ohlc = []
for... | |
#!/usr/bin/env python3
import argparse
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument("-m", "--midiout", help="enable midi output", action="store_true")
parser.add_argument("-c", "--midiport", type=int, help="connect to midi port")
parser.add_argument("-l", "--listmidiports", help="list midi ... | |
<filename>Acquire/Client/_user.py
import os as _os
from enum import Enum as _Enum
from datetime import datetime as _datetime
import time as _time
from Acquire.Service import call_function as _call_function
from Acquire.Service import Service as _Service
from Acquire.ObjectStore import bytes_to_string as _bytes_to_... | |
float(value)
except:
dlg = wx.MessageDialog(None,
"Can not set item with format %s to value %s" % (fmt4, value),
'Change to item', wx.OK|wx.ICON_ERROR)
dlg.ShowModal()
dlg.Destroy()
return False
else:
return True
def GetValue(self, name, radio_dict):
try:
value = radio_dict[name]
except:
pass
else:
retu... | |
[M] myLeoSettings.leo
[@] @mode, @button, @command
'''
if not d: return g.es('no bindings')
legend = g.adjustTripleString(legend, c.tab_width)
data = []
for stroke in sorted(d):
assert g.isStroke(stroke), stroke
aList = d.get(stroke, [])
for si in aList:
assert g.isShortcutInfo(si), si
s1 = '' if si.pane ==... | |
#!/usr/bin/env python3
# Project : From geodynamic to Seismic observations in the Earth's inner core
# Author : <NAME>
""" Define classes and functions to play with positions and coordinates systems. """
from __future__ import division
from __future__ import absolute_import
import numpy as np
import sys # .float_in... | |
from collections import Mapping, Sequence, Sized, namedtuple as nt
from moodle.fieldnames import JsonFieldNames as Jn
import logging
log = logging.getLogger('moodle.responses')
class JsonWrapper(Sized):
def __len__(self):
return len(self._data)
def __init__(self, json):
self._data = json
@property
def raw(... | |
import lmfit
from time import time
class ModelFit:
""" We collect all information related to a fit between a pygom model and a set of data in this class
It has access to the model structure and defines all required parameters and details of fit """
def dumpparams(self,run_id=''): # Have to add self since this will... | |
<gh_stars>1-10
import sys
import os
import pytest
import pandas as pd
from Medeina.Web import Web
from unittest.mock import MagicMock
from Medeina.config import *
# import Medeina.common as MC
from mock import patch
from unittest.mock import patch, MagicMock, call, mock_open
IDTRACKER = (
"numericCounter-b2ca94aee36... | |
"""Storm-centered radar images."""
import os
import copy
import glob
import numpy
from scipy.interpolate import interp1d as scipy_interp1d
import netCDF4
from gewittergefahr.gg_io import netcdf_io
from gewittergefahr.gg_io import gridrad_io
from gewittergefahr.gg_io import myrorss_and_mrms_io
from gewittergefahr.gg_ut... | |
newdq |= npiece
# The result should be a new mask with reduced dimensionality
return newdq
def _generate_mask(self, data, dq, bitmask=1):
"""
Use the contents of the dq array to generate a numpy mask of the
same shape as the data array.
:Parameters:
data: numpy array
The data array to be masked
dq: nu... | |
self.dec
if tar_ap // 2 == tar_ap / 2:
print(Warning('tar_ap must be odd, adding 1'))
tar_ap += 1
if sky_out // 2 == sky_out / 2:
print(Warning('sky_out must be odd, adding 1'))
sky_out += 1
if sky_in // 2 == sky_in / 2:
print(Warning('sky_out must be odd, adding 1'))
sky_in += 1
if (ra i... | |
<reponame>jonathantribouharet/FrameworkBenchmarks
import json
import re
import traceback
from datetime import datetime
from toolset.utils.output_helper import log
from time import sleep
def basic_body_verification(body, url, is_json_check=True):
'''
Takes in a raw (stringy) response body, checks that it is non-empt... | |
# -*- coding: utf-8 -*-
"""
@author: <NAME> <<EMAIL>>
Date: Aug 2017 2018
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as _plt
from ..simenv import SimEnv
from .. import precomp_funs as _pf
class Pump(SimEnv):
"""
type: Pump class.
One pump is required in each contiguous seaction of the mo... | |
])
self.configure(f'{conan}.in', conan, True, [
('BIN', f'"{bin_directory}"'),
('CONAN', "'/usr/local/bin/conan'"),
('USERNAME', config["options"]["username"]),
])
self.configure(f'{buildroot}.in', buildroot, True, [
('BUILDROOT_VERSION', buildroot_version),
('JOBS', config["options"]["build_jobs"]),
('USERNAM... | |
#!/usr/bin/python
#
# x2z2
# BT Nodes for Testing, ID, Solving
#
# Solve using the x^2 + y^2 method Craig uses
# for puma joint 2 (eqn 4.65 p 118)
#
# BH 2/2/17
#
# BH : Dec-21: SIMPLIFY! After squaring and summing,
# if a one-unk equation is identified, just add
# it to the list of one-unk equations (in a persistent ... | |
> 0) and (len(abbreviation) > 0):
result = lookup_abbreviation(abbreviation, line, search_end, position)
if not result:
## print(2,start,search_end)
result = abbreviation_match(abbreviation, previous_words, line, search_end, position
# @semanticbeeng @todo not used , False, False
)
if not result and alt_abbre... | |
from datetime import date
MAX_YEAR = date.today().year + 1
# these are the acceptable ranges for answers from the master codebook
RANGE_LIST = {
'g1_01d': range(1, 31 + 1) + [99],
'g1_01m': range(1, 12 + 1) + [99],
'g1_01y': range(1900, MAX_YEAR) + [9999],
'g1_05': [1, 2, 8, 9],
'g1_06d': range(1, 31 + 1) + [99]... | |
# The following source code was originally obtained from:
# https://github.com/rootpy/rootpy/blob/master/rootpy/tree/tree.py
# ==============================================================================
# Copyright (c) 2012-2017, The rootpy developers
# All rights reserved.
#
# Please refer to LICENSE.rootpy for th... | |
<reponame>edwarnicke/bomsh<filename>scripts/bomsh_hook2.py
#! /bin/env python3
# Copyright (c) 2022 Cisco and/or its affiliates.
#
# SPDX-License-Identifier: Apache-2.0
#
# 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... | |
g.dinner_choice == 'none':
no_dinners += 1
if s.num_dinners:
guests = ndb.get_multi(s.dinner_keys[:s.num_dinners])
for g in guests:
if g.first_name and g.last_name and g.dinner_choice:
ndinners += 1
s.total_golfers = total_golfers
s.adjusted_dinners = total_golfers - no_dinners + s.num... | |
"""
PINNACLE.
Publications from an Institute: Numbers, Networks, Authors and
Citations Looking for Excellence.
Copyright (c) 2020, <NAME>
MIT License:
https://github.com/IATE-CONICET-UNC/pinnacle/blob/master/LICENSE
"""
import ads
import pandas as pd
import pickle
import numpy as np
class inst_adsentries:
"""
in... | |
self.ms_band_rngsig = np.divide(self.ms_band_rng,self.ms_band_std)
self.ms_band_rngmean = np.divide(self.ms_band_rng,self.ms_band_mean)
if(mode):
self.ms_band_mode = sp.stats.mode(self.ms_pixels,axis=0)[0][0]
self.ms_band_deciles = np.percentile(
self.ms_pixels,np.linspace(10,90,9),axis=0)
self.ms_band_quartiles ... | |
yyyymmddHHMM
example: 2018-08-26 14:18:40 ->> 201808261418
"""
return dateString.replace("-", "").replace(" ", "").replace(":",
"").replace(
"/", "").replace("T", "")[:12]
# achieve rule3 to yyyymmddHHMM
def e_timeToString(dateString):
"""
input: string
output: string
description: format dateString to yyyymm... | |
})
def edit_score(request, code):
if not request.user.is_authenticated:
return HttpResponseRedirect(reverse("login"))
formInfo = Form.objects.filter(code = code)
#Checking if form exists
if formInfo.count() == 0:
return HttpResponseRedirect(reverse('404'))
else: formInfo = formInfo[0]
#Checking if form creator... | |
self.check_increasing_bool(node1.corner_lower,node1.corner_upper,node2.corner_lower,node2.corner_upper,self.in_feats,self.de_feats,self.nmt_feats):
return np.int(node1.predicted_class>node2.predicted_class)
elif self.check_increasing_bool(node2.corner_lower,node2.corner_upper,node1.corner_lower,node1.corner_upper,sel... | |
<filename>src/apps/core/models/ModuleModels.py
from datetime import timedelta
from django.utils.timezone import now
# from cms.models import PlaceholderField, ValidationError, uuid
import uuid
from django.urls import reverse
from django.db import models, transaction
from django.conf import settings
from django_extens... | |
<filename>src/server.py<gh_stars>1-10
from flask import Flask, Response, redirect, url_for, request, send_file, session
from werkzeug.utils import header_property
from flask_session import Session
from werkzeug.utils import secure_filename
import json
from tags import MusicFileHandler
from database import Databas... | |
"▁Temer": 13432,
"69)": 13433,
"▁Gim": 13434,
"▁Miko": 13435,
"▁Tax": 13436,
"▁has": 13437,
"▁Boc": 13438,
"vé": 13439,
"▁SAP": 13440,
"1.3": 13441,
"608": 13442,
"▁Barba": 13443,
"▁sco": 13444,
"▁eu": 13445,
"210": 13446,
"▁0.0": 13447,
"▁Zub": 13448,
"mov": 13449,
"wad": 13450,
"▁Lex": 13451,
"bia... | |
Item(user_id=1, name="Towels",
description="saw. Hath called ", category=category13)
session.add(item9)
session.commit()
category14 = Category(user_id=1, name="Coins, Stamps & Paper money")
session.add(category14)
session.commit()
item1 = Item(user_id=1, name="Coins",
description="the sea called void ... | |
certain syntax prefix. For example <b>set-prefix</b> 1
"add" will cause breakpoint 1 only to stop if the instruction begins
with "add". The text to compare the prefix with for an instruction is
the one which the instruction is disassembled to.
Set prefix to the empty string ("") to remove this extra condition.""", fil... | |
float(line_split[1])
p_w_neut = float(line_split[2])
p_w_neg = float(line_split[3])
for index, element in enumerate(ppmi_matrix[i]):
if element != 0:
f = open(sentiment_lexicon)
lines = f.readlines()
cword = lines[index].split()
pos_weight = float(cword[1])
neut_weight = float(cword[2])
neg_weight = float(cwo... | |
__all__ = ['biblio_parser',
'build_institutions_dic',
'build_title_keywords',
'check_and_drop_columns',
'country_normalization',
'extend_author_institutions',
'getting_secondary_inst_list',
'merge_database',
'name_normalizer',
'normalize_journal_names',
'setting_secondary_inst_filter',
'upgrade_col_names',
... | |
%s' % ('one', "two"))"""
contents, tokens, tree = self.make_data(contents)
expected = contents
results = self.fstringify(contents, tokens, tree)
self.assertEqual(results, expected)
#@-others
#@+node:ekr.20200107174645.1: *3* class TestOrange (BaseTest)
class TestOrange(BaseTest):
"""
Tests for the Orange class.
... | |
Space": 0xAAB7C1,
"Calmness": 0x68A895,
"Calthan Brown": 0x6D5044,
"Calypso": 0x3D7188,
"Calypso Berry": 0xC53A4B,
"Calypso Blue": 0x347D8B,
"Calypso Coral": 0xEE5C6C,
"Calypso Green": 0x2E5F60,
"Calypso Red": 0xDE6B66,
"Camaron Pink": 0xFE828C,
"Camarone": 0x206937,
"Cambridge Blue": 0xA3C1AD,
"Cambridge L... | |
# -*- coding: utf-8 -*-
'''
Connection module for Amazon KMS
.. versionadded:: beryllium
:configuration: This module accepts explicit kms credentials but can also utilize
IAM roles assigned to the instance trough Instance Profiles. Dynamic
credentials are then automatically obtained from AWS API and no further
con... | |
from flask import Flask, render_template, jsonify, json, url_for, request, redirect, Response, flash, abort, make_response, send_file
import requests
import io
import os
import csv
import datetime
import investmentportfolio
print ('Running Portfolio Analyze')
app = Flask(__name__)
# On IBM Cloud, get the port number ... | |
<reponame>pipesanta/WS8552-python<gh_stars>0
import serial
import time
class WS8552_FingerPrintReader(object):
# define ACK_SUCCESS 0x00 //Operation successfully
# define ACK_FAIL 0x01 // Operation failed
# define ACK_FULL 0x04 // Fingerprint database is full
# define ACK_NOUSER 0x05 //No such user
# defi... | |
<filename>MultiQubit_PulseGenerator/NQB/nqb_tomo_functions.py
'''
-------------------------------------------------
- Suite of functions for tomography -
-------------------------------------------------
Generalized MLE code written by <NAME> (<EMAIL>),
based on 1-2QB code written by <NAME> (<EMAIL>)
with input fro... | |
<reponame>PlaytikaResearch/abexp
# MIT License
#
# Copyright (c) 2021 Playtika Ltd.
#
# 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 r... | |
##
## Module & Package Import
##
import json
import os
import datetime
import statistics
import plotly
import plotly.plotly as py
import plotly.graph_objs as go
from flask import Flask, Blueprint, request, render_template, jsonify, flash, redirect
from dotenv import load_dotenv
import gspread
from gspread.excepti... | |
1)))
proportion[I] = (quadrant[I] - (np.pi / 2 - theta.repeat(data.shape[1], 1)[I])) \
/ (theta.repeat(data.shape[1], 1)[I])
# %%Finish Proportion Calculation
section[flats] = FLAT_ID_INT
proportion[flats] = FLAT_ID
section[section == 8] = 0 # Fence-post error correction
proportion = (1 + adjust[section]) / 2.0... | |
'''
Reads a HUD HMIS XML 3.0 Document into memory and parses its contents storing them into a postgresql database.
This is a log database, so it holds everything and doesn't worry about deduplication.
'''
import os#, sys
from .reader import Reader
from zope.interface import implementer
from lxml import etree
import... | |
<reponame>larryhastings/pyweek24
# json-map, a tiled JSON map renderer for pyglet
# Copyright (C) 2014 <NAME> <<EMAIL>>
#
# 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, ... | |
return _get_compression_parameter(self._params, lib.ZSTD_c_ldmHashLog)
@property
def ldm_min_match(self):
return _get_compression_parameter(self._params, lib.ZSTD_c_ldmMinMatch)
@property
def ldm_bucket_size_log(self):
return _get_compression_parameter(
self._params, lib.ZSTD_c_ldmBucketSizeLog
)
@property
... | |
from lowest to highest amplitude value
sort = np.argsort(np.array(amps_fit)[indices_blended])
return indices_blended[sort]
def remove_components(params_fit, remove_indices):
"""Remove parameters of Gaussian fit components.
Parameters
----------
params_fit : list
Parameter vector in the form of [amp1, ..., am... | |
issue
"""
# Recover InteractiveSession
isess = deserialize_isession_and_prepare_db_session()
if isess and isinstance(isess, Response):
return isess
# A reproducible session must be open, signal about it if not
if isess.reproducible_session_opened():
if isess.state:
code = request.args.get("code", None)
try:
... | |
<gh_stars>1-10
from os import path
import numpy as np
from cycgkit.cgtypes import vec3
from glaze.GL import *
from glaze.utils import sizeofArray
from .RenderTarget_OGL3 import RenderTarget
from .shader_management.ShadersManagerClass import ShadersManager
from ..RenderTargetBase import attachmentTypeEnum, renderTextu... | |
<filename>scripts/jprep_ranges.py<gh_stars>0
""""
Scan output from consol_to_json.py and create C3S error report.
Test
----
Initial scan assessing completeness and consistency of json files.
JprepRanges
-----------
Sa
"""
import collections
MASKS = {'LImon.snd': 'fx.sftlf', 'LImon.snw': 'fx.sftlf', 'Lmon.mr... | |
<reponame>orionlee/pht_eb_stats
"""
Convenience helpers for `lightkurve` package.
"""
import os
import logging
import math
import json
import warnings
from collections import OrderedDict
import astropy.units as u
import numpy as np
from scipy.interpolate import UnivariateSpline
from IPython.display import display, H... | |
# Copyright 2017 - RoboDK Software S.L. - http://www.robodk.com/
# 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... | |
# coding=UTF-8
import numpy as np
import videoseam as vs
class weights_delegate(object):
"""Delegate class to manage the weightning for the graph construction"""
def __init__(self, parent, fill_with=np.inf, ndim=3):
super(weights_delegate, self).__init__()
self.parent = parent
self.fill_with = fill_with
self.nd... | |
# -*- coding: utf-8 -*-
import ast
import builtins
import re
import token
import tokenize
import os.path
from thonny.assistance import ErrorHelper, Suggestion, name_similarity, add_error_helper
from thonny import assistance
from thonny.misc_utils import running_on_linux, running_on_windows
class SyntaxErrorHelper(Er... | |
#!/usr/bin/env python
# encoding: utf-8
"""
ScriptFilter API for building Alfred ScriptFilter entries.
.. module:: scriptfilter
:platform: MacOSX
:synopsis: Create and build XML for Alfred's ScriptFilter output.
.. moduleauthor:: Ritashugisha <<EMAIL>>
`Documentation <?>`_.
`License MIT <http://opensou... | |
<reponame>uktrade/exceptional-review-procedure
import json
from directory_components import forms
from directory_constants import choices
from directory_forms_api_client.forms import GovNotifyEmailActionMixin
from django.forms import Textarea, HiddenInput
from core import constants, fields
OTHER = 'OTHER'
INDUSTRY... | |
brif
network_iface = dev
break
return QEMUCMDTEMPLATE % {'IID': iid,
'NETWORK_TYPE' : network_type,
'NET_BRIDGE' : network_bridge,
'NET_INTERFACE' : network_iface,
'START_NET' : startNetwork(network),
'STOP_NET' : stopNetwork(network),
'ARCHEND' : arch + endianness,
'QEMU_DISK' : qemuDisk,
'QEMU_INIT' : qem... | |
<filename>tgen/seq2seq.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import division
from future import standard_library
standard_library.install_aliases()
from builtins import zip
from builtins import str
from builtins import range
from past.utils import old_div
from builtins imp... | |
"""
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
run evaluation of VCMR or infenrece of TVR for submission
"""
import argparse
import os
from os.path import exists
from time import time
import torch
from torch.utils.data import DataLoader
from torch.nn import functional as F
import numpy as np... | |
3))
elif (border_mode == 'full' and subsample == (1, 1) and
direction_hint == 'bprop inputs'):
# Special case: We are asked to use GpuDnnConvGradI. We need to set
# up a suitable 'fake' convolution to compute the gradient for.
img = gpu_contiguous(img)
kerns = gpu_contiguous(kerns.dimshuffle(1, 0, 2, 3))
conv_m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.