input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
"""
A video controller for ai2thor
Basic example:
from ai2thor.controller import VideoController
with VideoController() as vc:
vc.play(vc.MoveAhead())
vc.wait(5)
vc.play(vc.MoveAhead())
vc.export_video('thor.mp4')
Known issues:
- Multi agent rotations don't work (since TeleportFull breaks when passing in an AgentID... | |
<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 23 15:42:02 2019
####################################################################
#### ####
#### (married to the) game module ####
#### ####
####################################################################
This module hous... | |
account on category of this product are same.'))
if acc_src == acc_valuation:
raise osv.except_osv(_('Error!'), _('Cannot create Journal Entry, Input Account of this product and Valuation account on category of this product are same.'))
if not acc_src:
raise osv.except_osv(_('Error!'), _('Please define stock inpu... | |
"""
Test the pipeline module.
"""
from distutils.version import LooseVersion
from tempfile import mkdtemp
import shutil
import time
import pytest
import numpy as np
from scipy import sparse
from sklearn.externals.six.moves import zip
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import as... | |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
def batch_pairwise_squared_distance(x, squared=False):
bsz, max_len, dim = x.size()
x_sq = (x**2).sum(dim=2)
prod = torch.bmm(x, x.transpose(1,2))
dist = (x_sq.unsqueeze(1) + x_sq.unsqueeze(2) - 2*prod).clamp(min=1e-12)
if squar... | |
<gh_stars>0
#Embedded file name: ACEStream\Core\NATFirewall\UDPPuncture.pyo
import guessip
import time
import socket
import sys
import errno
import random
from collections import deque
import TimeoutFinder
import os
DEBUG = False
if sys.platform == 'win32':
SOCKET_BLOCK_ERRORCODE = 10035
else:
SOCKET_BLOCK_ERRORCODE ... | |
3)
trans_num = N.array([0,0,0])
trans_den = N.array([1,1,1])
transformations.append((rot, trans_num, trans_den))
rot = N.array([1,0,0,0,-1,0,0,0,-1])
rot.shape = (3, 3)
trans_num = N.array([1,1,0])
trans_den = N.array([2,2,1])
transformations.append((rot, trans_num, trans_den))
rot = N.array([-1,0,0,0,1,0,0,0,-1])
rot.... | |
""" LSPEAS proximal ring pulsatility and expansion module
Module for obtaining node to node pulsatility in ECG gated CT of Anaconda
Button interaction:
ENTER: calculate distances and pulsatility between selected nodes
ESCAPE: FINISH MODEL, GET MAX PULSATILITY OVERALL, STORE TO EXCEL
"""
import os
import visvis as v... | |
<reponame>quantify-os/quantify-core<gh_stars>1-10
# ---
# jupyter:
# jupytext:
# cell_markers: '"""'
# formats: py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.13.0
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
# name: pytho... | |
to server and vice-versa",
"Upgrading OpenSSL to latest versions will mitigate this issue. This resource gives more information about the vulnerability and the associated remediation. http://ccsinjection.lepidum.co.jp/"],
[17, "With this vulnerability the attacker will be able to perform a MiTM attack and thus compro... | |
#! /usr/bin/python3.9
"Python script containing functions and classes for general cryptographic use."
# importing libraries
import os
import rsa
import string
import secrets
import hashlib as hash
from random import shuffle
from Crypto.Cipher import AES
from Crypto.Cipher import Blowfish
from Crypto.Util.strxor import... | |
<reponame>emcknight/ChessEngineAASpr2022-
import math
import chess
from chess import *
# Chess location to index dictionary.
chessToIndex = {
'a8': 56, 'b8': 57, 'c8': 58, 'd8': 59, 'e8': 60, 'f8': 61, 'g8': 62, 'h8': 63,
'a7': 48, 'b7': 49, 'c7': 50, 'd7': 51, 'e7': 52, 'f7': 53, 'g7': 54, 'h7': 55,
'a6': 40, 'b6... | |
<reponame>abdellaui/camera_construction
bl_info = {
"name": "Camera Construct (main)",
"description": "Camera Construct",
"author": "<NAME>",
"version": (0, 0, 2),
"blender": (2, 79, 0),
"location": "3D View > Tools > Camera Construct",
"category": "Render"
}
import bpy
import math
import os
from datetime impo... | |
if randomboss == True: #!
if randomweapons == False:
for y in range(8):
if posB[y][0] == "Airman":
Seek = ROM.seek(Pointer,0)
for x in range(19): #Writes first part
ROM.write(GetEquippedtext[x])
Pointer+=1
z = len(AirShooterReceived)
AirShooterReceived.remove(b'\x20')
z -= 1
for x in range(z)... | |
#! /usr/bin/env python
# -*- coding: UTF-8 -*-
'''
Extension functionality around the os and path modules (os.path, posixpath, ntpath).
Implements the commons.resource_if interface based on local files.
Created on 21.05.2011
@author: SIGIESEC
'''
from __future__ import with_statement
from commons.core_if import Cont... | |
from PyQt5 import QtCore, QtGui, QtWidgets
from dialogError import Ui_DialogError
import yfinance as yf
import matplotlib as mpl
import matplotlib.pyplot as plt
import plotly.graph_objects as go
import pandas as pd
import pandas_datareader as pdr
import numpy as np
import chart_studio.plotly as py
from date... | |
<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf8
import urllib.request, urllib.parse, urllib.error
import zipfile
from io import BytesIO
import json
import csv
import copy
import sys
import time
import math
from xml.etree import ElementTree as ET
import utm
version = "0.5.0"
header = {"User-Agent": "nkamap... | |
COMMA foreign ref
| expr RP
"""
p[0] = p[1]
p_list = list(p)
if p_list[-1] != "," and p_list[-1] != ")":
if "type" in p_list[-1] and "name" in p_list[-1]:
p[0]["columns"].append(p_list[-1])
elif "check" in p_list[-1]:
if isinstance(p_list[-1]["check"], list):
check = " ".join(p_list[-1]["check"])
if isinstan... | |
"""
This script extracts stack traces from txt files made available by Campbell 2016.
"""
import argparse
import codecs
import gzip
import logging
import math
import os
import re
import traceback
from datetime import datetime
from itertools import count
import sys
import json
import pymongo
import unicodedata
def ... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use... | |
values: the value to filter
Ex.
pp.subscript(dataArray, index, value)
"""
if not isinstance(dataArray, xr.DataArray):
raise ValueError(
"the 'dataArray' parameter must be of the type xr.DataArray")
if not isinstance(indexes, list):
indexes = [indexes]
if not isinstance(values, list):
values = [values]
... | |
def to_map(self):
result = {}
result['TimeStamp'] = self.time_stamp
result['StorageUtilization'] = self.storage_utilization
result['NetworkOut'] = self.network_out
return result
def from_map(self, map={}):
self.time_stamp = map.get('TimeStamp')
self.storage_utilization = map.get('StorageUtilization')
self.net... | |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests import Form, tagged
from odoo.addons.stock_account.tests.test_anglo_saxon_valuation_reconciliation_common import ValuationReconciliationTestCommon
from odoo.exceptions import UserError
@tagged('post_ins... | |
between 0 and maxangle
:param angle2: angle scaled to be between 0 and maxangle
:param maxangle: max angle. defaults to 2 * pi.
:return: angle1 - angle2, shifted to be between -.5 and +.5 * maxangle
"""
if maxangle is None:
maxangle = np.pi * 2
return (((angle1 / maxangle)
- (angle2 / maxangle) + .5) % 1. - .5)... | |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# #
# The code is hosted on GitHub at https://github.com/aiidateam/aiida_core #
# For further information on the license, s... | |
#!/usr/bin/python2
"""Reads and plots the data in a simulation log protocol buffer file.
This script requires Python 2, because protobufs doesn't really work for Python 3 yet."""
import argparse
import os
import sys
from textwrap import wrap
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from ... | |
# !/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Author : WenRichard
# @Email : <EMAIL>
# @File : predict_bert_crf.py
# @Software: PyCharm
import pandas as pd
import tensorflow as tf
import numpy as np
import codecs
import pickle
import os
from datetime import time, timedelta, datetime
import json
import copy
from ... | |
last node of the original list.
self_last.set_next(self, mscdll_first)
mscdll_first.set_back(self, self_last)
# if we are to unlink the nodes from the extension list, there is only one
# node, so, just delete its self list links.
if unlink_nodes:
mscdll_first._links.pop(mscdll._id)
# case 3: length of both li... | |
<filename>test/functional/feature_futures.py
#!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Copyright (c) DeFi Blockchain Developers
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
"""Test Futures co... | |
# H20.12.03/R02.02.11 by <NAME>
import math, sys
def get_file(channel, mode):
f = channels.get(channel)
if f is None:
channels[channel] = f = os.fdopen(channel, mode)
return f
channels = {0: sys.stdin, 1: sys.stdout, 2: sys.stderr}
def inchar(channel, s):
rf = get_file(channel, "r")
ch = rf.read(1)
r = s.fin... | |
# Copyright (c) ZenML GmbH 2021. 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:
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
-> bool:...
@staticmethod
def UndoAutoNumbering() -> bool:...
@staticmethod
def Unstack() -> bool:...
class ThemeChangedEventHandler(_n_8_t_6, _n_8_t_7, _n_18_t_0):
def __init__(self, A_0: object, A_1: _n_8_t_0) -> ThemeChangedEventHandler:...
def BeginInvoke(self, callback: _n_8_t_9, obj: object) -> _n_8_t_8:...... | |
if fully anchored
if not self.verifyAnchor(serder=serder, seqner=seqner, diger=diger):
self.escrowALEvent(serder=serder)
raise MissingAnchorError("Failure verify event = {} "
"".format(serder.ked))
self.logEvent(pre=vci, sn=sn, serder=serder, seqner=seqner, diger=diger)
elif ilk is Ilks.brv: # backer revoke
i... | |
<filename>suitesparse_graphblas/create_headers.py
"""
Script to generate suitesparse_graphblas.h, suitesparse_graphblas_no_complex.h, and source.c files.
- Copy the SuiteSparse header file GraphBLAS.h to the local directory.
- Run the C preprocessor (cleans it up, but also loses #define values).
- Parse the process... | |
adjacent bone
adj_bone = adjacent_2_bone[0]
T_2_dir = Vector(*r_2).cross((adj_bone.X[n_frame, 0] - adj_bone.XG[n_frame])).unit()
if len(adjacent_2_bone) == 0 or np.isnan(T_2_dir).any(): # if no adjacent, or if above calc causes error
T_2_dir = (0, 1, 0) # Improve later, for now say all torques about y ax... | |
<reponame>xiexie1993/Tool_Sublime_Text3_for_Windows
#!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You ma... | |
= self._getTraverseReport.execute(params)
traverseNodes = []
#TraverseOder is a dict containing the members along the traverse path, including their linear pisition in the "position" attribute.
#traverseNeighbors contains everything that was noted as a neighbor of any node while traversing. Their linear position i... | |
from graphistry.Plottable import Plottable
from typing import Any, Callable, List, Optional, Union, TYPE_CHECKING
import copy, hashlib, logging, numpy as np, pandas as pd, pyarrow as pa, sys, uuid
from functools import lru_cache
from weakref import WeakValueDictionary
from .util import (error, in_ipython, make_iframe,... | |
self.validate_required(self.creation_time, 'creation_time')
self.validate_required(self.complete_time, 'complete_time')
self.validate_required(self.transcode_progress, 'transcode_progress')
self.validate_required(self.input_file_url, 'input_file_url')
self.validate_required(self.priority, 'priority')
self.validate... | |
import csv
import logging
import math
import shutil
import tempfile
import typing
from collections import defaultdict
from dataclasses import dataclass
from pathlib import Path
import librosa
import torch
from phonemes2ids import phonemes2ids
from torch.utils.data import Dataset
from vits_train.config import Training... | |
<filename>kalite_zim/management/commands/export2zim.py
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
import json
import os
import shutil
import subprocess
import sys
import tempfile
from datetime import datetime
from optparse import make_option
f... | |
"Type": "STRING"
}
]
}
},
"networkphysicaltable": {
"RelationalTable": {
"DataSourceArn": dataARN,
"Schema": "patch_compliance",
"Name": AWS_NETWORK_TABLE,
"InputColumns": [
{
"Name": "accountid",
"Type": "STRING"
},
{
"Name": "resourceid",
"Type": "STRING"
},
{
"Name": "ipv4",
"Type": "STRING"
},... | |
for Fractional Powers of a Matrix."
SIAM Journal on Matrix Analysis and Applications,
32 (3). pp. 1056-1078. ISSN 0895-4798
"""
# This code block is copied from numpy.matrix_power().
A = np.asarray(A)
if len(A.shape) != 2 or A.shape[0] != A.shape[1]:
raise ValueError('input must be a square array')
# Get the ... | |
0.0,
'autocalculatable': False,
'type': 'real',
'unit': u'dimensionless'}),
(u'relative humidity fraction 20',
{'name': u'Relative Humidity Fraction 20',
'pyname': u'relative_humidity_fraction_20',
'maximum': 1.0,
'required-field': False,
'autosizable': False,
'minimum': 0.0,
'autocalculatable': False,
'typ... | |
<gh_stars>0
"""Creating and manipulating measurement sets from T3 visibilities.
Author: <NAME>, <EMAIL>
"""
import yaml
import h5py
import numpy as np
from pkg_resources import resource_filename
import matplotlib.pyplot as plt
import astropy.units as u
from astropy.coordinates import Angle
from antpos.utils import get... | |
<filename>Python/data_structures.py<gh_stars>0
import unittest
import bisect
from heapq import *
"""
https://www.freecodecamp.org/news/the-top-data-structures-you-should-know-for-your-next-coding-interview-36af0831f5e3/
https://docs.python.org/3/tutorial/datastructures.html?highlight=lists
http://thomas-cokelaer.info... | |
<filename>app/main/views.py<gh_stars>0
from flask import render_template , redirect , url_for , abort , flash , request , \
current_app , make_response
from flask_login import login_required , current_user
from flask_sqlalchemy import get_debug_queries
from . import main
from .forms import EditProfileForm , EditProfil... | |
<gh_stars>1-10
"""
Quantile regression forest of trees-based ensemble methods.
The module structure is the following:
- The ``BaseForestQuantileRegressor`` base class implements a common ``fit``
method for all the estimators in the module. The ``fit`` method of the base
class calls the ``fit`` method of the ``Fores... | |
#!/usr/bin/env python
# An IRC bot doing random handy things.
from ircbot import SingleServerIRCBot
from irclib import nm_to_n, nm_to_h, irc_lower, ip_numstr_to_quad, ip_quad_to_numstr, Event
import random, time, datetime
DATADIR = "datadir/"
# Can add lines to a file, and read either certain lines or lines at ran... | |
TType.STRING:
self.db_name = iprot.readString();
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(f... | |
match sets of tokens or blocks.
# Note 2: Elements in a set can be matched in any order
# Note 3: Elements of sets are separated by commas
# Note 4: Elements as a whole should be enclosed in parentheses for mandatory matching or braces for optional
# Note 5: The below grammar will match a sequence of 1, 2, 3, 4 and... | |
__author__ = '<NAME>'
import ctypes
import os
import time, queue
import numpy as np
import threading
libc = ctypes.cdll.msvcrt
libc.fopen.restype = ctypes.c_void_p
class PixelFly(object):
"""
PixelFly class loads the pf_cam.dll in order to interface
the basic functions of the pco.pixelfly ccd dete... | |
<filename>pyelements/underlordboot.py
from bs4 import BeautifulSoup
from collections import defaultdict
from operator import itemgetter
import numpy as np
import tensorflow
import itertools
from copy import deepcopy
fr = open('C:/users/mnj/Downloads/under.html', 'r', encoding='utf8').read()
soup = Beautiful... | |
higher than c[i,j]
cabove = scumsum( count )
# solid lines give probability contours at specified levels
# (defaults to 0.68 for "1-sigma contours")
ax1.contour( x[:-1], y[:-1], cabove, linelevels, colors=[plotargs['color'],plotargs['color']], ls='-' )
if plotstyle=='contourf' :
#flevels = [ 1e-30, 0 ]
# fille... | |
parse_dates=[
'DEALDATETIME']) for x in page_files]
df = pd.concat(page_dfs)
df = df.reset_index()
df = df.sort_index()
# now some geocoding:
loc_df = parse_body_request_to_dataframe(body)
loc_df = loc_df.append([loc_df]*(len(df) - 1), ignore_index=True)
df = pd.concat([df, loc_df], axis=1)
# fill in district ... | |
migrations.AddField(
model_name='investhighpotentialopportunitydetailpage',
name='companies_list_item_image_alt_six_zh_hans',
field=models.TextField(blank=True, help_text='If this image adds extra information to the page that is not already provided by the text (e.g. if the image is a diagram, chart, or has text on ... | |
<gh_stars>0
from isodate.isodatetime import parse_datetime
from isodate.isoerror import ISO8601Error
import uuid
from django.conf import settings
from . import get_agent_ifp, convert_to_datatype
from authorization import auth
from StatementValidator import StatementValidator
from ..models import Statement, Agent, Act... | |
0 * 0 NIL <かな漢字><ひらがな><付属>
思い おもい 思う 動詞 2 * 0 子音動詞ワ行 12 基本連用形 8 "代表表記:思う/おもう 補文ト" <代表表記:思う/おもう><補文ト><正規化代表表記:思う/おもう><かな漢字><活用語><自立><内容語><タグ単位始><文節始><文節主辞>
こま こま こむ 動詞 2 * 0 子音動詞マ行 9 未然形 3 "代表表記:込む/こむ 付属動詞候補(基本) 反義:動詞:空く/すく" <代表表記:込む/こむ><付属動詞候補(基本)><反義:動詞:空く/すく><正規化代表表記:込む/こむ><かな漢字><ひらがな><活用語><付属>
ないで ないで ぬ 助動詞 5 * 0 助動... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import logging
import functools
import numpy as np
import torch
import torch.nn as nn
import torch._utils
import torch.nn.functional as F
BN_MOMENTUM = 0.1
logger = logging.getLogger(__name__)
d... | |
import curses
import datetime
import json
import logging
import os
import re
import signal
import threading
import time
from collections import OrderedDict
from typing import Dict, List
import yaml
from .core import CephNode, CephNodeManager
from .exceptions import MinionDoesNotExistInConfiguration, ValidationExcepti... | |
None:
if cost > sims4.math.EPSILON:
cost = max(cost, minimum_router_cost)
full_cost = self._get_location_cost(location.position, location.orientation, location.routing_surface, cost)
full_cost += surface_costs[location.routing_surface.type]
if self.constraint.enables_height_scoring:
full_cost += max_goal_height -... | |
<gh_stars>1-10
#FLM: Glyph: Layers
# ----------------------------------------
# (C) <NAME>, 2018 (http://www.kateliev.com)
# (C) Karandash Type Foundry (http://www.karandash.eu)
#-----------------------------------------
# No warranties. By using this you agree
# that you use it at your own risk!
# - Dependencies ---... | |
rules: Optional[pulumi.Input[Sequence[pulumi.Input['DetectorRuleArgs']]]] = None,
show_data_markers: Optional[pulumi.Input[bool]] = None,
show_event_lines: Optional[pulumi.Input[bool]] = None,
start_time: Optional[pulumi.Input[int]] = None,
tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
teams: O... | |
Parameters
----------
coin : gecko_coin.Coin
Cryptocurrency
other_args : List[str]
argparse arguments
"""
parser = argparse.ArgumentParser(
add_help=False,
prog="market",
description="""
Market data for loaded coin. There you find metrics like:
market_cap_rank, total_supply, max_supply, circulating_supply,... | |
words[0] == 'hypercalls':
for w in map(var_subst, words[1:]):
hypercalls.add(add_hypercall_dsl(d, w, local_env))
elif words[0] == 'events':
for w in map(var_subst, words[1:]):
event_sources.add(add_event_dsl(d, w, local_env))
have_events = True
elif words[0] == 'local_include':
add_include(d, 'include', local_e... | |
macie pryszcze!',
'CrtmiO0vp3aqtYFOm2IY4pXZ2qKOfmKs': '*Skucha, skucha, zezulce',
'pEmnG9ivAZ1xjbBl0xnePNL2IqTv5lGf': 'Nic mi nie jest! Nic mi nie jest!',
'EtV2D1NfGt7ugV3UWJnksvZKGSbYzZOy':
'Trzeba powiadomić Kleopatrę! Tylko ona może sprawić, żeby Cezar... Żeby Cezar zaprzestał ostrzału.',
'lb7uN8PqZhhQRdhCNePnm... | |
"""
Module for methods reading from and writing to the file system
"""
import os
import logging
from pathlib import PurePath
from ractl_cmds import (
get_server_info,
get_reserved_ids,
attach_image,
detach_all,
list_devices,
reserve_scsi_ids,
)
from pi_cmds import run_async
from socket_cmds import send_pb_comma... | |
import functools
import inspect
import logging
import typing
from typing import Any, Optional, Type
from dbnd._core.configuration.environ_config import get_dbnd_project_config
from dbnd._core.current import current_task_run, get_databand_run, try_get_current_task
from dbnd._core.errors import show_exc_info
from dbnd.... | |
<filename>modules/s3/s3sync.py
# -*- coding: utf-8 -*-
""" S3 Synchronization
@copyright: 2011-2016 (c) Sahana Software Foundation
@license: MIT
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 Softw... | |
固定長度
# 固定長度
if len(parityAmount) < len(parityJourney):
parityAmount.extend([None] * (len(parityJourney) - len(parityAmount)))
if len(parityBadge) < len(parityJourney):
parityBadge.extend([None] * (len(parityJourney) - len(parityBadge)))
if len(parityFlat) < len(parityJourney):
parityFlat.extend([None] * (len(par... | |
open.
URL : str
URL to open.
title_in : str
Title to add manually.
tags_in : str
Comma-separated tags to add manually.
desc : str
Bookmark description.
Returns
-------
tuple
Parsed results from parse_temp_file_content().
"""
temp_file_content = to_temp_file_content(url, title_in, tags_in, desc)
fd, tm... | |
import sys
import os
import json
import time
sys.path.insert(1, os.path.join(sys.path[0], '..'))
import grapher_admin.wsgi
from openpyxl import load_workbook
from grapher_admin.models import Entity, DatasetSubcategory, DatasetCategory, Dataset, Source, Variable, VariableType, DataValue
from importer.models import Impor... | |
self).save(*args, **kwargs)
def delete(self, *args, **kwargs):
self.current_authenticated_user = get_current_authenticated_user()
super(Gutachterfotos, self).delete(*args, **kwargs)
signals.post_save.connect(photo_post_processing, sender=Gutachterfotos)
signals.post_save.connect(assign_permissions, sender=Gutach... | |
".join(["{:.2f}".format(f) for f in shareddata["timepoints"]])
default="Array size"
if "temperaturepoints" in shareddata:
TMP=shareddata["temperaturepoints"]
average,MINT,MAXT=sum(TMP)/len(TMP),min(TMP),max(TMP)
temppoints=", ".join(["{:.1f}".format(t) for t in TMP])
Twarning=""
else:
temppoints=MINT=MA... | |
str(self)
return float(self).__format__(s)
def to_wei(self):
return self._wei
def decimals(self):
return self._decimals
class TokenProxy:
"""
A proxy for an ERC20 token. Monitors events, processes them when update()
is called, and fulfils balance requests from memory.
"""
def __init__(self, contract):
... | |
<filename>tests/functional/Hydro/Riemann/RiemannSolution.py
#!/usr/bin/env python
#-------------------------------------------------------------------------------
# RiemannSolution
#
# Adapted from code I got from <NAME>, which in turn was based on code from
# Toro as described in the following comments.
#
# Exact Riem... | |
<gh_stars>1-10
import json
import copy
from pprint import pprint
import itertools
import numpy as np
from falx.symbolic import SymTable, SymVal
from falx.utils import table_utils
from falx.visualization import visual_trace
from falx.visualization.visual_trace import BarV, BarH, Point, Line, Area, Box
def remove_un... | |
#! python3
# -*- coding: utf-8 -*-
"""mwxlib param controller and wx custom controls
Author: <NAME> <<EMAIL>>
"""
from __future__ import division, print_function
from __future__ import unicode_literals
from __future__ import absolute_import
from itertools import chain
import sys
import wx
import numpy as np
from numpy... | |
self and R is the base ring.
Note that these are not generally uniquely determined, and depending on
how Smith normal form is implemented for the base ring, they may not
even be deterministic.
This can safely be overridden in all derived classes.
EXAMPLES::
sage: V = span([[1/2,1,1],[3/2,2,1],[0,0,1]],ZZ); W ... | |
'''
Does Covid 19 contact tracing analysis on data of the form:
<name, latitude, longitude, date, time, condition>
where name = name of the person, latitude & longitude are the geographical coordinates, date
& time are the time stamp when those coordinates were recorded and finally condition indicates
whether this per... | |
image for central {}/{}.'.format(ii+1, len(galaxy_indx)))
# Build the model image (of every object except the central)
# on-the-fly. Need to be smarter about Tractor sources of resolved
# structure (i.e., sources that "belong" to the central).
nocentral = np.delete(np.arange(len(tractor)), central)
srcs = tractor... | |
<reponame>cristobaltapia/sajou
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Defines the different load types,thta can be applied to the elements, which are
transfered accordingly to the respective nodes.
"""
import numpy as np
import scipy.sparse as sparse
from sajou.utils import Local_Csys_two_points
class Loa... | |
import __main__
import os
import importlib
import gzip
from json import dumps
from lxml import etree
schema_path = os.path.join(os.path.dirname(__main__.__file__), 'schemas')
parser = etree.XMLParser(
schema=etree.XMLSchema(file=os.path.join(schema_path, 'form.xsd')),
attribute_defaults=True, remove_comments=True, re... | |
<reponame>saba-ja/fprime_owls<filename>Fw/Python/src/fprime/util/build_helper.py
"""
fprime.util.build_helper.py
This script is defined to help users run standard make processes using CMake. This will support migrants from the old
make system, as well as enable more efficient practices when developing in the CMake sys... | |
self.checkScript(test_sizes, (torch.rand(777),))
self.checkScript(test_sizes, (torch.rand(0),))
def test_for_in_tensors_rank0(self):
with self.assertRaisesRegex(RuntimeError, "of a 0-d tensor"):
@torch.jit.script
def test_sizes(x):
sumz = 0
for s in x:
sumz += 1
return sumz
test_sizes(torch.tensor(1))
def... | |
# Copyright (c) 2021, <NAME>
# License: MIT License
from typing import Iterable, List
import pytest
from itertools import permutations
import ezdxf.tools.text_layout as tl
@pytest.mark.parametrize(
"margins,expected",
[
[None, (0, 0, 0, 0)],
[(1,), (1, 1, 1, 1)],
[(1, 2), (1, 2, 1, 2)],
[(1, 2, 3), (1, 2, 3, 2)... | |
self.numTimes = C.c_int(0)
else:
self.__ex_get_info()
self.numTimes = C.c_int(
self.__ex_inquire_int(ex_inquiry("EX_INQ_TIME")))
def copy(self, fileName):
"""
copy to a new database
e.copy(fileName) -> copies Exodus database to fileName and returns
this copy as a new exodus object
"""
new = exodus(fileName,... | |
<reponame>wikimedia/operations-software-python-poolcounter
"""Poolcounter client implementation."""
import logging
import socket
from enum import Enum
from typing import Callable, Dict, Optional # pylint: disable=unused-import
from poolcounter.ring import HashRing
class PoolcounterError(Exception):
"""Custom excep... | |
# -*- coding: UTF-8 -*-
# the comment above is for the Python interpreter, there are Unicode
# characters written straight into this source file
import json
import sys
import os
if sys.version_info[0] == 2 and sys.version_info[1] < 7:
from portality.ordereddict import OrderedDict
else:
from collections import Order... | |
<filename>synapse/handlers/cas_handler.py
# -*- coding: utf-8 -*-
# Copyright 2020 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/l... | |
<gh_stars>10-100
# Copyright (c) 2012 NetApp, Inc.
# 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... | |
<filename>schicexplorer/scHicCluster.py
import argparse
import os
from multiprocessing import Process, Queue
import time
import logging
log = logging.getLogger(__name__)
from scipy import linalg
import cooler
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.cm import get_cmap
fr... | |
Note: no trailing whitespace.
#@+node:ekr.20041005105605.182: *6* at.putStartDocLine
def putStartDocLine(self, s, i, kind):
"""Write the start of a doc part."""
at = self
sentinel = "@+doc" if kind == at.docDirective else "@+at"
directive = "@doc" if kind == at.docDirective else "@"
# Put whatever follows the di... | |
import time, math, copy
import numpy as np
import pandas as pd
import machineLearning
import pickle
INFINITY = float("inf")
class GameAI(object):
def __init__(self, game):
super().__init__()
self.game = game
self.move = (-1,-1)
self.timeLimit = 3 # 3 seconds is the time limit for search
self.debug = False... | |
# @Author: JC
import requests
import json
from lxml import etree
from tool import read_json_file_to_object
from tool import get_html
from tool import save_object_to_json_file
from tool import save_html_response_to_html_file
from tool import read_txt_file_to_list
from tool import Logger
from login import get_cookie_from... | |
from __future__ import absolute_import, division
import json
import logging
import random
import re
import requests
import sys
import time
import uuid
from cStringIO import StringIO
from contextlib import closing
from datetime import datetime
from flask import current_app
from lxml import etree, objectify
from typing... | |
import math
import pyglet
import rabbyt
from pyglet.gl import *
from glart import *
from sounds import *
class MapDialogue:
def __init__(self,window):
self.window = window
self.width = 500
self.height = 500
self.margin = [(window[0] - self.width) / 2 ,(window[1] - self.height) / 2]
self.corners = [(self.margin[... | |
def plotHDeadZoneLine(self):
self.tagDeadZone(self.plotXLine(comp.getYAxis(), conf.get('colour', 'grid-line-4')))
def plotWDeadZoneLine(self):
self.tagDeadZone(self.plotYLine(comp.getXAxis(), conf.get('colour', 'grid-line-4')))
def plotZeroLabel(self):
self.tagDeadZone(self.plotGridLabel(x=comp.getXAxis(), y=co... | |
course.",
"Peter, what did she say to you? I couldn't make her out.",
"Do you know Keats? The poet, I mean, Keats, the poet.",
"I can't speak.",
"I'm too weak.",
"No, you're not.",
"You are not here.",
"And yet Who are you? You are not Sir Malcolm.",
"You have to name a thing to make it live, don't you? And shall I nam... | |
item_extent=None, search_existing=True, owner=None):
super().__init__(target, clone_mapping, info, data, sharing, thumbnail, portal_item, folder, item_extent, search_existing, owner)
self._related_items = related_items
@property
def related_items(self):
"""Gets the related items for the survey"""
return self._r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.