input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
# Why: #3791 in Alexa global
'http://www.gsm.ir/',
# Why: #3792 in Alexa global
'http://dek-d.com/',
# Why: #3793 in Alexa global
'http://www.giantbomb.com/',
# Why: #3794 in Alexa global
'http://www.tala.ir/',
# Why: #3795 in Alexa global
'http://www.extremetracking.com/',
# Why: #3796 in Alexa global
'http... | |
theta_B3) - g_B2_B3*cos(theta_B2 - theta_B3))
struct[0].Gy_ini[4,3] = V_B2*V_B3*(b_B2_B3*cos(theta_B2 - theta_B3) + g_B2_B3*sin(theta_B2 - theta_B3))
struct[0].Gy_ini[4,4] = V_B2*(b_B2_B3*sin(theta_B2 - theta_B3) - g_B2_B3*cos(theta_B2 - theta_B3)) + 2*V_B3*g_B2_B3
struct[0].Gy_ini[4,5] = V_B2*V_B3*(-b_B2_B3*cos(the... | |
= getattr(handler.query_tree(), item)
self.positionGetter = handler
else:
self.positionGetter = pygame_win
pos = desktops['linux2'][self.desk_env].get('position_setter', None)
if pos:
if DEBUG_WM:
print "pos_setter.split('.')", pos.split('.')
handler = pygame_win
for item in pos.split('.'):
handler = getattr(... | |
import math
import copy
import types
import random
from direct.showbase.ShowBaseGlobal import *
from direct.gui.DirectGui import *
from panda3d.core import *
from direct.showbase.PythonUtil import *
from direct.directnotify import DirectNotifyGlobal
from direct.controls import ControlManager
from direct.interval.Interv... | |
<filename>AG.py
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider
'''
Se define la función crearPoblacionInicial(cantidad, numeroDeCiudades) donde:
* cantidad es la cantidad de individuos que se desean crear para la población
* numeroDeCiudades es la cantidad de ciudades que se... | |
import functools, math, struct, sys
from struct import Struct
from io import BytesIO
from Catalog.Identifiers import PageId, FileId, TupleId
from Catalog.Schema import DBSchema
from Storage.Page import PageHeader, Page, PageTupleIterator
class SlottedPageHeader(PageHeader):
"""
A slotted page header implementation.... | |
are uniform after resampling
self.weights = 1./self.num_particles * ones(self.num_particles)
new_particles = empty(self.num_particles,dtype=object)
used = set()
for i in range(len(resampled_indices)):
j = resampled_indices[i]
if j in used:
new_particles[i] = self.particles[j].shallow_copy()
else:
new_particles... | |
<reponame>twstewart42/ParlAI
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from typing import Dict
import torch
import random
from parlai.core.metric... | |
in st.get_tg_links(data[device_type]):
if link <= max_mem:
if config_type == 'ipv4' or config_type == 'all':
ipaddr1 = "{}.{}.{}.1".format(ipv4_adr_leaf, j, link)
ipaddr2 = "{}.{}.{}.2".format(ipv4_adr_leaf, j, link)
tg_neigh_list.append(ipaddr2)
leaf_neigh_list.append(ipaddr1)
if class_reconfig == "No":
[tg, _... | |
"__call__") as call:
client.create_job()
call.assert_called()
_, args, _ = call.mock_calls[0]
assert args[0] == services.CreateJobRequest()
@pytest.mark.asyncio
async def test_create_job_async(
transport: str = "grpc_asyncio", request_type=services.CreateJobRequest
):
client = TranscoderServiceAsyncClient(
cre... | |
import numpy as np
import pandas as pd
import pytest
from pandas.testing import assert_frame_equal
# from http://imachordata.com/2016/02/05/you-complete-me/
@pytest.fixture
def df1():
return pd.DataFrame(
{
"Year": [1999, 2000, 2004, 1999, 2004],
"Taxon": [
"Saccharina",
"Saccharina",
"Saccharina",
"Agarum",
... | |
from random import randrange
def choose_icebreaker():
icebreakers = ['What was your first job?',
'Have you ever met anyone famous?',
'What are you reading right now?',
'If you could pick up a new skill in an instant what would it be?',
'Who’s someone you really admire?',
'Seen any good movies lately yo... | |
<reponame>TUM-EI-RCS/StratoX
#!/usr/bin/python
# This script parses GNATprove output and gives per-file coverage statistics,
# as well as overall statistics
#
# (C) 2016-2017 <NAME>, RCS, <NAME> <<EMAIL>>
import sys, getopt, os, inspect, time, math, re, datetime, numpy;
import pprint;
# use this if you want to inclu... | |
<filename>train_progressive_all_pggan_improvements.py<gh_stars>0
"""
This file is based on WaveGAN v1: https://github.com/chrisdonahue/wavegan/tree/v1
and the Tensorflow Models implementation of PGGAN: https://github.com/tensorflow/models/tree/master/research/gan/progressive_gan
Both of these are modified and interwov... | |
qp\n'][i] = ''.join([' refvolume=',str(Vol),'\n'])
elif item.split('=')[0] == ' isoconstraint':
self.element['# qp\n'][i] = ''.join([' isoconstraint=',str(Dose),'\n'])
elif item.split('=')[0] == ' weight':
self.element['# qp\n'][i] = ''.join([' weight=',str(Weight),'\n'])
elif item.split('=')[0] == '... | |
1, (10, 10), 'uint32')),
(IMPL_32_1_15F, (IMPL, 32, 1, 0, 15, (15, 10, 10), 'uint32')),
(EXPL_32_3_1F, (EXPL, 32, 3, 0, 1, (100, 100, 3), 'uint32')),
(EXPL_32_3_2F, (EXPL, 32, 3, 0, 2, (2, 100, 100, 3), 'uint32')),
]
@pytest.mark.skipif(not HAVE_NP, reason='Numpy is not available')
class TestNumpy_NumpyHandler:
"... | |
# -*- coding: utf-8 -*-
"""Test for tmuxp configuration import, inlining, expanding and export.
tmuxp.tests.config
~~~~~~~~~~~~~~~~~~
"""
from __future__ import absolute_import, division, print_function, \
with_statement, unicode_literals
import logging
import os
import shutil
import tempfile
import unittest
impo... | |
<reponame>federatedcloud/FRB_pipeline<filename>Pipeline/Modules/friends.py
''' The module contains tools to run a Friends-of-Friends search algorithm.
The main function is fof(), which is found at the bottom of this file.
Most other functions defined in this module are called by fof(),
and some may also be useful ... | |
<reponame>sparkprime/helm
#!/usr/bin/env python
#
# Copyright 2015 The Kubernetes 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/licens... | |
Period(Semiannual), bondCalendar,
Unadjusted, Unadjusted,
DateGeneration.Backward, False)
floatingBond1 = FloatingRateBond(settlementDays, self.faceAmount,
floatingBondSchedule1,
self.iborIndex, Actual360(),
Following, fixingDays,
[1], [0.0056],
[], [],
inArrears,
100.0, Date(29,September,2003))
floatingBo... | |
import requests
import time
from JumpScale import j
import JumpScale.portal
import JumpScale.lib.cloudrobots
import JumpScale.baselib.remote
import JumpScale.baselib.redis
import JumpScale.portal
import ujson as json
import sys
class Output(object):
def __init__(self):
self.out=""
self.lastlines=""
self.counter=... | |
`user_link`: str, the link to the user entity.
- `query`: str or dict.
- `options`: dict, the request options for the request.
:Returns:
query_iterable.QueryIterable
"""
path = base.GetPathFromLink(user_link, 'permissions')
user_id = base.GetResourceIdOrFullNameFromLink(user_link)
def fetch_fn(options):
retu... | |
#!/usr/bin/env python
"""cflib.main
===============
This library contains functions that are used by PoMo.
"""
import argparse
import random
from scipy.misc import comb as choose
import cflib as lp
import os
import pdb
import time
# define PoMo10 states
codons = ["aaa", "aac", "aag", "aat", "aca", "acc", "acg", "... | |
specifies the configurations for an `Estimator` run."""
def __init__(self,
model_dir=None,
tf_random_seed=None,
save_summary_steps=100,
save_checkpoints_steps=_USE_DEFAULT,
save_checkpoints_secs=_USE_DEFAULT,
session_config=None,
keep_checkpoint_max=5,
keep_checkpoint_every_n_hours=10000,
log_step_count_step... | |
3.867840E+04, 4.123867E+04, 4.393547E+04, 4.677456E+04,
4.976184E+04, 5.290340E+04, 5.620549E+04, 5.967453E+04, 6.331712E+04, 6.714003E+04,
7.115023E+04, 7.535485E+04, 7.976121E+04, 8.437683E+04, 8.920942E+04, 9.426687E+04,
9.955728E+04, 1.050889E+05, 1.108703E+05, 1.169102E+05, 1.232174E+05, 1.298010E+05,
1.366705... | |
x3, x4, x5, x6, x7, l, s):
check(len(s) == 1*5 + 2*45 + 3*450 + 4*500)
return None, f, after
def test_compile_framework_5(self):
self.run('compile_framework_5')
def define_compile_framework_7(cls):
# Array of pointers (test the write barrier for setarrayitem_gc)
def before(n, x):
return n, x, None, None, None... | |
<gh_stars>0
from bearlibterminal import terminal as blt
from e_tile import TileType
from e_culture import Culture
from e_person import Gender
from e_state import State
from e_omode import OMode
import random
import camera
import gamemap
import cursor
import console
import actor
import villager
import calendar
import se... | |
# -*- coding: utf-8 -*-
#
# DDE Management Library (DDEML) client module
#
# Notes:
# This code has been adapted from <NAME>'s dde-client code from
# ActiveState's Python recipes (Revision 1) modified by <NAME>
# Copyright:
# (c) <NAME>
# Licence:
# New BSD license
# Website:
# http://code.activestate.com/recipes/57765... | |
<gh_stars>100-1000
from rpython.rtyper.lltypesystem import lltype, llmemory
from rpython.flowspace.model import mkentrymap, checkgraph, Block, Link
from rpython.flowspace.model import Variable, Constant, SpaceOperation
from rpython.tool.algo.regalloc import perform_register_allocation
from rpython.tool.algo.unionfind i... | |
import random
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AbstractUser
from django.contrib.gis.db import models
from django.contrib.postgres.fields import ArrayField
from django.core.exceptions import ValidationError
from django.core.validators import MaxValueValidator, MinVal... | |
<filename>flopz/target/bolero/bolero_target.py
from typing import Tuple
from flopz.arch.instruction import ArbitraryBytesInstruction
from flopz.core.addressable_object import AddressableObject
from flopz.core.function import Function
from flopz.core.module import Module
from flopz.core.shellcode import Shellcode
from ... | |
#!/usr/bin/env python
import json
import logging
import os
import sys
from datetime import datetime
import click
import requests
from click import Context
from furl import furl
from requests import HTTPError
pkg_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) # noqa
sys.path.insert(0, pkg_root) ... | |
'blocks_q2' : 2D array of local medians
'blocks_iqr' : 2D array of local IQRs
'blocks_var' : IQR of blocks_q2
'iqr_ratio' : blocks_var / iqr
'blocks_iqrvar' : IQR of blocks_iqr
'mean' : mean of full chip array
'std' : std of full chip array
'blocks_mean' : 2D array of local means
'blocks_std' : 2D array of lo... | |
m.b1046 <= 0)
m.e999 = Constraint(expr= m.x519 - 41 * m.b1047 <= 0)
m.e1000 = Constraint(expr= m.x520 - 39 * m.b1048 <= 0)
m.e1001 = Constraint(expr= m.x489 - 40 * m.b1049 <= 0)
m.e1002 = Constraint(expr= m.x490 - 45 * m.b1050 <= 0)
m.e1003 = Constraint(expr= m.x491 - 41 * m.b1051 <= 0)
m.e1004 = Constraint(expr= m.x49... | |
= interpolate.interp1d(time_,temp[:,p_id],kind='linear',axis=0,fill_value=temp[istop,p_id])
temp_output = interp_func_temp(time_output)
interp_func_rho = interpolate.interp1d(time_,density[:,p_id],kind='linear',axis=0,fill_value=density[istop,p_id])
rho_output = interp_func_rho(time_output)
interp_func_ye = int... | |
#!/usr/bin/env python3
# coding=utf-8
import csv
import os
from collections import defaultdict
from enum import IntEnum
cool_x = "❌"
cool_check = "✔️"
ignore_targets = [
'no_undefined_behavior',
'reading_uninitialized_value_lib']
class DetectionType(IntEnum):
COMPILER_WARNING = 1
STANDALONE_STATIC_ANALYSIS = 2... | |
base class version always returns an empty Python list.
"""
if self.GetImageList(wx.IMAGE_LIST_SMALL):
raise Exception("List control has an image list, OnGetItemImage should be overridden.")
return []
def OnGetItemColumnImage(self, item, column=0):
"""
This function **must** be overloaded in the derived clas... | |
<reponame>Avdbergnmf/DataProcessing_DrossRemovalThesis
#!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
import scipy.stats as stats
import pingouin as pg
from matplotlib.ticker import MaxNLocator
from statsmodels.graphics.factorplots import interaction_... | |
import filecmp
import os
import sys
import unittest as unittest
import numpy as np
from qd.cae.dyna import *
class TestDynaModule(unittest.TestCase):
"""Tests the dyna module."""
def is_almost_equal(self, val1, val2, tolerance):
if(np.abs(val1 - val2) < tolerance):
return True
else:
return False
def asse... | |
propvalue = self.repos.get_rev_prop(self.propname)
self.output.write('New Property Value:\n')
self.output.write(propvalue)
self.output.finish()
def generate_content(output, cfg, repos, changelist, group, params, pool):
svndate = repos.get_rev_prop(svn.core.SVN_PROP_REVISION_DATE)
### pick a different date forma... | |
audio_filters.append(arg)
all_args = []
all_args.append(self.ffmpeg_path)
all_args.extend(input_args)
if video_filters:
all_args.append("-filter:v {}".format(",".join(video_filters)))
if audio_filters:
all_args.append("-filter:a {}".format(",".join(audio_filters)))
all_args.extend(output_args)
return all_a... | |
import os, sys
import adsk.core, adsk.fusion, adsk.cam, traceback, math
from math import sqrt
from ..ParameterValues import ParameterValues
class DimensionsBuilder:
def __init__(self, app):
self.app = app
self.design = app.activeProduct
def buildDimensions(self, parameters: ParameterValues):
rootComp = self.de... | |
110.0 106.53 SOURCE3 1
p2-n -p2 103.6 119.62 SOURCE3 1
p3-n -p3 106.4 108.73 SOURCE3 3 0.2591
p4-n -p4 108.7 108.55 SOURCE3 1
p5-n -p5 114.3 99.99 SOURCE3 1
pc-n -pc 103.2 119.62 SOURCE3 1
pd-n -pd 103.2 119.62 SOURCE3 1
s4-n -s4 63.2 113.75 SOURCE3 1
s6-n -s6 63.4 119.68 SOURCE3 1
sh-n -sh 63.2 119.03 SOURCE3 1
s -n -... | |
in range(len(files)):
# read the tif file
f = gdal.Open(path+"/"+files[i])
arr_3d[:,:,i] = f.ReadAsArray()
return arr_3d
def ExtractValues(Path, ExcludeValue, Compressed = True, OccupiedCellsOnly=True):
"""
=================================================================
ExtractValues(Path, ExcludeValue, Co... | |
"""The watcher file is a script meant to be run as an ongoing process to watch a given directory and analyzing files
that may be moved there for certain keywords. Automatic processing will be started if the file contains the keywords."""
import collections
import concurrent.futures
import datetime
import os
from functo... | |
# coding: utf-8
"""
Application Manager API
Application Manager APIs to control Apache Flink jobs # noqa: E501
OpenAPI spec version: 2.0.1
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python... | |
""" Firefox Desktop Churn and Retention Cohorts
Tracked in Bug 1226379 [1]. The underlying dataset is generated via
the telemetry-batch-view [2] code, and is generated once a day. The
aggregated churn data is updated weekly.
Due to the client reporting latency, we need to wait 10 days for the
data to stabilize. If th... | |
<filename>results/generate_result.py
#!/usr/bin/python3
#
# Copyright 2018, The Android Open Source Project
#
# 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/... | |
'v2',
}),
})
content_type, content_text = self.handler.store_and_build_forward_message(
form, '================1234==', bucket_name='my-test-bucket')
self.mox.VerifyAll()
self.assertEqual(EXPECTED_GENERATED_CONTENT_TYPE_WITH_BUCKET, content_type)
self.assertMessageEqual(EXPECTED_GENERATED_MIME_MESSAGE_WITH_BU... | |
LOG.info('Device current rebuilding status is %s',
dev.rebuild_status)
if dev.rebuild_status in ['rebuilding', 'queued']:
msg = 'Device {0} rebuilding is in progress in '\
'{1}, Please try again later.'.format(
dev.name, self.cluster_name)
LOG.error(msg)
self.module.fail_json(msg=msg)
def dev_checks(device_nam... | |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import boto3
import botocore
from botocore.exceptions import WaiterError
from botocore.waiter import WaiterModel, create_waiter_with_client
import logging
import os
import secrets
import time
import json
from cryptogr... | |
etc.
5 4.02e+03 22.57 |
5 4.02e+03 22.57 | 22.57 0.5 28 0 | 0.05 0.81 1.37 0.33
5 1.93e+05 264.67 |
5 1.93e+05 264.67 | 264.67 2.3 111 1 | 0.15 0.10 12.14 0.09
5 3.04e+05 419.28 |
5 3.04e+05 419.28 | 419.28 1.3 142 0 | 0.16 0.12 19.81 0.11
5 3.91e+05 679.15 |
5 3.91e+05 679.15 | 679.15 3.2 246 2 | 0.18 0.16 28.57 0.14
... | |
0)
TESTS:
Tests for :trac:`10888`::
sage: K.<th> = NumberField(x^2+3)
sage: E = EllipticCurve(K,[7,0])
sage: phi = E.isogeny(E(0,0))
sage: P = E(-3,4*th)
sage: phi(P)
(-16/3 : 8/9*th : 1)
sage: Q = phi(P)
sage: phihat = phi.dual()
sage: phihat(Q)
(-1/48 : 127/576*th : 1)
Call a composed isogeny (added ... | |
= linear_regression(tvec.flatten()[indx], stbarTime.flatten()[indx], w.flatten()[indx], intercept_origin=True)
else:
print('not enough points to estimate dv/v for dtw')
m0=0;em0=0
return m0*100,em0*100,dist
def mwcs_dvv(ref, cur, moving_window_length, slide_step, para, smoothing_half_win=5):
"""
Moving Windo... | |
<gh_stars>1-10
from abc import abstractmethod
import time, os, math, random
import knowledgebases, benchutils
import pandas as pd
import numpy as np
import matplotlib as matplots
import matplotlib.pyplot as plt
from matplotlib_venn import venn2
from matplotlib_venn import venn3
from matplotlib import colors as mcolors
... | |
#!/usr/bin/env python2.7
# __BEGIN_LICENSE__
#
# Copyright (C) 2010-2013 Stanford University.
# All rights reserved.
#
# __END_LICENSE__
# lflib imports
import lflib
from lflib.imageio import load_image, save_image
from lflib.lightfield import LightField
from lflib.calibration import LightFieldCalibration
from lflib... | |
<reponame>sevgiun/T_System
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
.. module:: high_tech_aim
:platform: Unix
:synopsis: the top-level submodule of T_System that contains the classes related to high tech targeting mark of T_System's vision ability.
.. moduleauthor:: <NAME> <<EMAIL>>
"""
import numpy
import cv... | |
# Copyright (c) 2012 OpenStack Foundation
# 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 applicab... | |
# -*- coding: utf-8 -*-
"""
This module contains the class Population.
Created on Tue Sep 17 14:29:43 2019
@author: <NAME> (jcrvz.github.io), e-mail: <EMAIL>
"""
import numpy as np
from itertools import product as cartesian_product
from itertools import islice
__all__ = ['Population']
__selectors__ = ['all', 'greed... | |
(compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)',
'YahooSeeker/1.2 (compatible; Mozilla 4.0; MSIE 5.5; yahooseeker at yahoo-inc dot com ; http://help.yahoo.com/help/us/shop/merchant/)',
'Mozilla/5.0 (X11; U; Linux ... | |
-> float:
"""Fee earned by the Lending Partner in a securities lending agreement."""
return self.__lending_partner_fee
@lending_partner_fee.setter
def lending_partner_fee(self, value: float):
self._property_changed('lending_partner_fee')
self.__lending_partner_fee = value
@property
def region(self) -> str:
... | |
<gh_stars>1-10
from __future__ import with_statement
from binascii import unhexlify
import contextlib
from functools import wraps, partial
import hashlib, logging
log = logging.getLogger(__name__)
import random, re, os, sys, tempfile, threading, time
from otp.ai.passlib.exc import PasslibHashWarning, PasslibConfigWarni... | |
workflow with imported tools""")
@pytest.mark.cwl_conformance
@pytest.mark.cwl_conformance_v1_1
@pytest.mark.inline_javascript
@pytest.mark.workflow
@pytest.mark.green
def test_conformance_v1_1_wf_wc_expressiontool(self):
"""Test two step workflow with inline tools
Generated from::
id: 25
job: tests/wc-job... | |
with a `DimensionNotAvailable` error if the specified dimension does not exist.
:param context: Additional data to be passed to the reducer.
:return: A data cube with the same dimensions. The dimension properties (name, type, labels, reference
system and resolution) remain unchanged, except for the resolution and d... | |
# Standard library imports.
import ast
import getopt
import logging
import pprint
import re
import sys
# External imports.
import docx
import pympi
import pyramid.paster as paster
# Project imports.
from lingvodoc.models import (
DBSession,
Dictionary,
)
# Setting up logging, if we are not being run as a scri... | |
this turn
combinedVariance = np.var(combinedDensityMap)
#if the rounded variance of this turn is more or the same of the variance last turn
if round(combinedVariance,precision) >= round(lastVariance,precision):
placingcondition = True
#and update the last variance for next turn with the new value
lastVariance =... | |
header_roots = {header: (header.transaction_root, header.uncles_hash) for header in headers}
completed_header_roots = valfilter(lambda root: root in bodies_by_root, header_roots)
completed_headers = tuple(completed_header_roots.keys())
# store bodies for later usage, during block import
pending_bodies = {
heade... | |
BCC_B2 PHASE
$ metastable
$
$ Present work: july 1999, study of Al-Cr-Ni, revision of NDTH.
PARAMETER G(BCC_B2,CR:NI:VA;0) 298.15 4000;,,N 01DUP !
PARAMETER G(BCC_B2,NI:CR:VA;0) 298.15 4000;,,N 01DUP !
$
$ L12_FCC PHASE
$ metastable
$ Present work: july 1999, study of Al-Cr-Ni, revision of NDTH.
$ The L12 phase is me... | |
#!/usr/bin/python3
"""
This module provides the base class For driving unipolar and bipolar stepper motors via a number of different chips.
"""
import pootlestuff.watchables as wv
from pootlestuff.watchables import loglvls
import threading, time
class basestepper(wv.watchablepigpio):
"""
A base class for stepper m... | |
13.313, 51.508,
VERTEX, 25.356, 13.509, 51.534,
VERTEX, 25.335, 13.705, 51.557,
VERTEX, 25.331, 13.709, 51.533,
VERTEX, 25.307, 13.724, 51.335,
VERTEX, 25.285, 13.720, 51.136,
VERTEX, 25.270, 13.701, 50.973,
END,
BEGIN, LINE_LOOP,
VERTEX, 25.443, 12.790, 50.880,
VERTEX, 25.522, 12.625, 50.782,
VERTEX, 25.602, 12.461, 5... | |
<reponame>timelyportfolio/bokeh<gh_stars>1-10
# -*- coding: utf-8 -*-
""" Models for display visual shapes whose attributes can be associated
with data columns from data sources.
"""
from __future__ import absolute_import
from ..plot_object import PlotObject
from ..mixins import FillProps, LineProps, TextProps
from .... | |
id="div-pqhsp",
),
html.Div(
[
html.H6("Cross-Contamination"),
dbc.Tooltip(
"Cross-contamination rate in quarantine facilities.",
target="div-pcross",
placement="right",
),
dcc.Slider(
id="slider-pcross",
min=0,
max=1,
value=0.01,
step=0.01,
tooltip={"always_visible": True},
),
],
id="div-pcross",
)... | |
'z,-x+3/4,-y+3/4',
'-z+3/4,-x+3/4,y', '-z+3/4,x,-y+3/4', 'y,z,x', '-y+3/4,z,-x+3/4', 'y,-z+3/4,-x+3/4', '-y+3/4,-z+3/4,x',
'-x,-y,-z', 'x+1/4,y+1/4,-z', 'x+1/4,-y,z+1/4', '-x,y+1/4,z+1/4', '-z,-x,-y', '-z,x+1/4,y+1/4',
'z+1/4,x+1/4,-y', 'z+1/4,-x,y+1/4', '-y,-z,-x', 'y+1/4,-z,x+1/4', '-y,z+1/4,x+1/4', 'y+1/4,z+1/4,-... | |
<reponame>limberc/hypercl
#!/usr/bin/env python3
# Copyright 2019 <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 ... | |
<reponame>davidharvey1986/rrg<gh_stars>1-10
"""
Table element classes for input
@author: <NAME>, <NAME>
@organization: Space Telescope - European Coordinating Facility (ST-ECF)
@license: Gnu Public Licence
@contact: <EMAIL>
@since: 2005/09/13
$LastChangedBy: mkuemmel $
$LastChangedDate: 2008-07-03 10:27:47 +0200 (Thu... | |
offset
# Execute requests
response_json, status_code = utils.request(
session=self,
request_type=const.REQUEST_GET,
endpoint=Endpoints.SEARCH,
uri_params=uri_params
)
if status_code != 200:
raise utils.SpotifyError(status_code, response_json)
# Extract data per search type
# TODO: test what happens if unn... | |
<filename>eosfactory/core/cleos.py<gh_stars>100-1000
import subprocess
import json
import pathlib
import random
import os
import re
import eosfactory.core.errors as errors
import eosfactory.core.logger as logger
import eosfactory.core.config as config
import eosfactory.core.setup as setup
import eosfactory.core.interf... | |
# Copyright 2018 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed t... | |
import pytest
import numpy as np
import tensorflow as tf
from gym import spaces as gym_spaces
from tf_agents.environments.gym_wrapper import GymWrapper
from tf_agents.environments.tf_py_environment import TFPyEnvironment
import snc.utils.snc_tools as snc
from snc.environments.rl_environment_wrapper \
import RLContro... | |
This tricky setup (immediately above) allows us to just write
# (e.g.) "split('exec')" in the Python code and the split #ifdef's
# will automatically be added to the exec_output variable. The inner
# Python execution environment doesn't know about the split points,
# so we carefully inject and wrap a closure that c... | |
<filename>src/app.py
import dash_bootstrap_components as dbc
from dash import Dash, html, dcc, Output, Input, State
from vega_datasets import data
import altair as alt
import pandas as pd
from altair import datum
from wordcloud import WordCloud
import matplotlib.pyplot as plt
import base64
import io
import matplotlib
f... | |
cameraproperties.brightnesscmd = str("-br " + str(brightness1) + " ")
print("new brightness set to = " + str(brightness1))
else:
pass
def setcontrast():
contrast1 = cameraproperties.contrast
print("current contrast = " + str(contrast1) )
print("enter new contrast value between -100 and 100 ")
contra... | |
import flask
import time
from contextlib import closing
from flask_login import current_user
from werkzeug.exceptions import HTTPException
import gal_utils
from gal_utils import text
from PIL import Image
import os
import os.path
import traceback
import sys
S3_dir = u'https://glyphic.s3.amazonaws.com/cfa/gallery/'
Th... | |
pt0, pt1 = t==0 and (self.point(t), self.point(t+0.001)) or (self.point(t-0.001), self.point(t))
return geometry.angle(pt0.x, pt0.y, pt1.x, pt1.y)
def point(self, t):
""" Returns the PathElement at time t (0.0-1.0) on the path.
See the linear interpolation math in bezier.py.
"""
if self._segments is None:
self.... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import with_statement
import abc
import sys
import pprint
import datetime
from python_utils import converters
import six
from .... | |
# File: sshcustodian/sshcustodian.py
# -*- coding: utf-8 -*-
# Python 2/3 Compatibility
from __future__ import (unicode_literals, division, absolute_import,
print_function)
from six.moves import filterfalse
"""
This module creates a subclass of the main Custodian class in the Custodian
project (github.com/materialspr... | |
= value
@property
def operating_system_name(self):
"""
Returns the value of the `operating_system_name` property.
"""
return self._operating_system_name
@operating_system_name.setter
def operating_system_name(self, value):
"""
Sets the value of the `operating_system_name` property.
"""
self._operating_sys... | |
"""The main module handling the simulation"""
import copy
import datetime
import logging
import os
import pickle
import queue
import random
import sys
import threading
import warnings
from functools import lru_cache
from pprint import pformat # TODO set some defaults for width/etc with partial?
import numpy as np
impo... | |
+ 1):
cand = get_expected(placed, lowest, exclude
) - exclude - needed_budget
ret = max(ret, cand)
print 'Case #%d: %.10lf' % (cc + 1, ret)
if lowest + can_replicate not in seen:
seen.add(lowest + can_replicate)
queue.append(lowest + can_replicate)
if lowest + can_replicate - 1 not in seen:
seen.add(lowest + c... | |
sub_policy_name
super().__init__(xml_tags.Elements.BINDING)
@classmethod
def from_xml_node(cls, xml_node):
"""
Initialize the object from a XML node.
:param xml_node: The XML node from which all necessary parameters will be parsed.
:type xml_node: xml.etree.Element
"""
acl_node = get_xml_node(xml_node, xml_ta... | |
<reponame>lottilotte/compas
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from itertools import product
from compas.plugins import pluggable
from compas.geometry import Point
from compas.utilities import linspace
from compas.utilities import meshgrid
fro... | |
the name of iterator_cls here}, based
on ForcedEvenIterator, that wraps iterator_cls.
"""
assert issubclass(iterator_cls, SubsetIterator)
dct = ForcedEvenIterator.__dict__.copy()
dct["_base_iterator_cls"] = iterator_cls
dct["fancy"] = iterator_cls.fancy
dct["stochastic"] = iterator_cls.stochastic
NewForcedEv... | |
increasing, so reverse the gcm arrays
# outside the range of Zf, interp returns the first or the last point of the range
h = les.get_zf()
thl = sputils.interp(h, Zf[::-1], thl_[::-1])
qt = sputils.interp(h, Zf[::-1], qt_[::-1])
ql = sputils.interp(h, Zf[::-1], QL[::-1])
u = sputils.interp(h, Zf[::-1], U[::-1])
... | |
regions_transformer(self.view, f)
# TODO: Revise this text object... Can't we have a simpler approach without
# this intermediary step?
class ViI(IrreversibleTextCommand):
def __init__(self, view):
IrreversibleTextCommand.__init__(self, view)
def run(self, inclusive=False):
state = VintageState(self.vi... | |
"""
Copyright (c) 2018 The University of Notre Dame
Copyright (c) 2018 The Regents of the University of California
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 copy... | |
# -*- coding: utf-8 -*-
from collections import OrderedDict
from gluon import current
from gluon.storage import Storage
def config(settings):
"""
Cumbria County Council extensions to the Volunteer Management template
- branding
- support Donations
- support Assessments
"""
T = current.T
settings.base.syste... | |
= pk_max
idx_ecg = np.where(pk_max >= thresh)[0]
else:
# use correlation
idx_ecg = [meg_raw.ch_names.index(name_ecg)]
ecg_filtered = mne.filter.filter_data(meg_raw[idx_ecg, :][0],
meg_raw.info['sfreq'],
l_freq=flow, h_freq=fhigh)
ecg_scores = ica.score_sources(meg_raw, target=ecg_filtered,
score_func=score_fun... | |
<reponame>jdthorpe/MCPH
"""
because timelines have this nice property of keeping track of nested
timelines, we need to prevent timline instances from duplicating this
calculation. Hence, we need to freeze the timeline when it has been
accessed as a child timeline.
==============================================... | |
<reponame>bmmalone/pyllars
"""
This module contains helpers for using dask: https://dask.pydata.org/en/latest/
"""
import logging
logger = logging.getLogger(__name__)
from typing import Callable, Iterable, List
import argparse
import collections
import dask.distributed
import pandas as pd
import shlex
import tqdm
im... | |
13244: "<square> 03BC 0057",
13245: "<square> 006D 0057",
13246: "<square> 006B 0057",
13247: "<square> 004D 0057",
13248: "<square> 006B 03A9",
13249: "<square> 004D 03A9",
13250: "<square> 0061 002E 006D 002E",
13251: "<square> 0042 0071",
13252: "<square> 0063 0063",
13253: "<square> 0063 0064",
13254: "<s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.