input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
import multiprocessing as mp
from copy import copy
import numpy as np
import tkinter
import pickle
import os
from itertools import accumulate
from matplotlib import pyplot as plt, lines
from casadi import Callback, nlpsol_out, nlpsol_n_out, Sparsity
from ..misc.data import Data
from ..misc.enums import PlotType, Cont... | |
import asyncio
import glob
import gzip
import hashlib
import importlib.util
import logging
import os
import re
import signal
import socket
import ssl
import sys
import threading
from email.utils import formatdate
from http.cookies import SimpleCookie
from logging.handlers import RotatingFileHandler
from traceback impor... | |
# Written by Dr <NAME>, Marda Science LLC
# for the USGS Coastal Change Hazards Program
#
# MIT License
#
# Copyright (c) 2021, Marda Science LLC
#
# 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 Soft... | |
MOBILE_PREFIX = [
{'prefix': '1', 'en': 'USA', 'cn': '美国'},
{'prefix': '1', 'en': 'PuertoRico', 'cn': '波多黎各'},
{'prefix': '1', 'en': 'Canada', 'cn': '加拿大'},
{'prefix': '7', 'en': 'Russia', 'cn': '俄罗斯'},
{'prefix': '7', 'en': 'Kazeakhstan', 'cn': '哈萨克斯坦'},
{'prefix': '20', 'en': 'Egypt', 'cn': '埃及'},
{'prefix': '... | |
# Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
# The implementation largely follows the design in PyTorch's `torch.distributions`
#
# Copyright (c) 2016- Facebook, Inc (<NAME>)
# Copyright (c) 2014- Facebook, Inc (<NAME>)
# Copyright (c) 2011-2014 Idiap Research Institute (<NAME>)
... | |
<gh_stars>0
import concurrent.futures
from collections import defaultdict
from dataclasses import dataclass
from pathlib import Path
from textwrap import indent
from typing import Dict, Iterable, List, Mapping, Optional, Sequence, Set
import pandas as pd
import typer
from more_itertools import chunked
from pydantic.er... | |
# validation work in March 9th
# The general purpose of this script is to generate the result
# published in cancer cell paper with ImmunoPepper
# Link: (https://www.sciencedirect.com/science/article/pii/S1535610818303064)
# validate 2019/03/07
import gzip
import pickle
import argparse
import sys
import os
import num... | |
OoOO000.join(timeout=0.1)
ii1Ii11I.append(sum(OoOO000.result))
print ((sum(ii1Ii11I) / (timeit.default_timer() - i1I1iI1iIi111i)) / 1000 / 1000) * 8
del OoOO000
if 1 - 1: II111iiii
OOooooO0Oo = Queue(6)
OO = threading.Thread(target=I1I1I, args=(OOooooO0Oo, files))
iIiIIi1 = threading.Thread(target=O0O, args=(OO... | |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A tool to extract size information for chrome, executed by buildbot.
When this is run, the current directory (cwd) should be th... | |
def set_Z_lims(self, lower=None, upper=None, extra_percent=0.0):
if lower is None:
lower = self.alt_limits[0]
if upper is None:
upper = self.alt_limits[1]
lower -= (upper-lower)*extra_percent
upper += (upper-lower)*extra_percent
self.coordinate_system.set_plotZ(lower, upper)
self.AltVsEw_axes.set_ylim([lo... | |
# This files contains your custom actions which can be used to run
# custom Python code.
#
# See this guide on how to implement these action:
# https://rasa.com/docs/rasa/core/actions/#custom-actions/
# This is a simple example for a custom action which utters "Hello World!"
import re
import io
import ast
import req... | |
that you give in the "x" local variable of this method.
"""
def getReluActivation(self, x):
if (x > 0):
return x
else:
return 0
"""
getReluActivationDerivative(x="the instant independent value from which you want to know the derivate of the dependent ReLU value/result")
This method calculates and returns t... | |
<reponame>ViriginaWangluyao/test
''' Utils for io, language, connectivity graphs etc '''
import os
import sys
import re
sys.path.append('build')
import MatterSim
import string
import json
import time
import math
from collections import Counter, defaultdict
import numpy as np
import networkx as nx
from param import arg... | |
import warnings
from functools import partial
import onnx
from onnx import numpy_helper
import tensorflow as tf
from onnx.mapping import TENSOR_TYPE_TO_NP_TYPE
import numpy as np
from tensorflow.python.ops.image_ops_impl import ResizeMethodV1
class Operations:
def make_op(self, op_type, inputs, attrs):
# print(op_... | |
<filename>Model.py
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
import torch
import torch.nn as nn
from block_zoo import *
import copy
import logging
import ujson as json
from utils.exceptions import ConfigurationError, LayerUndefinedError, LayerConfigUndefinedError
fro... | |
false,
"name": "name",
"type_key": "String"
}
],
"given_name": null,
"key": "Shape.241ac489ffa5f718db6444bae7849fb86a62e441",
"kind": {
"__enum__": "ConfigTypeKind.STRICT_SHAPE"
},
"scalar_kind": null,
"type_param_keys": null
},
"Shape.32aa7ec6e7407e8a502d0a6094909a9365103a8e": {
"__class__": "ConfigTypeS... | |
height_y > 0.7:
vr_z_offset = 0.01
if hmd_height + curr_offset[2] + vr_z_offset <= self.vr_settings.height_bounds[1]:
self.set_vr_offset([curr_offset[0], curr_offset[1], curr_offset[2] + vr_z_offset])
# Update haptics for body and hands
if self.main_vr_robot:
vr_body_id = self.main_vr_robot.links["body"].get_bod... | |
<reponame>JacobParrott/OccultationProfiler<filename>FindDopplerMain.py
import numpy as np
import spiceypy as spice
import spiceypy.utils.support_types as stypes
import pandas as pd
from os import *
import matplotlib.pyplot as plt
import time as timer
from scipy import constants
from tqdm import tqdm
import math
#Impo... | |
<filename>LSDPlottingTools/LSDMap_GDALIO.py<gh_stars>1-10
## LSDMap_GDALIO.py
##=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
## These functions are tools to deal with rasters
##=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
## SMM
## 26/07/2014
##=-=-=-=-=... | |
the variables for which del was inserted.
"""
blocks = wrap_parfor_blocks(parfor)
cfg = compute_cfg_from_blocks(blocks)
usedefs = compute_use_defs(blocks)
live_map = compute_live_map(cfg, blocks, usedefs.usemap, usedefs.defmap)
dead_map = compute_dead_maps(cfg, blocks, live_map, usedefs.defmap)
# treat loop var... | |
above that in the identifier so make sure the unique
# keyword is present
if attr[level][0] not in identifier:
raise InvalidIdentifier(
f"The Identifier is missing a unique key for " f"the '{level}' level"
)
def clear(session):
"""Delete all entries from the database.
Parameters
----------
session : sqlalch... | |
<reponame>Blank3495/aiotfm<gh_stars>0
import asyncio
import sys
import time
import traceback
from aiotfm.packet import Packet
from aiotfm.get_keys import get_keys
from aiotfm.connection import Connection
from aiotfm.player import Profile, Player
from aiotfm.tribe import Tribe
from aiotfm.message import Messa... | |
feat2 = params
interactions = []
# Favorable cation-nucleophile interaction
if feat1.name == "Nucleophile" and feat2.name in CATIONS:
dipole_grp, dipole_type = group1, "Nucleophile"
ion_grp, ion_type = group2, "Cation"
elif feat1.name in CATIONS and feat2.name == "Nucleophile":
dipole_grp, dipole_type = group2,... | |
<reponame>karlp/KiCost
# -*- coding: utf-8 -*-
# MIT license
#
# Copyright (C) 2018 by XESS Corporation / <NAME> / <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... | |
admx_policies:
admx_policies.append(policy_item)
log.trace("Search complete: %s seconds", time.time() - start_time)
if return_not_configured:
log.trace("Gathering non configured policies")
start_time = time.time()
not_configured_policies = ALL_CLASS_POLICY_XPATH(
admx_policy_definitions, registry_class=policy_c... | |
from __future__ import division
import io
import os
import logging
from math import ceil
import numpy as np
from sklearn.utils import Bunch
from keras.models import Sequential, Model
from keras.layers import (Conv2D, Dropout, Input, concatenate, MaxPooling2D,
Conv2DTranspose, UpSampling2D)
from keras.callbacks impo... | |
from datetime import datetime
from importlib import import_module
import inspect
import json
import logging
from multiprocessing import Process
from psycopg2.extras import execute_batch
import sys
import time
from django.conf import settings
from django.contrib.admin.utils import quote
from django.contrib.auth.models ... | |
#!/usr/bin/env python
# Copyright 2021, <NAME>, mailto:<EMAIL>
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Li... | |
int
numel_in(self, str iname) -> int
For a particular input or for all of the inputs
"""
return _casadi.Function_numel_in(self, *args)
def numel_out(self, *args):
"""
Get number of output elements.
numel_out(self) -> int
numel_out(self, int ind) -> int
numel_out(self, str oname) -> int
For a parti... | |
'met_heatflx_minute'
var_list[13].name = 'met_latnflx_minute'
var_list[14].name = 'met_netlirr_minute'
var_list[15].name = 'met_sensflx_minute'
var_list[16].name = 'eastward_velocity'
var_list[17].name = 'northward_velocity'
var_list[18].name = 'met_spechum'
var_list[0].data = np.array([])
var_list[1].d... | |
(m^3; net mouth is 15cm high)']]
concentration_surf = pd.DataFrame(np.divide(counts_surf.values, volume_surf.values))
# Get a nice array with three columns corresponding to the three 'super station' sites
concentrations = pd.DataFrame(columns=[0, 1, 2], index=[0, 1, 2, 3, 4, 5]).fillna(0.0)
depths = pd.DataFrame(c... | |
"""
Constructs for grouping tool parameters
"""
import logging
log = logging.getLogger( __name__ )
import os
import StringIO
import unicodedata
from basic import ToolParameter
from galaxy.datatypes import sniff
from galaxy.util import inflector
from galaxy.util import relpath
from galaxy.util import sanitize_for_file... | |
if pixel_select == 1:
#RD=dir([r_path 'multiharlocs*.mat']); # DOESN'T seem to be used
#str1=[q_path 'multiharlocs_' num2str(tmplt_index,'%.6d') '.mat'];
#load(str1)
# Retrieve the query harloc (Harris features)
har1pp = q_path[tmplt_index];
#str2=[r_path 'multiharlocs_' num2str(img_index,'%.6d') '.mat'];
#har... | |
squares, three moves
board = Board('k7/pp6/8/8/8/8/PPPPPPPP/RNBQKBNR w - - 0 1')
target_bb = BitBoard(0)
target_bb[Sq.H3] = 1
target_bb[Sq.E4] = 1
moves = board.get_target_noncapture_moves(target_bb)
assert len(moves) == 3
assert sorted(moves) == sorted([Move(Sq.E2, Sq.E4, MoveType.DOUBLE),
Move(Sq.H2, Sq.H3, M... | |
auth_source_ldap['name'] = self.params.name
auth_source_ldap['attr_mail'] = self.params.extra['attr_mail']
auth_source_ldap['account_password'] = self.params.extra['account_password']
auth_source_ldap['attr_firstname'] = self.params.extra['arttr_firstname']
auth_source_ldap['host'] = self.params.extra['host']
auth... | |
<reponame>myvyang/rre
#!/usr/bin/env python
# coding: utf-8
import os
import sys
"""
laucha: regular expressions static compiler.
<NAME>, @alejolp
"""
RE_SPECIAL_SYMBOLS = set(".[]^$()*+?|{}")
RE_CLASSES = ['[:upper:]', '[:lower:]', '[:alpha:]', '[:alnum:]', '[:digit:]', '[:xdigit:]', '[:punct:]', '[:blank:]', '[:sp... | |
<reponame>gynvael/stream
from z3 import *
def movsx(v):
return ZeroExt(32 - 8, v)
def imul(a, b, c = None):
if c is None:
return a * b
return b * c
def xor_(r, v):
return r ^ v
def or_(r, v):
return r | v
def mov(_, r2):
return r2
def shr(r1, c):
return LShR(r1, c)
def shl(r1, c):... | |
struct_anon_97(Structure):
__slots__ = [
'type',
'serial',
'send_event',
'display',
'window',
'deviceid',
'mode',
'detail',
'time',
]
struct_anon_97._fields_ = [
('type', c_int),
('serial', c_ulong),
('send_event', c_int),
('display', POINTER(Display)),
('window', Window),
('deviceid', XID),
('mode', ... | |
no children of the same type, so it's the "deepest" in its branch.
else:
# Return this match
return node
# Failing a direct descendant match, we'll check each descendant's children (grandchildren check)
for node in self.nodes:
# Check for grandchild node
node2 = node.find_deepest_node_by_tag(tag_type)
# Di... | |
f the fraction on N
# of the max growth rate
ga_vars = self.get_ordered_ga_vars()
out_expr = self.mu.variable.lb
# Build z = ga_0*2^0*mu_max/N * [E]
# + ga_1*2^1*mu_max/N * [E]
# + ...
# + ga_n*2^n*mu_max/N * [E]
for i, ga_i in enumerate(ga_vars):
# Linearization step for ga_i * [E]
z_name = '... | |
<reponame>facebookresearch/Project_FARSI
#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 json
import os
from settings import config
from typing import Dict, List
import collections
import ... | |
"""Preprocessing functions.
Authors: <NAME> <<EMAIL>>
<NAME> <<EMAIL>>
"""
def preprocess_fif(fif_file, l_freq=None, h_freq=None, down_sfreq=None):
"""Filter and downsample data."""
import os
from mne.io import read_raw_fif
from mne import pick_types
from nipype.utils.filemanip import split_filename as split_f... | |
<reponame>davidyzeng/sigpy<filename>sigpy/plot/image.py<gh_stars>0
# -*- coding: utf-8 -*-
"""Image plot.
"""
import os
import uuid
import subprocess
import datetime
import numpy as np
import matplotlib.pyplot as plt
from sigpy.util import prod, move
class Image(object):
"""Plot array as image.
Keyword Args:
x/y... | |
<reponame>duncanesmith/lsclib
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 18 10:33:32 2019
@author: smithd24
"""
# import common functions from default python library
import math # import math functions
import random # import random number functions
import numpy as np # import numpy matrix operations
# import tra... | |
# -*- coding: utf-8 -*-
import time
import sys
import traceback
import xbmc
import xbmcgui
# Add JSON support for queries
if sys.version_info < (2, 7):
import simplejson
else:
import json as simplejson
# Import the common settings
from settings import Settings
from settings import log
from settings import os_path_j... | |
<filename>mom6_tools/m6plot.py<gh_stars>1-10
"""
A method for producing a standardized pseudo-color plot of 2D data
"""
import os
try:
if os.environ['DISPLAY'] != None: pass
except:
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.colors import BoundaryNorm, ListedColormap, Lo... | |
ID can be in ASCII form (e.g. "abcd") or in
colon-separated HEX form (e.g. 1:2:ab:cd). HEX representation is
used only when the sub-option value contains unprintable
characters. If a remote ID sub-option value is in ASCII form, it
is always enclosed in quotes to prevent ambiguous values (e.g.
"10:20" - ASCII 5-byt... | |
<filename>evap/staff/views.py
import csv
import itertools
from collections import OrderedDict, defaultdict, namedtuple
from dataclasses import dataclass
from datetime import date, datetime
from typing import Any, Container, Dict
from django.conf import settings
from django.contrib import messages
from django.core.exce... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2011-2014, <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 requi... | |
Waveform
0xe0c8: {
'align': 'l', 'valign': 'c', 'stretch': 'xy', 'params': {'overlap': 0.01}},
# Hexagons
0xe0cc: {'align': 'l', 'valign': 'c', 'stretch': 'xy', 'params': ''},
0xe0cd: {'align': 'l', 'valign': 'c', 'stretch': 'xy', 'params': ''},
# Legos
0xe0ce: {'align': 'l', 'valign': 'c', 'stretch': '... | |
<filename>melodic/lib/python2.7/dist-packages/mavros_msgs/msg/_CommandCode.py
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from mavros_msgs/CommandCode.msg. Do not edit."""
import codecs
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
c... | |
= [
]
mock_do_request.side_effect = [
MockResponse(200, ""),
MockResponse(200)
]
expected = [
{
"lang": "en",
"format": "html",
"pid_v2": "pid-v2", "acron": "xjk",
"doc_id_for_human": "artigo-1234",
"doc_id": "ldld",
"uri": "https://www.scielo.br/j/xjk/a/ldld?format=html&lang=en",
"available": True,
"sta... | |
<gh_stars>0
"""
This module handles conversion of POP files to JSON files in ESPEI format
"""
from sympy.parsing.sympy_parser import parse_expr
from pyparsing import *
from pop_keywords import expand_keyword, POP_COMMANDS
print("""WARNING! This module is VERY experimental. You will most likely get failures or incorre... | |
= SymmetricFunctions(QQ)
sage: e = NCSym.e()
sage: elem = Sym.e()
sage: elt = e.from_symmetric_function(elem[2,1,1]); elt
1/12*e{{1}, {2}, {3, 4}} + 1/12*e{{1}, {2, 3}, {4}} + 1/12*e{{1}, {2, 4}, {3}}
+ 1/12*e{{1, 2}, {3}, {4}} + 1/12*e{{1, 3}, {2}, {4}} + 1/12*e{{1, 4}, {2}, {3}}
sage: elem(elt.to_symmetric_func... | |
if len(list_sentences) > 1:
split_match = TMSplitMatch([TMUtilsMatching.pre_process(q.split(' '), self.src_lang, 'untokenizer', {}) for q in list_sentences], [], self.src_lang, self.tgt_lang, 'sentence', self.machine_translation, self.domain)
src_text, tgt_text, editSplit = split_match._match()
#print('*****Only se... | |
<reponame>aalmah/Theano<gh_stars>0
"""
Define abstract conv2d interface
"""
import logging
import theano
from theano.tensor import (as_tensor_variable, patternbroadcast)
from theano.tensor import TensorType
from theano.gof import Apply, Op
from theano.gof import local_optimizer
from theano.tensor.opt import register_s... | |
import datetime
import json
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import Column, Integer, String, Boolean, ForeignKey, Float, \
Enum, DateTime, Numeric, Text, Unicode, UnicodeText
from sqlalchemy import event
from sqlalchemy.dialects.mysql import LONGTEXT
from sqlalchemy.sql import func
from sqlalche... | |
<gh_stars>0
# Copyright 2018 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... | |
# 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 ... | |
<filename>pyethapp/jsonrpc.py<gh_stars>0
from decorator import decorator
from collections import Iterable
import inspect
from ethereum.utils import is_numeric, is_string, int_to_big_endian, encode_hex, decode_hex, sha3
import ethereum.slogging as slogging
from ethereum.transactions import Transaction
from ethereum impo... | |
<gh_stars>0
"""Parse the model definition into a MCX graph.
When the user defines a model in MCX she uses the symbol `<~` to denote random
variable assignment, and the decorator `@mcx.model` to denote the definition of
a multivariate distribution. The constructs do not exist in Python and we parse
them into SampleOps ... | |
import torch
import torch.nn as nn
import torch.nn.functional as F
class ResNet50(nn.Module):
def __init__(self, num_classes = 1000):
super(ResNet50, self).__init__()
self.conv1 = nn.Conv2d(3, 64, kernel_size = 7, stride = 2, padding = 3, bias = False) # 112x112x64, 1층
self.bn = nn.BatchNorm2d(64)
self.maxpool ... | |
<filename>Misc/functionalList.py
#=============================================
#=============================================
# A Functional-Paradigm List Implementation
# in Python 3
#
# <NAME>
#=============================================
#=============================================
"""
The following code impleme... | |
<gh_stars>10-100
#!/usr/bin/env python
#------------------------------
def usage() : return "Use command: python hexanode/examples/ex-10-sort-data.py"
#------------------------------
import os
import sys
import hexanode
import numpy as np
from time import time
from math import sqrt
from pyimgalgos.GlobalUtils import ... | |
find CLR method
"""
IsRequiredForFormCore(self: UIElementAutomationPeer) -> bool
Gets a value that indicates whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
Sy... | |
3)
self.points_table = FCTable()
self.points_table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
# self.points_table.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustToContents)
grid_lay.addWidget(self.points_table, 16, 0, 1, 3)
self.points_table.setColumnCount(4)
self.points_table.setHori... | |
<filename>src/vrf.py
from src import common_ops
import json
def get_all_vrfs(**kwargs):
"""
Perform a GET call to get a list (or dictionary) of all entries in VRF table
:param kwargs:
keyword s: requests.session object with loaded cookie jar
keyword url: URL in main() function
:return: List/dict of all VRFs i... | |
from .explorers import *
from .jericho_env import *
from .utils import *
import time
from tqdm import tqdm
@dataclass
class GridDimension:
attr: str
div: int
@dataclass()
class ChainLink:
__slots__ = ['start_cell', 'end_cell', 'seed']
start_cell: typing.Any
end_cell: typing.Any
seed: int
@dataclass
class C... | |
# coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2016-2018 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to d... | |
finger_jnt:
self.ring_list.append(finger_jnt)
elif "pinky" in finger_jnt:
self.pinkey_list.append(finger_jnt)
# Move the hand_cc, move the pivot to the wrist, and rename it
if self.type_flag == "hand":
self.hand_cc = cmds.duplicate(self.hand_cc, n="hand_" + self.side + "_cc")[0]
elif self.type_flag == "... | |
return Component('Multiply', arguments={'left': self, 'right': Component.of(other)})
def __rmul__(self, other) -> "Component":
return Component('Multiply', arguments={'left': Component.of(other), 'right': self})
def __floordiv__(self, other) -> "Component":
return Component('Divide', arguments={'left': self, 'rig... | |
content_cell = content_cell['content']
# spec. align property
SPEC_PROPS = ['align',]
if 'align' in cell_spec_style:
align = celstyle[i]['align']
# any property for cell, by OOXML specification
for cs, attrs in cell_spec_style.items():
if cs in SPEC_PROPS:
continue
cell_prop = makeelement(cs, attributes=attr... | |
<reponame>Askinkaty/text-readability<gh_stars>0
# -*- coding: utf-8 -*-
from process_gram import process_grammar
import codecs
first_pp = ['мы', 'я', 'наш', 'мой']
second_pp = ['ты', 'вы', 'ваш', 'твой']
third_pp = ['он', 'она', 'они', 'оно', 'их', 'ee', 'его', 'ихний', 'ихним', 'ихнем']
indef_pron = ['некто', 'некого... | |
or rev_big == 20 ):
version = 20.0;
elif ( rev_little == 21 or rev_big == 21 ):
version = 21.0;
elif ( rev_little == 23 or rev_big == 23 ):
version = 21.0;
elif ( rev_little == 24 or rev_big == 24 ):
version = 24.0;
elif ( rev_little == 26 or rev_big == 26 ):
version = 26.0;
else:
raise UnknownPfile("Un... | |
"""A basic extended attributes (xattr) implementation for Linux, FreeBSD and MacOS X."""
import errno
import os
import re
import subprocess
import sys
import tempfile
from ctypes import CDLL, create_string_buffer, c_ssize_t, c_size_t, c_char_p, c_int, c_uint32, get_errno
from ctypes.util import find_library
from distu... | |
numbers.
portstr: does exactly that.
Example:
dfm r:logs service=port:port,proto
The above will create/overwrite columns 'service' with a port string
constructed from the port number and protocol number:
service,port,proto
80/tcp,"80","6"
53/udp,53,17
'''
# sanity check lhs, rhs
errors = []
if len(lhs)... | |
<reponame>Na2CuCl4/latex2sympy<filename>gen/PSLexer.py
# Generated from PS.g4 by ANTLR 4.7.2
# encoding: utf-8
from __future__ import print_function
from antlr4 import *
from io import StringIO
import sys
def serializedATN():
with StringIO() as buf:
buf.write(u"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2"... | |
json.load(setup)
else:
with open("POSCAR", "r") as poscar:
for line_ind, line in enumerate(poscar):
if line_ind in [5, 6]:
no_of_atoms = sum([int(atom_no) for atom_no in re.findall("[0-9]+", line)])
if no_of_atoms > 0: break
raw_argv_dict = {key.lower(): value for key, value in [argv.split(":") for argv in arg... | |
<reponame>RobSpringer/xls<filename>xls/contrib/xlscc/build_rules/xlscc_rules.bzl
# Copyright 2021 The XLS 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/lic... | |
retrieve the preferred
lifetime value of a DHCP IPv6 Network object.
range_templates: The list of IPv6 address range templates assigned
to this IPv6 network template object. When you create an IPv6
network based on an IPv6 network template object that contains
IPv6 range templates, the IPv6 address ranges are crea... | |
return vimagemodule.VImage_tan(*args)
def andimage(*args): return vimagemodule.VImage_andimage(*args)
def orimage(*args): return vimagemodule.VImage_orimage(*args)
def eorimage(*args): return vimagemodule.VImage_eorimage(*args)
def shiftleft(*args): return vimagemodule.VImage_shiftleft(*args)
def shiftright(*args)... | |
/ "correct2002",
feeddown=0,
ips=correct_ips,
ignore_missing_columns=True,
iterations=1,
)
# Testing --------------------------------------------------------------
# Check output data ---
assert len(list(tmp_path.glob("correct*"))) == 6
# Check all found correctors ---
# only octupole correctors should be p... | |
# Copyright 2020 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... | |
<reponame>RuichunWang/ModelArts-Lab<filename>tools/DeepFM-GPU/code/data_process.py
# coding:utf-8
import os
import pickle
import glob
import toml
import collections
import argparse
import tensorflow as tf
import numpy as np
import pandas as pd
import time
class DataStatsDict():
def __init__(self, value_col_num=13, ... | |
import numpy as np
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import spikewarp as sw
"""
Class and helpers for main clustering meta analyses
"""
class MetaClusterAnalysisHolder(object):
def __init__(self, shuffle_option_string, is_mainz=True):
self.shuffle_option_string = shuffle_op... | |
inequality](
https://en.wikipedia.org/wiki/Jensen%27s_inequality))
this is *smaller* in expectation than the true
`log p(observations[t] | observations[:t])`.
${non_markovian_specification_str}
#### Examples
**Tracking unknown position and velocity**: Let's consider tracking an object
moving in a one-dimensio... | |
# -*- mode: python; coding: utf-8 -*-
# Copyright 2012-2018 <NAME> <<EMAIL>> and collaborators.
# Licensed under the MIT License.
"""Model data with least-squares fitting
This module provides tools for fitting models to data using least-squares
optimization.
"""
from __future__ import absolute_import, division, prin... | |
Adjustment Method: SS-S by stability class Alpha w/cup')
ResultsLists_class_alpha_Ane = initialize_resultsLists('class_alpha_Ane')
className = 1
for item in All_class_data_alpha_Ane:
inputdata_adj, lm_adj, m, c = adjuster.perform_SS_S_adjustment(item.copy())
print ("SS-S: y = " + str(m) + "* x +" + str(c))
... | |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Hash Code 2017
"""
import os, sys
from pprint import pprint
import argparse
import time
import datetime
import pandas as pd
from pymongo import MongoClient
import numpy as np
from math import cos, sin
from collections import defaultdict, deque
import copy
import mat... | |
-- an end-user error
if not self.commands:
raise DistutilsArgError, "no commands supplied"
# All is well: return true
return 1
def _get_toplevel_options(self):
"""Return the non-display options recognized at the top level.
This includes options that are recognized *only* at the top
level as well as options r... | |
"""
Module implements classes and functions to specify data for use in pointlike analysis.
author(s): <NAME>, <NAME>
"""
__version__ = '$Revision: 1.29 $'
#$Header: /nfs/slac/g/glast/ground/cvs/pointlike/python/uw/data/dataman.py,v 1.29 2016/06/22 17:02:49 wallacee Exp $
import os, sys
import collections
import glob... | |
# -*- coding: utf-8 -*-
# Copyright © 2014, German Neuroinformatics Node (G-Node)
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted under the terms of the BSD License. See
# LICENSE file in the root of the Project.
import os
import gc
import nu... | |
maint_date
maintenance.maint_type = row[8]
maintenance.current_mileage = row[7]
maintenance.description = row[2]
maintenance.projected_cost = row[11]
maintenance.actual_cost = row[12]
maintenance.difference = row[13]
maintenance.status = "Good Condition"
maintenance.invoice_number = row[3]
maintenance.service_... | |
"""UmiSchedules module."""
import calendar
import collections
import hashlib
from datetime import datetime
import numpy as np
import pandas as pd
from validator_collection import validators
from archetypal.schedule import Schedule, _ScheduleParser, get_year_for_first_weekday
from archetypal.template.umi_base import ... | |
is '<CatName>_HTM'
Output :- A list of N_trixels dictionnaries containing the 2D matrix info
example:
By : <NAME> (original Matlab function by <NAME>) August 2018"""
#print('I am looking for the data in',catalogs_dir + '/' + CatDir + '/' +Filename)
Data=class_HDF5.HDF5(catalogs_dir + '/' + CatDir + '/' +Filename).... | |
import numpy as np
import matplotlib
import platform
if platform.system() == 'Darwin':
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
from matplotlib import rcParams
import torch
from datetime import datetime
import time
import pickle
import os
import seaborn as sns
import matplotlib.pylab as plt
from scipy... | |
direct children.
children = sorted(directory_node.Query(filter_string=filter_string,
limit=100000))
# Filter the children according to types.
if self.visible_types:
children = [x for x in children
if x.__class__.__name__ in self.visible_types]
self.content_cache.Put(key, children)
try:
self.message = "Direc... | |
Optional[pulumi.Input[bool]]):
pulumi.set(self, "tls", value)
@property
@pulumi.getter(name="userDisabledBitMask")
def user_disabled_bit_mask(self) -> Optional[pulumi.Input[int]]:
"""
User disabled bit mask (int)
"""
return pulumi.get(self, "user_disabled_bit_mask")
@user_disabled_bit_mask.setter
def user_d... | |
'</td>' + \
'<td>' + r10c3 + '</td>' + \
'<td>' + r10c4 + '</td>' + \
'<td>' + r10c5 + '</td>' + \
'<td>' + r10c6 + '</td>' + \
'<td>' + r10c7 + '</td>' + \
'<td>' + r10c8 + '</td>' + \
'<td>' + r10c9 + '</td>' + \
'<td>' + r10c10 + '</td>' + \
'<td>' + r10c11 + '</td>' + \
'<td>' + r10c12... | |
'''
Created on Jul 07, 2015
@author: alexandru-m-g
'''
import datetime
import json
import logging
from flask import request
from sqlalchemy import or_
import ckan.lib.dictization.model_save as model_save
import ckan.lib.munge as munge
import ckan.lib.plugins as lib_plugins
import ckan.lib.uploader as uploader
impor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.