input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<gh_stars>1-10
"""Certbot command line argument parser"""
import argparse
import copy
import functools
import glob
import sys
from typing import Any
from typing import Dict
from typing import Iterable
from typing import List
from typing import Optional
from typing import Union
import configargparse
from certbot impo... | |
be true when w is '0101' or '0111'
m, _ = match_bitpattern(w, '??01') # m be true when last two bits of w are '01'
m, _ = match_bitpattern(w, '??_0 1') # spaces/underscores are ignored, same as line above
m, (a, b) = match_pattern(w, '01aa1?bbb11a') # all bits with same letter make up same field
m, fs = match_patte... | |
<gh_stars>0
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from typing import Union
from typing_extensions import Literal
import warnings
from tqdm import tqdm
import os
class Mlp(nn.Module):
def __init__(self, inSize:int, hiddenSize:int,outputSize:int,outputFuntion:nn = nn.Si... | |
d_xt] = sigma_tj
if j >= t:
# Calculating the (t, j) block entry (of size n_treatments x n_treatments) of matrix J
m_tj = np.mean(
XT_res[j][t].reshape(-1, d_xt, 1) @ resT_t.reshape(-1, 1, d_xt),
axis=0)
J[t * d_xt:(t + 1) * d_xt,
j * d_xt:(j + 1) * d_xt] = m_tj
return np.linalg.inv(J) @ Sigma @ np.linalg.inv(J... | |
queue.append(lowest + can_replicate)
if lowest + can_replicate - 1 not in seen:
seen.add(lowest + can_replicate - 1)
queue.append(lowest + can_replicate - 1)
for exclude in xrange(0, min(remaining_budget, partial) + 1):
cand = get_expected(placed, lowest, exclude
) - exclude - needed_budget
ret = max(ret, cand)
... | |
subtransaction.
t = id(transaction.get())
if t != self._v_transaction:
self._v_total = 0
self._v_transaction = t
self._v_total = self._v_total + 1
# increment the _v_total counter for this thread only and get a
# reference to the current transaction. the _v_total counter is
# zeroed if we notice that we're in a... | |
else:
# No regularization. Use the simplified expression
Var_dq = nps.matmult(dq_dpief_packed, nps.transpose(A))
if what == 'covariance': return Var_dq * observed_pixel_uncertainty*observed_pixel_uncertainty
if what == 'worstdirection-stdev': return worst_direction_stdev(Var_dq) * observed_pixel_uncertainty
if wh... | |
'''
return nnf.NN_time_uv(x,y,t,w_u,b_u,geom,omega_0)
def fluid_v(x,y):
'''
Compute mode shapes of v
Input : x,y TF tensors of shape [Nint,1]
Return TF tensor of shape [1,Nint,Nmodes] with complex values
'''
return nnf.out_nn_modes_uv(x,y,w_v,b_v,geom)
def fluid_v_t(x,y,t):
'''
Compute v at instant t and pos... | |
"falcated",
"falchion",
"falconet",
"falderal",
"falderol",
"fallaway",
"fallfish",
"fallibly",
"falloffs",
"fallouts",
"fallowed",
"faltboat",
"falterer",
"fameless",
"familism",
"famished",
"famishes",
"fanciest",
"fancying",
"fanegada",
"fanfares",
"fanfaron",
"fanfolds",
"fangless",
"fanglik... | |
<reponame>alexmirrington/mac-network
import json
import math
import os
import pickle
import random
import re
import time
import numpy as np
from nltk.tokenize import word_tokenize
from nltk.tokenize.stanford import StanfordTokenizer
from termcolor import colored
from tqdm import tqdm
from config import config
from pr... | |
"""
jaraco.itertools
Tools for working with iterables. Complements itertools and more_itertools.
"""
import operator
import itertools
import collections
import math
import warnings
import functools
import heapq
import collections.abc
import queue
import inflect
import more_itertools
def make_rows(num_columns, seq):... | |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'CIValueFloat.created'
db.add_column('cmdb_civaluefloat', 'created',
self.gf('django.db.models.fields.DateTim... | |
= re.compile(r"0\.[0-9]{3}\*")
model_topics = [(topic_no, re.sub(topic_sep, '', model_topic).split(' + ')) for topic_no, model_topic in
model.print_topics(num_topics=num_topics, num_words=5)]
descriptors = []
for i, m in model_topics:
print(i+1, ", ".join(m[:5]))
descriptors.append(", ".join(m[:2]).replace('"', '')... | |
<reponame>tantioch/aiokubernetes<filename>aiokubernetes/models/__init__.py
# coding: utf-8
# flake8: noqa
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v1.10.6
Generated by: https://github.com/swagger-api/... | |
# type: ignore
# TODO: remove line above once mypy understands the match statement
"""Handles changes since PY310
handle
- import-alias requiring lineno
- match statement
"""
import ast
from xonsh.parsers.v39 import Parser as ThreeNineParser
from xonsh.ply.ply import yacc
class Parser(ThreeNineParser):
def p_imp... | |
<gh_stars>0
import math
import time
import random
import os.path
from pygame.locals import *
from pygame.math import Vector2
from abc import ABC
from projectSS.spritesheet import *
# Abstract entity class
class Entity(pygame.sprite.Sprite, ABC):
def __init__(self, gameplay_screen, *groups):
super().__init__(groups)... | |
Heart on Fire'],
['❤️‍🩹', ' Mending Heart'],
['❤️', ' Red Heart'],
['🧡', ' Orange Heart'],
['💛', ' Yellow Heart'],
['💚', ' Green Heart'],
['💙', ' Blue Heart'],
['💜', ' Purple Heart'],
['🤎', ' Brown Heart'],
['🖤', ' Black Heart'],
['🤍', ' White Heart'],
['💯', ' Hundred Points'],
['💢', ' Anger ... | |
"""
Commonly used utils:
evaluation metrics e.g. similarity, AUC, AP@k, MAP@k
graph related operation
testing data generator
file I/O
visualization
etc...
"""
import time
import numpy as np
from scipy import sparse
import pickle
import networkx as nx
# ----------------------------------------------------------------... | |
#!/usr/env/python
# This file was used to run official experiments
import os
import sys
import numpy as np
import pandas as pd
from ..datasets.datasets import DataLoader
from ..utils import learn
from ..utils.files import ensureDirExists
from ..utils.misc import nowAsString
from estimators import * # TODO don't do ... | |
(str) : Data keys to plot.
weight_key (str) : Data key for data to use as a weight. By None, no weight.
x_data_args, y_data_args (dicts) : Keyword arguments to be passed only to x or y.
slices (int or tuple of slices) : How to slices the data.
ax (axis) : What axis to use. By None creates a figure and places the ax... | |
__author__ = '<NAME>'
__copyright__ = 'Oregon State University'
__credits__ = ['<NAME>']
__license__ = 'MIT'
__version__ = '0.1.0'
__maintainer__ = ''
__email__ = ''
__status__ = 'Prototype'
import math
import sys
import time
import CachedMethods
from cache_control_helper import CacheControlHelper
import pickledb
impo... | |
use checkerboard vs image texture
diffuse_2 = Lambertian(checker_board, name="checkerboard")
# diffuse_2 = Lambertian(odd_color, name="odd_color")
else:
diffuse_2 = Lambertian(logo, name="io_logo'")
metal_1 = Metal(silver, name="metal_1")
world = GeometryList()
world.add(Sphere(Vec3(0, 1.25, 0.35), 1.0, metal... | |
1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,... | |
# coding: utf-8
# # Explore highly co-expressed genes
# In the previous [notebook](2_explore_corr_of_genes.ipynb) we observed that using 39 samples with 201 PAO1-specific genes, that the correlation of accessory-accessory genes is higher compared to the correlation of core-core and core-accessory genes.
#
# Based on... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
#Imports
from scipy.stats import kurtosis, skew
import novainstrumentation as ni
import numpy as np
from scipy import signal
# #################################### TEMPORAL DOMAIN ############################################################# #
#####################################... | |
import RPi.GPIO as GPIO
import time
import read_RPM
import threading
import setup_robo
import sys
import multiprocessing
from Gyro_new import Gyro
#from mpu6050 import mpu6050
class Control_robo:
def __init__(self, encoder_1, encoder_2, SAMPLE_TIME, motor_1, motor_2):
self.encoder_1 = encoder_1 ## LEFT ENCODER
... | |
representing the whole model. The default value is None.
Returns
-------
step: FrequencyStep
A FrequencyStep object.
"""
self.steps[name] = step = FrequencyStep(name, previous, eigensolver, numEigen, description, shift, minEigen,
maxEigen, vectors, maxIterations, blockSize, maxBlocks, normalization,
propertyEv... | |
if padding == Padding.CIRCULAR:
init_padding = Padding.SAME
def input_total_dim(input_shape):
return input_shape[lhs_spec.index('C')] * np.prod(filter_shape)
ntk_init_fn, _ = ostax.GeneralConv(dimension_numbers, out_chan, filter_shape,
strides, init_padding.name, W_init, b_init)
def standard_init_fn(rng, input... | |
null_variance,
cs_val, block_merge_dist)
hpo_info['blocks'][block_id] = {'coords' : block,
'refine_res' : refine_res,
'credset_coords' : credset_coords,
'credset_bt' : credset_bt,
'credset_windows' : credset_windows}
# If no windows are significant, add empty placeholder dict for all windows
else:
hpo_info['a... | |
<filename>target_extraction/analysis/sentiment_metrics.py
'''
This module contains functions that expect a TargetTextCollection that contains
`target_sentiments` key that represent the true sentiment values and a prediction
key e.g. `sentiment_predictions`. Given these the function will return either a
metric score e.... | |
= TestEngine()
engine.enable_module('analysis_module_test_delayed_analysis')
engine.controlled_stop()
engine.start()
engine.wait()
from saq.modules.test import DelayedAnalysisTestAnalysis
root = create_root_analysis(uuid=root.uuid, storage_dir=storage_dir_from_uuid(root.uuid))
root.load()
analysis = root.get_... | |
dkey = d[0]
except Exception as e:
print(e)
print(download_filters)
# Get the download, if not ready, keep trying
print("Waiting for the Darwin Core Archive.....")
timestamp2 = datetime.now()
gotit = False
while gotit == False:
try:
# Download the file
timestamp = datetime.now()
zipdownload = occurrences.... | |
from pylearn2.space import NullSpace
from theano import config
from pylearn2.utils import sharedX
import functools
import numpy as np
from pylearn2.train_extensions import TrainExtension
class DropoutScaler(TrainExtension):
def __init__(self, estimate_set = "train"):
self.estimate_set = estimate_set
@functools.wra... | |
self.robot.iq_compensation = iq_compensation
return True
def calibration_geometry(self):
# Mark instance as un-started, uninitialized
self.robot.booted = False
self.robot.initialized = False
# Calibrate the geometry of the whole hand.
# Ping all actuators
error = self.ping() # 4 bit respectively for INDEX, I... | |
<gh_stars>0
#!/usr/bin/env python
# coding: utf-8
# # Create INCAR and INVICON MOLA JSON
# version: 2
#
# info:
# - Create standard MOLA JSON
#
# author: <NAME>
"""
# ## MOLA Annotations Data Format
# If you wish to combine multiple datasets, it is often useful to convert them into a unified data format.
#
# Ob... | |
# Copyright 2022 Huawei Technologies Co., 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 required by applicable law or agreed to... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 10 20:50:35 2020
@author: awills
"""
import sisl, os, sys
from tqdm import tqdm
import numpy as np
import MDAnalysis as MD
class Simulation():
'''Base class to build other simulations from, primarily for utility functions
like _filefind and other... | |
import json
import os
import sys
import re
from time import sleep
import time
import pexpect # 追加ライブラリ
import jinja2 # 追加ライブラリ
from termcolor import colored, cprint # 追加ライブラリ
def doNgconf(filename):
# config の中身を解析する
routerconfig, sendlines = readrouterconfig(filename)
# ログファイル名の作成
nowstr = time.strftime('%Y%m%d%H... | |
return ret
def read_file_object(self, file_obj, file_format='FASTA'):
"""Augments the matrix by reading the file object.
If duplicate sequence names are encountered then the old name will be replaced.
"""
if ( file_format.upper() == 'FASTA' ):
read_func = read_fasta
elif ( file_format.upper() == 'NEXUS' ):
rea... | |
city, Texas",8193),
("Alba town, Texas",774),
("Albany city, Texas",1840),
("Aldine CDP, Texas",15822),
("Aledo city, Texas",3817),
("Alfred CDP, Texas",0),
("Alice city, Texas",19146),
("Alice Acres CDP, Texas",188),
("Allen city, Texas",99255),
("Alma town, Texas",359),
("Alpine city, Texas",5992),
("Alto town, Texas... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | |
# PyVision License
#
# Copyright (c) 2006-2008 <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
# notice, this list o... | |
#!/usr/bin/python3
import subprocess, sys, os, time, getpass
# Make sure the script is being run as root
whoami = getpass.getuser()
if whoami != 'root':
print('This script must be run as root')
sys.exit()
# Should be resolvable via hosts file
HEAD_NODE = "yourhostname"
# Directory where you archive old users home ... | |
vars2use = ['NOy', 'PM2.5(dust)', ]
# Now loop and plot
for var in vars2use:
# for var in vars2use[:2]: # For testing
# Plot up by level
# for lev2use in ds.lev.values:
for lon2use in list(ds.lon.values):
if verbose:
print(var, lev2use)
# Get units for species
units = ds[var].units
# Select for level and var... | |
0.020043961872515337,
0.03349805785639342,
0.05492093713529983,
0.07197670056780921,
0.11082793065442348,
0.1726905197856368,
0.2474840042903689,
0.3194774175219229,
0.43857065063945483,
0.4878223722128196,
0.49687497006014864,
0.4978109091076936,
0.49787578355651946,
0.612510479368423,
0.7073262127729109... | |
<gh_stars>0
# Copyright 2020 Google LLC
#
# 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 wr... | |
import json
import traceback
import boto3
from botocore.exceptions import ClientError
import re
import requests
from .exceptions import IoTBotoError, QueryError, ThingNotExists
from .utils import Logger, HttpVerb
from settings.aws import USER_POOL_ID
project_logger = Logger()
logger = project_logger.get_logger()
c... | |
call somatic variants
:param config: The configuration dictionary.
:type config: dict.
:param sample: sample name.
:type sample: str.
:param input_bam: The input_bam file name to process.
:type input_bam: str.
:returns: str -- The output vcf file name.
"""
vardict_vcf = "{}.vardict.vcf".format(name)
logfile ... | |
self . mweight ) )
if 98 - 98: II111iiii - i1IIi - ooOoO0o
if 36 - 36: IiII + o0oOOo0O0Ooo
def print_rloc_name ( self , cour = False ) :
if ( self . rloc_name == None ) : return ( "" )
O0O00O = self . rloc_name
if ( cour ) : O0O00O = lisp_print_cour ( O0O00O )
return ( 'rloc-name: {}' . format ( blue ( O0O00O , ... | |
except Exception as e:
self.fail("Problem reading backup persistence file after POST. Error: %s"%e)
def check_test_persistance_file_load(self, test_method_name, test_function_name, state_change_or_validation, test_iteration, argument):
test_record = self.test_table.get(test_method_name)
uuid_str = argument
#... | |
power = {'BUSES': {'Area': 1.33155,
'Bus/Area': 1.33155,
'Bus/Gate Leakage': 0.00662954,
'Bus/Peak Dynamic': 0.0,
'Bus/Runtime Dynamic': 0.0,
'Bus/Subthreshold Leakage': 0.0691322,
'Bus/Subthreshold Leakage with power gating': 0.0259246,
'Gate Leakage': 0.00662954,
'Peak Dynamic': 0.0,
'Runtime Dynamic': 0.0,
... | |
import discord, timeago, requests, datetime,random, json, time, os, urbandict
from os import listdir
from library import constants, funcs
from discord.ext import commands
from colorthief import ColorThief
import keep_alive
from discord.utils import get
from dhooks import Webhook
from discord_buttons_plugin import *
imp... | |
<gh_stars>0
"""OM - plots for MEG data."""
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from om.plts.fig_info import FigInfo
from om.plts.utils import set_axis_spines, save_figure
from om.core.errors import UnknownDataTypeError
#############################################################... | |
import shutil
from pathlib import Path
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import matplotlib.ticker as mtick
from scipy.optimize import minimize_scalar
import filter
kBarWidth = 0.2
def fitLine(row, formantName, start, end, outputDir):
key = '@'.join([row['Filename'], row[... | |
"Cluster", "Experiment"
Returns:
fig_dynamic_range: bar plot, dynamic range of each protein cluster for desired experiments is displayed.
"""
df_dynamicRange_combined = self.df_dynamicRange_combined.copy()
df_dynamicRange_combined = df_dynamicRange_combined[df_dynamicRange_combined["Experiment"].isin(multi_choic... | |
####################################################
## 0. Useful stuff about Python
####################################################
# Pyhton Enhancement Proposals, or PEPs, are useful conventions which guide
# the user in writing readable and pretty code, as well as many other
# details about Python. PEP-8 is the... | |
= Constraint(expr= m.x49 - m.x286 - m.x289 == 0)
m.c215 = Constraint(expr= m.x62 - m.x314 - m.x320 == 0)
m.c216 = Constraint(expr= m.x63 - m.x315 - m.x321 == 0)
m.c217 = Constraint(expr= m.x64 - m.x316 - m.x322 == 0)
m.c218 = Constraint(expr= m.x284 - 3.34221486003388*m.b611 <= 0)
m.c219 = Constraint(expr= m.x285 ... | |
of the periodic site.
###
elems.append(site.species.elements[0].name.lower())
fracs.append([site.frac_coords[0],site.frac_coords[1], site.frac_coords[2]])
fracs = np.array(fracs)
m.natoms=len(elems)
m.set_elems(elems)
m.set_atypes(elems)
m.set_cell(cell)
m.set_xyz_from_frac(fracs)
m.set_nofrags()
m.set_empty... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2020 <NAME>
# Copyright (c) 2020 Phryk
# Copyright (c) 2001 <NAME>
# This file is licensed under
# The Python Software Foundation License Version 2
# https://github.com/python/cpython/blob/2.7/LICENSE
"""
pydocmk preprocessor
"""
import __builtin__
import os
import re
import sys... | |
dN_dEdVdt1 + dN_dEdVdt2
elif flavor == 'numu':
dN_dEdVdt = model.neutrino_spectrum(energy, radius, n_H, flavor='numu').T
elif flavor == 'nue':
dN_dEdVdt = model.neutrino_spectrum(energy, radius, n_H, flavor='nue').T
else :
raise ValueError('Only all, numu and nue flavor are available.')
# Case of K14
el... | |
39, default: 5)
:param float mar_down_side_deviation: minimum acceptable return for downside deviation - (statId: 58, default: 0)
:param float max_percentile_monte_carlo: max percentile for monte carlo, i.entity. 80 - (statId: 62, default: 95)
:param float mean_percentile_monte_carlo: mean percentile for monte carl... | |
#!/usr/bin/env python
"""
Generates an AXI Stream switch with the specified number of ports
"""
from __future__ import print_function
import argparse
import math
from jinja2 import Template
def main():
parser = argparse.ArgumentParser(description=__doc__.strip())
parser.add_argument('-p', '--ports', type=int, defa... | |
# get limits for zooms
xmin, xmax = xzoom1[row], xzoom2[row]
ymin, ymax = yzoom1[row], yzoom2[row]
# get image zoom
image_zoom = image[ymin:ymax, xmin:xmax]
# threshold = percentile
threshold = np.nanpercentile(image_zoom, 95)
# ------------------------------------------------------------------
# plot image
im... | |
<reponame>dperl-sol/cctbx_project<filename>iotbx/regression/tst_reflection_file_utils.py
from __future__ import absolute_import, division, print_function
import libtbx.load_env
from six.moves import range
if (libtbx.env.has_module("ccp4io")):
from iotbx import reflection_file_reader
from iotbx.reflection_file_utils i... | |
<reponame>seermedical/seer-py
"""
Utility and helper functions for downloading data, as well as plotting.
Copyright 2017 Seer Medical Pty Ltd, Inc. or its affiliates. All Rights Reserved.
"""
import functools
import gzip
import logging
import time
from multiprocessing import Pool
import os
import numpy as np
import p... | |
operator, var_right)] = {}
elif is_numeric_str(var_left):
if type(var_right) == Data:
for v_right in var_right.variables():
res[Formula.__name_data(var_left, operator, v_right)] = {}
elif is_numeric_str(var_right):
res[Formula.__name_data(var_left, operator, var_right)] = {}
else:
variable_right = Variable.from... | |
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 23 01:22:56 2019
@author: CHaithcock
"""
import numpy as np
import svgwrite
import RHConstants
class RHState():
def __init__(self,board,red_car_end_a):
"""
Input (Option 1):
board: ndArray of dypte int and size 36
red_car_end_a: left most position of red car m... | |
"""
resourceview.py
Contains administrative views for working with resources.
"""
from datetime import date
from admin_helpers import *
from sqlalchemy import or_, not_, func
from flask import current_app, redirect, flash, request, url_for
from flask.ext.admin import BaseView, expose
from flask.ext.admin.actions im... | |
stopping criterion for all the gps.
This ignores the scaling factor.
scaling: list of floats or "auto"
A list used to scale the GP uncertainties to compensate for
different input sizes. This should be set to the maximal variance of
each kernel. You should probably leave this to "auto" unless your
kernel is non-st... | |
#!/usr/bin/env python
# coding: utf-8
# # Gender Recognition by Voice Kaggle [ Test Accuracy : 99.08 % ]
# In[ ]:
# ## CONTENTS::
# [ **1 ) Importing Various Modules and Loading the Dataset**](#content1)
# [ **2 ) Exploratory Data Analysis (EDA)**](#content2)
# [ **3 ) OutlierTreatment**](#content3)
# [ **4 ... | |
<gh_stars>0
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# #... | |
= vpython.rotate(north, angle=(el * math.pi / 180.0),
axis=v(1, 0, 0)) # Rotate up (around E/W axis) by 'el' degrees
pvector = vpython.rotate(t1, angle=(-az * math.pi / 180.0),
axis=v(0, 0, 1)) # Rotate clockwise by 'az' degrees around 'up' axis
parrow = vpython.arrow(pos=v(0, 0, 0), axis=pvector, color=color.yello... | |
# sqlalchemy/event.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Base event API."""
from . import util, exc
from itertools import chain
import ... | |
|= r_uint(1) << (val % (WORD * 8))
return gcmap
def consider_gc_store(self, op):
args = op.getarglist()
base_loc = self.rm.make_sure_var_in_reg(op.getarg(0), args)
size_box = op.getarg(3)
assert isinstance(size_box, ConstInt)
size = size_box.value
assert size >= 1
if size == 1:
need_lower_byte = True
else:
... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | |
"""API to control Walter."""
# Copyright 2017 <NAME>. All rights reserved.
OVERRIDE_TRANSFORM = 'transform'
OVERRIDE_SHADER = 'shader'
OVERRIDE_DISPLACEMENT = 'displacement'
OVERRIDE_ATTRIBUTE = 'attribute'
class Walter(object):
"""
This object represents the Walter API. The Walter Panel interacts with Maya
(in ... | |
import sys
sys.path.append('../src/org_to_anki')
from org_to_anki.org_parser import parseData
from org_to_anki.ankiClasses.AnkiQuestion import AnkiQuestion
from org_to_anki.ankiClasses.AnkiDeck import AnkiDeck
from org_to_anki.org_parser.DeckBuilder import DeckBuilder
### Test basic deck is parsed and built correct... | |
GET THE SERVICE RESULTS
result = get_result_dict_from_livy(service_exec.livy_session, 'result')
print 'result: ' + str(result)
# clean_up_new_note(service_exec.notebook_id)
dataset_id = str(result['dataset_id'])
dataset_title = str(Dataset.objects.get(pk=dataset_id))
location_lat = str(result['location_lat'])
l... | |
i:
self.frame.keypress(size, 'down')
nf, (ni, nsub) = self.walker.get_focus()
def move_focus_prev(self, size):
f, (i, sub) = self.walker.get_focus()
assert i>0
ni = i
while ni == i:
self.frame.keypress(size, 'up')
nf, (ni, nsub) = self.walker.get_focus()
def update_results( self, start_from=None ):
"""Up... | |
ncol, int p) -> [SX]
Create a vector of length p with nrow-by-ncol symbolic primitives.
sym(str name, Sparsity sp, int p, int r) -> [[SX]]
Create a vector of length r of vectors of length p with symbolic primitives
sym(str name, int nrow, int ncol, int p, int r) -> [[SX]]
symbolic primitives.
> sym(str name, (... | |
#!/usr/bin/python
# python console for OnlyRAT
# created by : C0SM0
# imports
import os
import sys
import getpass
import random as r
from datetime import datetime
# banner for display
banner = """
_;,
,,=-,--,,__ _,-;:;;},,,_
_,oo, Ll _,##&&&&$$&&$$$&-=;%%^%&;v:&& @ `=,_
,oO" `0} Ll ,%#####&#>&&$$$$&$$$&,&'$$#`... | |
|AnalogOut| channel.
node (DwfAnalogOutNode): The channel node.
Returns:
float: The currently configured node phase value, in degrees.
Raises:
DwfLibraryError: An error occurred while executing the operation.
"""
c_phase = typespec_ctypes.c_double()
result = self.lib.FDwfAnalogOutNodePhaseGet(
self.hdwf,
ch... | |
#Commenting for single
'''
Commenting for multiple lines
'''
#How to declare variables in Python
my_age = 40
#One variable can hold different data type
# Integer
my_var = 8
type(my_var)
# Float
my_var = 26.5
type(my_var)
# String
my_var = "FORSK"
type(my_var)
# Boolean
my_var = True
type(my_var)
# NoneTy... | |
class AminoAcid:
def __init__(self,name='AA'):
self.name = name
self.name3L = ''
self.Hydrophobic = 0 # 1: Hydrophobic, 0: Hydrophilic
self.charge = 0
self.polar = 0
self.corner = 0 # Would prefer to be at a corner : give positive value
self.loop = 0 # cost/benefit when on a loop
self.size = 0 # Residu... | |
<reponame>bluthen/isadore_electronics
#!/usr/bin/python
# Copyright 2010-2019 <NAME>, <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
#
#... | |
<gh_stars>10-100
#!/usr/bin/env python
#
# Copyright 2007 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | |
import itertools as it
import os
import random
from scipy.ndimage import distance_transform_edt
import cv2
import numpy as np
from skimage import color, morphology
from datasets.Util.flo_Reader import read_flo_file
from datasets.Util.python_pfm import readPFM
D = 40
D_MARGIN = 5
# Number of positive clicks to sample... | |
<reponame>KanegaeGabriel/SplitXPBot
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
from os import environ
import logging
import auth # Telegram Bot Token
from DBM import DBM
from Transaction import Transaction
from utils import *
def kill(bot, update):
printCommandExecution(bot, ... | |
<reponame>wangji1/test-framework-and-suites-for-android
#!/usr/bin/env python
"""
Copyright (C) 2018 Intel Corporation
?
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... | |
<reponame>KangJuSeong/FIRA_RoboWorldCup
import cv2
import numpy as np
import time
import datetime
from library.motion import Motion
from library.image_processor import ImageProcessor
from library.motion import Motion
"""
#----알고리즘----#
# 노랑 or 파랑, 빨강 장애물이 나올 때 까지 걷기 /멈추기: thread walk
# 노랑 or 파랑 장애물
# 5걸음 앞으로
# 밑에 보고... | |
the Microsoft.Win32.RegistryHive enumeration.
machineName: The remote machine.
Returns: The requested registry key.
"""
pass
def OpenSubKey(self,name,*__args):
"""
OpenSubKey(self: RegistryKey,name: str,permissionCheck: RegistryKeyPermissionCheck,rights: RegistryRights) -> RegistryKey
Retrieves t... | |
<reponame>julianpistorius/computing-pipeline<gh_stars>10-100
#!/usr/bin/env python
from __future__ import print_function
import sys
import os
import argparse
import requests
import json
import posixpath
import cv2
import numpy as np
import plantcv as pcv
# Parse command-line arguments
################################... | |
<reponame>jdmonnier/mircx_mystic
#! /usr/bin/env python
# -*- coding: iso-8859-15 -*-
import argparse, subprocess, os, glob, socket, datetime
from mircx_pipeline import log, lookup, mailfile, headers, files, summarise
import numpy as np
import matplotlib.pyplot as plt
from astropy.io import fits as pyfits
import smtp... | |
of the versions and the files in that version"""
#Definitions
subj = URIRef(self.getManifestUri("datasets/TestSubmission"))
base = self.getManifestUri("datasets/TestSubmission/")
dcterms = "http://purl.org/dc/terms/"
ore = "http://www.openarchives.org/ore/terms/"
oxds = "http://vocab.ox.ac.uk/dataset/schema#"
st... | |
# ----------------------------------------------------------------------------
# Copyright (C) 2017 Verizon. 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://ww... | |
lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:32:80:38 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.7/24 brd 10.0.0.255 scope global noprefix... | |
'repos', 'Marketing-for-Engineers')
# multicall.multicall_directories(path_name, fuzzer='quickfuzz', validator=validate)
# def test_repos_MegEngine():
# path_name = os.path.join(constants.seeds_dir, 'repos', 'MegEngine')
# multicall.multicall_directories(path_name, fuzzer='quickfuzz', validator=validate)
# def test... | |
self.disk_exists(pool, storagename):
if diskpool in volsxml:
volsxml[diskpool].append(volxml)
else:
volsxml[diskpool] = [volxml]
else:
common.pprint("Using existing disk %s..." % storagename, color='blue')
if index == 0 and diskmacosx:
macosx = True
machine = 'pc-q35-2.11'
if diskwwn is not None and diskbus =... | |
"""
core/shell.py -- Entry point for the shell interpreter.
"""
from __future__ import print_function
import errno
import time
from _devbuild.gen import arg_types
from _devbuild.gen.option_asdl import option_i, builtin_i
from _devbuild.gen.syntax_asdl import source
from asdl import runtime
from core import alloc
fr... | |
import torch
from set_matching.models.modules import (
ISAB,
MAB,
PMA,
SAB,
ConvolutionSentence,
CrossSetDecoder,
FeedForwardLayer,
LayerNormalizationSentence,
MultiHeadAttention,
MultiHeadExpectation,
MultiHeadSimilarity,
SetDecoder,
SetEncoder,
SetISABEncoder,
SlotAttention,
StackedCrossSetDecoder,
m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.