input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
'Rochester', 'state': 'New York'},
{'city': 'Rochester', 'state': 'New York'},
{'city': 'Rochester', 'state': 'New Hampshire'},
{'city': 'Rochester Hills', 'state': 'Michigan'},
{'city': 'Rock Falls', 'state': 'Illinois'},
{'city': 'Rock Hill', 'state': 'South Carolina'},
{'city': 'Rock Island', 'state': 'Illinoi... | |
<filename>u24_lymphocyte/third_party/treeano/core/network.py
import six
import theano
import theano.tensor as T
from .graph import TreeanoGraph
from .update_deltas import UpdateDeltas
from .variable import VariableWrapper
from .. import utils
class MissingHyperparameter(Exception):
pass
class Network(object):
"... | |
status.HTTP_404_NOT_FOUND
else:
assert response.status_code == status.HTTP_403_FORBIDDEN
@pytest.mark.django_db
@pytest.mark.parametrize(
"user_type",
[
None,
"normal_user",
"retina_grader_non_allowed",
"retina_grader",
"retina_admin",
],
)
@pytest.mark.parametrize(
"viewset,factory,serializer,basename,wit... | |
<gh_stars>0
# Copyright 2018 <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 rights to
# use, copy, modify, merge, publish, dist... | |
<filename>lib/checkinput.py
# for multi_padlock_design
# Xiaoyan, 2018
import os
from lib import readfastafile
from lib import retrieveseq
from lib import createoutput
def correctinput(string):
""" Change from backslash to slash """
string = string.encode('unicode-escape').decode() # un-escape escape characters
s... | |
# coding: utf-8
"""
Couchbase Backup Service API
This is REST API allows users to remotely schedule and run backups, restores and merges as well as to explore various archives for all there Couchbase Clusters. # noqa: E501
OpenAPI spec version: 0.1.0
Generated by: https://github.com/swagger-api/swagger-codegen... | |
for box in self.site.homepage.contents[lang].sidebar.boxes:
if box.is_empty():
continue
soup = BeautifulSoup(box.content, 'html5lib')
soup.body.hidden = True
for url_mapping in self.urls_mapping:
new_url = "{}/{}/".format(site_folder, url_mapping["wp_slug"])
for old_url in url_mapping["jahia_urls"]:
self.fix... | |
gamma_threshold
# Initialize the variational distributions q(beta|lambda) and q(theta|gamma)
self.state = AuthorTopicState(self.eta, (self.num_topics, self.num_terms), (self.num_authors, self.num_topics))
self.state.sstats = self.random_state.gamma(100., 1. / 100., (self.num_topics, self.num_terms))
self.expElogbe... | |
self._cfg.learn.aux_freq == 0:
aux_loss, bc_loss, aux_value_loss = self.learn_aux()
return {
'policy_cur_lr': self._optimizer_ac.defaults['lr'],
'value_cur_lr': self._optimizer_aux_critic.defaults['lr'],
'policy_loss': ppo_policy_loss.policy_loss.item(),
'value_loss': value_loss.item(),
'entropy_loss': ppo_polic... | |
]
all_params.extend(
[
'async_req',
'_return_http_data_only',
'_preload_content',
'_request_timeout',
'_request_auth'
]
)
for key, val in six.iteritems(local_var_params['kwargs']):
if key not in all_params:
raise ApiTypeError(
"Got an unexpected keyword argument '%s'"
" to method get_portfolio_metadata" ... | |
<filename>core/misc.py
# -*- coding: utf-8 -*-
# Copyright (C) 2012, <NAME>
#
# Visvis is distributed under the terms of the (new) BSD License.
# The full license can be found in 'license.txt'.
""" Module misc
Various things are defined here that did not fit nicely in any
other module.
This module is also meant to ... | |
else:
self.fail_apriori = True
return
if random.randint(0, 1) == 0:
new_function[0] = -new_function[0]
if self.max_xor > 0:
while len(new_function) > self.max_xor:
temp = new_function[0:self.max_xor - 1]
new_function = [curIndex] + new_function[self.max_xor - 1:]
temp.append(curIndex)
curIndex += 1
self.new_... | |
100, 200],
vax_policies = ["contact", "random", "mortality"],
policy_colors = [contactrate_vax_color, random_vax_color, mortality_vax_color],
policy_labels = ["contact rate", "random", "mortality"]
)
plt.gca().ticklabel_format(axis = "y", useOffset = False)
plt.show()
## 2D: state x age
if "2D" in figs_to... | |
"""
return graph_transform(self, *args, **kwargs)
def graph(self, ig):
"""Specify the node and edge data.
:param ig: NetworkX graph or an IGraph graph with node and edge attributes.
:type ig: Any
:returns: Plotter
:rtype: Plotter
"""
res = copy.copy(self)
res._edges = ig
res._nodes = None
return res
... | |
# -*- coding: utf-8 -*-
"""
Diagnostic Plots for Pipeline
Author: <NAME>
Date last updated: February 2017
"""
# Import statements
from glob import glob
import os
import numpy as np
from matplotlib.backends.backend_pdf import PdfPages
import matplotlib.pyplot as plt
from PyPDF2 import PdfFileMerger
import pandas as pd
i... | |
import os
import unittest
import logging
import vtk, qt, ctk, slicer
from slicer.ScriptedLoadableModule import *
from slicer.util import VTKObservationMixin
#
# SegmentCrossSectionArea
#
class SegmentCrossSectionArea(ScriptedLoadableModule):
"""Uses ScriptedLoadableModule base class, available at:
https://github.co... | |
<reponame>lgiommi/MLaaS4HEP<gh_stars>1-10
#!/usr/bin/env python
#-*- coding: utf-8 -*-
#pylint: disable=E1004,R0912,R0913,R0914,R0915,R0903,R0902,C0302
"""
File : reader.py
Author : <NAME> <vkuznet AT gmail dot com>
Reader module provides various readers for different data-formats:
JSON, CSV, Parquet, ROOT. It also all... | |
and is protected by a bearer token.',
)
EDUTEAMS_LABEL = Field(
'Eduteams', description='Label is used by HomePort for rendering login button.'
)
EDUTEAMS_CLIENT_ID = Field(
'', description='ID of application used for OAuth authentication.'
)
EDUTEAMS_SECRET = Field('', description='Application secret key.')
E... | |
<gh_stars>1-10
"""Unit tests for scalarstop.model."""
import doctest
import logging
import os
import tempfile
import unittest
import unittest.mock
import warnings
import tensorflow as tf
import scalarstop as sp
from tests.assertions import (
assert_directory,
assert_keras_saved_model_directory,
assert_model_after_... | |
#
# This file is part of pySMT.
#
# Copyright 2014 <NAME> and <NAME>
#
# 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 appl... | |
from typing import Union, Optional, Iterable, Tuple, Mapping
import argparse
import pathlib
import os
import json
from datetime import datetime
import uuid
import soundfile
from tqdm import tqdm
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from sklearn.preprocessing import LabelEncoder
i... | |
mock_response = [
{
"url": "https://api.github.com/repos/oakbani/f3Github/pulls/5",
"id": 226795927,
"node_id": "MDExOlB1bGxSZXF1ZXN0MjI2Nzk1OTI3",
"html_url": "https://github.com/oakbani/f3Github/pull/5",
"diff_url": "https://github.com/oakbani/f3Github/pull/5.diff",
"patch_url": "https://github.com/oakbani/f3G... | |
"""
Testing for the default/base strategy class
"""
import os
from fractions import Fraction as frac
import pytest as pt
import pandas as pd
from test_all_tests import get_test_data_path
import lib.base_strategy as bs
def compare(value1, value2):
"""
Helpful testing function that prints values if there are a mismatc... | |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""WebsiteTest testing class."""
import logging
import time
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common... | |
from PyQt5 import QtCore
from PyQt5 import QtGui
import weakref
import numpy as np
import pyqtgraph as pg
import classCustomGraphicsItems
class EquityChart(pg.PlotWidget):
"""
Class for displaying equity curves.
Inherits from pyqtgraph plotWidget.
"""
def __init__(self, *args, **kwargs):
"""
Init functio... | |
# -*- coding: utf-8 -*-
"""
Created on Fri 2015-03-20
@author: <NAME>
"""
import unittest, sys
import inspect, os
import sympy as sp
import symbtools as st
import symbtools.noncommutativetools as nct
import pickle
from ipydex import IPS
if 'all' in sys.argv:
FLAG_all = True
else:
FLAG_all = False
# s, t from... | |
(0x2082420, 'libc_2_27.ungetwc'),
(0x2082500, 'libc_2_27.putwc'),
(0x2082640, 'libc_2_27.putwc_unlocked'),
(0x2082680, 'libc_2_27.putwchar'),
(0x20827d0, 'libc_2_27.putwchar_unlocked'),
(0x2082810, 'libc_2_27.putchar'),
(0x2082950, 'libc_2_27.putchar_unlocked'),
(0x2082990, 'libc_2_27.fwprintf'),
(0x2082a50, 'l... | |
<reponame>Ramprasad273/code-20211201-ramprasad<filename>venv/Lib/site-packages/pylint/lint/run.py
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
import os
import sys
import warnings
from pylint import __pkginfo__, exten... | |
<filename>src/pykeen/datasets/base.py
# -*- coding: utf-8 -*-
"""Utility classes for constructing datasets."""
from __future__ import annotations
import logging
import pathlib
import tarfile
import zipfile
from abc import abstractmethod
from io import BytesIO
from typing import Any, ClassVar, Dict, List, Mapping, Op... | |
elif F_CK > 50:
F_CTMJ = 2.12 * np.log(1 + 0.11 * F_CKJ)
F_CTMJ *= 1E3
F_CTKINFJ = 0.7 * F_CTMJ
F_CTKSUPJ = 1.3 * F_CTMJ
# Módulo de elasticidade do concreto
F_CKJ *= 1E3
F_CK *= 1E3
[E_CIJ, E_CSJ] = MODULO_ELASTICIDADE_CONCRETO(AGREGADO, F_CK, F_CKJ)
return F_CKJ, F_CTMJ, F_CTKINFJ, F_CTKSUPJ, E_CIJ, E_CSJ
... | |
<reponame>ucrscholar/HandWashNet
import os
import random as rd
os.environ["CUDA_VISIBLE_DEVICES"] = "2"
from tensorflow.compat.v1 import ConfigProto
from tensorflow.compat.v1 import InteractiveSession
config = ConfigProto(allow_soft_placement=True)
config.gpu_options.per_process_gpu_memory_fraction = 1
config.gpu_opt... | |
handled separately)
inittable = [
(None, s_0_table),
(None, s_1_table),
(IENC_LOAD_IMM_OFF, None), # Load or store an immediate
(None, s_3_table),
(IENC_LOAD_MULT, None),
(IENC_BRANCH, None),
(None, s_6_table),
(None, s_7_table),
]
endian_names = ("le","be")
class ArmOpcode(envi.Opcode):
_def_arch = envi.ARC... | |
#! usr/bin/env python
import numpy as np
import pandas as pd
import ase.io
import ase
from ase import atoms
import networkx as nx
from periodictable import elements
import featpro.utils as utils
from featpro.pos import connectivity
from itertools import islice
#========================================================... | |
dicoAttrsAut [appl] ['MedIPCDiversity'] = len(set(Techno [appl]))/ dicoAttrsAut [appl]['NbBrevets']
dicoAttrsAut [appl] ['MedIPCForce' ] = len(Techno [appl]) / dicoAttrsAut [appl]['NbBrevets']
dicoAttrsAut [appl] ['MedCitations' ] =dicoAttrsAut [appl]['Citations']/ dicoAttrsAut [appl]['NbBrevets']
# TODO
# C... | |
"""
copy of the famous snake game written in python
SOURCES / CREDITS:
Fonts: -CamingoCode-Regular.ttf (Creative Commons Attribution - No Derivative Works 3.0 Unported,
https://creativecommons.org/licenses/by-nd/3.0/) by <NAME> published on
https://www.fontsquirrel.com/fonts/camingocode (last visited: 20. N... | |
<gh_stars>0
from collections import namedtuple
import re
import os
import copy
import random
import signal
import sys
SUN = "sun"
MOON = "moon"
KEY = "key"
DOOR = "door"
NIGHTMARE = "nightmare"
RED = "red"
BLUE = "blue"
GREEN = "green"
BROWN = "brown"
BLACK = "black"
VICTORY_MESSAGE = "Victory"
DEFEAT_MESSAGE = "D... | |
from __future__ import absolute_import, division, print_function
from iotbx.pdb.atom_selection import selection_string_from_selection
from iotbx.pdb.atom_selection import get_clean_selection_string
from mmtbx.ncs.ncs_search import get_chains_info
from scitbx.array_family import flex
import iotbx.pdb
from libtbx.test_ut... | |
0, -1, -1, -1], [ 0, 3, -1, -1, -1, 0],
[ 0, -1, 2, 0, -1, 0], [-1, -1, 0, 2, 0, 0],
[-1, -1, -1, 0, 3, 0], [-1, 0, 0, 0, 0, 1]])
:arg str direction: This argument is ignored for undirected graphs.
"out" - out-degree on diagonal of laplacian
"in" - in-degree on diagonal of laplacian
:arg str link_attribute: name... | |
<gh_stars>1-10
import sys, os, time, string, types
if os.environ.has_key('SIMICS_PYCHECKER'):
os.environ['PYCHECKER'] = ('--no-shadowbuiltin --no-argsused'
+ ' --no-implicitreturns --no-shadow')
import pychecker.checker
from cli import *
from refmanual import *
from re import *
from string import join
import os.pa... | |
<reponame>amoodie/pyDeltaRCM_WMT
import pytest
import platform
import os
from pathlib import Path
import unittest.mock as mock
import pyDeltaRCM
from pyDeltaRCM.model import DeltaModel
# from pyDeltaRCM import shared_tools
from pyDeltaRCM import preprocessor
from . import utilities
# from .utilities import test_De... | |
<filename>mrn_rdpgw_service_discovery.py
#!/usr/bin/env python
# |-----------------------------------------------------------------------------
# | This source code is provided under the Apache 2.0 license --
# | and is provided AS IS with no warranty or guarantee of fit for purpose. --
# | See the project's LICENSE.md... | |
# -*- coding: utf-8 -*-
# Copyright 2018 ICON Foundation
#
# 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 ... | |
import numpy as np
from enum import Enum, auto
class SolverState(Enum):
PRESOLVE = auto()
PHASE1_STEP = auto()
DRIVEOUT_STEP = auto()
PHASE2_STEP = auto()
DONE = auto()
class SimplexSolver:
def __stripReturnChar(self, str):
if str[-1] == '\n':
return str[:-1]
return str
'''
Reads MPS file to solve LP pr... | |
operation to return a list of gateways for your account and region.
:rtype: dict
:returns:
"""
pass
def describe_snapshot_schedule(self, VolumeARN: str) -> Dict:
"""
Describes the snapshot schedule for the specified gateway volume. The snapshot schedule information includes intervals at which snapshots are auto... | |
1:
if importPhaseAsSensor == True:
self.DAGfile.write("%s.set_downstream(%s_sensor)\n"%(self.mainStartTask, taskID))
self.DAGfile.write("%s_sensor.set_downstream(%s_import)\n"%(taskID, taskID))
else:
self.DAGfile.write("%s.set_downstream(%s_import)\n"%(self.mainStartTask, taskID))
self.... | |
= joPlug.child(0)
joPlugY = joPlug.child(1)
joPlugZ = joPlug.child(2)
jo = om.MTransformationMatrix(
om.MEulerRotation(joPlugX.asDouble(), joPlugY.asDouble(), joPlugZ.asDouble()).asMatrix())
m = r * jo.asMatrix()
r = self.get_rotate(m)
r.reorderIt(0)
mc.setAttr(s + '.r', 0, 0, 0)
mc.setAttr(s ... | |
# Lint as: python2, python3
r"""Babelfish version of Beam search.
This is TensorFlow implementation of beam search that is implemented to run fast
on TPUs. go/beam-search-on-fish
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from REDACTED.tensorflow_... | |
completion
try:
await asyncio.wait_for(beam_syncer._backfiller.manager.wait_finished(), timeout=10)
except asyncio.TimeoutError:
beam_syncer.logger.warning("Backfiller never exited, even though all state is present")
if beam_syncer._backfiller._check_complete():
beam_syncer.logger.warning("Backfiller thinks it's ... | |
import boto3
import calendar
import logging
import os
import requests
import threading
import math
import csv
from collections import namedtuple
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
from flask import g, current_app
from sqlalchemy import func, and_, or_
from sqlalch... | |
"defaultSort": None,
"model": "string",
"prettyName": "Query",
"toMany": False,
"type": "string",
},
},
"sortedFields": [
"id",
"admin",
"created_time",
"description",
"fields",
"google_sheets_formula",
"limit",
"model_name",
"name",
"open_view",
"owner",
"public",
"public_link",
"public_slug",
"q... | |
OoO0O00 / OoO0O00 - iIii1I11I1II1
if 80 - 80: OOooOOo . ooOoO0o + i1IIi * I1ii11iIi11i % O0
if ( Ii11111 != "?" and packet . encap_port != LISP_DATA_PORT ) :
if ( ed == "encap" ) : Ii11111 += ":{}" . format ( packet . encap_port )
if 77 - 77: OoOoOO00 % II111iiii % I1Ii111 . i1IIi - I11i - I1IiiI
if 95 - 95: OoOoO... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 10 22:15:17 2021
@author: jmontp
"""
import numpy as np
import pandas as pd
import pickle
from sklearn.decomposition import PCA
#Relative Imports
from .context import math_utils
#Set test assert_pd for speed boost
math_utils.test_pd = False
#... | |
"""
analysis.py
Module for manipulating data from QuantumEspresso Output after Parsing
Contains all functions for calculating Born Effective Charges
"""
import numpy as np
import pandas as pd
from pybec import utils
import dask.array as da
from pybec import parsers
from scipy.spatial import ConvexHull
from pykrige.r... | |
'''
Sum over system eigenstates formula for computing the nonlinear signals.
This is the simpliest method for nonlinear signals without going to
the Liouville space.
'''
import numpy as np
import proplot as plt
from numba import jit
import sys
from numpy import heaviside
from matplotlib import cm
from numpy import ... | |
other type, left
c = d1 ** 4
self.assertEqual(c, Decimal('625'))
self.assertEqual(type(c), type(d1))
#with other type, right
c = 7 ** d1
self.assertEqual(c, Decimal('16807'))
self.assertEqual(type(c), type(d1))
#inline with decimal
d1 **= d2
self.assertEqual(d1, Decimal('25'))
#inline with other type
d1 ... | |
messageCounter, canClaim, claimMessage, claimEmoji
emojis = message.guild.emojis
channel = message.channel
messageCounter += 1
rand = random.randrange(0, 100)
minMessages = 100
val = (int)((messageCounter * 100) / (minMessages * 2)) # convert to a value between 0-100.
# 50% chance per message at minMessages, 100... | |
<reponame>UW-OCP/Collocation-Solver-CUDA
import numpy as np
import scipy.linalg
class collocation_node:
"""
Node class for collocation solver, save the required DAE variables
at each time node
"""
'''
Input: size_y - size of the ODE variables
size_z - size of the DAE variables
size_p - size of the parameters... | |
import random
import math
from environment import Agent, Environment
from planner import RoutePlanner
from simulator import Simulator
class LearningAgent(Agent):
""" An agent that learns to drive in the Smartcab world.
This is the object you will be modifying. """
def __init__(self, env, learning=False, epsilon=1.... | |
parse tree produced by SQLParser#defaultRoleClause.
def enterDefaultRoleClause(self, ctx:SQLParser.DefaultRoleClauseContext):
pass
# Exit a parse tree produced by SQLParser#defaultRoleClause.
def exitDefaultRoleClause(self, ctx:SQLParser.DefaultRoleClauseContext):
pass
# Enter a parse tree produced by SQLParse... | |
information. """
network_delays = []
for task in self.__tasks.values():
if task.complete():
network_delays.append(task.network_delay())
if task.network_delay() > 20:
print "Network delay over 20ms for %s" % self.__id
#print task.node_monitor_submit_time
#print task.scheduler_launch_time
#print task.clock_skew
... | |
<filename>redisai/client.py
import warnings
from functools import wraps
from typing import (Any, AnyStr, ByteString, Dict, List, Optional, Sequence,
Union, overload)
import numpy as np
from deprecated import deprecated
from redis import StrictRedis
from redisai import command_builder as builder
from redisai.dag impo... | |
1
print('* INDUSTRY CODE DOES NOT EXIST (' + str(value) + ')')
else:
for row in ds_industry:
industry_name = row[0]
#commodity----------------------------------------------------------------------------------
value, rc = self.extract_field(message, 2, '')
if rc == 0:
commodity = value
t = (commodi... | |
def backward(self, top, propagate_down, bottom):
# no back-prop
for i in range(len(bottom)):
if not propagate_down[i]:
continue
bottom[i].diff[...] = np.zeros_like(bottom[i].data)
class NNEnc1HotLayer(caffe.Layer):
''' Layer which encodes ab map into Q colors
INPUTS
bottom[0] Nx2xXxY
OUTPUTS
top[0].data Nx... | |
provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:return: V1Organization
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
return self.update_organization_with_http_info(owner, body, **kwargs) ... | |
6}],
"tooltip": {
"valuePrefix": None,
"valueSuffix": None,
"valueDecimals": None,
},
"marker": {},
"stacking": self.stacking,
},
],
"annotations": [],
"colors": DEFAULT_COLORS,
},
result,
)
def test_cont_uni_dims_single_metric_bar_chart(self):
dimensions = [mock_dataset.fields.timestamp, mock_dataset.... | |
# cython: auto_cpdef=True
"""Python code for writing AVRO files"""
# This code is a modified version of the code at
# http://svn.apache.org/viewvc/avro/trunk/lang/py/src/avro/ which is under
# Apache 2.0 license (http://www.apache.org/licenses/LICENSE-2.0)
try:
from fastavro._six import utob, MemoryIO, long, is_str... | |
= c.glLightx
cfunc.restype = restype
cfunc.argtypes = argtypes
return cfunc(light, pname, param)
# Check if the function actually exists
f = c.glLightx
del f
loaded[0] += 1
except AttributeError as e:
loaded[1] += 1
if DEBUG > 0:
print('could not load the function')
print(e)
try:
def glLightxv(light,
p... | |
# Copyright 2013 OpenStack Foundation
# Copyright 2013 Rackspace Hosting
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2006-2009 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; e... | |
<gh_stars>0
'''
Making a multi-panel true (x) vs predicted (y) plot. Each panel can
show a label (title) and a list of scores. Default values optimized
for making the plots in Dobbels et al. 2020.
<NAME>., <NAME>., <NAME>., <NAME>., <NAME>., <NAME>.,
et al. (2020), A&A, 634, A57.
'''
import numpy as np
import pandas ... | |
<gh_stars>0
#-----------------------------------------------------------------------------
# Copyright (c) 2008 Firaxis Games, Inc. All rights reserved.
#-----------------------------------------------------------------------------
#
#
# FILE: RandomScriptMap.py
# AUTHOR: <NAME> / Refar
# <EMAIL>
# CONTRIB: Ex... | |
#####################################################
#
# 20 October 2009
# <NAME>
# University of California, San Diego
# <EMAIL>
#
# This script performs symbolic Hermite-Simpson
# integration on a vector field given in the text file
# equations.txt, takes the Jacobian and Hessian of the
# vector field, and stores th... | |
# Copyright 2018-2021 The glTF-Blender-IO 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 applicable law... | |
V02 , SN: PST2150N1E2
NAME: "Fan Tray", DESCR: "Cisco ISR4330 Fan Assembly"
PID: ACS-4330-FANASSY , VID: , SN:
NAME: "module 0", DESCR: "Cisco ISR4331 Built-In NIM controller"
PID: ISR4331/K9 , VID: , SN:
NAME: "NIM subslot 0/1", DESCR: "NIM-ES2-4"
PID: NIM-ES2-4 , VID: V01 , SN: FOC21486SRL
NAME: "NIM sub... | |
# If xmin or xmax is specified, use it to define a narrower interval
# make sure the data are odd-numbered and equally spaced
# 'interp' is method of interpolation: see make_potential_regular()
xnew, Vnew = make_potential_regular(x, V, 'odd', silent=silent, xmin=xmin,
xmax=xmax, npt=npt, interp=interp)
# create ... | |
<filename>grader/self.py
"""
Copyright (c) 2015-2019, the Selfie Project authors. All rights reserved.
Please see the AUTHORS file for details. Use of this source code is governed
by a BSD license that can be found in the LICENSE file.
Selfie is a project of the Computational Systems Group at the Department of
Compute... | |
1)
else:
dictotemplate[prot]['coupling']['1'][propval][sub] = round(max(valuelist), 1)
elif len(valuelist) > 0 and propval == "emax":
if all(i > 0 for i in valuelist):
dictotemplate[prot]['coupling']['1'][propval][sub] = round(mean(valuelist))
else:
dictotemplate[prot]['coupling']['1'][propval][sub] = round(max... | |
from player import Player
from card import Card
from util import Util
util = Util()
class JamesBond(Player):
def __init__(self):
# Constants
self.c = {}
self._generate_constants()
# Game data
self.name = '<NAME>'
self.opponents = {}
self.pot_evs = {}
# Hand data
self.hand = ()
self.betting_order = []
# ... | |
#!/usr/bin/env python
""" Create an installer environment """
# Standard lib
import os
import math
import shutil
import random
import pathlib
import zipfile
import platform
import textwrap
import argparse
import subprocess
from collections import namedtuple
# 3rd party
import numpy as np
from PIL import Image
from... | |
from datetime import datetime, timedelta
import logging
from django.core.urlresolvers import reverse
from django.http import Http404
from django.utils import html
from django.utils.safestring import mark_safe
import pytz
from corehq import Domain
from corehq.apps import reports
from corehq.apps.app_manager.models impor... | |
and horizons lengths
self.h_horizons = model.horizons
self.h_horizons_lengths = model.horizons_lengths
print(self.h_horizons_lengths)
print(self.h_horizons)
print("shape horizons lengths", self.h_horizons_lengths.shape)
print("shape horizons lengths", self.h_horizons.shape)
print(self.h_horizons_lengths.dtype, "... | |
<gh_stars>1-10
"""Convolutional Layer implementation."""
import logging
import numpy as np
import tensorflow as tf
from tensorflow.python.keras import initializers
from tensorflow.python.keras.utils import conv_utils
import tf_encrypted as tfe
from tf_encrypted.keras.engine import Layer
from tf_encrypted.keras import... | |
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doListAuthorizedApplicationsToUser(args, parsed_globals):
g_param = parse_global_arg(p... | |
not met: (met,mem,ts,tl,tc,ta)=cm('o',s,c)
if not met: (met,mem,ts,tl,tc,ta)=cm('p',s,c)
if not met: (met,mem,ts,tl,tc,ta)=cm('q',s,c)
if not met: (met,mem,ts,tl,tc,ta)=cm('r',s,c)
if not met: (met,mem,ts,tl,tc,ta)=cm('s',s,c)
if not met: (met,mem,ts,tl,tc,ta)=cm('t',s,c)
if not met: (met,mem,ts,tl,tc,ta)=cm('u',... | |
<filename>lib/datasets/abstract_scene.py
5#!/usr/bin/env python
from ssl import SSL_ERROR_WANT_WRITE
from SceneGraphParser import sng_parser
import os, sys, cv2, json, math, PIL
import cairo, random, torch, torchtext
import numpy as np
import os.path as osp
from time import time
from copy import deepcopy
from glob impo... | |
should check
arr = (
write_array
if write_array is not None
else next(filter(lambda x: isinstance(x, ndarray), operands), None)
)
assert arr is not None, "Deferred op with no ndarray parameter"
size = arr.size
distribution = arr.distribution
if (cls.ramba_deferred_ops is not None) and (
cls.ramba_deferred_ops... | |
register_paths=True, extensions={u'tailf-common': {u'callpoint': u'sysdiag-tmdevicestataggr', u'cli-suppress-show-path': None}}, namespace='urn:brocade.com:mgmt:brocade-sysdiag-operational', defining_module='brocade-sysdiag-operational', yang_type='list', is_config=False)
except (TypeError, ValueError):
raise ValueEr... | |
operands from nonterminals that are lookup functions:
if not gi.parser_output.is_lookup_function():
#msge("Collecting graph enum info")
collect_graph_enum_info(agi,gi.graph)
d = {}
d =collect_tree_depth(gi.graph, d)
#msge("DEPTHS: "+ str(d))
if agi.common.options.print_graph:
print_graph(agi.common.options,gi.g... | |
<gh_stars>100-1000
import numbers
import re
from collections.abc import Iterable, Mapping, MutableMapping, MutableSequence
from datetime import datetime
from enum import Enum
from pytz import utc
from descarteslabs.common.shapely_support import (
geometry_like_to_shapely,
shapely_to_geojson,
)
def parse_iso_datet... | |
<filename>codecov/__init__.py
#!/usr/bin/python
import os
import re
import sys
import glob
import requests
import argparse
from time import sleep
from json import loads
try:
from urllib.parse import urlencode
except ImportError: # pragma: no cover
from urllib import urlencode
try:
from shlex import quote
except I... | |
array.
NCRIT: int, maximum number of boundary elements per twig box of tree
structure.
"""
if (Cells[C].ntarget >= NCRIT):
octant = (x[j] > Cells[C].xc) + ((y[j] > Cells[C].yc) << 1) + (
(z[j] > Cells[C].zc) << 2)
if (Cells[C].nchild & (1 << octant)): # If child cell exists, use
O = octant
else: # If child ce... | |
<reponame>vsevolodpohvalenko/home-assistant<filename>venv/lib/python3.8/site-packages/pr2modules/wiset.py
'''
High level ipset support.
When :doc:`ipset` is providing a direct netlink socket with low level
functions, a :class:`WiSet` object is built to map ipset objects from kernel.
It helps to add/remove entries, lis... | |
<gh_stars>100-1000
# Copyright (c) 2019 Presslabs SRL
#
# 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 a... | |
<gh_stars>10-100
'''
## Aliyun ROS GWS Construct Library
This module is part of the AliCloud ROS Cloud Development Kit (ROS CDK) project.
```python
# Example automatically generated from non-compiling source. May contain errors.
import * as GWS from '@alicloud/ros-cdk-gws';
```
'''
import abc
import builtins
import d... | |
or list of changes set
"""
results = list()
nochangesmade = False
patchremoved = False
instances = self.get_selection()
if not instances or len(instances) == 0:
raise NothingSelectedSetError()
if selector:
for instance in instances:
if self.validate_headers(instance):
continue
else:
noch... | |
return True
current = getattr(current, 'parent', None)
return False
name = getNodeName(node)
if not name:
return
if on_conditional_branch():
# We cannot predict if this conditional branch is going to
# be executed.
return
if isinstance(self.scope, FunctionScope) and name in self.scope.globals:... | |
<reponame>gshefer/Nudgebot<filename>nudgebot/thirdparty/base.py<gh_stars>1-10
"""
Thirdparty module includes the interfaces for the third party.
Each implemented third party module should implement these classes.
"""
import time
from threading import Lock
from wait_for import wait_for
from cached_property import cach... | |
# -*- coding: utf-8 -*-
import requests
import os
import skimage
import random
import json
import webbrowser
import time
import pandas as pd
import matplotlib.pyplot as plt
import os
import sys
from PIL import Image, ImageDraw
global population
global api_calls
global stop
global MUTATION_RATE
classList = []
confidenc... | |
<gh_stars>0
import json
import logging
from collections import Sequence
import re
import six
import urllib3
from builtins import str
from requests import Session
import bartender
from bg_utils.mongo.models import System, Choices
from brewtils.choices import parse
from brewtils.errors import ModelValidationError
from ... | |
# coding=utf-8
# Copyright 2019 The Tensor2Tensor 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 applicable law... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.