input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
# -*- encoding: utf-8 -*-
"""
TODO:
* Address Issue 2251, printing of spin states
"""
from sympy.physics.quantum.anticommutator import AntiCommutator
from sympy.physics.quantum.cg import CG, Wigner3j, Wigner6j, Wigner9j
from sympy.physics.quantum.commutator import Commutator
from sympy.physics.quantum.constants import ... | |
<reponame>jacadcaps/webkitty<gh_stars>1-10
#! /usr/bin/env python
import sys
import os
import StringIO
import unittest
import make_passwords_json
import json
# Show DepricationWarnings come from buildbot - it isn't default with Python 2.7 or newer.
# See https://bugs.webkit.org/show_bug.cgi?id=90161 for details.
impo... | |
import kubernetes
import requests
import os
import json
import datetime
import logging
from django.conf import settings
from substrapp.utils import timeit
from substrapp.exceptions import PodErrorException, PodTimeoutException
import time
logger = logging.getLogger(__name__)
MEDIA_ROOT = os.getenv('MEDIA_ROOT')
REGI... | |
90 - 90: OoO0O00 / Ii1I % iIii1I11I1II1 / O0 * oO0o / I1IiiI
if 83 - 83: II111iiii . ooOoO0o / oO0o
if 54 - 54: ooOoO0o - iIii1I11I1II1 - I11i % Ii1I / II111iiii
if 80 - 80: i11iIiiIii % iIii1I11I1II1 / i11iIiiIii
lisp . lisp_geo_list [ OooOO0o0oOoO ] = i11I1Ii1Iiii1
return
if 66 - 66: OoOoOO00 . iIii1I11I1II1 * ... | |
<gh_stars>10-100
from __future__ import print_function
import numpy as np
from . import utils
import astropy.coordinates as c, astropy.units as u
# Optional dependencies are imported in the functions that
# use them. These include enlib.ephem, enlib.iers and enlib.pyfsla
# Python 2/3 compatibility
try: basestring
exce... | |
replicas
announce("Waiting for deployments to be available")
spinWait(lambda: waitUntilDeploymentsAvail(4, namespace))
# now the load balancers need to be running with their IPs assigned
announce("Waiting for load-balancers to launch")
spinWait(lambda: waitUntilLoadBalancersUp(services, namespace))
#
# Get the... | |
#!usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
import math
import time
import sys
sys.path.append('../..')
from envs.airCombateEnv.customization import init_posture
from envs.airCombateEnv.customization import REGISTRY_STATE as registry_state
from argument.argManage import args
from envs.unit import... | |
event that includes basic associated club information.
"""
club = serializers.SlugRelatedField(
queryset=Club.objects.all(), required=False, slug_field="code"
)
club_name = serializers.SerializerMethodField()
badges = BadgeSerializer(source="club.badges", many=True, read_only=True)
pinned = serializers.BooleanF... | |
import numpy as np
import matplotlib.pyplot as plt
from tqdm import tqdm
import cv2
import os
import pickle
import json
from roipoly.roipoly import RoiPoly, MultiRoi
import argparse
import datetime
import time
from threading import Timer, Thread
from OPTIMAS.utils.files_handling import images_list, read_fps, \
load_t... | |
<reponame>mvitousek/pypat
import unittest
from pypat import *
class TestExamples(unittest.TestCase):
# Matching against literal values
def test_literal(self):
result = match(42,
(234, lambda: False),
(True, lambda: False),
(42, lambda: True))
self.assertTrue(result)
# If no case matches, a PatternException i... | |
<reponame>tangaqi/tencent2019-rank88<filename>tencent-chusai/src/utils.py
import os
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.metrics import roc_auc_score
from time import time
import random
import pandas as pd
def frame_to_dict(train):
train_dict = {}
for col in train.... | |
placement policy for a service fabric service. Following are the possible values.
Expected value is 'PreferredPrimaryDomain'.
"""
return pulumi.get(self, "type")
@type.setter
def type(self, value: pulumi.Input[str]):
pulumi.set(self, "type", value)
@pulumi.input_type
class ServicePlacementRequireDomainDistribu... | |
<reponame>jlmucb/class_notes<filename>IoT/code/py/p3.py
def calc_miles(gallons, mpg=20.0):
return gallons*mpg
print( calc_miles(10.0, 15.0) )
print( calc_miles(10.0) )
for line in infile:
#STUFF DELETED HERE
m, d, y = date.split('/')
month = int(m)
day = int(d)
year = int(y)
#Put data into list
datalist.app... | |
#!/usr/bin/env python
import argparse
import datetime
import os
import pathlib
import posixpath
import re
import subprocess
import tarfile
import time
import sys
import shutil
import glob
from collections import defaultdict
import utilities.log_util as ut_log
import utilities.s3_util as s3u
import boto3
from boto3.s... | |
<reponame>j6k4m8/python-prompt-toolkit<filename>prompt_toolkit/application/application.py<gh_stars>0
from __future__ import unicode_literals
from prompt_toolkit.buffer import Buffer
from prompt_toolkit.cache import SimpleCache
from prompt_toolkit.clipboard import Clipboard, InMemoryClipboard
from prompt_toolkit.enums ... | |
whether any of the given expressions evaluate to True.
If no expressions are provided, returns False.
Examples::
import fiftyone as fo
import fiftyone.zoo as foz
from fiftyone import ViewField as F
dataset = foz.load_zoo_dataset("quickstart")
# Create a view that only contains predictions that are "cat" or
... | |
date - (id due_date delivery_date)')
for p in dd[:5]:
self.stdout.write( "\t{0.study_id} {0.due_date} {0.delivery_date} {0.study_group} (weeks {1:.0f})".format(
p, p.delta_days() / 7
) )
self.stdout.write( '\n')
# Add edd to dd delta seconds
dd_min , dd_max , dd_total , dd_count = None , None , 0 , dd.count()
... | |
a single-GPU and
the whole graph fits in GPU memory.
* If the input graph :attr:`g` is on CPU while the output device :attr:`device` is GPU, then
depending on the value of :attr:`use_uva`:
- If :attr:`use_uva` is set to True, the sampling and subgraph construction will happen
on GPU even if the GPU itself cannot... | |
import base64
import csv
import functools
import uuid
from io import StringIO
import werkzeug
from flask import abort, current_app, jsonify, request
from notifications_utils.recipients import (
RecipientCSV,
try_validate_and_format_phone_number,
)
from app import (
api_user,
authenticated_service,
create_uuid,
... | |
from __future__ import print_function
import ConfigParser
import argparse
import pickle
import sys
import os
import subprocess
import shutil
import time
pickle_name = "dump.pkl" # contains all the measurement objects in a list
history_file = "history.log"
clock_interval = 20 # in seconds
STATE_NONE = -1
STATE_ITERATI... | |
import os
import logging
import datetime
import numpy as np
import pandas as pd
import dask.dataframe as dd
import dask.bag as db
from psutil import cpu_count
from glob import glob
from astropy import units as u
from astropy.coordinates import SkyCoord
from django.conf import settings
from django.db import transaction... | |
{expected.__name__}:\n"
f" Expected message:\n\t'{message}'\n"
f" Received message:\n\t'{expected_message}'"
)
)
elif expected is not raised:
raise ExceptionClassError(
f"Raised exception for call {expectation._name} "
f"did not match expectation:\n"
f" Expected:\t{repr(expected)}\n"
f" Raised:\t{raised}\n\n"... | |
#!/bin/sh
# -*- coding:utf-8
import os
#import psutil # downloaded from http://code.google.com/p/psutil/downloads/detail?name=psutil-1.0.1.win32-py2.7.exe&can=2&q=
import wxversion
wxversion.select("2.8")
import wx
# import FU modules
import fumodel
import view
import const
import lib
import molec
import graph
from ... | |
-0.337218966457),
(-0.646195113652, -0.33706657095),
(-0.651832284777, -0.336912175174),
(-0.657460070718, -0.336755757338),
(-0.663078327691, -0.336597294951),
(-0.668686909161, -0.336436764791),
(-0.674285665754, -0.336274142883),
(-0.67987444516, -0.336109404467),
(-0.685453092043, -0.335942523975),
(-0.691... | |
<reponame>rashid-nhm/cowsay<filename>cowsay.py
#!/usr/bin/env python3
import random
from enum import Enum
ACKNOWLEDGEMENTS = """
cowsay for GNU/Linux was initially written in perl by <NAME> (<EMAIL>), with suggestions from
<NAME> (<EMAIL>) and contributions from <NAME> (<EMAIL>).
This code was originally written... | |
<gh_stars>0
# -*- coding=utf-8 -*-
# weakly label version
import tensorflow as tf
from OHEM import OHNM_batch
import numpy as np
slim = tf.contrib.slim
MODEL_TYPE_vgg16 = 'vgg16'
MODEL_TYPE_vgg16_no_dilation = 'vgg16_no_dilation'
dice_coff = 0.5
ms_flag = False
FUSE_TYPE_cascade_conv1x1_upsample_sum = 'cascade_conv1x1... | |
N_k W_nk = 1. Actual row sum for sample %d was %f' % (firstbad, row_sums[firstbad]))
# Compute estimate of asymptotic covariance matrix using specified method.
if method == 'generalized-inverse':
# Use generalized inverse (Eq. 8 of [1]) -- most general
# Theta = W' (I - W N W')^+ W
# Construct matrices
Ndiag = ... | |
n_bins=Nbins_RFP)
print "Fraction of True Positives in",Nbins_RFP,"probabilty bins"
print ' '.join(['{:.3f}'.format(f) for f in fraction_true])
#TEMPLATE STATISTICS
print "\nTemplate Statistics for {} Data".format(sim)
templates, counts = np.unique(data_test['sim_nonIa'].quantity.value, return_counts=True)
templ... | |
<gh_stars>1-10
import pandas as pd
import struct
import numpy as np
from more_itertools import run_length
from bitstring import BitArray
from scipy import signal
def bin2df(full_path):
"""
Reads geneactiv .bin files into a pandas dataframe.
Parameters
----------
full_path : str
Full path to the geneactiv .bin ... | |
port.
- timeout: timeout in seconds to wait for connection.
Known bugs:
- On some linux distribution once on two attempts the connection is denied by software. On third attempt however it connects.
Returns:
- True: if connection was succesfull.
- False if no connection was established.
Examples:
>>> if(USRP_... | |
== -1753
mmw inc -16 if t > 2911
eri dec 502 if um <= -785
hg inc 134 if x != -2775
lx dec 263 if kg <= 2978
hg dec 83 if es != -1235
mmw dec -837 if umr <= 693
dy inc 148 if um < -792
gk inc -13 if j > -247
x dec 749 if yk >= -568
lbf inc 606 if is != 2489
x inc 588 if dy >= 2345
dy dec 243 if yk <= -574
umr dec 1 if ... | |
<reponame>albertvillanova/pytest<gh_stars>0
import math
import pprint
from collections.abc import Iterable
from collections.abc import Mapping
from collections.abc import Sized
from decimal import Decimal
from numbers import Complex
from types import TracebackType
from typing import Any
from typing import Callable
from... | |
from collections import OrderedDict
from mujoco_py import MjSim, MjViewer
from mujoco_py import load_model_from_xml, load_model_from_path
import mujoco_py.cymj as cymj
from mujoco_py.generated import const
from mujoco_py import functions
from grasp.utils import MujocoPyRenderer
from grasp.controllers import inverse_ki... | |
# ##### BEGIN MIT LICENSE BLOCK #####
#
# MIT License
#
# Copyright (c) 2022 <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 without restriction, including without limitation the rig... | |
observable {} ({}) [{}] <{}> for {} ({}) [{}] <{}>".format(o, id(o), o.id, o.type, observable, id(observable), observable.id, observable.type))
return o
observable.root = self
self.observable_store[observable.id] = observable
logging.debug("recorded observable {} with id {}".format(observable, observable.id))
sel... | |
fps == "MAX":fps = 1000
elif fps == "MIN":fps = 30
else:
print(colorama.Fore.RED+'Error'+colorama.Fore.RESET)
print(colorama.Fore.YELLOW+'None fps'+colorama.Fore.RESET)
sys.exit()
self.clock.tick(fps)
def GET_INIT(self):
return pygame.display.get_init()
def GET_DISPLAY_DRIVER(self):
return pyga... | |
"""The tests for the Xiaomi ble_parser."""
from ble_monitor.ble_parser import BleParser
class TestXiaomi:
def test_Xiaomi_LYWSDCGQ(self):
"""Test Xiaomi parser for LYWSDCGQ."""
data_string = "043e2502010000219335342d5819020106151695fe5020aa01da219335342d580d1004fe004802c4"
data = bytes(bytearray.fromhex(data_str... | |
float
average arrival rate to queueing system
svc_rate : float
average service rate (each server). 1/svc_rate is mean service time.
c : int
number of servers
ca2 : float
squared coefficient of variation for inter-arrival time distribution
cs2 : float
squared coefficient of variation for service time distributi... | |
"Big Sky": 0xCDE2DE,
"Big Spender": 0xACDDAF,
"Big Stone": 0x334046,
"Big Stone Beach": 0x886E54,
"Big Sur": 0xB3CADC,
"Big Sur Blue Jade": 0x3F6E8E,
"Big Surf": 0x96D0D1,
"Big Yellow Streak": 0xFFEE22,
"Big Yellow Taxi": 0xFFFF33,
"Bigfoot": 0x715145,
"Bighorn Sheep": 0x20120E,
"Bijou Blue": 0x4E5E7F,
"Bij... | |
# coding: utf-8
"""
finAPI RESTful Services
finAPI RESTful Services # noqa: E501
OpenAPI spec version: v1.42.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from swagger_client.models.single_direct_debit_data import SingleDirectDebitDat... | |
the tessellated 3D triangle
u = tile_triangle[0] - tile_triangle.center()
v = tile_triangle[1] - tile_triangle.center()
r1_r2_angle = angle_between(u, v)
u = tile_triangle[0] - tile_triangle.center()
v = tile_triangle[2] - tile_triangle.center()
r1_r3_angle = angle_between(u, v)
# calculate the appropriate l... | |
import datetime
import csv
import re
import os.path
import sys
#from PyQt4 import uic, QtGui, QtCore
from PySide import QtUiTools, QtGui, QtCore
import functools
#http://thomas-cokelaer.info/tutorials/sphinx/docstring_python.html
################################################################################
# Prepa... | |
# Licensed under a 3-clause BSD style license - see LICENSE
from __future__ import print_function, division
__all__ = ["Star"]
from ..Utils.import_modules import *
from .. import Utils
from .Star_base import Star_base
logger = logging.getLogger(__name__)
######################## class Star ########################... | |
"'%(net_name)s' in project %(net_tenant)s with VRF %(vrf)s",
{'net_id': network_db.id, 'net_name': network_db.name,
'net_tenant': network_db.tenant_id, 'vrf': new_vrf})
# NOTE: Must only be called for networks that are not yet
# attached to any router.
session = aim_ctx.db_session
old_tenant_name = self.name_m... | |
int
:param enabled: True if configuration is enabled, false if it is disabled and null if
configuration is not set.
:type enabled: bool
"""
_attribute_map = {
'sas_url': {'key': 'sasUrl', 'type': 'str'},
'retention_in_days': {'key': 'retentionInDays', 'type': 'int'},
'enabled': {'key': 'enabled', 'type': 'bool... | |
= ipv6_dhcp_ip = None
if dhcp_port:
on_exc(self.delete_dhcp_nuage_port_by_id, context,
dhcp_port['id'])
for fixed_ip in dhcp_port['fixed_ips']:
if (ipv4_subnet and
fixed_ip['subnet_id'] == ipv4_subnet['id']):
ipv4_dhcp_ip = fixed_ip['ip_address']
if (ipv6_subnet and
fixed_ip['subnet_id'] == ipv6_subnet['id']):... | |
", rx_xposn-(rx_width/2)+20, h_5b, arcade.color.BLACK, float(20), bold = True, align="left")
arcade.draw_text("Speed = (# of Levels) - Current Level + GAME_SPEED_FLOOR", rx_xposn-(rx_width/2)+20, h_5b-25, arcade.color.GRAY, float(15), bold = True, align="left")
if self.GAME_SPEED is not None:
t_5b = f"{self.GAME_SPE... | |
<filename>ipsolver/_canonical_constraint.py
from __future__ import division, print_function, absolute_import
import numpy as np
import scipy.sparse as spc
from ._constraints import (NonlinearConstraint,
LinearConstraint,
BoxConstraint)
__all__ = ['CanonicalConstraint',
'to_canonical',
'lagrangian_hessian',
'empty... | |
<filename>tests/test_cli.py
import pytest
import tempfile
import time
import os
import pytest
import pprint
import requests
import tarfile
import glob
import uuid
from datetime import datetime
from collections import namedtuple
from ae5_tools.api import AEUnexpectedResponseError
from .utils import _cmd, _compare_tar... | |
= [x for x in class_5 if x.status == 'inactive']
totalCareDemand_5 = float(sum([x.hoursDemand for x in class_5]))
socialCareDemand_5 = float(sum([x.hoursDemand for x in inactivePeople_5]))
shareSocialCare_5 = 0
if totalCareDemand_5 > 0:
shareSocialCare_5 = socialCareDemand_5/totalCareDemand_5
# Graph 8
... | |
make a library we need an actual user
user = User(absolute_uid=self.stub_user.absolute_uid)
with self.app.session_scope() as session:
session.add(user)
session.commit()
session.refresh(user)
session.expunge(user)
# Make a library that ensures we get one back
stub_library = LibraryShop()
library_dict = self.us... | |
import bs
import random
def bsGetAPIVersion():
# see bombsquadgame.com/apichanges
return 4
def bsGetGames():
return [CTFGame]
class CTFFlag(bs.Flag):
def __init__(self, activity, team):
bs.Flag.__init__(
self,
materials=[team.gameData['flagMaterial']],
position=team.gameData['basePos'],
color=team.color)... | |
#!/usr/bin/env python
# coding: utf-8
# # Regression Project: The California Housing Prices Data Set
# ### Context
# This is the dataset used in the second chapter of <NAME>'s recent book *'Hands-On Machine learning with Scikit-Learn and TensorFlow'. (O'Reilly)*
#
# It serves as an excellent introduction to implemen... | |
grain ids can be used to restrict the grains.
A list of `Orientation` instances is then created and returned.
:param list id_list: a non empty list of the grain ids.
:return: a list of the grain orientations.
"""
rods = self.get_grain_rodrigues(id_list)
orientations = [Orientation.from_rodrigues(rod) for rod in ... | |
"""Functions to provide I/O APIs for all the modules.
Authors: <NAME>, <NAME>
"""
import json
import os
import pickle
from bz2 import BZ2File
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple, Union
import gtsam
import h5py
import numpy as np
from gtsam import Cal3Bundler, Rot3, Pose3
from ... | |
not None:
udpdatas = self.dynamic_compress(udpdata)
else:
udpdatas = [udpdata]
for udpdata in udpdatas:
try:
self.udpsockcounter += self.udpsocket.send(udpdata)
except error, e:
print >> sys.stderr, 'ignored:', str(e)
pass # ignore UDP send errors (buffer full, etc.)
if self.has_music > 1 and NOW >= self.musi... | |
<reponame>XinyuJing/DI-star<filename>ctools/worker/learner/base_learner.py
"""
Copyright 2020 <NAME>. All Rights Reserved
Main Function:
1. base class for model learning
"""
import os
from abc import ABC, abstractmethod
from typing import Any, Union, Callable
from functools import partial
from easydict import EasyDic... | |
"""
TODO:
Vertex Color
Tangent Space
V Flip
Normalize Bone Weights
Specify Axis Change
"""
import bpy
import struct
from enum import Enum
class VertexAttributeUsage(Enum):
POSITION = 0
TEXTURE_COORDINATE = 1
NORMAL = 2
COLOR = 3
BINORMAL = 4
TANGENT = 5
BONE_WEIGHTS = 6
BONE_INDICES = 7
CUSTOM = 8
class ... | |
"""Implements functionality unique to the Lake Shore Model 335 cryogenic temperature controller"""
from enum import IntEnum
from .temperature_controllers import TemperatureController, InstrumentException
from .temperature_controllers import RelayControlMode, RelayControlAlarm, InterfaceMode, HeaterError, \
CurveForma... | |
<reponame>Mai-Te-Pora/tradehub-python
from typing import Optional, List, Callable
import websockets
import json
class DemexWebsocket:
"""
DemexWebsocket is a high-level async implementation off the official Tradehub Demex websocket and provides all
functionalities described in the documentation.
"""
def __init_... | |
<gh_stars>0
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import json
import logging
from datetime import datetime, timedelta
from collections import defaultdict
from odoo import api, fields, models, _
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT, float_co... | |
{'left': EdgeFile(fn, [slice(None), slice(0, 1)], save_path),
'right': EdgeFile(fn, [slice(None), slice(-1, None)], save_path),
'top': EdgeFile(fn, [slice(0, 1), slice(None)], save_path),
'bottom': EdgeFile(fn, [slice(-1, None), slice(None)], save_path)}
for fn in list(self.neighbors.keys())}
self.edges = edges
r... | |
from __future__ import absolute_import
import logging
from copy import copy
import numpy as np
import scipy.ndimage as nd
from .reference import generate_reference
from .reference_q4 import generate_reference_Q4, find_elm_borders_mesh, normalized_zero_mean
from ..IO.image_stack import ImageStack
from ..elements.b_sp... | |
<reponame>xaliciayang/azure-cli
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ------------------------------------... | |
# 2015-05-22
# r-tree featuring insert, nn and k-nn search with threshold distance
# tie-breaking for same distance is identifier value with largest values appearing earlier
# updated on 2016-08-22 to fix some bugs and re-structure
# updated on 2016-08-23 to fix traditional/non-traditional isLeafNode() distinction
... | |
x.father = node.father
if change:
node = Node('root', -1)
node.child.append(copynode)
copynode.father = node
ans.solveroot = node#copynode
ans.type = type
#print(node.printTree(ans.solveroot))
else:
ans.solveroot = ans.root
ans.type = type
#print(copynode.printTree(copynode))
#assert(0)
return
import re
d... | |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Cisco Systems, Inc. and others. 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
... | |
= ds.ReadRaster(xoff, yoff, xsize, ysize, buf_xsize=4 * xsize, buf_ysize=4 * ysize)
ref_nbands_data_native_type_downsampled_x_upsampled_y = ds.ReadRaster(xoff, yoff, xsize, ysize, buf_xsize=int(xsize / 2), buf_ysize=32 * ysize)
ref_nbands_data_native_type_unordered_list = ds.ReadRaster(xoff, yoff, xsize, ysize, band_... | |
import datetime
import io
import json_tricks
import logging
import os
from os.path import (abspath, basename, dirname, exists, expanduser,
join, realpath, relpath, splitext)
import re
import shutil
import sys
from traits.api import (Any, Dict, Enum, HasTraits, Instance, List, Long,
Str)
from whoosh import fields, qp... | |
from __future__ import print_function, division, unicode_literals
from abc import ABCMeta, abstractproperty, abstractmethod
from collections import namedtuple
from distutils.version import LooseVersion
from functools import wraps
from itertools import takewhile, dropwhile
import operator
import re
import sys
try:
fr... | |
<filename>tests/driver/test_slurm_driver.py
import os
import shutil
from datetime import timedelta, datetime, date
from typing import Collection, Iterator
from unittest.mock import Mock, ANY, call
import pytest
from kong import util
from kong.config import Config, slurm_schema
from kong.drivers import InvalidJobStatu... | |
make them more obvious. We've already
# calculated the pass/fail stats so this won't impact results.
failed_uncertainty_int8_grow = self._grow_pixels(
failed_uncertainty_int8, self.pixel_growth)
# simplify distance is calculated as the distance pixels are grown out
# `ifd.geotransform[1]` is pixel size
simplify_... | |
<gh_stars>0
# Copyright (c) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | |
= allitems('hit_end',
doc="""List of all fragments' hit end coordinates""")
query_end_all = allitems('query_end',
doc="""List of all fragments' query end coordinates""")
hit_span_all = allitems('hit_span',
doc="""List of all fragments' hit sequence size""")
query_span_all = allitems('query_span',
doc="""List ... | |
<gh_stars>10-100
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017-present Alibaba Group Holding Limited. <NAME> <<EMAIL>>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and... | |
<gh_stars>100-1000
#!/usr/bin/env python
import argparse
import pysam
import os
import sys
from deeptools import parserCommon
from deeptools.bamHandler import openBam
from deeptools.mapReduce import mapReduce
from deeptools._version import __version__
from deeptools.utilities import getTLen, smartLabels, getTempFileNa... | |
specified.
:type val_f_VrrpAdvertiseIntervalErrors: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_VrrpAdvertiseIntervalErrors: If op_VrrpAdvertiseIntervalErrors is specified, this value will be compared to the value in VrrpAdvertiseInterval... | |
= udoc.do_rmi(mock_cmdp)
self.assertFalse(status)
udoc = udocker.Udocker(mock_local)
mock_cmdp.missing_options.return_value = False
mock_cmdp.get.side_effect = ["", "", "" "", "", ]
mock_chkimg.return_value = ("IMAGE", "TAG")
mock_local.isprotected_imagerepo.return_value = True
status = udoc.do_rmi(mock_cmdp)
... | |
import json
import time
import logging
import requests
from .robot_state import RobotState
from .eva_errors import eva_error, EvaError, EvaAutoRenewError
# TODO add more granular logs using __logger
# TODO lots of sleeps in control_* de to the robot state being updated slowly after starting an action, can this be imp... | |
= args[2]
instructionFields["rs1"] = args[1]
instructionFields["funct3"] = 5
instructionFields["rd"] = args[0]
instructionFields["opcode"] = 51
subInstructionFields.append(instructionFields)
elif (instructionEnum == INST.REM):
instructionFields = {}
instructionFields["type"] = "R"
i... | |
data structures and scenario flags:
self.update_parameters()
# Update the next checkpoint time:
checkpointIdx = numpy.searchsorted(checkpoints['t'],
self.t) # Finds 1st index in list greater than given val
if (checkpointIdx >= numCheckpoints):
# We are out of checkpoints, stop checking them:
checkpoints = None
... | |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 11 13:41:14 2019
@author: Emmett & Binyang
"""
from pprint import pprint
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from nltk.tokenize.punkt import PunktSentenceTokenizer, PunktTrainer
##Let’s f... | |
the
referer hostname (domains).
"""
keys = self.referer_host_hits.keys()
keys.sort(lambda x, y: cmp(self.referer_host_hits[y],
self.referer_host_hits[x]))
keys = keys[:GRAPH_ITEMS_MAX]
return keys
class Summary(dict):
"""
A dictionary of SummaryItems that represents a total summary of all
files contained i... | |
['Series'],
'HEMODYNAMIC IOD': ['Series'],
'OPHTHALMIC AXIAL MEASUREMENTS IOD': ['Series'],
'DIGITAL MAMMOGRAPHY X-RAY IMAGE IOD': ['Series'],
'VIDEO MICROSCOPIC IMAGE IOD': ['Series'],
'ENHANCED MR COLOR IMAGE IOD': ['Series'],
'ENHANCED CT IMAGE IOD': ['Series'],
'X-RAY RADIATION DOSE SR IOD': ['Series'],
'AU... | |
<gh_stars>1-10
import datetime
import time
import boto
import redis
import requests
import random
import zlib
from django.shortcuts import get_object_or_404
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.template.loader import render_to_string
from django.db im... | |
if results[k] is None:
results[k] = True
if v[0] == 6: #'reached high/low'
if v[3] is None:
v[3] = 1
period = getOffset(v[2].strip().lower(), v[1][0])
name = v[1][0] + ' ' + v[1][1]
for i in range(1, v[3]+1):
if indicators[name] is None or len(indicators[name]) <= i+period:
results[k] = False
... | |
"rownames": ["Background", "CSF", "GM", "WM"],
"title": "Confusion Matrix"}},
every=1), Event.ON_TEST_EPOCH_END) \
.with_event_handler(PlotCustomVariables(visdom_logger, "iSEG Confusion Matrix", PlotType.HEATMAP_PLOT,
params={
"opts": {"columnnames": ["VM", "GM", "CSF", "Background"],
"rownames": ["Background", "... | |
method on return'd breakpoint objects as they may be remote
and would then be *coppies* of the bp objects. (use the trace's
setBreakpointCode() instead).
"""
return self.bpbyid.get(id)
def getBreakpointByAddr(self, va):
'''
Return the breakpoint object (or None) for a given virtual address.
'''
return self.br... | |
# /dev/CMSSW_8_0_0/GRun/V135 (CMSSW_8_0_12)
import FWCore.ParameterSet.Config as cms
HLTConfigVersion = cms.PSet(
tableName = cms.string('/dev/CMSSW_8_0_0/GRun/V135')
)
HLTPSetInitialStepTrajectoryFilterBase = cms.PSet(
ComponentType = cms.string( "CkfBaseTrajectoryFilter" ),
minimumNumberOfHits = cms.int32( 3 ... | |
<reponame>Westlake-AI/openmixup<gh_stars>1-10
import random
import numpy as np
import torch
from torch.autograd import Variable
import torch.nn.functional as F
from openmixup.utils import force_fp32, print_log
from openmixup.models.utils import Canny, Laplacian, Sobel
from .base_model import BaseModel
from .. import ... | |
# Data Engineering Process
# There are several steps in Data Engineering process.
# Extract :- Data extraction is getting data from multiple sources. Ex. Data extraction from a website using Web scraping or gathering information from the data that are stored in different formats(JSON, CSV, XLSX etc.).
# Transform :- ... | |
<gh_stars>1-10
# ======================================================================
# Copyright CERFACS (February 2018)
# Contributor: <NAME> (<EMAIL>)
#
# This software is governed by the CeCILL-B license under French law and
# abiding by the rules of distribution of free software. You can use,
# modify and/or red... | |
# "Skeleton Statue": "",
# "Reaper Statue": "",
# "Woman Statue": "",
# "Imp Statue": "",
# "Gargoyle Statue": "",
# "Gloom Statue": "",
# "Hornet Statue": "",
# "Bomb Statue": "",
# "Crab Statue": "",
# "Hammer Statue": "",
# "Potion Statue": "",
# "Spear Statue": "",
# "Cross Statue": "",
# "Jellyfish St... | |
# Copyright 2018 The Defense-GAN Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | |
index1):
actualGroundGHI += frontGroundGHI[k] * (k + 1.0 - projectedX1);
elif (k == index2):
if (k < 100):
actualGroundGHI += frontGroundGHI[k] * (projectedX2 - k);
else:
actualGroundGHI += frontGroundGHI[k - 100] * (projectedX2 - k);
else:
if (k < 100):
actualGroundGHI += frontGroundGHI[k];
else:
actu... | |
# !/usr/bin/python
# -*- coding: utf-8 -*-
"""
This script is designed to store some kind of feature engineering methods.
"""
# Import necessary libraries.
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy
import warnings
import logging
from scipy.stats import kstest
from scipy.stats ... | |
^ q(31) ^ d(1) ^ d(5) ^ d(6) ^ d(9) ^ d(13) ^ d(14) ^ d(18) ^ d(20) ^ d(22) ^ d(23),
q(10) ^ q(14) ^ q(15) ^ q(18) ^ q(22) ^ q(23) ^ q(27) ^ q(29) ^ q(31) ^ d(2) ^ d(6) ^ d(7) ^ d(10) ^ d(14) ^ d(15) ^ d(19) ^ d(21) ^ d(23),
q(11) ^ q(15) ^ q(16) ^ q(19) ^ q(23) ^ q(24) ^ q(28) ^ q(30) ^ d(3) ^ d(7) ^ d(8) ^ d(11) ^ ... | |
"""
Suite to reduce spectroscopic data.
subfunctions:
calibrate
setheaders -- exptime, gain, readnoise, etc.
makeflat -- make median flat and noisy pixel map
makedark -- make median dark, and estimate noise in each pixel.
clean -- clean and replace bad pixels
extract
trace -- trace spectral orders
makeprofile ... | |
<filename>application.py<gh_stars>0
# -*- coding: utf-8 -*-
from cryptography.fernet import Fernet
from flask import Flask, render_template, Response, abort, session, request, url_for, flash, redirect
from flask.ext.github import GitHub, GitHubError
from flask_sslify import SSLify
import elasticsearch
import os
import... | |
#coding: utf-8
import subprocess,os,xtelnet
import requests,socket,random,time,ssl
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
import bs4
from bs4 import BeautifulSoup
from bane.payloads import *
from bane.pager import inputs
def sqli_error_based(u,logs=True,user_agent=None,return... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.