input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
"""Colormaps."""
# --- import --------------------------------------------------------------------------------------
import collections
import numpy as np
from numpy import r_
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.colors as mplcolors
import matplotlib.gridspec as grd
# --- define --... | |
import numpy as np
import pydart2 as pydart
import QPsolver
import IKsolve_one
import momentum_con
import motionPlan
from scipy import optimize
import yulTrajectoryOpt
from fltk import *
from PyCommon.modules.GUI import hpSimpleViewer as hsv
from PyCommon.modules.Renderer import ysRenderer as yr
from PyCommon.modules.... | |
dataf_r = open(self.filename, 'rb')
dataread = csv.reader(dataf_r)
except:
pass
else:
try:
header_file = dataread.next()
except: # empty file
write_head = True
else:
if header == header_file:
write_head = False
else:
write_head = True
dataf_r.close()
if write_head:
self.datawriter.writerow(header)
sel... | |
+ self.rest
raw_data = self.dec_TY5(raw8 + self.raw16 + self.raw32)
else:
dtype = numpy.dtype(numpy.int32)
nbytes = dim1 * dim2 * dtype.itemsize
raw_data = numpy.frombuffer(infile.read(nbytes), dtype).copy()
# Always assume little-endian on the disk
if not numpy.little_endian:
raw_data.byteswap(True)
... | |
#!/usr/bin/python
# Copyright (c) 2018
# United States Government as represented by <NAME> <<EMAIL>>
# No copyright is claimed in the United States under Title 17, U.S.Code. All Other Rights Reserved.
# This program attempts to forward tunneled traffic and send it over multiple
# interfaces that can reach the same de... | |
x = x + 1
# if constructed firelines are on then
# initialize constructed fire lines on day 6th
if t == 6 and typeOfFireline == 2:
# loop through every cell in grid except boundaries
for row in range(1,rows - 1):
for col in range(1, cols - 1):
# check where bruning fire front (state 10) is
if g... | |
<gh_stars>10-100
# ------------------------------------------------------------------------
# BEAUTY DETR
# Copyright (c) 2022 <NAME> & <NAME>
# Licensed under CC-BY-NC [see LICENSE for details]
# All Rights Reserved
# ------------------------------------------------------------------------
# Parts adapted from Group-F... | |
from __future__ import print_function
# -*- coding: utf-8 -*-
import base64
from importlib import import_module
import unittest
import socket
import json
import os
from time import sleep
import pytest
try:
from sauceclient import SauceClient
USE_SAUCE = True
WAIT_TIMEOUT = 20
except ImportError:
USE_SAUCE = False
... | |
<reponame>tsnouidui/energyplustofmu
#!/usr/bin/env python
#--- Purpose.
#
# Export an EnergyPlus model as a Functional Mockup Unit (FMU) for co-simulation.
#--- Note on directory location.
#
# This script uses relative paths to locate some of the files it needs.
# Therefore it should not be moved from its default d... | |
<reponame>ysadamori/-GiNZA<gh_stars>1-10
import importlib
import re
import sys
# Traverse policy definition (needed for non top-level elements)
# Element name for traverse type elements
ARC = 'arc'
# for parents with in max_hop, match only once
PARENT = 'parent'
# for descendants with in max_hop, for all, match all
... | |
<filename>src/pyon/container/procs.py
#!/usr/bin/env python
"""
Component of the container that manages ION processes etc.
The ProcManager keeps an IonProcessThreadManager as proc_sup (supervisor) to spawn
the ION process threads.
It also instantiates the BaseService instance with the app business logic,
and it regis... | |
import logging
from typing import Optional, Dict, Any
from django.conf import settings
from django.contrib.auth import get_user_model
from django.db import transaction, IntegrityError
from django.db.models import QuerySet
from django.utils import timezone
from baserow.core.exceptions import (
ApplicationNotInGroup,
... | |
<reponame>McZazz/PythonPrettyPrint
import re
# read in .txt and strip each line
with open('prettyPY_input.txt', 'r') as f:
linesInList = f.readlines()
# basic preparations after reading text
linesInList = [_.rstrip() for _ in linesInList]
newlinesinlist = ' \n'.join(linesInList)
splitList = list(newlinesinl... | |
return f"async hello: {hello} {world}"
>>> get_async_type(async_func)
'coro func'
>>> get_async_type(async_func(5))
'coro'
>>> get_async_type(sync_func)
'sync func'
>>> get_async_type(sync_func(10))
'unknown'
:param Any obj: Object to check for async type
:return str async_type: Either ``'coro func'``, ``'c... | |
# coding=utf-8
# Copyright 2022 The Uncertainty Baselines Authors.
#
# 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 applic... | |
import datetime
import re
import uuid
from functools import partial
from unittest.mock import ANY, call
import pytest
from bs4 import BeautifulSoup
from flask import url_for
from freezegun import freeze_time
from app.main.views.platform_admin import (
create_global_stats,
format_stats_by_service,
get_tech_failure_... | |
\x00 single null byte
:raises PaddingError: pad is less than 1 bytes in length
Example::
>>> d = NullStripped(Byte)
>>> d.parse(b'\xff\x00\x00')
255
>>> d.build(255)
b'\xff'
"""
def __init__(self, subcon, pad=b"\x00"):
super(NullStripped, self).__init__(subcon)
self.pad = pad
def _parse(self, stream, c... | |
to CUDA in the future
"""
if type(M)==type(1) or type(M)==type(1.1) or type(M)==type(self.matrix) :
matrix = self.matrix * M
name=self.name+"_times_"+ str(M)
if type(M)==type(self):
matrix = self.matrix * M.matrix
name=self.name+"_times_"+ M.name
return DBZ(dataTime=self.dataTime, matrix=matrix,\
dt=self.dt, ... | |
#!/usr/bin/env python3
import argparse
import datetime
import json
import os
import requests
import time
from pathlib import Path
DATA_DIR = "./data/"
class Leaderboard:
NO_TIME = ' '
SORTBYS = {
'local': lambda p: (-p['local_score'], p['last_star_ts']),
'stars': lambda p: (-p['stars'], p['last_star_ts']),
'dt... | |
table, but direct
assignment to the "__dict__" attribute is not possible (you can write
"m.__dict__['a'] = 1", which defines "m.a" to be "1", but you can't
write "m.__dict__ = {}"). Modifying "__dict__" directly is not
recommended.
Modules built into the interpreter are written like this: "<module
'sys' (built-in)>". ... | |
<gh_stars>1-10
# Copyright 2013-2015 STACKOPS TECHNOLOGIES S.L.
#
# 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... | |
help message for usage of the $rquote command
Parameters
==========
channel : discord.Channel
Channel to send the help message to.
"""
embed = discord.Embed(
title='How to Quote!',
color=discord.Color.red()
)
embed.set_author(name=CLIENT.user, icon_url=CLIENT.user.avatar_url)
embed.add_field(name='Adding a... | |
next-segment matches..."
.format(key, parentref))
next_translated_path = (
translated_path + YAMLPath.escape_path_section(
key, translated_path.seperator))
next_ancestry = ancestry + [(data, key)]
for node_coord in self._get_nodes_by_traversal(
val, yaml_path, segment_index,
parent=data, parentref=key,
transla... | |
<gh_stars>10-100
# 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
from ... import _utilit... | |
# self.ut_self.assertEqual(response.status_code, 400)
#
# def api_user_layer_update_error_401_unauthorized(self, feature_json):
# response = self.session.put(self.URL + '/api/user_layer',
# data=dumps(feature_json), headers=self.headers)
#
# self.ut_self.assertEqual(response.status_code, 401)
# user layer error... | |
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 05 11:55:37 2018
@author: hugonnet
DDEM LIBRARY:
Library of Python functions for manipulating DEM differences
"""
import os, sys, shutil
import csv
import numpy as np
import pandas as pd
from numpy.polynomial.polynomial import polyfit, polyval
import random
from vectlib ... | |
i1IIi / I1ii11iIi11i - O0
def lisp_get_lookup_string ( input_str ) :
if 85 - 85: i1IIi . i1IIi
if 16 - 16: I1IiiI - OOooOOo % Ii1I . OOooOOo + I1ii11iIi11i % i11iIiiIii
if 59 - 59: i11iIiiIii - I11i
if 59 - 59: OoooooooOO * o0oOOo0O0Ooo / I1Ii111
OOOO0oo0 = input_str
I11iiI1i1 = None
if ( input_str . find ( "->"... | |
new data set which are not classified correctly. To get the *next* sample we simply call the `next` method on our generator.
# %%
print(next(gn))
# %% [markdown]
# After looking at a few examples, maybe we decide to look at the most frequently appearing `5000` words in each data set, the original training data set an... | |
<filename>Exercise-Sheet-01/Planetary_Evolution.py
#!/usr/bin/env python3
"""
@author: <NAME>
@email: <EMAIL>
Albert-Ludwigs-Universität Freiburg
Computational Physics: Material Science
Exercise Sheet 01 - Planetary Evolution
The following are the referenced equations in the code:
Eq(1), Eq(2) : Euler algorithm for ... | |
<gh_stars>100-1000
import numpy as np
from ukfm import SO3, SEK3
import matplotlib.pyplot as plt
class INERTIAL_NAVIGATION:
"""3D inertial navigation on flat Earth, where the vehicle obtains
observations of known landmarks. See a text description in
:cite:`barrauInvariant2017`, Section V.
:arg T: sequence time ... | |
str(eachReadLineAL)
stringArrayAL = str.split(unicodeReadLineAL)
agentMemePath = stringArrayAL[0]
agentID = rmlEngine.api.createEntityFromMeme(agentMemePath)
agents.append(agentID)
n = 0
for eachReadLineT in allLinesT:
unicodeReadLineT = str(eachReadLineT)
stringArray = str.split(unicodeReadLineT)
... | |
Add line if the file is already created
else:
# Add line when the new session is detect
if add_line :
with open(path_script+'Results'+'/'+Patient_First_Name+'_'+Patient_Name+'/'+Report_Number +
'_'+'following.csv', 'ab') as fp:
# Define format as excel format
a = csv.writer(fp, delimiter=';')
# Create r... | |
'حساب',
'Current Address': 'العنوان الحالي',
'Current Beneficiaries': 'المستفيدين الحاليين',
'Current community priorities': 'أولويات المجتمع الحالي',
'Current greatest needs of vulnerable groups': 'أكبرالاحتياجات الحالية للفئات الضعيفة',
'Current Group Members': 'أعضاء الفريق الحالي',
'Current health problems': ... | |
"""Test the search module"""
from collections.abc import Iterable, Sized
from io import StringIO
from itertools import chain, product
from functools import partial
import pickle
import sys
from types import GeneratorType
import re
import numpy as np
import scipy.sparse as sp
import pytest
from sklearn.utils.fixes im... | |
bool
:param use_user_defaults: If ``True`` and a user configuration is found, this will be used as a default for all non
set arguments. So the value will be determined according to the first found instance of: argument,
user default, tool default
:type user: :class:`evaluation_system.model.user.User`
:param user: The u... | |
self.INIT_transition = 10
#Initialize the fields
bsz = 1
if self.resume:
#Import the saved fields
velx = np.load(f'{self.out_dir}A_{self.alpha}_RE_{self.Re}_dx_{self.Nx}_{self.Ny}_velocity_x_field.npy')[-1,0,:,:]
vely = np.load(f'{self.out_dir}A_{self.alpha}_RE_{self.Re}_dx_{self.Nx}_{self.Ny}_velocity_y_field.... | |
"[V][Conc][Trns][A_4Pl][P_1Du]": [
"@–nger+megtekuk"
],
"[V][Conc][Trns][A_4Pl][P_1Pl]": [
"@–nger+megtekut"
],
"[V][Conc][Trns][A_4Pl][P_1Sg]": [
"@–nger+megtenga"
],
"[V][Conc][Trns][A_4Pl][P_2Du]": [
"@–nger+megcetek"
],
"[V][Conc][Trns][A_4Pl][P_2Pl]": [
"@–nger+megceci"
],
"[V][Conc][Trns][A_4Pl][P_... | |
import numpy as np
from .utils.math_utils import subsets
from .aps import aps
r_is_initialized = False
class GlobalImport:
# https://stackoverflow.com/a/53255802
# This doesn't seem to like to be imported from elsewhere, e.g.,
# from utils. Maybe with some work it might be possible too.
def __enter__(self):
r... | |
heightmap_lerp_hm(
hm1: np.ndarray, hm2: np.ndarray, hm3: np.ndarray, coef: float
) -> None:
"""Perform linear interpolation between two heightmaps storing the result
in ``hm3``.
This is the same as doing ``hm3[:] = hm1[:] + (hm2[:] - hm1[:]) * coef``
Args:
hm1 (numpy.ndarray): The first heightmap.
hm2 (numpy.... | |
= True
compound_operations = ['UNION', 'UNION ALL']
field_overrides = {
'bool': 'BOOL',
'binary': 'BINARY',
'decimal': 'NUMERIC',
'double': 'DOUBLE PRECISION',
'float': 'FLOAT',
'primary_key': 'INTEGER AUTO_INCREMENT',
'text': 'LONGTEXT',
'uuid': 'VARCHAR(255)',
}
for_update = True
interpolation = '%s'
li... | |
"""The module for training ENAS."""
import contextlib
import glob
import math
import os
import numpy as np
import scipy.signal
from tensorboard import TensorBoard
import torch
from torch import nn
import torch.nn.parallel
from torch.autograd import Variable
import models
import utils
logger = utils.get_logger()
d... | |
<gh_stars>1-10
import json
import logging
import os
import psutil
import time
from dcicutils.misc_utils import environ_bool, PRINT, ignored
from functools import lru_cache
from pkg_resources import resource_filename
from pyramid.events import BeforeRender, subscriber
from pyramid.httpexceptions import (
HTTPMovedPerm... | |
perpendicular to edge
if ((state.constrainedDir == 'y') and (abs(base.direct.dr.mouseX) > 0.9)):
deltaX = 0
deltaY = base.direct.dr.mouseDeltaY
elif ((state.constrainedDir == 'x') and (abs(base.direct.dr.mouseY) > 0.9)):
deltaX = base.direct.dr.mouseDeltaX
deltaY = 0
else:
deltaX = base.direct.dr.mouseDeltaX
d... | |
<filename>officinam/999999999/0/1603_3_12.py<gh_stars>0
#!/usr/bin/env python3
# ==============================================================================
#
# FILE: 1603_3_12.py
#
# USAGE: ./999999999/0/1603_3_12.py
# ./999999999/0/1603_3_12.py --help
# NUMERORDINATIO_BASIM="/dir/ndata" ./999999999/0/1603_3_12.py
... | |
= None
self.new_pic = None
self.dim = Dimensions()
self.rec = Dimensions()
self.last_dir = ''
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Methods : File Dialogs /About +++++++++++++++++++++++++++++++++++++++++ #
def set_advanced(self):
if not self.isAdvanced:
self.resize(1812... | |
<reponame>sttollgrin/hydrus
import hashlib
import io
import numpy
import numpy.core.multiarray # important this comes before cv!
import struct
import warnings
try:
# more hidden imports for pyinstaller
import numpy.random.common # pylint: disable=E0401
import numpy.random.bounded_integers # pylint: disable=E040... | |
<gh_stars>0
power = {'BUSES': {'Area': 1.33155,
'Bus/Area': 1.33155,
'Bus/Gate Leakage': 0.00662954,
'Bus/Peak Dynamic': 0.0,
'Bus/Runtime Dynamic': 0.0,
'Bus/Subthreshold Leakage': 0.0691322,
'Bus/Subthreshold Leakage with power gating': 0.0259246,
'Gate Leakage': 0.00662954,
'Peak Dynamic': 0.0,
'Runtime Dyn... | |
<filename>gen_plots_tables/plot_figure1-6.py
import numpy as np
import empca
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLocator
from mpl_toolkits.axes_grid1.inset_locator import inset_axes, mark_inset
from apogee.tools.path import change_dr
from apogee.tools import pi... | |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
from utils import to_gpu
import json
import os
import numpy as np
class MLP_Latent(nn.Module):
def __init__(self, ninput, noutput, layers,
... | |
qu'un 501 Internal Server Error)
# return (400, "".join(traceback.format_exc())) # Affiche le "traceback" (infos d'erreur Python) en cas d'erreur (plutôt qu'un 501 Internal Server Error)
else:
return r
### LISTES MORTS ET VIVANTS
def liste_joueurs(d): # d : pseudo-dictionnaire des arguments passés en GET (pwd, t... | |
Compute areas of cell faces & volumes
V = self.aveCC2F * self.cell_volumes
L = self.reshape(self.face_areas / V, "F", "Fy", "V")
self._cell_gradient_y = sdiag(L) * G2
return self._cell_gradient_y
@property
def cell_gradient_z(self):
"""Z-derivative operator (cell centers to z-faces)
This property constructs a... | |
import matplotlib
matplotlib.use('TkAgg')
from numpy import arange, sin, pi
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
# implement the default mpl key bindings
from matplotlib.backend_bases import key_press_handler
from matplotlib.figure import Figure
from tkinter ... | |
== 'width' and child_.text:
sval_ = child_.text
fval_ = self.gds_parse_double(sval_, node, 'width')
fval_ = self.gds_validate_double(fval_, node, 'width')
self.width = fval_
self.width_nsprefix_ = child_.prefix
# validate type doubleMaxExclusive100MinInclusive0.01
self.validate_doubleMaxExclusive100MinInclusive0... | |
quota for "
"project {0}".format(proj.id)))
@_utils.valid_kwargs(
'action', 'description', 'destination_firewall_group_id',
'destination_ip_address', 'destination_port', 'enabled', 'ip_version',
'name', 'project_id', 'protocol', 'shared', 'source_firewall_group_id',
'source_ip_address', 'source_port')
def creat... | |
<filename>processing.py
#AUTHOR : <NAME>
#MATRICULATION NUMBER : 65074
#Personal Programming Project
#---------------------------------------------------------------------------------------#
#A python file where Iso-geometric analysis is performed along with Toplogy optimization
# --------------------------------------... | |
#%% ----------------------------------------------------------------------------
# <NAME>, March 2021
# KWR BO 402045-247
# ZZS verwijdering bodempassage
# AquaPriori - Transport Model
# With <NAME>, <NAME>, <NAME>, <NAME>
#
# Based on Stuyfzand, <NAME>. (2020). Predicting organic micropollutant behavior
# for 4 public... | |
<filename>academic_observatory_workflows/workflows/web_of_science_telescope.py
# Copyright 2020 Curtin University
#
# 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/lic... | |
<reponame>Evavanrooijen/AfricanGDP
# -*- coding: utf-8 -*-
"""Africa
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1d5nRE-PHRXsNvsdt77szeIjeU0ig8hjj
"""
import numpy as np
import pandas as pd
from math import sqrt
import matplotlib.pyplot as plt
impor... | |
will be ignored when sending a request.
All required parameters must be populated in order to send to Azure.
:param type: Required. The type of the step.Constant filled by server. Possible values
include: "Docker", "FileTask", "EncodedTask".
:type type: str or ~azure.mgmt.containerregistry.v2019_06_01_preview.mod... | |
PublicationId):
self.id = PublicationId(self.id)
if self._is_empty(self.type):
self.MissingRequiredField("type")
if not isinstance(self.type, str):
self.type = str(self.type)
if not isinstance(self.authors, list):
self.authors = [self.authors] if self.authors is not None else []
self.authors = [v if isinstanc... | |
return handle.query_dn(mo.dn)
def bios_profile_delete(handle, name, server_id=1):
"""
Deletes the bios profile specified by the name on the Cisco IMC server
Args:
handle (ImcHandle)
name (str): Name of the bios profile.
Corresponds to the name field in the json file.
server_id (int): Id of the server to perfor... | |
# Copyright 2017-2020 Lawrence Livermore National Security, LLC and other
# CallFlow Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: MIT
import os
import json
import math
import pandas as pd
import numpy as np
# CallFlow imports
import callflow
from callflow.modules.gradie... | |
if mode == "POMODORO_W" or mode == "POMODORO_B":
if pomoWorkTime < 7200:
pomoWorkTime += 300
queuePom.put(300)
timeTillNextLed = pomoWorkTime // getAvailable() # Calculate new LED time
if mode == "TASK":
if taskNum < 32: # Max 32 tasks because 32 LEDs
taskNum += 1
quantityON = getAvailable() // taskNum
if... | |
A[1])
det_DHC1 = (B[0] - A[0])
det_DHD0 = (B[1] - A[1])
det_DHD1 = - (B[0] - A[0])
DHDH = DH * DH
Jacbian_gboxes[iter, i * 2, n_of_inter[iter] * 2] += (det_DxA0 * DH - Dx * det_DHA0) / DHDH
Jacbian_gboxes[iter, i * 2, n_of_inter[iter] * 2 + 1] += (det_DyA0 * DH - Dy * det_DHA0) / DHDH
Jacbian_gboxes[iter, i * ... | |
<reponame>DBerke/DRAGONS
#
# DRAGONS
#
# http_proxy.py
# ------------------------------------------------------------------------------
import os
import json
import time
import select
import datetime
import urllib.error
import urllib.parse
import urllib.request
from socketserver import ThreadingMixIn
from http.server... | |
# Copyright 2017 Max Planck Society
# Distributed under the BSD-3 Software license,
# (See accompanying file ./LICENSE.txt or copy at
# https://opensource.org/licenses/BSD-3-Clause)
"""This class implements POT training.
"""
import collections
import logging
import os
import time
import tensorflow as tf
import utils
f... | |
request asynchronously.
:type async_req: bool, optional
:param _preload_content: if False, the urllib3.HTTPResponse object will
be returned without reading/decoding response
data. Default is True.
:type _preload_content: bool, optional
:param _request_timeout: timeout setting for this request. If one
number prov... | |
<reponame>timcera/hspf_water_balance<filename>hspf_water_balance/hspf_water_balance.py<gh_stars>0
#!/bin/env python
import os
import sys
import re
import warnings
import pandas as pd
from mando import command
from mando import main
from tabulate import simple_separated_format
from tabulate import tabulate
from tsto... | |
{
'instance_type': {'required': True},
}
_attribute_map = {
'instance_type': {'key': 'instanceType', 'type': 'str'},
}
_subtype_map = {
'instance_type': {'InMageRcm': 'InMageRcmUpdateApplianceForReplicationProtectedItemInput'}
}
def __init__(
self,
**kwargs
):
super(UpdateApplianceForReplicationProtecte... | |
"""
Trains an image segmentation model with SGD.
python joint_train.py --seperate_background_channel --data_dir joint_fewshot_shards_uint8_background_channel --augment --epochs 10 --steps_per_epoch 2 --batch_size 3 --val_batches 2 --sgd --l2 --final_layer_dropout_rate 0.2 --rsd 2 --restore_efficient_net_weights_from m... | |
<filename>buildscripts/test_failures.py
#!/usr/bin/env python
"""Test Failures
Compute Test failures rates from Evergreen API for specified tests, tasks, etc.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import datetime
import ite... | |
#
# 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 u... | |
industry
common aliases for these indicators.
calculation_method (bool): If true, the measurement for each sample will be calculated first. If not, the
confusion matrix for each image (the output of function '_get_confusion_matrix')
will be returned. In this way, users should achieve the confusion matrixes for all
... | |
generate the ortho-mosaic from.
The image_collection can be a portal Item or an image service URL or a URI
The image_collection must exist.
----------------------------------- --------------------------------------------------------------------
out_ortho Required. This is the ortho-mosaicked image converted from th... | |
#===----------------------------------------------------------------------===##
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
#===----------------------------------... | |
<filename>NavControl3.py
# -*- coding: utf-8 -*-
"""
Created on Sat May 28 08:53:18 2016
@author: mtkessel
"""
import sys
import PyQt4.QtCore as QtCore
import PyQt4.QtGui as QtGui
import PyQt4.QtOpenGL as QtOpenGL
import ctypes
import numpy
import math
from math import pi, sin, cos # convenience
import time
impo... | |
<filename>conda_build/convert.py
# (c) 2012-2017 Continuum Analytics, Inc. / http://continuum.io
# All Rights Reserved
#
# conda is distributed under the terms of the BSD 3-clause license.
# Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause.
"""
Tools for converting conda packages
"""
import glob
imp... | |
import yaml
import numpy as np
from xml.etree.ElementTree import ElementTree, Element, SubElement
from .transform import Transform
from .utils import lift_material, visual, collision, box_link, joint
class LiftDoor:
def __init__(self, yaml_node, name, lift_size, gap, plugin=True):
self.name = name
self.door_type ... | |
{1!s}'.format(type(pe).__name__, pe))
cpx_status_string = 'Internal error: {0!s}'.format(pe)
cpx_status = -2
finally:
solve_time = cpx.get_time() - solve_time_start
solve_dettime = cpx.get_dettime() - solve_dettime_start
details = SolveDetails(solve_time, solve_dettime,
cpx_status, cpx_status_string,
cpx_p... | |
com_google_fonts_check_description_min_length(description):
"""DESCRIPTION.en_us.html must have more than 200 bytes."""
if len(description) <= 200:
yield FAIL,\
Message("too-short",
"DESCRIPTION.en_us.html must"
" have size larger than 200 bytes.")
else:
yield PASS, "DESCRIPTION.en_us.html is larger than 200 by... | |
def __getattr__
# end class Pkg_NS
### Scope creation methods
@classmethod
def load (cls, app_type, db_url, user = None) :
"""Load a scope for `app_type` from `db_url`.
Depending on `app_type.EMS`, `load` might load all instances from
`db_url` into the application or it might just connect to the
database an... | |
#!/usr/bin/python
import subprocess
import traceback
import time
import os
import sys
import socket
import random
import string
import shutil
import requests
import json
import getpass
import urllib3
import platform
import pwd
import glob
try:
import distro
except:
print ('Unable to find `distro` package hence using... | |
<filename>csb/test/cases/statistics/samplers/__init__.py
import numpy as np
import csb.test as test
import csb.numeric
from csb.statistics.pdf import Normal, BaseDensity
from csb.numeric.integrators import AbstractGradient, VelocityVerlet, LeapFrog, FastLeapFrog
from csb.numeric import InvertibleMatrix
from csb.sta... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2006-2011 <NAME> http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# Copyright (c) 2011, Nexenta Systems, Inc.
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation ... | |
# 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... | |
SKIN_PATH + '/OpenConfig.xml'
f = open(skin, 'r')
self.skin = f.read()
f.close()
Screen.__init__(self, session)
info = '***'
self['fittitle'] = Label(_('..:: TivuStream Config ::..'))
self['infoc'] = Label(Credit)
self['Maintainer'] = Label(_('Maintainer'))
self['Maintainer2'] = Label('%s' % Maint... | |
>>>
>>> print(m.solve_limited(expect_interrupt=True))
None
>>> m.delete()
"""
if self.solver:
self.solver.interrupt()
def clear_interrupt(self):
"""
Clears a previous interrupt. If a limited SAT call was interrupted
using the :meth:`interrupt` method, this method **must be called**
before calling the SAT s... | |
import sqlite3
from PyQt5 import QtCore, QtGui, QtWidgets
import pathlib
from PyQt5.QtCore import QModelIndex
from PyQt5.QtGui import QFont
from PyQt5.QtWidgets import QAbstractItemView
s = None
accounts = pathlib.Path("Accounts.db")
user = pathlib.Path("User.db")
lam = [[user, 0], [accounts, 1]]
for file in lam:
pri... | |
import sys
import json
import io
import enum
from messagebird.balance import Balance
from messagebird.call import Call
from messagebird.call_list import CallList
from messagebird.contact import Contact, ContactList
from messagebird.error import Error, ValidationError
from messagebird.group import Group, GroupList
from... | |
<gh_stars>0
"""
A simple JSON REST request abstraction layer that is used by the
``dropbox.client`` and ``dropbox.session`` modules. You shouldn't need to use this.
"""
import io
import pkg_resources
import socket
import ssl
import sys
import urllib
try:
import json
except ImportError:
import simplejson as json
tr... | |
"""
BUCKEYE TETROMINOES
Coded by: <NAME> in collaboration w/ The Ohio State University's OHI/O
Game Logic Sourced from Arcade Sample Code library.
Distributed under the MIT LICENSE.
"""
################################################################################
import arcade
import random
import time
import PIL
i... | |
# Chassis VM5D4C6B3599 VMX
m = p_chassis.match(line)
if m:
for k,v in m.groupdict().items():
k = k.replace('_', '-')
if v:
chassis_inventory_dict[k] = v.strip()
continue
# -------------------------------------------------------------------------------------
# For general chassis modules, for example:
# -----... | |
== 'createControlsTable':
actions = self.process_controls_table(data)
result = {'actions': actions,
'results': {'operationSucceeded': True}
}
elif action == 'createMeasurementTable':
actions = self.process_create_measurement_table(data)
result = {'actions': actions,
'results': {'operationSucceeded': True}
}
e... | |
<filename>tests/test_01_users.py
import pytest
from django.contrib.auth import get_user_model
from .common import auth_client, create_users_api
class Test01UserAPI:
@pytest.mark.django_db(transaction=True)
def test_01_users_not_auth(self, client):
response = client.get('/api/v1/users/')
assert response.status_... | |
ma.AbsoluteURLFor('observations.unflagged',
observation_id='<observation_id>'),
},
description="Contains a link to the Observation endpoints."
)
@spec.define_schema('ObservationValues')
class ObservationValuesSchema(ObservationValuesPostSchema):
observation_id = ma.UUID(
title='Observation ID',
description="UU... | |
<gh_stars>100-1000
# Copyright 2018-2021 Xanadu Quantum Technologies 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 requir... | |
import pyautogui as pag
from getpass import getpass
import sys
import json
import requests
import keyboard
import time
import random
import webbrowser
from os import system, name
from colorama import Fore, Back, Style
import os
os.system('cls')
def clear():
if name == 'nt':
_ = system('cls')
def add():
try:
na... | |
inp, s1,s2, reuse, use_batch_norm, filter_size=3):
global rbId
# convolutions of resnet block
if dataDimension == 2:
filter = [filter_size,filter_size]
filter1 = [1,1]
elif dataDimension == 3:
filter = [filter_size,filter_size,filter_size]
filter1 = [1,1,1]
gc1,_ = gan.convolutional_layer( s1,... | |
y, z):
a = np.add(x, y)
return np.add(np.subtract(a, z), a)
exercise(input(), expected(), ref, rands((5, 7), 3))
def test_annotate_expr():
metatable = {"SEScope": [CPU, GPU]}
def input():
return tvm.parser.parse(
"""
#[version = "0.0.5"]
def @main(%x: Tensor[(5, 7), float32], %y: Tensor[(5, 7), float32], %... | |
<reponame>raunaqtri1/MINT-Transformation<filename>funcs/topoflow/topoflow/components/satzone_darcy_layers.py
#
# Copyright (c) 2001-2016, <NAME>
#
# Nov 2016.
# Sep 2014.
# Nov 2013. Converted TopoFlow to Python package.
# Jan 2013. Revised handling of input/output names.
# Oct 2012. CSDMS Standard Names and BMI.
# Ma... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.