input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<filename>yfantasy_api/api/league.py
from yfantasy_api.api.terminal import TerminalApi
from yfantasy_api.models import League
class LeagueApi:
"""League Resource API: An api used for querying league resources
Attributes
----------
__yfantasy_api: YahooFantasyApi
The api class responsible for checking the tokens... | |
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 13 20:45:47 2017
@author: Rachit & Nitesh
"""
import json
class tweetsSenti:
def __init__(self, **kwargs):
return super().__init__(**kwargs)
def searchTweets(self, q, ct):
import numpy as np
import pandas as pd
import re
from twitter import Twitter, OAuth, Twitt... | |
reviewchangesets_values)
cursor.executemany("""INSERT INTO reviewfiles (review, changeset, file, deleted, inserted)
SELECT reviewchangesets.review, reviewchangesets.changeset, fileversions.file, COALESCE(SUM(chunks.deleteCount), 0), COALESCE(SUM(chunks.insertCount), 0)
FROM reviewchangesets
JOIN fileversions USING ... | |
# ATTENTION! File managed by Puppet. Changes will be overwritten.
from __future__ import print_function
import ConfigParser
import StringIO
import inspect
import itertools
import os
import re
import shlex
import shutil
import subprocess
import threading
import urllib
import saf
from saf.exceptions import *
from sa... | |
Iterate over datasets
datasets = select_metadata(datasets, var_type=var_type)
if var_type == 'feature':
groups = self.group_attributes
else:
groups = [None]
for group_attr in groups:
group_datasets = select_metadata(datasets,
group_attribute=group_attr)
if group_attr is not None:
logger.info("Loading '%s' dat... | |
node 4
mastercoord.MasterCoord(0.0, 0.5, 0.5), # node 5
mastercoord.MasterCoord(0.0, 0.0, 0.5), # node 6
mastercoord.MasterCoord(0.5, 0.0, 0.0), # node 7
mastercoord.MasterCoord(0.5, 0.5, 0.0), # node 8
mastercoord.MasterCoord(0.5, 0.0, 0.5), # node 9
mastercoord.MasterCoord(0.25, 0.25, 0.25),
mastercoord.Master... | |
id_or_person):
s = id_or_person
if type(id_or_person) is not str:
s = id_or_person.id
return s in self.people and self.people[s].death is None
def get_person (self, id1):
economy = self
if id1 in economy.people:
return economy.people[id1]
elif id1 in economy.tombs:
return economy.tombs[id1].person... | |
<gh_stars>0
'''The SimpleSystemBase is not a true concurrency environment, but it
runs in the context of the current thread and simply queues actor
sends to call each actor's handler in sequence. This sytem can be
used for simple actor environments where no parallelism is achieved,
but any actor doing long-running ... | |
import logging
import re
import socket
import threading
import time
from collections import deque
import six
from requests import ConnectionError
from requests.exceptions import ChunkedEncodingError
from ..errors import Etcd3WatchCanceled
from ..models import EventEventType
from ..utils import check_param
from ..util... | |
"""
Platformer Game
python -m arcade.examples.platform_tutorial.11_animate_character
"""
import math
import os
import arcade
# Constants
SCREEN_WIDTH = 1000
SCREEN_HEIGHT = 650
SCREEN_TITLE = "Platformer"
# Constants used to scale our sprites from their original size
TILE_SCALING = 0.5
CHARACTER_SCALING = TILE_SCAL... | |
local access restriction type.
Returns:
dict: The JSON structure.
'''
for note in record_json['notes']:
if note['persistent_id'] == csv_row['persistent_id']:
if 'rights_restriction' in note:
note['rights_restriction']['local_access_restriction_type'].append(csv_row['local_type'])
else:
note['rights_restrictio... | |
'Weather Service trying to use location-based property when street_or_region_id is None')
self._weather_info[self._street_or_region_id]._next_weather_event_time = value
@property
def _forecast_time(self):
logger.assert_raise(self._street_or_region_id is not None, 'Weather Service trying to use location-based prope... | |
<reponame>SugaanthMohan/Database_Hacks<gh_stars>1-10
#! /usr/bin/python3.5
'''
Process : COMPARE SIMILAR TABLES IN DATABASES
Author : <NAME>
Created : Oct 19 2018
Last Modified Date : -
Version Control:
_______________
pandas == 0.23.0
smtplib == Default Package : Python 2.7.12
sys == Default Package : Python 2.7... | |
#!/usr/bin/python2.7
"""
Copyright (C) 2014 Reinventing Geospatial, Inc.
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, either version 3 of the License, or
(at your option) any later version.
This ... | |
"""High-level sound and video player."""
from __future__ import print_function
from __future__ import division
from builtins import object
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 <NAME>
# All rights reserved.
#
# Redistribution and use in source ... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# pylint: disable=method-hidden,C0103,E265,E303,R0914,W0621,W503
"""Module describing the weighted non-linear optimization scheme used to
determine the wavelength sensitivity of the spectrometer using a polynomial
as a model function"""
import os
import sys
import math
i... | |
""" Contains basic Batch classes """
import os
import traceback
import threading
import dill
try:
import blosc
except ImportError:
pass
import numpy as np
try:
import pandas as pd
except ImportError:
pass
try:
import feather
except ImportError:
pass
try:
import dask.dataframe as dd
except ImportError:
pass
f... | |
#!/usr/bin/env python
from __future__ import division, absolute_import, print_function
import numpy as np
from jams.const import eps
def zacharias(h, clay, sand, db, params=None, thetar=False, thetas=False, lnalpha=False, n=False):
"""
Soil water content with the van Genuchten equation and
the pedotransfer function... | |
<gh_stars>0
# import cupy as cp
# import argparse
# import os
# import random
# import shutil
import time
from pprint import pprint
# import warnings
# import sys
# import logging
# import matplotlib
import logging
# from pprint import pprint
# from pprint import pformat
from config import opt
from dataset import Train... | |
<gh_stars>10-100
# -*- coding: utf-8 -*-
# pragma pylint: disable=unused-argument, no-self-use
# (c) Copyright IBM Corp. 2010, 2019. All Rights Reserved.
"""Polling implementation"""
import calendar
import logging
import os
import time
from datetime import datetime
from threading import Thread
import jinja2
from res... | |
import numpy as np
from spherical_geometry import sphere_distance
from qc import sunangle, dayinyear
import copy
import Extended_IMMA as ex
import math
"""
The trackqc module contains a set of functions for performing the tracking QC
first described in Atkinson et al. [2013]. The general procedures described
in Atkin... | |
<reponame>acrellin/cesium
import numpy as np
import scipy.stats as stats
from ._lomb_scargle import lomb_scargle
def lomb_scargle_model(time, signal, error, sys_err=0.05, nharm=8, nfreq=3, tone_control=5.0):
"""Simultaneous fit of a sum of sinusoids by weighted least squares:
y(t) = Sum_k Ck*t^k + Sum_i Sum_j A_ij ... | |
<filename>tests/test_tests.py
import json
import os
import time
import unittest
from mock import (
MagicMock,
Mock,
)
class TestGetTree(unittest.TestCase):
"""Tests for the get_tree function
"""
def test_nonascii_attribute(self):
from smoketest.tests import get_tree
response = Mock()
response.text = u"""
<... | |
'remote_system_name': neighbor[3],
'remote_port': neighbor[1],
'remote_port_description': neighbor[2],
'remote_system_description': neighbor[4],
'remote_system_capab': neighbor[5],
'remote_system_enable_capab': neighbor[5]
}
lldp_neighbors[local_iface].append(neighbor_dict)
return lldp_neighbors
def __get_nt... | |
Note
---------
The results are stored in a DataFrame for each subspace/singleton
under the "FAS" column of the main DataFrame
"""
if useSubSpaces:
self._updateOffsets() # make sure offset times are up to date
for sta in self.subspaces.keys():
# check if FAS already calculated, only recalc if recalc
fas1 = self... | |
41.469, 29.027,
VERTEX, 10.225, 41.425, 29.178,
VERTEX, 10.348, 41.381, 29.330,
VERTEX, 10.470, 41.336, 29.482,
VERTEX, 10.593, 41.291, 29.633,
VERTEX, 10.716, 41.244, 29.784,
VERTEX, 10.817, 41.205, 29.908,
END,
BEGIN, LINE_LOOP,
VERTEX, 11.182, 40.607, 29.803,
VERTEX, 11.213, 40.498, 29.948,
VERTEX, 11.243, 40.388, 3... | |
dict_len,
frag_min,
frag_max,
folder,
offset_threshold,
off_correction_threshold,
three_prime,
get_coverage_stats=True,
advanced=True,
conserve_frame=True,
bootstrap=False,
cov_range=(1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 30, 35, ... | |
<reponame>glcLucky/dccapp<filename>dccapp/src/utils/graph_utils.py<gh_stars>0
import numpy as np
import pandas as pd
import networkx as nx
import matplotlib.pyplot as plt
from operator import itemgetter
class mgcgraph(object):
"""plot graph given a networkx graph type"""
def __init__(self, graph_input,... | |
of yesterday
edt = dtm - datetime.timedelta(seconds=1)
# Subtract one day to obtain the beginning of yesterday
bdt = dtm - datetime.timedelta(days=1)
# Attempt to count the user posts
pcount = CountUserPostsBetween(userid, bdt, edt)
# Now generate the reply message
reply = '{:d} posts made between ({:s}) and ({:... | |
<reponame>gh20s/lear<filename>legal-api/tests/unit/services/filings/validations/test_incorporation_application.py
# Copyright © 2019 Province of British Columbia
#
# 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... | |
from copy import deepcopy
from geochem_dataset.excel import Dataset
from geochem_dataset.excel.dataclasses import Survey, Sample, Result
from geochem_dataset.excel.exceptions import (
IntegrityError,
)
import numpy as np
import pandas as pd
import pytest
from helpers.utils import xlref, xlrowref, xlcolref
"""
|--... | |
zSize[0] * zSize[1] * zSize[2];
groups = %(grp)s;
fdimension = dimension + (groups != 1);
// Create conv gradInput primitive
CHECK_ERR( dnnGroupsConvolutionCreateBackwardData_%(precision)s(&pConvolutionBwdData, NULL,
dnnAlgorithmConvolutionDirect, groups, dimension, imageSize,
zSize, weightSize, convStride, con... | |
svm.getMaxIter()
100
>>> svm.setMaxIter(5)
LinearSVC...
>>> svm.getMaxIter()
5
>>> svm.getRegParam()
0.0
>>> svm.setRegParam(0.01)
LinearSVC...
>>> svm.getRegParam()
0.01
>>> model = svm.fit(df)
>>> model.setPredictionCol("newPrediction")
LinearSVCModel...
>>> model.getPredictionCol()
'newPrediction'
>... | |
<reponame>shaurz/ome<filename>ome/ome_ast.py<gh_stars>1-10
# ome - Object Message Expressions
# Copyright (c) 2015-2016 <NAME> <<EMAIL>>
from .constants import *
from .emit import MethodCodeBuilder
from .error import OmeError
from .instructions import *
from .sexpr import format_sexpr
from .symbol import is_private_sy... | |
'-':
tzoff *= -1
tz = GeneratedsSuper._FixedOffsetTZ(
tzoff, results.group(0))
input_data = input_data[:-6]
time_parts = input_data.split('.')
if len(time_parts) > 1:
micro_seconds = int(float('0.' + time_parts[1]) * 1000000)
input_data = '%s.%s' % (
time_parts[0], "{}".format(micro_seconds).rjust(6, "0"), )
... | |
a list of parameters after splitting <line> at space boundaries."""
return shlex.split(line) # Use shlex so that quoted substrings are preserved intact
def display_single_line(self, object_type):
"""
Query for objects named object_type, and display the most recent one on a single, refreshed line.
The query is re... | |
"""
Procurement Model
Copyright: 2009-2021 (c) Sahana Software Foundation
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... | |
#!/usr/bin/env python
# Rock-Paper-Scissors runner for http://www.rpscontest.com/
# Copyright (c) 2011 <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, includin... | |
<filename>midgard/parsers/_parser_sinex.py
"""Basic functionality for parsing Sinex datafiles
Description:
------------
This module contains functions and classes for parsing Sinex datafiles.
References:
-----------
* SINEX Format: https://www.iers.org/IERS/EN/Organization/AnalysisCoordinator/SinexFormat/sinex.htm... | |
<reponame>JamesATrevino/cassandra-dtest<filename>upgrade_tests/paging_test.py
import itertools
import time
import uuid
import pytest
import logging
from cassandra import ConsistencyLevel as CL
from cassandra import InvalidRequest
from cassandra.query import SimpleStatement, dict_factory, named_tuple_factory
from ccmli... | |
to WebSocket
await self.send(text_data=json.dumps({"message": message}))
# Receive message from room group
async def requested_message(self, event):
message = event["message"]
# print(f'data_message: {json.dumps(message)}')
# Send message to WebSocket
await self.send(text_data=json.dumps({"message": message}))
... | |
# Copyright 2009-2010 by <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 applicable law or agreed to in writing, s... | |
acceptable types for their
corresponding properties or a TypeError is raised.
If the value of the key property is set, it must not collide with
other key strings or a ValueError is raised.
If the value of a Link or Multilink property contains an invalid
node id, a ValueError is raised.
"""
raise NotImplemented... | |
import time, sys, collections, os
from textwrap import dedent
import psycopg2
# NOTE: instead of using the python csv writer, this directly writes tables to
# file in the pyomo .tab format. This uses tabs between columns and the standard
# line break for the system it is run on. This does the following translations (... | |
import arviz as az
import warnings
from importlib import reload
from typing import List, Any
from copy import copy
import altair as alt
import numpy as np
import pandas as pd
import xarray as xr
from bayes_window import models, BayesWindow
from bayes_window import utils
from bayes_window import visualization
from bay... | |
#!/usr/bin/env python
#SETMODE 777
#----------------------------------------------------------------------------------------#
#------------------------------------------------------------------------------ HEADER --#
"""
:author:
<NAME> & <NAME>
:synopsis:
runs step three of the auto rigger, creating the rig
:des... | |
from __future__ import division
from __future__ import print_function
__copyright__='''
Copyright (c) 2010 Red Hat, Inc.
'''
# All rights reserved.
#
# Author: <NAME> <<EMAIL>>
#
# This software licensed under BSD license, the text of which follows:
#
# Redistribution and use in source and binary forms, with or witho... | |
'xs', 10020)
>>> h2.merge(h2_2)
MAT MF MT
128 1 451 1.002000+3 1.995712+0 0 0 ...
2 151 1.002000+3 1.995712+0 0 0 ...
3 1 1.002000+3 1.995712+0 0 0 ...
2 1.002000+3 1.995712+0 0 0 ...
3 1.002000+3 1.995712+0 0 0 ...
16 1.002000+3 1.995712+0 0 0 ...
102 1.002000+3 1.995712+0 0 0 ...
4 2 1.002000+3 1.995712+0 0... | |
import os
import io
import struct
import bmesh
import bpy
import math
import mathutils
from mathutils import Matrix, Vector, Color
from bpy_extras import io_utils, node_shader_utils
import bmesh
from bpy_extras.wm_utils.progress_report import (
ProgressReport,
ProgressReportSubstep,
)
def name_compat(name):
if name... | |
+ ' '
def p_otros_from(t):
'otros_froms : otros_froms COMA otro_from'
t[1].append(t[2])
t[1].append(t[3])
t[0] = t[1]
def p_otros_from2(t):
'otros_froms : otro_from'
t[0] = [t[1]]
def p_opcion_select_tm(t):
'opcion_select_tm : opcion_select_lista FROM opciones_from opcion_from'
# ES UNA LISTA t[3]
cadena = ... | |
import inspect, traceback
import json
import sys
from contextlib import contextmanager
from time import perf_counter
from typing import Optional, Callable
from ._backend import Backend, BACKENDS, _DEFAULT
from ._dtype import DType
class BackendCall:
def __init__(self, start: float, stop: float, backend: 'Profiling... | |
<filename>d3pm/text/losses.py
# coding=utf-8
# Copyright 2022 The Google Research 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
#
# U... | |
import hashlib
import json
import logging
import urllib.parse
from collections import OrderedDict
import requests
from django import forms
from django.conf import settings
from django.contrib import messages
from django.core import signing
from django.http import HttpRequest
from django.template.loader import get_temp... | |
<gh_stars>1-10
from __future__ import annotations
import logging
import os
import uuid
from types import TracebackType
from typing import cast, Optional, Literal, Type, Tuple, Set
import aiohttp
import azure.core
import azure.core.exceptions
import azure.identity
import azure.identity.aio
from azure.core.credentials ... | |
<filename>optimal/tests/test_optimize.py
###############################################################################
# The MIT License (MIT)
#
# Copyright (c) 2014 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Soft... | |
from .testutils import FullStackTests, Recording, Collection, BaseAccess
from mock import patch
from itertools import count
from pywb.recorder.multifilewarcwriter import MultiFileWARCWriter
from webrecorder.models.usermanager import CLIUserManager
from webrecorder.rec.storage import get_storage
from webrecorder.mod... | |
#!/usr/bin/python2.4
#
# Copyright 2008 Google 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 agr... | |
in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class createUser_args:
"""
Attributes:
- handle
"""
thrift_spec ... | |
? 140 ALA A CB 1
ATOM 857 N N . GLN A 1 140 ? 38.584 -7.502 31.515 1.00 11.10 ? 141 GLN A N 1
ATOM 858 C CA . GLN A 1 140 ? 39.500 -7.524 32.666 1.00 11.23 ? 141 GLN A CA 1
ATOM 859 C C . GLN A 1 140 ? 40.311 -6.206 32.828 1.00 11.20 ? 141 GLN A C 1
ATOM 860 O O . GLN A 1 140 ? 40.782 -5.835 33.904 1.00 12.35 ? 141... | |
(1.0, -100, 'Simulation temperature for hydration free energies (atm)', 'Hydration free energy using molecular dynamics', 'hydration'),
"energy_rms_override" : (0.0, 0, 'If nonzero, override the Energy RMS used to normalize the energy part of the objective function term', 'Energy matching', 'abinitio'),
"force_rms_ov... | |
# -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'uiMainWindow.ui'
##
## Created by: Qt User Interface Compiler version 6.2.3
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
##############... | |
#!/usr/bin/env python
"""
Created on Mon Jun 15 21:49:32 2015
@author: <NAME>
"""
import sys, os, glob, textwrap, itertools
from optparse import OptionParser
from collections import defaultdict
from os.path import splitext
from pdbx.reader.PdbxReader import PdbxReader
from multiprocessing import Pool
DEBUG_MODE = F... | |
@hybrid_property
def work(self):
return self.entity1
@hybrid_property
def work_id(self):
return self.entity1_id
class LinkReleaseGroupReleaseGroup(Base):
__tablename__ = 'l_release_group_release_group'
__table_args__ = (
Index('l_release_group_release_group_idx_uniq', 'entity0', 'entity1', 'link', 'link_orde... | |
roll, None, purpose, listener)['Result']
# Now get the exact scroll.
words = scroll_type.split(' ')
commonness = words[0].lower()
self.arcaneness = words[1].lower()
# Roll for the spell.
purpose = 'scroll spell'
roll = self.roll('1d100', purpose)
# Note that unlike potions, there are uncommon level 0 scrolls.
... | |
56: '_', 57: ':', 58: '5', 59: 'q', 60: 'P', 61: '<',
62: 'i', 63: 'r', 64: 'j', 65: 'J', 66: 'I', 67: ']', 68: '3',
69: 'g', 70: 'u', 71: '3', 72: '@', 73: 'j', 74: 'a', 75: 'm',
76: '`', 77: 'I', 78: 'L', 79: 'i', 80: 'M', 81: 'u', 82: ']',
83: 'w', 84: '3', 85: 'u', 86: 's', 87: 'H', 88: 'w', 89: '@',
90: '?', ... | |
<gh_stars>10-100
from ...base import *
from .transform import TransformMixin
class SelectionMixin:
""" GeomDataObject class mix-in """
def __setstate__(self, state):
self._poly_selection_data = {"selected": [], "unselected": []}
self._selected_subobj_ids = {"vert": [], "edge": [], "poly": [], "normal": []}
de... | |
<filename>baiduspider/core/__init__.py
"""BaiduSpider,爬取百度的利器
:Author: <NAME>
:Licence: MIT
:GitHub: https://github.com/samzhangjy
:GitLab: https://gitlab.com/samzhangjy
TODO: 完成文档
TODO: 添加更多爬虫
"""
import json
import os
import re
from html import unescape
from pprint import pprint
from urllib.parse import quote, urlp... | |
int
"""
num = c_int()
self._call_fmod("FMOD_Sound_GetMusicNumChannels", byref(num))
return num.value
@property
def name(self):
"""The name of a sound.
:type: str
"""
name = create_string_buffer(256)
self._call_fmod("FMOD_Sound_GetName", byref(name), 256)
return name.value
@property
def num_subsounds(se... | |
which to freeze
boundary condition regions, or the SymbolicConstant MODEL, used with
*freezeBoundaryConditionRegions*. The default value is MODEL.
geometricRestrictionEvaluationFrequency
A SymbolicConstant specifying the frequency of evaluating geometric restrictions during
mesh smoothing. Possible values are LOW,... | |
<reponame>gtfarng/Odoo_migrade
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import uuid
from odoo import api, fields, models, _
from odoo.exceptions import UserError
class AccountCashboxLine(models.Model):
_inherit = 'account.cashbox.line'
default_pos_id = fie... | |
<gh_stars>10-100
#/usr/bin/env python
# Copyright (c) 2012, <NAME> and <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
#... | |
incoming_bids:
if bid_txid == bid["txid"]:
tokenid = bid["tokenid"]
fill_sum = bid["totalrequired"]
fillbid_hex = rpc_connection.tokenfillbid(tokenid, bid_txid, str(fill_sum))
try:
fillbid_txid = rpc_connection.sendrawtransaction(fillbid_hex["hex"])
except Exception as e:
print(e)
print(fillbid_hex)
print("So... | |
<filename>NG-RO/osm_ng_ro/ns.py
# -*- coding: utf-8 -*-
##
# Copyright 2020 Telefonica Investigacion y Desarrollo, S.A.U.
# 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.... | |
from contextlib import contextmanager
from datetime import datetime
from textwrap import dedent
from typing import Dict, List, Optional, ContextManager, Set
from zkay.compiler.privacy.circuit_generation.circuit_helper import CircuitHelper, HybridArgumentIdf
from zkay.config import cfg
from zkay.utils.multiline_formatt... | |
self._success_with_angle_requirement = success_with_angle_requirement
if not additional_observation_list:
additional_observation_list = self._object_list
self._additional_observation_list = additional_observation_list
self._pos_list = list(
itertools.product(
range(-self._max_play_ground_size, self._max_play_grou... | |
<filename>libc/tools/gensyscalls.py
#!/usr/bin/python
#
# this tool is used to generate the syscall assmbler templates
# to be placed into arch-x86/syscalls, as well as the content
# of arch-x86/linux/_syscalls.h
#
import sys, os.path, glob, re, commands, filecmp, shutil
from bionic_utils import *
if sys.version_inf... | |
r"""Implementation of games in extensive form.
The most important class of the module is ``ExtensiveFormGame'', which
provides support for n-player extensive form games, including chance moves.
It also provides support for a graphical representation of the game tree and
implementation for the backward induction algori... | |
2*m.b150*m.b971 + 2*m.b151*m.b153
- 2*m.b151 + 2*m.b151*m.b265 - 2*m.b265 - 2*m.b151*m.b566 + 4*m.b566 + 2*m.b151*m.b716 + 2*
m.b152*m.b154 + 2*m.b154 + 2*m.b152*m.b933 - 2*m.b152*m.b951 + 2*m.b153*m.b910 + 2*m.b153*m.b951
- 2*m.b154*m.b466 + 2*m.b466 - 2*m.b154*m.b648 - 2*m.b154*m.b788 + 2*m.b155*m.b156 - 2*m.b156 ... | |
the PSU. <br><br>See [PSU identifiers](https://docs.yapily.com/knowledge/psu_identifiers/) to see if this header is required.
:param _return_http_data_only: response data without head status code
and headers
:param _preload_content: if False, the urllib3.HTTPResponse object will
be returned without reading/decoding... | |
colors=inner_colors,
shadow=False, wedgeprops=dict(width=size, edgecolor='#FFFFFF'))
ax5.set(aspect="equal", title='Luminance modulated cells summary`')
if self.save_fig:
if os.path.exists(self.save_dir):
fig2.savefig(f'{self.save_dir}{os.sep}{decode_what}_modulation_summary.{self.fig_format}')
else:
print("Spec... | |
<filename>python/ggtk/term_set_sim.py
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 1.3.40
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
# This file is compatible with both classic and new-style classes.
from sys im... | |
+ ": " + str(para_back[2 + i * 4])+"\n"
info = info + "Sigma " + str(i + 1) + ": " + str(para_back[3 + i * 4])+"\n"
info = info + "Step " + str(i + 1) + ": " + str(para_back[4 + i * 4])+"\n"
info_area = info_area + "Area " + str(i + 1) + ": " + str(np.sum(peak_gauss[i][0]))+"\n"
info = info + "============\... | |
# -*- coding: utf-8 -*-
"""
User class for the locust scenario runner
"""
from __future__ import print_function, unicode_literals
import json
import random
import requests
import sys
import time
from datetime import datetime as dt
from locust import TaskSet
def get_pk( node):
# Old versions of Kolibri use 'id' inst... | |
# Auxialary functions
#
# <NAME>, 2020
# <EMAIL>
import math
import torch
import numpy as np
import matplotlib.pyplot as plt
import sklearn
import copy
from tqdm import tqdm
from sklearn import metrics
from scipy import stats
import scipy.special as special
import icenet.tools.prints as prints
import numba
def sp... | |
import turing
import turing.batch
import turing.batch.config
import turing.router.config.router_config
from turing.router.config.route import Route
from turing.router.config.router_config import RouterConfig
from turing.router.config.router_version import RouterStatus
from turing.router.config.resource_request import R... | |
coeff includes
parity due to sorting. opa and opb are integer arrays
"""
n_a = len(opa)
n_b = len(opb)
coeff *= (-1)**(n_a * (n_a - 1) // 2 + n_b * (n_b - 1) // 2)
amap = set()
bmap = set()
amask = reverse_integer_index(opa)
bmask = reverse_integer_index(opb)
for index in range(self.lena()):
current = self.... | |
2*m.b57*m.b214 - 4*m.b57 - 4*m.b214 + 2*m.b57*m.b280 + 2*m.b57*
m.b536 + 2*m.b57*m.b674 + 2*m.b58*m.b353 - 2*m.b58 - 4*m.b353 + 2*m.b58*m.b355 - 2*m.b58*m.b498
+ 2*m.b498 + 2*m.b58*m.b591 + 2*m.b59*m.b60 - 2*m.b59 - 2*m.b60 + 2*m.b59*m.b116 - 2*m.b116 + 2*
m.b59*m.b220 - 4*m.b220 - 2*m.b59*m.b612 + 2*m.b60*m.b95 - 2... | |
# Copyright (C) 2021-2022 Intel Corporation
#
# SPDX-License-Identifier: MIT
from __future__ import annotations
from typing import Callable, Iterable, Iterator, Optional, Tuple, Union
import os
import os.path as osp
import shutil
import weakref
import cv2
import numpy as np
from datumaro.util.image import (
_image... | |
<gh_stars>0
# -*- coding: utf-8 -*-
"""local_inference_test.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1DoufA_ZZTQ4Cbkrwxll2eoD-ek4rkO7B
## Run inference test
Test with images in repository `object_detection_demo/test` directory.
"""
import os... | |
= 0
checks = 20
x_lis = []
previousStart = 0
forceAv = 0
forceAbsAv = 0
x = f
force = np.zeros(periods)
else:
# R=i/100
t0 = time.time() #Calling computer clock
x0 = [1,0,0,0,0,0] #Initial values. Change here.
totPoints = 1000000*factor
periods = 1000*factor
pointPerPeroid = int(totPoints/periods)
ste... | |
set of 20 colors, dark then light
nesr_colors = {0 : 'blue', 1: 'gold', 2: 'green', 3: 'yellow', 4: 'purple', 5: 'white',
6 : 'red', 7: 'bisque', 8: 'maroon', 9: 'aqua', 10: 'black', 11: 'lime',
12: 'indigo', 13: 'fuchsia', 14: 'darkcyan', 15: 'gold', 16: 'navi',
17: 'khaki', 18: 'saddlebrown', 19: 'lightsteelb... | |
tand = 0.02
print("\n\nCalculating for FR4 patch.")
W, L, h, Er = DesignPatch(Er, h, freq)
eff = CalculatePatchEff(Er, W, L, h, tand, sigma, freq, VSWR)
CalcDirectivity(eff, PatchFunction, freq, W, L, h, Er)
# Rogers RO4350
print("\n\nCalculating for RO4350 patch.")
Er = 3.48
tand = 0.004
W, L, h, Er = Desig... | |
= "data_0924"
file_ext = "sff"
def sniff(self, filename):
# The first 4 bytes of any sff file is '.sff', and the file is binary. For details
# about the format, see http://www.ncbi.nlm.nih.gov/Traces/trace.cgi?cmd=show&f=formats&m=doc&s=format
try:
header = open(filename, 'rb').read(4)
if header == b'.sff':
re... | |
<filename>test/functional/abc-block-sigchecks-activation.py<gh_stars>1-10
#!/usr/bin/env python3
# Copyright (c) 2020 The Bitcoin Developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Test activation of block sigchecks lim... | |
default='', nargs='?',
help="Input filename of 2D spectrum")
parser_ext.add_argument("-o", "--output", type=str, default='',
help="Output filename of 1D spectrum (FITS Table)")
parser_ext.add_argument("--axis", type=int, default=1,
help="Dispersion axis: 1 horizontal, 2: vertical")
parser_ext.add_argument('--auto... | |
# Copyright (c) 2013 New Dream Network, LLC (DreamHost)
#
# 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... | |
0), # East Asian ideograph
0x213157: (0x4FE1, 0), # East Asian ideograph
0x223158: (0x6357, 0), # East Asian ideograph
0x213159: (0x4FB5, 0), # East Asian ideograph
0x22315A: (0x633C, 0), # East Asian ideograph
0x22315B: (0x6358, 0), # East Asian ideograph
0x21315C: (0x4FDE, 0), # East Asian ideograph
0x27315D: ... | |
<reponame>RicoloveFeng/KDraw<filename>src/CLI/Kdraw.py
'''
KDraw v0.0.1
1. setColor has been writen in opcodes when in instruction.py
2. for resetCanvas command, change img object and clear oplist
3. for draw command, put it into list
4. for adjust command, find in list according to id, and adjusting points
5. for save... | |
range(len(enum_hypothesis_list))[::-1]:
hypothesis_syns = set(
chain(
*[
[
lemma.name()
for lemma in synset.lemmas()
if lemma.name().find("_") < 0
]
for synset in wordnet.synsets(enum_hypothesis_list[i][1])
]
)
).union({enum_hypothesis_list[i][1]})
for j in range(len(enum_reference_list))[::-1]:
if enum_r... | |
numpify(msg)
# roll = torch.full(sz, np.nan, dtype=torch.float32)
# pitch = torch.full(sz, np.nan, dtype=torch.float32)
# z = torch.full(sz, np.nan, dtype=torch.float32)
# for i, yaw in enumerate(range(0, 360, 45)):
# roll[i, ...] = torch.tensor(cloud['roll_%i' % yaw], dtype=torch.float32).reshape(sz[1:])
# pitch... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.