input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<filename>degoo/API.py
###########################################################################
# A Python front end for the Degoo GraphQL API
import os
import sys
import json
import time
import datetime
import hashlib
import base64
import requests
import humanize
from shutil import copyfile
from appdirs import us... | |
- np.outer(np.ones((self.X_scaled.shape[0], 1)), self.X_scaled[:,d]))
def getNumParams(self): return 2
def getTrainKernel(self, params):
self.checkParams(params)
ell = np.exp(params[0])
p = np.exp(params[1])
#compute d2
if (self.K_sq is None): d2 = sq_dist(self.X_scaled.T / ell) #precompute squared distance... | |
matrix:
[3 4 5]
Notice how the basis for the same subspace is different if we
merely use the ``subspace`` command.
::
sage: W2 = W.subspace([[3,4,5]]); W2
Vector space of degree 3 and dimension 1 over Finite Field of size 7
Basis matrix:
[1 6 4]
Nonetheless the two subspaces are equal (as mathematical obje... | |
schema
class AlterObjectFragment(AlterObjectOrFragment[so.Object_T]):
def apply(
self,
schema: s_schema.Schema,
context: CommandContext,
) -> s_schema.Schema:
# AlterObjectFragment must be executed in the context
# of a parent AlterObject command.
scls = self.get_parent_op(context).scls
self.scls = cast(so.... | |
'draft' and payment.payment_method_code in self._get_method_codes_needing_bank_account()
@api.depends('partner_id')
def _compute_partner_bank_id(self):
''' The default partner_bank_id will be the first available on the partner. '''
for pay in self:
available_partner_bank_accounts = pay.partner_id.bank_ids.filtere... | |
<filename>devstack/tools/nsxv3_cleanup.py
# Copyright 2015 VMware Inc
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | |
parse_source_value(self._raw_data.get('renderamt', 255))
@property
def rendercolor(self):
return parse_int_vector(self._raw_data.get('rendercolor', "255 255 255"))
@property
def rendermode(self):
return self._raw_data.get('rendermode', "5")
class func_reflective_glass(func_brush):
pass
class env_particle_... | |
+ str(status) )
# Remove unused
tempMat["data"] = tempMat["data"][0:idx.value]
tempMat["row"] = tempMat["row"][0:idx.value]
tempMat["col"] = tempMat["col"][0:idx.value]
return tempMat
def acquireSmallerMatrix( COOMat ):
"""
Make matrix smaller by removing zero rows
:param COOMat: The large sparse... | |
<filename>models/00_tables.py
# -*- coding: utf-8 -*-
"""
Global tables and re-usable fields
"""
# =============================================================================
# Import models
#
from s3.s3model import S3Model
import eden as models
current.models = models
current.s3db = s3db = S3Model()
# Explicit i... | |
# Copyright (c) 2013, 2018 National Technology and Engineering Solutions of Sandia, LLC.
# Under the terms of Contract DE-NA0003525 with National Technology and Engineering Solutions
# of Sandia, LLC, the U.S. Government retains certain rights in this software.
# standard library
import os
import hashlib
import pic... | |
<gh_stars>0
# Copyright (c) 2020. CSIRO Australia.
#
# 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, ... | |
This method
is called by System.Windows.Automation.Peers.AutomationPeer.GetAcceleratorKey.
Returns: The System.Windows.Automation.AutomationProperties.AcceleratorKey that is
returned by
System.Windows.Automation.AutomationProperties.GetAcceleratorKey(System.Windows.
DependencyObject).
"""
pass... | |
# -*- coding: utf-8 -*-
"""The DataSource class contains all needed information for importing, processing, and saving data.
@author: <NAME>
Created on Jul 31, 2020
"""
import itertools
import numpy as np
import pandas as pd
from . import utils
from .excel_writer import ExcelWriterHandler
from .functions import Ca... | |
<gh_stars>1-10
'''
Launches multiple simulations (simulation.py) in parallel. Each simulation is configured
using command line arguments. Configurations are generated based on factor matrices.
A factor matrix is specified by extending CommandBuilder and implementing all required methods.
Parameters:
[output file na... | |
<reponame>GuiMarion/DeepJazz
import os
import pickle
import numpy as np
from music21 import corpus, converter, stream, note, duration, interval, instrument
from music21.analysis.floatingKey import FloatingKeyException
from tqdm import tqdm
from .Chords import *
NUM_VOICES = 3
SUBDIVISION = 4 # quarter note subdivis... | |
1.1, 1.6 etc. To show powers of 10 plus
small digits between, use "D1" (all digits) or "D2"
(only 2 and 5). `tick0` is ignored for "D1" and "D2".
If the axis `type` is "date", then you must convert the
time to milliseconds. For example, to set the interval
between ticks to one day, set `dtick` to 86400000.0.
"dat... | |
noqa: E501
"""Get contacts in a list # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_contacts_from_list_with_http_info(list_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param int ... | |
import numpy as np
from .base import OdeSolver, DenseOutput
from .common import (validate_max_step, validate_tol, select_initial_step,
norm, warn_extraneous, validate_first_step)
from . import dop853_coefficients
# Multiply steps computed from asymptotic behaviour of errors by this.
SAFETY = 0.9
MIN_FACTOR = 0.2 # M... | |
= "Operating System :: Microsoft"
MSDOS = "Operating System :: Microsoft :: MS-DOS"
class Windows(object):
Windows = "Operating System :: Microsoft :: Windows"
Windows_10 = "Operating System :: Microsoft :: Windows :: Windows 10"
Windows_3_1_or_Earlier = "Operating System :: Microsoft :: Windows :: Windows 3.1... | |
= config.path_star + " --quantMode TranscriptomeSAM GeneCounts --runThreadN " + str(nproc) + " --genomeDir " + path_genome
command = command + " --readFilesIn " + fn + " --outFileNamePrefix " + path_base + folder + "/results_star/" + sample + "_" + gg
if len(star_params) > 0:
command = command + star_params
command... | |
<reponame>metodj/FGP-VAE
import argparse
import time
import pickle
import os
import json
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
import tensorflow_probability as tfp
from utils import make_checkpoint_folder, pandas_res_saver, plot_mnist, import_rotated_mnist, print_traina... | |
from warnings import warn
from collections import OrderedDict
from ..core.util import GuidTracker
from ..core import (
AtlasAttributeDef,
AtlasClassification,
AtlasEntity,
ClassificationTypeDef,
EntityTypeDef
)
from .lineagemixin import LineageMixIn
from . import util as reader_util
class ReaderConfiguration()... | |
# -*- coding: utf-8 -*-
import os
import sys
import tempfile
import unittest
import warnings
import xml.etree.ElementTree as ET
import pandas as pd
from mock import patch
from dwca.darwincore.utils import qualname as qn
from dwca.descriptors import ArchiveDescriptor, DataFileDescriptor
from dwca.exceptions import Ro... | |
<gh_stars>10-100
"""Help classes and functions related to geometry."""
import math
from typing import Iterable, List, Optional, Sequence, Union
import numpy as np
from scipy.spatial.transform import Rotation
from morfeus.data import ANGSTROM_TO_BOHR
from morfeus.typing import Array1D, Array2D, ArrayLike1D, ArrayLike... | |
does not have a commutative antiderivative, it cannot be
solved by linodesolve.
Returns
=======
Dict
Raises
======
NotImplementedError
When the coefficient matrix does not have a commutative antiderivative
See Also
========
linodesolve: Function for which linodesolve_type gets the info... | |
<reponame>alonhirsch/pyTenable
'''
networks
========
The following methods allow for interaction into the Tenable.io
:devportal:`networks <networks>` API endpoints.
Methods available on ``tio.networks``:
.. rst-class:: hide-signature
.. autoclass:: NetworksAPI
:members:
'''
from tenable.io.base import TIOEndpoint, ... | |
# coding=utf-8
# Author: <NAME>
# Date: Nov 16, 2014
#
# Description: Plot DDI Statistics
#
#
# coding=utf-8
from __future__ import division
import numpy as np
import pandas as pd
import scipy.stats
from scipy import stats
slice = pd.IndexSlice
pd.set_option('display.max_rows', 24)
pd.set_option('display.max_columns', ... | |
= descr[:-2] + ")"
return descr
def variance_bounds(self, resids: Float64Array, power: float = 2.0) -> Float64Array:
return super().variance_bounds(resids, self.power)
def _generate_name(self) -> str:
q, power = self.q, self.power
if power == 2.0:
if q == 0:
return "FIARCH"
else:
return "FIGARCH"
elif pow... | |
<filename>tests/unit/core/test_environment.py
# Copyright 2014 Rackspace
# 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
... | |
<filename>data/utils.py
import requests
import re
import logging
import pytz
from time import sleep
from bs4 import BeautifulSoup
from django.conf import settings
from collections import deque
from dateutil.parser import parse
from datetime import datetime, timedelta
from .models import (Terminal, Route, Ferry, Sailing... | |
* coupling_dict[id2.replace("E","P") + id3.replace("E","P")]
analytic_cov[i * n_bins:(i + 1) * n_bins, j * n_bins:(j + 1) * n_bins] = bin_mat(M, binning_file, lmax)
analytic_cov = np.triu(analytic_cov) + np.tril(analytic_cov.T, -1)
mbb_inv_ab = extract_TTTEEE_mbb(mbb_inv_ab)
mbb_inv_cd = extract_TTTEEE_mbb(mbb_i... | |
import numpy as nm
import string as st
import pylab as pl
from ThreadClasses import *
from Protein_properties_v3 import *
from AminoData import *
import copy as cp
import time
from ReadDate import *
def build_path_matrix_v3(row,col,Structure_rules):
'''
Build an empty mpath matrix
'''
tmp1 =[]
mp = []
base_leng... | |
<reponame>thanever/SOC
from numpy import array
def scigrid_2011_01_07_17():
ppc = {"version": '2'}
ppc["baseMVA"] = 100.0
ppc["bus"] = array([
[586, 3, 0, 0, 0, 0, 0, 1.0, 0, 220.0, 0, 1.1, 0.9 ],
[589, 2, 0, 0, 0, 0, 0, 1.0, 0, 380.0, 0, 1.1, 0.9 ],
[590, 2, 0, 0, 0, 0, 0, 1.0... | |
<gh_stars>0
#
# Copyright 2018 Analytics Zoo 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 or a... | |
memory_mi_b(self) -> Optional[pulumi.Input['EC2FleetMemoryMiBRequestArgs']]:
return pulumi.get(self, "memory_mi_b")
@memory_mi_b.setter
def memory_mi_b(self, value: Optional[pulumi.Input['EC2FleetMemoryMiBRequestArgs']]):
pulumi.set(self, "memory_mi_b", value)
@property
@pulumi.getter(name="networkInterfaceCoun... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2021 <NAME>, zju-ufhb
# This module is part of the WATex core package, which is released under a
# MIT- licence.
"""
.. Synopsis: Module features collects geo-electricals features computed from
:class:`watex.core.erp.ERP` and :class:`watex.core.ves.VES` and keeps
on a new d... | |
should be a list of
[frequency, S11, S12, S13,S14,S21, S22,S23,S24,S31,S32,S33,S34,S41,S42,S43,S44], etc are complex numbers
Designed to use S2P.sparameter_complex and SNP.sparameter_complex"""
# first create 4 separate matrix lists for 16 term correction
s1_matrix_list=[]
s2_matrix_list=[]
s3_matrix_list=[]
s4... | |
# -*- encoding: utf-8 -*-
"""
Views: Encontramos todas las vistas del sistema de establecimientos.
@author <NAME>
@contact <EMAIL>
<EMAIL>
@camilortte on Twitter
@copyright Copyright 2014-2015, RecomendadorUD
@license GPL
@date 2014-10-10
@satus Pre-Alpha
@version= 0..215
"""
import datetime
import js... | |
"""General Kalman filter
Description:
------------
Kalman filter and the modified Bryson-Frazier smoother is covered in the book "Factorization Methods for Discrete
Sequential Estimation" by Bierman :cite:`bierman2006`. However, there are some typos but a corrected version of the
algorithm is listed in :cite:`gibbs20... | |
term length back to saved values
self.__send('term length {0}\n'.format(self.term_len))
self.__wait_for_string(self.prompt)
if self.term_width:
# Set term width back to saved values
self.__send('term width {0}\n'.format(self.term_width))
self.__wait_for_string(self.prompt)
elif self.os == "ASA":
self.screen.Se... | |
"""
Lagrangian Multiphase Plume
===========================
This module contains the numerical solution for the `bent_plume_model` module.
Some of the general tools for handling the multiphase components are
contained in `dispersed_phases`.
"""
# <NAME>, November 2014, Texas A&M University <<EMAIL>>.
from __future__ ... | |
<filename>osmchadjango/supervise/tests/test_views.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import xml.etree.ElementTree as ET
from django.urls import reverse
from django.contrib.gis.geos import MultiPolygon, Polygon, Point, LineString
from rest_framework.test import APITestCase
from social_d... | |
'''
Created on Jun 9, 2014
@author: dbhage
English Celex Test Class
'''
import unittest
from celex.phonology.english_celex import EnglishCelex
from test import TEST_CELEX_PATH
class EnglishCelexTest(unittest.TestCase):
def setUp(self):
'''
Set values for tests.
'''
self.expected_prefix = 'e'
self.expected... | |
<reponame>Razmo99/SimproAPI<filename>SimproAPI/Trackables.py
import logging
from .Sessions import Sessions
import json
import requests
import itertools
import concurrent.futures
logger = logging.getLogger(__name__)
logger.debug('Importing Module : '+__name__)
class Trackables(object):
"""Class containing methods to ... | |
<reponame>mehrdad-shokri/mne-python<filename>tutorials/source-modeling/plot_background_freesurfer_mne.py<gh_stars>1-10
"""
.. _tut-freesurfer-mne:
=================================
How MNE uses FreeSurfer's outputs
=================================
This tutorial explains how MRI coordinate frames are handled in MNE-P... | |
"""Generate coil geometries.
This module provides functions to generate various coil geometries
that can be used in conjuction with the eppy module to calculate eddy
currents in flat plates.
"""
import numpy as np
import numpy.typing as npt
# ----------------------------------------------------------------------
#... | |
self.__set_parameters_0_with_http_info(bt_locator, **kwargs) # noqa: E501
return data
def set_templates(self, bt_locator, **kwargs): # noqa: E501
"""set_templates # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = a... | |
<reponame>mercuree/BoilerPy<filename>boilerpy/filters.py
#!/usr/bin/env python
""" generated source for module MarkEverythingContentFilter """
#
# * boilerpipe
# *
# * Copyright (c) 2009 <NAME>
# *
# * The author licenses this file to You under the Apache License, Version 2.0
# * (the "License"); you may not use this ... | |
import itertools
import json
import sys
import time
import traceback
import urllib
import hypixel
import asyncio
from discord.ext import commands
from utils.config import Config
from utils.logger import log
from utils import checks
from utils.tools import *
config = Config()
key = [config._hypixelKey] #no push perm... | |
and
associated name servers
show cache : show cache status
add acl : add acl entry
clear acl <id> : clear the content of this acl
del acl : delete acl entry
get acl : report the patterns matching a sample for an ACL
show acl [id] : report available acls or dump an acl's contents
add map : add map entry
clear m... | |
]
if ( socket . ntohs ( oOo00Oo0o00oo ) == LISP_AFI_NAME ) :
packet = packet [ OO00OO : : ]
packet , self . hostname = lisp_decode_dist_name ( packet )
if 13 - 13: i11iIiiIii * O0 . OoooooooOO % I1Ii111 + I1ii11iIi11i + OOooOOo
if 45 - 45: oO0o % i11iIiiIii / Ii1I / IiII % Ii1I - Ii1I
return ( iIiiII11 )
if 73 -... | |
<reponame>linwukang/hue
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (th... | |
#
# Copyright (c) 2021 The GPflux Contributors.
#
# 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 ... | |
<reponame>EiffL/powerbox-jax
"""
A set of tools for dealing with structured boxes, such as those output by :mod:`powerbox`. Tools include those
for averaging a field angularly, and generating the isotropic power spectrum.
"""
from . import dft
import jax
import jax.numpy as np
import warnings
def _getbins(bins, coo... | |
from py_db import db
from decimal import Decimal
import NSBL_helpers as helper
from datetime import datetime
from time import time
import numpy as np
import argparse
import math
from scipy.stats import norm as NormDist, binom as BinomDist
# script that produces in-playoffs probability charts
db = db('NSBL')
def p... | |
noted below.
Attributes:
success_message (str): Message to display on successful deletion.
success_url (str): URL to redirect to on successful deletion.
"""
model = models.PlanList
permission_required = 'subscriptions.subscriptions'
raise_exception = True
context_object_name = 'plan_list'
pk_url_kwarg = 'plan... | |
import argparse
import cv2
import numpy as np
import os
import sys
import time
import torch.backends.cudnn
import torch.nn as nn
import torch.nn.parallel
from plyfile import PlyData, PlyElement
from typing import Tuple
from torch.utils.data import DataLoader
from datasets.data_io import read_cam_file, read_image, read... | |
useful as a sanity check in algorithms that make
extensive use of linkage and distance matrices that must
correspond to the same set of original observations.
Parameters
----------
Z : array_like
The linkage matrix to check for correspondence.
Y : array_like
The condensed distance matrix to check for correspon... | |
1
elif self.beforeRadioChecked == self.lineRadio2:
lineType = '-'
lineColor = 'deepskyblue'
self.list_points_type.append('White')
self.plotDraggableLine(lineType, lineColor)
select = 2
elif self.beforeRadioChecked == self.lineRadio3:
lineType = '--'
lineColor = 'deepskyblue'
self.list_points_type.append('Whit... | |
hf_net_kwargs['feedthrough'] = feedthrough
self.hf_net_kwargs = hf_net_kwargs
self.feedthrough = feedthrough
def init_nets(self, nu, ny): # a bit weird
na_right = self.na_right if hasattr(self,'na_right') else 0
nb_right = self.nb_right if hasattr(self,'nb_right') else 0
self.encoder = self.e_net(nb=self.nb+nb_... | |
4590, 4591, 4597, 4596)
model.createElement(2800, 4831, 4832, 4838, 4837, 4591, 4592, 4598, 4597)
model.createElement(2801, 4832, 4833, 4839, 4838, 4592, 4593, 4599, 4598)
model.createElement(2802, 4833, 4834, 4840, 4839, 4593, 4594, 4600, 4599)
model.createElement(2803, 4834, 2949, 2950, 4840, 4594, 2909, 2910, 4600)
... | |
# Copyright 2017 The TensorFlow 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 ... | |
prototype(IWbemClassObject_GetMethodQualifierSet_Idx,
'GetMethodQualifierSet',
paramflags)
_GetMethodQualifierSet.errcheck = winapi.RAISE_NON_ZERO_ERR
return_obj = _GetMethodQualifierSet(self.this,
method
)
try:
return_obj = IWbemQualifierSet(return_obj)
except WindowsError:
return_obj = None
return return_o... | |
option to Write product to L2 resolution has been DISABLE !!!")
LOGGER.info(
"**************************************************************************************************")
# ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ... | |
<reponame>wingify/vwo-python-sdk
# Copyright 2019-2021 Wingify Software Pvt. Ltd.
#
# 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 req... | |
<gh_stars>10-100
# Copyright (c) 2020, NVIDIA CORPORATION. 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 requi... | |
numpy.min(self.image)
zmax = numpy.max(self.image)
general_utilities.put_value(zmin, self.minField)
general_utilities.put_value(zmax, self.maxField)
zmin1, zmax1 = self.get_limits(self.image)
general_utilities.put_value(zmin1, self.zsminField)
general_utilities.put_value(zmax1, self.zsmaxField)
self.displayImage... | |
Orientation.Quaternion2OrientationMatrix(q)
o = Orientation(g)
return o
@staticmethod
def Zrot2OrientationMatrix(x1=None, x2=None, x3=None):
"""Compute the orientation matrix from the rotated coordinates given
in the .inp file for Zebulon's computations.
The function needs two of the three base vectors, the th... | |
<reponame>kkiningh/cs448h-project
from __future__ import print_function
from __future__ import division
import sys
import numpy as np
import matplotlib.pyplot as plt
import cvxpy as cvx
import hypergraph
import hypergraph.core
from hypergraph.core import Graph, Edge
from hypergraph.convert.nx import networkx_export... | |
<filename>src/business/models.py
from django.conf import settings
from fractions import Fraction
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth import get_user_model
from django.contrib.auth import models as auth_mode... | |
+ 0.5*m.b371*m.b515 + 0.5*m.b371*m.b554 + m.b371*m.b555 + 0.5*m.b371*
m.b558 + 0.5*m.b371*m.b582 + 0.5*m.b371*m.b587 + 0.5*m.b371*m.b603 + 0.5*m.b371*m.b608 + 0.5*
m.b371*m.b614 + 0.5*m.b371*m.b619 + 0.5*m.b371*m.b628 + 0.5*m.b371*m.b632 + 0.5*m.b371*m.b633 +
0.5*m.b371*m.b638 + 0.5*m.b371*m.b639 + 0.5*m.b371*m.b64... | |
import warnings
import numpy as np
from einsteinpy.integrators import GeodesicIntegrator
from .utils import _P, _kerr, _kerrnewman, _sch
class Geodesic:
"""
Base Class for defining Geodesics
Working in Geometrized Units (M-Units),
with :math:`c = G = M = k_e = 1`
"""
def __init__(
self,
metric,
metric_p... | |
"""
Copyright (C) 2020 by the Georgia Tech Research Institute (GTRI)
This software may be modified and distributed under the terms of
the BSD 3-Clause license. See the LICENSE file for details.
"""
import json
import tempfile
import unittest
import uuid
from pathlib import Path
import pandas as pd
from model_proces... | |
<gh_stars>0
import rdflib # FIXME decouple
import ontquery as oq
from hyputils.hypothesis import idFromShareLink, shareLinkFromId
from pyontutils.sheets import update_sheet_values, get_note, Sheet
from pyontutils.scigraph import Vocabulary
from pyontutils.namespaces import ilxtr, TEMP, definition
from pyontutils.closed... | |
sf = self.df
m = tc.recommender.factorization_recommender.create(sf,
self.user_id,
self.item_id,
target='rating',
verbose=False)
'''
TODO:
Test CoreML export, when we have a dirarchiver that doesn't
depend on the filesystem
if m.target:
self._test_coreml_export(m, ['135085','135038'], [0,1])
else:
self._te... | |
<filename>server.py
import os
from flask import Flask, flash, session, request, send_file, render_template, redirect, url_for, jsonify
from flask_socketio import SocketIO, send, join_room, leave_room, emit
from flask_cors import cross_origin
from datetime import datetime
from db import DBConn, SQL
from pathlib import P... | |
<gh_stars>10-100
# MIT License
# Copyright (c) 2022 Muhammed
# 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, mod... | |
# Copyright 2004-2010 <NAME>.
# See license.txt for terms.
"""
x86inst.py
----------
This contains the core functionality to handle x86 instructions. We need to
build definition tables, so that instructions can be converted to/from
mneumonics durring assembly/disassembly phases.
At some point we'll need to deal with... | |
of code written under
DendroPy 3.x. It will be removed in future versions. All new code should
be written using |TaxonNamespace|. Old code needs to be updated to use
|TaxonNamespace|.
"""
def __init__(self, *args, **kwargs):
deprecate.dendropy_deprecation_warning(
message="Deprecated since DendroPy 4: 'TaxonSet... | |
return jsonify_request(HttpResponseBadRequest("Error"))
try:
position = int(position)
except (TypeError, ValueError):
position = 0
try:
site = Site.objects.get(id=int(site_id))
except (TypeError, ValueError, MultipleObjectsReturned,
ObjectDoesNotExist):
site = get_current_site(request)
if target is None:
#... | |
filter_types=False, needs_verb=False):
deps = self.find_deps(index, dir="parents", filter_types=filter_types)
if needs_verb:
deps = [d for d in deps if self.gov_is_verb(d) or self.dep_is_verb(d)]
return [d["governor"] for d in deps]
def find_children(self, index, filter_types=False, exclude_types=False, needs_v... | |
import pygame
import math
import random
from pygame.locals import *
def main():
"""Main game execution
"""
game_init() # initializing game
load_resources() # loading game resources
game_loop() # looping through game
def game_init():
"""Initializing game
"""
# initializing global variables
global screen, widt... | |
_internals.ERROR_CONNECT_FAILED
ERROR_ILLEGAL_STATE = _internals.ERROR_ILLEGAL_STATE
ERROR_CODEC_FAILURE = _internals.ERROR_CODEC_FAILURE
ERROR_INDEX_OUT_OF_RANGE = _internals.ERROR_INDEX_OUT_OF_RANGE
ERROR_INVALID_CONVERSION = _internals.ERROR_INVALID_CONVERSION
ERROR_ITEM_NOT_FOUND = _internals.ERROR_ITEM_NOT_FOUND
E... | |
import Storage
import BplusTree
import tkinter
from tkinter import *
from tkinter import messagebox
from tkinter import filedialog
from tkinter.filedialog import askopenfile
import os
def show_data_bases():
data_bases = Storage.showDatabases()
database_tree = Storage.serializable.Read('./Data/', 'Databases')
databa... | |
<filename>Parsing/ParseBCSL.py<gh_stars>1-10
import collections
import json
from numpy import inf
import numpy as np
from copy import deepcopy
from lark import Lark, Transformer, Tree, Token
from lark import UnexpectedCharacters, UnexpectedToken
from lark.load_grammar import _TERMINAL_NAMES
import regex
from sortedcont... | |
curr_value / network_weight[layer][scale][1]
curr_result.pop()
#print('end0-0')
curr_value = curr_value * network_weight[layer][scale][2]
curr_result.append([scale, 1])
_parse(network_weight, layer+1, curr_value, curr_result, last=1)
curr_value = curr_value / network_weight[layer][scale][2]
curr_result.po... | |
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be d... | |
import sys
import matplotlib
matplotlib.use("Agg")
from pylab import *
ioff()
base = '../'
sys.path.append(base+"utils/Continuum/")
sys.path.append(base+"utils/Correlation/")
sys.path.append(base+"utils/GLOBALutils/")
sys.path.append(base+"utils/OptExtract/")
baryc_dir= base+'utils/SSEphem/'
sys.path.append(baryc_d... | |
be in [msc, nx, radioss, optistruct]")
def saves(self):
"""Saves a pickled string"""
return dumps(self)
def __getstate__(self):
"""clears out a few variables in order to pickle the object"""
# Copy the object's state from self.__dict__ which contains
# all our instance attributes. Always use the dict.copy()
#... | |
params[name] = []
params[name].append((token.section_number, token))
for name, parts in params.items():
parts = sorted(parts, key=itemgetter(0))
first_param = parts[0][1]
charset = first_param.charset
if not first_param.extended and len(parts) > 1:
if parts[1][0] == 0:
parts[1][1].defects.append(errors.InvalidH... | |
🤍.jpg', params='', query='abc=def&možnost=Příliš žluťoučký kůň&další možnost=🤍', fragment='Příliš\r\n\x01\x00 žluťoučký\uffff kůň 🤍') # noqa
),
(
'https://user@pass:www.example.org:8443/Příliš žluťoučký/kůň 🤍.jpg?test=test\x00abc&speciální=abc\uffff\u2028\r\n\t \u202f\x01test',
ParseResult(scheme='https', netlo... | |
_ = call.mock_calls[0]
assert args[0] == cloud_sql.SqlInstancesTruncateLogRequest()
# Establish that the response is the type that we expect.
assert isinstance(response, cloud_sql_resources.Operation)
assert response.kind == 'kind_value'
assert response.target_link == 'target_link_value'
assert response.status =... | |
<filename>speechdetector/speech_detect.py
import os
import re
from collections import defaultdict
import numpy as np
#from numpy import mean, std, array, min, max, inf,sqrt, exp, pi
import numpy as np
import pylab as P
from acousticsim.representations.mfcc import Mfcc
from acousticsim.representations.amplitude_enve... | |
<gh_stars>1-10
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GObject, GLib, Gdk
import dataConnection, Installer, installThread
from Functions import functions, systemTools
import os
tr = functions.tr
class userWindow(Gtk.Window):
"""Graphical User Interface. Use GTK3 and glade."""
dataC... | |
'':
self.addExdata(self._buf, False)
self._bufSize = int(size) << 20
self._buf = ''
return self
def closeBuffer(self):
return self.openBuffer(0)
def beginRebuild(self):
self.execCommand({'cmd': CMD_INDEX_REBUILD, 'arg1': 0}, CMD_OK_DB_REBUILD)
self._rebuild = True
return self
def endRebui... | |
x4 * x4) / 36.0) / (L * L)
tmpVar2 = (x3 / (2 * L)) * np.sqrt(E / (4 * G))
PC = tmpVar * (1 - tmpVar2)
g[0] = tauMax - tau
g[1] = sigmaMax - sigma
g[2] = x4 - x1
g[3] = PC - P
g = np.where(g < 0, -g, 0)
return f, g
class CRE23():
def __init__(self):
self.problem_name = 'CRE23'
self.n_objectives = 2
sel... | |
# 'Linear'
if data[0] is None and data[1] is None:
dx = self.draw_app.x
dy = self.draw_app.y
else:
dx = data[0]
dy = data[1]
geo_list = []
geo = None
self.points = [dx, dy]
for item in range(self.drill_array_size):
if self.drill_axis == 'X':
geo = self.util_shape(((dx + (self.drill_pitch * item)), dy))
i... | |
<reponame>clohr/model-service
import csv
import datetime
import io
import json
import os
from collections import OrderedDict
from dataclasses import dataclass
from typing import Any, Dict, List
from uuid import UUID
import boto3
import pytest
from moto import mock_s3
from publish.config import PublishConfig
from publ... | |
U = t*X' - X
To get the system:
.. math:: U' = t*(A(t)*U + b(t))
Where $U$ is the vector of dependent variables, $X$ is the vector of dependent
variables in `funcs` and $X'$ is the first order derivative of $X$ with respect to
$t$. It may or may not reduce the system into linear first order system of ODEs... | |
= False
return ret
##
# \brief Gets the current FPGA state.
#
# \copydetails CyberRadioDriver::IRadio::getFpgaState()
def getFpgaState(self):
ret = None
if self.fpgaStateCmd is not None:
ret = self.getConfigurationByKeys("fpgaState")
return ret
##
# \brief Sets the current FPGA state.
#
# \copydetails C... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.