input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<reponame>CMPUT404F21TEAM/social-distribution
import base64
from django.contrib import messages
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from django.http.response import *
from django.http import HttpResponse, JsonResponse
from django.http.response import HttpRes... | |
easily collected into the tree of tests, and have their public
#test methods called. It is worth noting that, for a given TestCase_, an
#instance of the test fixture class will be constructed prior to the
#test method being called, and destructed afterwards. This prevents 'leakage'
#of information from one test case to... | |
<reponame>osheraz/komodo<filename>komodo2_rl/src/environments/komodo_env_new.py
#! /usr/bin/env python
# coding=utf-8
import rospy
import time
import numpy as np
from std_srvs.srv import Empty
from nav_msgs.msg import Odometry
from std_msgs.msg import Float64
from sensor_msgs.msg import JointState
from gazebo_msgs.srv... | |
<reponame>pbmanis/ephys
"""
Analyze EPSCs or IPSCs
Or EPSPs and IPSPs...
This module provides the following analyses:
1. Amplitudes from a train
2. Paired pulse facilitation for pulse pairs, and the first pair in a train.
3. Current-voltage relationship in voltage clamp measured over a time window
The results of the... | |
a TF 1.0 checkpoint in priority if from_tf
archive_file = os.path.join(pretrained_model_name_or_path, TF_WEIGHTS_NAME + ".index")
elif from_tf and os.path.isfile(os.path.join(pretrained_model_name_or_path, TF2_WEIGHTS_NAME)):
# Load from a TF 2.0 checkpoint in priority if from_tf
archive_file = os.path.join(pretrai... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010-2011 OpenStack Foundation
# Copyright 2012-2013 IBM Corp.
# 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
... | |
<reponame>movermeyer/madrona
from django.contrib.gis.geos import GEOSGeometry, Polygon, LineString, Point, LinearRing, fromstr
from django import forms
from madrona.studyregion.models import *
from django.conf import settings
from madrona.common.utils import LargestPolyFromMulti, LargestLineFromMulti
from django.templa... | |
main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\
intentState
if not intentState:
main.log.warn( "Not all intents installed" )
if intentState:
break
else:
#Dumping intent summary
main.log.info( "Intents:\n" + str( main.ONOScli1.intents( jsonFormat=False, summary=True ) ) )
utilities.assert_equals... | |
# coding: utf-8
# 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")... | |
3: 153,
4: 153,
5: 2,
}
self.assertEqual(expected, {
d['id']: d['parts'] for d in rb._iter_devs()})
# ... balance is a little lumpy on the small guy since he wants
# one and a half parts :\
expected = {
0: 0.4609375000000142,
1: -0.1914062499999858,
2: -0.1914062499999858,
3: -0.1914062499999858,
4: -0.19... | |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | |
#!/usr/bin/env python3
import sys, os, shutil, time, math, re, stat
from optparse import OptionParser
import datetime
import fileReadHelp
import json
try:
import annotate
except ImportError:
sys.stdout.write('[Warning: "annotate" import failed, no annotations will be generated]\n')
annotate = None
usage = '%prog ... | |
= mod16(rst, t, RS);
int r = div16(rs, magic_S, shift_S);
int s = mod16(rs, r, S);
int x = qs + s;
int y = pr + r;
int z = mt + t;
int c = kj + j;
bool bounds_x = x >= 0 && x < W;
bool bounds_y = y >= 0 && y < H;
bool bounds_z = z >= 0 && z < D;
bool bounds_c = c >= 0 && c < C;
bool in_bounds = bounds_x &... | |
"""
Functions for geometrical image transformation and warping.
"""
import sys
import time
import numbers
from functools import wraps
from collections import namedtuple
import numpy as np
import scipy.ndimage
from scipy.signal import convolve2d
from sunpy import log
from sunpy.util.exceptions import warn_deprecated, ... | |
ShotgunError("Unable to share thumbnail: %s" % result)
return attachment_id
def upload_thumbnail(self, entity_type, entity_id, path, **kwargs):
"""
Upload a file from a local path and assign it as the thumbnail for the specified entity.
.. note::
Images will automatically be re-sized on the server to generate ... | |
<filename>tuplex/python/tuplex/context.py
#!/usr/bin/env python3
#----------------------------------------------------------------------------------------------------------------------#
# #
# Tuplex: Blazing Fast Python Data Science #
# #
# #
# (c) 2017 - 2021, Tuplex team #
# Created by <NAME> first on 1/1/2021 #
# Li... | |
<gh_stars>1-10
import time
import requests
from mock import patch
from pyramid_sna.compat import urlparse
from eduid_signup.testing import FunctionalTests
import pprint
import logging
logger = logging.getLogger(__name__)
EXISTING_USER = {
'id': '789',
'name': '<NAME>',
'given_name': 'John',
'family_name': 'Smith... | |
#!/usr/bin/env python
"""A keyword index of client machines.
An index of client machines, associating likely identifiers to client IDs.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from future.builtins import map
from future.builtins import range
... | |
extension), then the
# path should be rejected, otherwise it should validate successfully. If
# the path is accepted, the application should display the user notice
# associated with anyPolicy in the intermediate certificate
TestInfo(True, user_constrained_policy_set=[TEST_POLICY_1]),
],
'4.11.1': [ # Invalid in... | |
<reponame>patmloi/PalettePal<gh_stars>1000+
# Copyright 2021, <NAME>, mailto:<EMAIL>
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in ... | |
+ I11i - OOooOOo
i1IIIIi1Ii111 = lisp_rloc ( )
i1IIIIi1Ii111 . store_rloc_from_record ( i1iIiII , None , Iii1 . mapping_source )
if ( oO000O0oooOo != None ) : i1IIIIi1Ii111 . stats = copy . deepcopy ( oO000O0oooOo )
if 20 - 20: OoO0O00 . OoooooooOO - I1Ii111 * IiII
if ( I11iI1iIi1i and i1IIIIi1Ii111 . is_rtr ( ) =... | |
to the provider's website. Use text and URL
to create the hyperlink.
:type url: str
:ivar optional_for_list_display: Indicates whether this provider's
attribution is optional.
:vartype optional_for_list_display: bool
"""
_validation = {
'target_property_name': {'readonly': True},
'_type': {'required': True},
... | |
"""AppDaemon App For use with Monitor Bluetooth Presence Detection Script.
apps.yaml parameters:
| - monitor_topic (default 'monitor'): MQTT Topic monitor.sh script publishes to
| - mqtt_event (default 'MQTT_MESSAGE'): MQTT event name as specified in the plugin setting
| - not_home_timeout (default 30s): Time interval... | |
string
# Otherwise return the original string.
# If matchAreaLabels, the areaLabel of previous node must match
# that of the current if we are to return an empty string.
# This prevents phrases such as:
# Chance of rain and snow 20 percent windward rain and snow 40 percent leeward.
#
# Check sub-phrases
#print... | |
self._stmt_delete_key = self._session.prepare(self.QUERY_DELETE_KEY.format(table_name))
self._stmt_delete_val = self._session.prepare(self.QUERY_DELETE_VAL.format(table_name))
@property
def buffer_size(self):
"""
Get the buffer size.
:rtype: int
:return: the buffer size
"""
return self._buffer_size
@buffer... | |
#!/usr/bin/env python
import argparse
import numpy as np
import tqdm
import sys
from LLC_Membranes.llclib import timeseries, fitting_functions, stats, rand
from LLC_Membranes.analysis import Poly_fit
import matplotlib.pyplot as plt
from multiprocessing import Pool
import time as timer
import fbm
from LLC_Membranes.tim... | |
"""
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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.... | |
block['hash'][2:],
'block_number': block['index'],
'block_size': block['size'],
'block_time': block['time'],
'block_date': datetime.datetime.utcfromtimestamp(block['time']).strftime('%Y-%m-%d'),
'contract_hash': txn['contract_hash'],
'contract_hash_version': txn['contract_hash_version'],
'transaction_hash': txn[... | |
+ 5.6981417358594e-7*log(
236.453447120506 - 0.956203191157888*m.x1) + 5.0424073396149e-7*log(509.329744330999 -
0.868619394055885*m.x1) + 3.6945328156719e-7*log(719.780347180692 - 0.801072072839622*m.x1) +
1.1443315505226e-7*log(327.517012158458 - 0.926974955194555*m.x1) + 2.7110655469944e-7*log(
547.74451919602... | |
<filename>lib/trainer.py
import os
import time
import glob
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from .utils import get_latest_file, iterate_minibatches, check_numpy, process_in_chunks
from .nn_utils import to_one_hot
from collections import OrderedDict
from copy import ... | |
import os
import sys
import numpy as np
import pickle
from datetime import date
from gtracr.lib._libgtracr import TrajectoryTracer, uTrajectoryTracer
from gtracr.lib.trajectory_tracer import pTrajectoryTracer
from gtracr.utils import particle_dict, location_dict, ymd_to_dec
from gtracr.lib.constants import EARTH_RADIUS... | |
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 24 16:52:00 2017
@author: Paul
"""
import numpy as np
from skimage import measure
from collections import defaultdict
import PySkelFrac.classes as c
from scipy import ndimage
import copy
import time
import cv2
def NewAssociatedContours(AllContours,AllArc... | |
<reponame>streamsets/datacollector-tests
# Copyright 2021 StreamSets 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... | |
<filename>tests/ampligraph/evaluation/test_protocol.py<gh_stars>0
# Copyright 2019 The AmpliGraph Authors. All Rights Reserved.
#
# This file is Licensed under the Apache License, Version 2.0.
# A copy of the Licence is available in LICENCE, or at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
import numpy as np
imp... | |
<reponame>lresende/text-extensions-for-pandas
#
# Copyright (c) 2020 IBM Corp.
# 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... | |
The parameters used at the time that the task ran.
- **Status** *(string) --*
The task status for an invocation.
- **StatusDetails** *(string) --*
The details explaining the status. Details are only available for certain status values.
- **StartTime** *(datetime) --*
The time that the task started running on... | |
<filename>remoteobjects/http.py
# Copyright (c) 2009 Six Apart Ltd.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# t... | |
<reponame>ouyang-w-19/decogo
# NLP written by GAMS Convert at 04/21/18 13:51:14
#
# Equation counts
# Total E G L N X C B
# 166 166 0 0 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc si
# Total cont binary integer sos1 sos2 scont sint
# 317 317 0 0 0 0 0 0
# FX 53 53 0 0 0 0 0 0
#
# Nonzero counts
# Total const NL D... | |
<gh_stars>1-10
'''
Extensions to SMAP L4C (and calibration) to support soil respiration
enhancements related to improved soil hydrology modeling.
'''
import os
import pickle
import warnings
import h5py
import numpy as np
import matplotlib
from functools import partial
from matplotlib import pyplot
from pyl4c import su... | |
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\objects\base_interactions.py
# Compiled at: 2020-05-28 20:15:33
# Size of source mod 2**32: 34163 by... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 11 13:58:05 2019
Methodology:
0) run code with --prep drdump on all rinex files
1) run code with either --prep edit24hr or --prep edit30hr on all
datarecords files
2) run code with --gd2e 30hr or --gd2e 24hr for either solve ppp on 24hr
folder o... | |
" correctly. anywhere.
# TODO this used to turn "1.5%" into empty string; why does error
# not work?
m = SELECTOR_TOKENIZER.match(selector, pos)
if not m:
# TODO prettify me
raise SyntaxError("Couldn't parse selector: %r" % (selector,))
token = m.group(0)
pos += len(token)
# Kill any extraneous space, BUT ma... | |
<filename>reports_generator.py
# -*- coding: utf-8 -*-
import MySQLdb
import pandas as pd
import configparser
import xlsxwriter
import datetime
import os
import argparse
from collections import defaultdict
from working_time import compute_working_time
config = configparser.ConfigParser()
config.read('settings.ini')
B... | |
__, entity in entities:
if not entity and not with_disabled:
continue
if with_disabled:
for version in entity.all_versions:
if version.is_renderable(allow_disabled=True):
yield version
else:
if entity.is_renderable():
yield entity
@classmethod
def list_content(cls, holder, entity_class, with_disabled):
for... | |
"""
"""
__author__ = "<NAME>"
__version__ = "0.0"
import sys
import time
import os
import math
import argparse
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.lines as lines
import scipy.optimize as opt
import utils.fileio as fileio
import utils.display as display
import utils.model as model
i... | |
iBuilding in [iPaganTemple, iSacrificialAltar]:
iTemples = getNumBuildings(iPlayer, iPaganTemple)
iAltars = getNumBuildings(iPlayer, iSacrificialAltar)
if iTemples >= 6 and iAltars >= 6:
win(iPlayer, 1)
# first Mexican goal: build three cathedrals of your state religion by 1880 AD
elif iCiv... | |
= self.get_guild(int(data["guild_id"]))
if not guild:
return
member = Member(self, data, guild)
guild._members[member.id] = member
self.dispatch("guild_member_add", member)
async def parse_guild_member_remove(self, data: Dict) -> None:
"""Parses the ``GUILD_MEMBER_REMOVE`` event.
This method parses the raw ... | |
from tython.lex import TokenType
from tython.errors import SyntaxError
from tython.types import Types
from .parse_result import ParseResult
from .nodes import *
############################################
# PARSER
############################################
class Parser:
def __init__(self, tokens):
self.tokens ... | |
if value.get('assay_term_name') not in controlRequiredAssayList:
return
# single cell RNA-seq in E4 do not require controls (ticket WOLD-6)
if value.get('assay_term_name') == 'single cell isolation followed by RNA-seq' and \
check_award_condition(value, ["ENCODE4"]):
return
# We do not want controls
if value.g... | |
<filename>google/cloud/iam_credentials_v1/services/iam_credentials/client.py
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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://ww... | |
rmw byte w/o wrap-around
mpu.pc = 0x200
mpu.a[0] = 0x7F
zp = 0x7F
mpu.memory[mpu.pc] = zp
self.mask = mpu.wordMask
self.rmwVal = 0x55AA
self.rtnVal = self.mask & (-self.rmwVal)
mpu.memory[0xFE] = mpu.byteMask & self.rmwVal
mpu.memory[0xFF] = mpu.byteMask & (self.rmwVal >> 8)
pc = mpu.pc + 1
mpu.rmw_zpX(... | |
objects for catalog cross-matching; in arcseconds
import_ZTF : Import ZTF data (True) or read existing file (False)
import_OSC : Import OSC data (True) or read existing file (False)
import_local : Import local data from ./photometry directory
import_lightcurve : Regenerate existing lightcurve file (True) or read
t... | |
masks = (inputs.data[:, :, self.field.vocab.stoi['<pad>']] != 1).float()
if bp < 1.0:
masks = self.change_bp_masks(masks, bp)
return masks
def find_captions_length(self, all_captions):
# find length of each caption
all_captions_lengths = []
# list of lists
if type(all_captions[0]) == list:
num_captions = le... | |
7.0 | 7.5, 7.5 | 8.0, 8.0 | 8.5, 8.5 | 9.0, 9.0 | 9.5, 9.5 | 10.0, 10.0
dmaptcontr3pain = Column(Numeric, nullable=True, comments=None)
# Rep 3: (double entry)
# Field Type: dropdown
# Choices: 0.0, 0.0 | 0.5, 0.5 | 1.0, 1.0 | 1.5, 1.5 | 2.0, 2.0 | 2.5, 2.5 | 3.0, 3.0 | 3.5, 3.5 | 4.0, 4.0 | 4.5, 4.5 | 5.0, 5.0 | 5... | |
""" Contains LotlanTreeVisitor """
# standard libraries
from enum import Enum
import re
# local sources
from lotlan_scheduler.model.transport.transport import Transport
from lotlan_scheduler.model.transport.template import Template
from lotlan_scheduler.model.transport.instance import Instance
from lotlan_scheduler.m... | |
name_btn.style.button_color = 'lightgreen'
self.float316 = FloatText(value='0', step='0.01', style=style, layout=widget_layout)
units_btn = Button(description='a.u. of concentration', disabled=True, layout=name_button_layout)
units_btn.style.button_color = 'lightgreen'
description_btn = Button(description='initial ... | |
str, *args: Any, **kwargs: Any
) -> Optional[JSONLike]:
"""Try to call a function on the ledger API."""
function = getattr(self._api.eth, callable_name)
response = function(*args, **kwargs)
if isinstance(response, AttributeDict):
result = AttributeDictTranslator.to_dict(response)
return result
if type(respon... | |
PRIMITIVE representation.
<BLANKLINE>
alpha = the unique root of x^2 - 3 between 0 and 4
= 1.7320508076-
<BLANKLINE>
Coordinate 1 = 0
= 0.0000000000
Coordinate 2 = alpha
= 1.7320508076-
----------------------------------------------------
We see that, the level of this cell is 2, meaning that it is part of
th... | |
with angle_between() (i.e. abs value of angles.)
if 0.75 * np.pi < angle <= np.pi:
feature[0] += 1
elif 0.25 * np.pi <= angle < 0.75 * np.pi:
feature[1] += 1
elif 0.0 <= angle < 0.25 * np.pi:
feature[2] += 1
else:
raise ValueError(
"Error in binning orientation. Orientation does not fit into any bin."
)
ret... | |
= {'Type': 'GenericResourceType', 'Properties': {'Foo': 'xyz'}}
tmpl_diff = {'Properties': {'Foo': 'xyz'}}
prop_diff = {'Foo': 'xyz'}
self.m.StubOutWithMock(generic_rsrc.ResourceWithProps, 'handle_update')
generic_rsrc.ResourceWithProps.handle_update(
utmpl, tmpl_diff, prop_diff).AndReturn(None)
self.m.ReplayAll(... | |
<gh_stars>0
import argparse
import numpy as np
import matplotlib.pyplot as plt
import os
import pickle
import torch
from torch import optim, nn
from utils.batchutils import make_batch_point, make_batch_line
from utils.batchutils import make_target_point, make_target_line
from utils.loss import reconstruction_loss, ku... | |
['PillarsofGoldLE', '필러스오브골드-래더',
'GoldeneSäulenLE', '黄金之柱-天梯版',
'ЗолотыестолпыРВ', 'PiliersdorEC',
'PilastridoratiLE', 'PilaresdeoroEE',
'ZłoteFilaryER', 'PilaresdeoroEJ',
'PilaresdeOuroLE'],
'9230f3d80948da581ab945bc67a23d262d8e13e0fa11053db29d7ccd34c07c9c': ['Jagannatha'],
'32469c955c8892b1a9f44c4bd2557d46866... | |
<filename>tools.py
import datetime
import functools
import io
import math
import pathlib
import pickle
import re
import uuid
import imageio
import gym
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf1
import tensorflow_probability as tfp
from tensorflow.keras.mixed_precision import experimen... | |
<filename>ZS4Mic/load_functions/prepare_for_zoominterpolation.py
#WORKING
import os
import sys
sys.path.insert(0,'/content/ZoomInterpolation/load_functions')
from skimage import io
import numpy as np
from tqdm import tqdm
import shutil
from aicsimageio import AICSImage, imread
import time
import random
from aicsimageio... | |
0 or invalid_node is not None:
log_nodes = list()
for idx in range(nodes):
log_nodes.append("%s:%s" % (self.servers[idx + 1].ip, self.servers[idx + 1].port))
if invalid_node is not None:
log_nodes.append("invalid:8091")
log_nodes = ",".join(log_nodes)
if initialized:
cli = CouchbaseCLI(server, server.rest_user... | |
<reponame>jbasko/aws-sfn-builder
import json
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
from uuid import uuid4
import dataclasses
from bidict import bidict
from jsonpath_ng import parse as parse_jsonpath
from .base import Node
from .choice_rules import ChoiceRule
def _generate_name()... | |
#!/usr/bin/python
'''
Shader assembler.
Usage: asm.py --isa-file ../rnndb/isa.xml in.asm out.bin
'''
# Copyright (c) 2012-2017 <NAME>
#
# 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 withou... | |
= top_level_aggregation.order(self.sort_column, order)
top_level_aggregation = top_level_aggregation.order("_term", order, reset=False)
query = (
case_es.CaseES()
.domain(self.domain)
.user_ids_handle_unknown(user_ids)
.size(0)
)
if self.case_type:
query = query.case_type(self.case_type)
else:
query = query... | |
supply pre-extracted NetCDF variables to the
computational routines. It is primarily used for internal
purposes, but can also be used to improve performance by
eliminating the need to repeatedly extract the same variables
used in multiple diagnostics calculations, particularly when using
large sequences of fi... | |
# -*- coding: utf-8 -*-
tosho_1 = [
['1301','極洋','水産・農林'],
['1332','日本水産','水産・農林'],
['1333','マルハニチロ','水産・農林'],
['1352','ホウスイ','卸売'],
['1376','カネコ種苗','水産・農林'],
['1377','サカタのタネ','水産・農林'],
['1379','ホクト','水産・農林'],
['1384','ホクリヨウ','水産・農林'],
['1414','ショーボンドホールディングス','建設'],
['1417','ミライト・ホールディングス','建設'],
['1419','タ... | |
new_instancemethod(_TopTools.TopTools_DataMapOfShapeListOfInteger_Set,None,TopTools_DataMapOfShapeListOfInteger)
TopTools_DataMapOfShapeListOfInteger.ReSize = new_instancemethod(_TopTools.TopTools_DataMapOfShapeListOfInteger_ReSize,None,TopTools_DataMapOfShapeListOfInteger)
TopTools_DataMapOfShapeListOfInteger.Clear = ... | |
<reponame>artofimagination/stereo-calibration-and-vSLAM
import os
import numpy as np
import glob
import shutil
from pathlib import Path
from backend import Backend, States, Modes
from pointCloudGLWidget import PointCloudGLWidget
from linePlotWidget import LinePlotWidget
from PyQt5 import QtCore
from PyQt5.QtCore impo... | |
import itertools
from enum import IntEnum
from typing import Dict, List, Set
from uuid import uuid4
import networkx as nx
import numpy as np
import sm.misc as M
import sm.outputs as O
from grams.algorithm.semantic_graph import (
SGColumnNode,
SGEdge,
SGEntityValueNode,
SGLiteralValueNode,
SGNode,
SGStatementNode... | |
# -*- coding: utf-8 -*-
#
# Copyright 2017 Inc
# @author ipqhjjybj
'''
上传期货的数据
'''
import sys
import os
import six
import numpy as np
import pandas as pd
sys.path.append("..")
from config import *
from connect import *
from reportPyConfig import *
upload_date = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S... | |
<gh_stars>0
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Software License Agreement (BSD License)
#
# Copyright (c) 2009-2011, Eucalyptus Systems, Inc.
# All rights reserved.
#
# Redistribution and use of this software in source and binary forms, with or
# without modification, are permitted provided that the following ... | |
<reponame>ambarqadeer/ALOPqadeer
"""
VERSION 4 Feb 2017
Compatible with python3 and Numpy 1.12 - <NAME>
"""
from astropy.io import fits as pyfits
import math
import numpy
import sys
import scipy.ndimage
import re
def regextract(filename, comments=False):
"""
Converts ds9 region files to become usable by the aper fu... | |
= "accounting-probes",
type = OPTTYPE_STRING,
required = False,
doc = """
Accounting probes.
There are four built-in probes:
- AR: Collects information on AR leases.
- best-effort: Collects information on best effort leases.
- immediate: Collects information immediate leases.
- utilization: Collects inform... | |
<reponame>oxu2/flyingsquid
from pgmpy.models import MarkovModel
from pgmpy.factors.discrete import JointProbabilityDistribution, DiscreteFactor
from itertools import combinations
from flyingsquid.helpers import *
from flyingsquid import _triplets
from flyingsquid import _graphs
from flyingsquid import _observables
from... | |
<reponame>sebtelko/pulumi-azure-native
# 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, ... | |
<reponame>thejacobhardman/Tic-Tac-Toe<filename>Tic-Tac-Toe.py
# <NAME>
# Intro To Programming
# Professor <NAME>
# 4/10/19
# Python Version 3.7.3
# Credit for punch sound effect to <NAME>: http://soundbible.com/995-Jab.html
# Credit for cat scream sound effect to Ca9: http://soundbible.com/1509-Cat-Scream.html
# All o... | |
returned results to models registered in the search (default = True)
Returns:
A dictionary with the following keys:
`results` -- A list of `SearchResult`
`hits` -- The total available results
Opens a database connection, then builds a simple query using the
`model_instance` to build the unique identifier.
For... | |
<reponame>AILab-FOI/APi<gh_stars>0
#!/usr/bin/env python3
from baseagent import *
import json
import argparse
class APiChannel( APiBaseAgent ):
'''Channel agent.'''
REPL_STR = '"$$$API_THIS_IS_VARIABLE_%s$$$"'
def __init__( self, channelname, name, password, holon, token, portrange, channel_input=None, channel_ou... | |
"-".join(fname.split("-")[:-3])
if fname.endswith(".tar"):
fname, _ = os.path.splitext(fname)
# Substring out package name (plus dash) from file name to get version.
version = fname[len(name) + 1 :]
# Ignore implicit post releases in version number.
if "-" in version and version.split("-")[1].isdigit():
version ... | |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 1 10:51:23 2019
@author: Jarvis
Functions
"""
import glob #used in to read in all the fles
import pandas as pd
import numpy as np
from datetime import datetime#
from datetime import timedelta
import glob #used in to read in all the fles
from s... | |
<reponame>00sapo/OpenEWLD<gh_stars>1-10
import time
import argparse
import csv
import json
import operator
import os
import sys
import traceback
import zipfile
import sqlite3
from collections import defaultdict
from typing import List, Dict
import discogs_client
import requests
from music21 import converter, stream, n... | |
# Copyright (c) 2009, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the followi... | |
"longer-side": "keep-aspect-ratio"})
resizes all images to a height/width of 224 pixels depending on which axis is shorter
and resizes the other axis so that the aspect ratio is maintained.
>>> aug = iaa.Resize({"height": (0.5, 0.75), "width": [16, 32, 64]})
resizes all images to a height of ``H*v``, where ``H``... | |
<reponame>drsaunders/RapDetector<gh_stars>0
# coding: utf-8
# In[7]:
get_ipython().magic(u'matplotlib inline')
get_ipython().magic(u"config InlineBackend.figure_formats = {'svg',}")
import numpy as np
import pandas as pd
from IPython.display import display
from sklearn.metrics import confusion_matrix
from sklearn i... | |
<filename>Author_Template/TexScanner.py
#!/usr/bin/env python
# T e x S c a n n e r . p y
#
# Defines a TexScanner class that can be used to extract LaTeX directives
# from a .tex file. Call SetFile() to supply a reference to an already
# open .tex file, then use successive calls to GetNextTexCommand() to get
# all t... | |
<gh_stars>1-10
"""
Remote ranorex library for robot framework
All commands return True if they are executed correctly
"""
#iron python ]%imports
import clr
clr.AddReference('Ranorex.Core')
clr.AddReference('System.Windows.Forms')
import System.Windows.Forms
import Ranorex
#python imports
from argparse import Argument... | |
#COUNTS
if personal_query == '':
if str(request.vars['type_L'])=="all" or str(request.vars['type_L'])=="i":
infoeLevelTemp.append(db((db.validate_laboratory_log.period==T(period.period.name))&(db.validate_laboratory_log.yearp==period.yearp)&(db.validate_laboratory_log.project==project.name)&(db.validate_laboratory_l... | |
mluv.dudy.rolling(t=nperseg, center=True)
.reduce(np.average, weights=sig.hann(nperseg))
.dropna("t")
)
dvdys = (
mluv.dvdy.rolling(t=nperseg, center=True)
.reduce(np.average, weights=sig.hann(nperseg))
.dropna("t")
)
sstrains = (
mluv.sstrain.rolling(t=nperseg, center=True)
.reduce(np.average, weights=sig.hann(... | |
can be a
float or integer, which will set the same timeout value for
the socket connect and the socket read, or an instance of
:class:`urllib3.util.Timeout`, which gives you more fine-grained
control over your timeouts.
"""
self.num_requests += 1
timeout_obj = self._get_timeout(timeout)
timeout_obj.start_conne... | |
<filename>refine_code/GUI_hm_dark_style.py
import cv2
import sys
import os.path as osp
import time
from matplotlib import pyplot as plt
import numpy as np
from pyclustering.samples.definitions import SIMPLE_SAMPLES, FCPS_SAMPLES;
import os
from pyclustering.cluster import cluster_visualizer;
from pyclustering.cluster.... | |
<gh_stars>1-10
"""
The SQLAlchemy model definition.
revision history:
40 - Move image data to seperate table for speed
39 - Remove SQL insert functions, add dataset row to frequencyband table. Add image data.
38 - add varmetric table
37 - add forcedfits_count column to runningcatalog
36 - switch to SQLAlchemy sc... | |
elif n_gpu > 1:
model = torch.nn.DataParallel(model, device_ids=[0])
return model
def init_and_load_roberta_classifier_model(model_dir, model_name):
load_model_file = os.path.join(model_dir, model_name)
load_config_file = os.path.join(model_dir, NEW_CONFIG_NAME)
my_logger("Loading fine-tuned / pre-trained RoBERT... | |
f"'{export_format_id}' is not a supported export format for this model. "
f"Choose one of the following: {self.supported_export_formats}"
)
content_types = gca_model_compat.Model.ExportFormat.ExportableContent
supported_content_types = self.supported_export_formats[export_format_id]
if (
artifact_destination
a... | |
#!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Herald HTTP transport discovery, based on a homemade multicast protocol
:author: <NAME>
:copyright: Copyright 2014, isandlaTech
:license: Apache License 2.0
:version: 1.0.1
:status: Alpha
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Version... | |
= [ 'Identity(3,4)' ],
lorentz = [ L.SSSS1 ],
couplings = {(0,0):C.GC_2175})
V_827 = Vertex(name = 'V_827',
particles = [ P.sd1__tilde__, P.sd1, P.su1__tilde__, P.su1 ],
color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)' ],
lorentz = [ L.SSSS1 ],
couplings = {(1,0):C.GC... | |
#!/usr/bin/env python3
# -*- coding: cp1252 -*-
'''
Created on 13.03.2018
GUI_forms.py
widgits for adding new sequences or new projects to TypeLoader
@author: <NAME>
'''
# import modules:
import sys, os, shutil, re
from PyQt5.QtSql import QSqlQuery
from PyQt5.QtWidgets import (QApplication, QFormLayout, QPushButto... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.