input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
id2, suf = m.groups()
ext1 = idMap[id1]
ext2 = idMap[id2]
if not suf:
if ext1[0] == ext2[0]:
# edge is an adjacency
if ext1[0] not in adjacenciesList:
adjacenciesList[ext1[0]] = list()
adj = (ext1[1:], ext2[1:])
adjacenciesList[ext1[0]].append(adj)
weightsDict[adj] = 0.0
else:
# edge is an extremity edge (m... | |
"eth0 rx bytes": [ETH0_RX_BYTES, {}],
"wlan_soma tx bytes": [WLAN_TX_BYTES, {}],
"wlan_soma rx bytes": [WLAN_RX_BYTES, {}],
"txq_busy_rate": [TX_QUEUE_BUSY_RATE, {}],
"MPDUs delivered to HTT": [RX_MPDUS, {}],
"MPDU errors (FCS, MIC, ENC)": [FCS_ERRORS, {}],
"service_counters": [SERVICE_COUNTERS, {}],
"dns_reques... | |
"""Create citation files from a bib file."""
import bibtexparser
import tempfile
from bibtexparser.bparser import BibTexParser
from bibtexparser.customization import homogenize_latex_encoding
import os
from pathlib import Path
def makemycv(filename='cv.bib',
silent=True,
bibtex_types=('inbook', 'article', 'periodi... | |
Q1nm c0ea 4serr
%
Gbqnl'f fcnz:
Unir lbh frra rirel Cnevf Uvygba frk gncr znqr lrg?
Lbh unir gb purpx vg bhg vgf n serr naq zhpu zber!
Purpx ure bhg urer
%
Gbqnl'f fcnz:
Orpbzr N yrguny Jrncba genvarq ol Ehffvna XTO ntragf!
%
Gbqnl'f fcnz:
Yrnea Gur Gehr Frpergf Bs Frys Qrsrafr Naq Unir Na Hasnve Nqinagntr
Bire Nal ... | |
self.assertRaises(errors.ResourceNotFound):
self.fs.openbin("foo.bin")
# Open from missing dir
with self.assertRaises(errors.ResourceNotFound):
self.fs.openbin("/foo/bar/test.txt")
self.fs.makedir("foo")
# Attempt to open a directory
with self.assertRaises(errors.FileExpected):
self.fs.openbin("/foo")
# Att... | |
environmental boundary for water-based organism
if(self.get_block(x).terrain_type == animal.preferred_terrain or (animal.preferred_terrain != "water" and self.get_block(x).terrain_type == "water" and self.get_block(x).terrain_water_depth <= 1)):
if(food_type == "herbivore" or food_type == "omnivore"):
# if herb/omni... | |
<reponame>h3dema/deepwifi
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import time
import logging
from collections import namedtuple
"""create a log variable for this module"""
LOG = logging.getLogger('common')
#
#
# definitions
#
#
#
AP_Config = namedtuple('AP', ['id', 'name', 'port', 'iface', 'mac', 'SS... | |
<filename>django_windows_tools/management/commands/winfcgi.py
# encoding: utf-8
# FastCGI-to-WSGI bridge for files/pipes transport (not socket)
#
# Copyright (c) 2002, 2003, 2005, 2006 <NAME> <<EMAIL>>
# Copyright (c) 2011 <NAME> <<EMAIL>>
# Copyright (c) 2012 <NAME> <<EMAIL>>
# All rights reserved.
#
# Redistribution... | |
<filename>lapd_codes/mo_codes.py<gh_stars>0
mo_codes = {
'0100': 'Suspect Impersonate',
'0101': 'Aid victim',
'0102': 'Blind',
'0103': 'Crippled',
'0104': 'Customer',
'0105': 'Delivery',
'0106': 'Doctor',
'0107': 'God',
'0108': 'Infirm',
'0109': 'Inspector',
'0110': 'Involved in traffic/accident',
'0112': '... | |
# Copyright (C) 2014-2017 <NAME>, <NAME>, <NAME>, <NAME> (in alphabetic order)
#
# This file is part of OpenModal.
#
# OpenModal is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
... | |
import abc
import numpy as np
from menpo.transform import AffineTransform
from menpo.transform.fastpwa import CLookupPWA
from menpo.transform.base import PureAlignment, Invertible, Transform
# TODO View is broken for PWA (TriangleContainmentError)
class TriangleContainmentError(Exception):
r"""
Exception that is th... | |
self.nmRazao is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<%snmRazao>%s</%snmRazao>%s' % (namespace_, self.gds_encode(self.gds_format_string(quote_xml(self.nmRazao), input_name='nmRazao')), namespace_, eol_))
if self.nmCont is not None:
showIndent(outfile, level, pretty_print)
outfile.write... | |
<filename>executor/contexts.py
# Programmer friendly subprocess wrapper.
#
# Author: <NAME> <<EMAIL>>
# Last Change: May 20, 2018
# URL: https://executor.readthedocs.io
r"""
Dependency injection for command execution contexts.
The :mod:`~executor.contexts` module defines the :class:`LocalContext`,
:class:`RemoteConte... | |
"""
pyGoogleTranslate
--> A Google Translate webpage parser for Python 3
⚠️ Do not forget to set the used browser with browser()\n
⚠️ Do not forget to call browser_kill() after using pyGoogleTranslate (at the end of your script/when you stop your script)\n
Without browser_kill(), your browser will stay opened until y... | |
<filename>tests/router_policy_test.py
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Versio... | |
OK (elt:Any) element R
drived by restriction from wildcard (any) B : B's namespace=##any, R's
targetNamespace=absent, B's minOccurs=absent, R's minOccurs=absent
"""
assert_bindings(
schema="msData/particles/particlesJc009.xsd",
instance="msData/particles/particlesJc009.xml",
class_name="Doc",
version="1.1",
mo... | |
IDLObjectWithIdentifier.__init__(self, location, parentScope, identifier)
IDLObjectWithIdentifier.resolve(self, parentScope)
def finish(self, scope):
pass
def validate(self):
pass
def isExternal(self):
return True
def isInterface(self):
return True
def isConsequential(self):
return False
def addExtend... | |
None #: The offset of the first section header in the file.
flags = None #: The flags. Currently, no flags are defined.
hsize = None #: The size of the header.
phentsize = None #: The size of a program header.
phnum = None #: The number of program headers.
shentsize = None #: The size of a section header.
shnum =... | |
<reponame>rpeloff/multimodal_one-shot_learning
"""
TODO(rpeloff) old batch feeder code; need to update/remove/merge this with batch.py
TODO(rpeloff) triplets section adapted from https://github.com/kamperh/tflego/blob/master/tflego/test_siamese.py
Author: <NAME>
Contact: <EMAIL>
Date: May 2018
"""
import numpy as np... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import itertools
import json
import logging
import multiprocessing
import os
import pprint
import re
import sys
from pelican.generators import ArticlesGenerator
from pelican.generators import PagesGenerator
from pelican.settings import DE... | |
import os
import numpy as np
import pandas as pd
import torch
from torch.utils.data import Dataset, DataLoader
# from sklearn.preprocessing import StandardScaler
from utils.tools import StandardScaler
from utils.timefeatures import time_features
import warnings
warnings.filterwarnings('ignore')
class Dataset_ETT_ho... | |
<filename>create_managed_endpoint.py
import json
from logging import FATAL
import string
import uuid
import argparse
import boto3
from botocore.exceptions import ClientError
import re
import sys
import datetime
import time
def exists_hz(hzonename):
# Detects if hosted zone exists. returns True if found,... | |
x.__eq__(y) <==> x==yx.__eq__(y) <==> x==y """
pass
def __init__(self, *args): #cannot find CLR method
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __str__(self, *args): #cannot find CLR method
p... | |
<gh_stars>1-10
#
# Autogenerated by Thrift Compiler (0.14.2)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
from thrift.T... | |
r"""
Piecewise-defined Functions
Sage implements a very simple class of piecewise-defined functions.
Functions may be any type of symbolic expression. Infinite
intervals are not supported. The endpoints of each interval must
line up.
TODO:
- Implement max/min location and values,
- Need: parent object - ring of pie... | |
<filename>src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_view_operations.py
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the p... | |
<reponame>iobeam/iobeam-client-python<filename>iobeam/iobeam.py
"""The iobeam client and related types/methods."""
from .endpoints import devices
from .endpoints import exports
from .endpoints import imports
from .endpoints import tokens
from .http import request
from .resources import data
from .resources import devic... | |
= None
# $ANTLR start "variableDeclarationList"
# D:\\PycharmProjects\\SolidityObfuscator\\src\\solidityobf\\T\\sol.g:201:1: variableDeclarationList : ( variableDeclaration )? ( ',' ( variableDeclaration )? )* ;
def variableDeclarationList(self, ):
retval = self.variableDeclarationList_return()
retval.start =... | |
and (body := self.func_suite()) is not None
):
return Class(name, body, parent_classes, generics_annotation)
return None
@backtrackable
@memoize
def lhs_argument_trailer(self):
"""
rule =
| '[' subscripts ']'
| '.' identifier
"""
cursor, row, column = self.cursor, *self.get_line_info()
# FIRST ALTERNAT... | |
match_criteria['PROJECT_URN']
if not isinstance(urns, list):
urns = [urns]
match_criteria['PROJECT_NAME'] = \
[from_project_urn(urn) for urn in urns]
q = session.query(self.db.PROJECT_TABLE)
q = add_filters(q, match_criteria, self.db.PROJECT_TABLE, \
SA.project_field_mapping, session)
rows = q.all()
projects ... | |
'86138357':{'en': '<NAME>', 'zh': u('\u5c71\u897f\u7701\u4e34\u6c7e\u5e02')},
'86138354':{'en': '<NAME>', 'zh': u('\u5c71\u897f\u7701\u664b\u4e2d\u5e02')},
'86138355':{'en': 'Changzhi, Shanxi', 'zh': u('\u5c71\u897f\u7701\u957f\u6cbb\u5e02')},
'86138428':{'en': 'Dalian, Liaoning', 'zh': u('\u8fbd\u5b81\u7701\u5927\u... | |
#!/bin/env python
"""
ProofPDF.py. A wrapper for the fontPDF.py module. This script verifies
the existence of the specified font files, crreates a font class object
with the call-backs required by fontPDF, and translates the command line
options to arguments for the fontPDF module; the latter produces a proof
file usin... | |
divide by range (1) or by weighted range (2)
:type unbias: integer or None
:param normalize: divide by 1st coefficient (1) or by maximum abs. value (2)
:type normalize: integer or None
:return coefficients: autocorrelation coefficients [normalized, unbiased]
:rtype coefficients: numpy array
:return N: number of c... | |
<filename>core/process.py
# Copyright 2016 <NAME>. 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
"""
process.py - Launch pr... | |
# imports from core
from pyjamas_core import Supermodel
from pyjamas_core.util import Input, Output
# imports for database
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from Models.Technology.European_power_plant.V001.db.db_declarative import Base, Kraftwerk, Co2Preis
# all other tables ... | |
#! /usr/bin/env python
# -*- coding:utf-8 -*-
"""Generate SN Ia toy models for Weizmann workshop code-comparison study
(Radiation Transfer and Explosive Thermonuclear Burning in Supernovae,
17-28 June 2018)
The model is defined by its total mass (--mtot) and asymptotic kinetic
energy (--ekin; alternatively it... | |
FLOWCONTROL[ unit_configure["FanControlType"] ]["a3"]
a2 = FLOWCONTROL[ unit_configure["FanControlType"] ]["a2"]
a1 = FLOWCONTROL[ unit_configure["FanControlType"] ]["a1"]
a0 = FLOWCONTROL[ unit_configure["FanControlType"] ]["a0"]
if unit_configure["FanMinOpeningRate"] == None:
Vmin = 1
else:
Vmin = unit_config... | |
self.targets]
#
# drivers = [list(map(np.float64, [driver.identity,
# driver.max_capacity,
# len(driver.loaded),
# driver.max_capacity - len(driver.loaded)] + driver.get_trunk())) for driver in self.drivers]
# return world, targets, drivers, positions, time_constraint
elif self.rep_type=='3':
# Depot (2dim), t... | |
<filename>scriptabit/habitica_service.py<gh_stars>1-10
# -*- coding: utf-8 -*-
""" Habitica API service interface.
"""
# Ensure backwards compatibility with Python 2
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals)
from builtins import *
import logging
from enum import Enum
i... | |
"""
This code is automatically generated. Never edit it manually.
For details of generating the code see `rubi_parsing_guide.md` in `parsetools`.
"""
from sympy.external import import_module
matchpy = import_module("matchpy")
if matchpy:
from matchpy import Pattern, ReplacementRule, CustomConstraint, is_match
from... | |
"""
Wiki gems exporter
Overview
===============================================================================
+----------+------------------------------------------------------------------+
| Path | PyPoE/cli/exporter/wiki/parsers/gems.py |
+----------+---------------------------------------------------------------... | |
local_router_id
continue
# Status: s-suppressed, x-deleted, S-stale, d-dampened, h-history, *-valid, >-best
# Path type: i-internal, e-external, c-confed, l-local, a-aggregate, r-redist, I-injected
# Origin codes: i - IGP, e - EGP, ? - incomplete, | - multipath, & - backup
# *>i[2]:[77][7,0][10.69.9.9,1,15158708... | |
<gh_stars>1-10
import cv2.aruco as aruco
from PIL import Image
import datetime
import _datetime
import itertools
import numpy as np
import cv2
import time
import math
import threading
import sys
from fps_limiter import LimitFPS
from dji_asdk_to_python.errors import CustomError
from dji_asdk_to_python.flight_controller.... | |
<filename>code.py<gh_stars>1-10
import streamlit as st
import streamlit.components.v1 as stc
#load EDA
import pandas as pd
import numpy as np
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.metrics.pairwise import cosine_similarity,linear_kernel
from scipy.sparse import csr_matrix
from sklearn... | |
"Malmö",
"es_ES": "Malmö",
"fr_FR": "Malmö",
"it_IT": "Malmö",
"ja_JP": "マルメ",
"ko_KR": "말뫼",
"pl_PL": "Malmö",
"pt_BR": "Malmö",
"ru_RU": "Мальме"
},
"MAMULL_MAPU": {
"de_DE": "Mamüll Mapu",
"es_ES": "Mamüll Mapu",
"fr_FR": "Mamüll Mapu",
"it_IT": "Mamüll Mapu",
"ja_JP": "マムル・マプ",
"ko_KR": "마물 마푸",
"p... | |
import gzip
import io
import json
import os
from hashlib import sha1
from metaflow._vendor import click
from . import parameters
from .current import current
from .exception import MetaflowException
from .metaflow_config import DATATOOLS_LOCALROOT, DATATOOLS_SUFFIX
from .parameters import DeployTimeField, Parameter... | |
<gh_stars>0
"""
Project: Hotel management system \n
Name: <NAME>, <NAME> \n
Date: 28-02-2022 \n
Info: Main running file for hotel application. \n
This is in theory meant to be used by personal at a given hotel,
hence the management of seeing SSN easily.
"""
from abc import ABCMeta, abstractmethod
import json
import o... | |
= samples_out.astype(dtype=np.float)/2**15
except:
# ADC read failed.
print('Unhandled exception in ADC read')
# del self.sl
# raise
# Signal to other functions that they can use the DDR2 logger
self.sl.bDDR2InUse = False
print('Elapsed time (Comm) = %f' % (time.perf_counter()-start_time))
start_... | |
#!/usr/bin/env python3
from flask import Flask
from flask import request
from flask import jsonify
import random
import traceback
'''
This is a slack slash command dicebot.
Slack slash commands can be run against this command.
And various dice can be rolled.
The following options exist:
- /roll - this rolls the nu... | |
> var115)
s.add(var111 > var114)
s.add(var111 > var113)
s.add(var111 < var112)
s.add(var111 < var110)
s.add(var111 > var10f)
s.add(var111 > var10e)
s.add(var111 < var10c)
s.add(var111 > var10b)
s.add(var111 < var10a)
s.add(var111 > var109)
s.add(var111 < var108)
s.add(var111 > var107)
s.add(var111 > var106)
s.add(var11... | |
import logging
from Pyro5.compatibility import Pyro4
try:
import queue
except ImportError:
import Queue as queue
import sys
import threading
import time
import uuid
import zmq
#from ..pyro4_server import config
#from ..util import PausableThread, iterative_run
from ..threading_util import PausableThread
from ..thre... | |
"""
## =========================================================================== ##
MIT License
Copyright (c) 2021 <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, inc... | |
'mysqlx_deflate_default_compression_level': 'int',
'mysqlx_deflate_max_client_compression_level': 'int',
'mysqlx_lz4_max_client_compression_level': 'int',
'mysqlx_lz4_default_compression_level': 'int',
'mysqlx_zstd_max_client_compression_level': 'int',
'mysql_zstd_default_compression_level': 'int'
}
self.attrib... | |
cpp,
cpp_contents, out_sources)
def __call__(self, target, source, env):
"""
Smart autoscan function. Gets the list of objects for the Program
or Lib. Adds objects and builders for the special qt5 files.
"""
moc_options = self.create_automoc_options(env)
# some shortcuts used in the scanner
self.splitext =... | |
not y1:
y1 = [ZZ_0]
elif len(y1) > 1 and y1[-1] == 1:
y1.pop()
y1[-1] += 1
# check that y2 is not a pure power (in a very naive way!!)
n2 = len(y2)
for i in range(1, (n2 + 2) // 2):
if n2 % i == 0 and y2[:-i] == y2[i:]:
y2 = y2[:i]
break
# check that at the end y1 has no zeros in it
for i in range(1, len(... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2016-2018 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# All Rights Reserved.
#
""" System Inventory Storage Backend Utilities and helper functions."""
import ast
import pecan
import wsme
from inventory.common import constants
from... | |
</dep>
</dependencies>
<dependencies type="collapsed-ccprocessed-dependencies">
<dep type="root">
<governor idx="0">ROOT</governor>
<dependent idx="3">showed</dependent>
</dep>
<dep type="nn">
<governor idx="2">data</governor>
<dependent idx="1">Radar</dependent>
</dep>
<dep type="nsubj">
<governor idx="3">... | |
"""
this is the main GUI interface of the program.
author: <NAME>
build time: 11/9/2019 19:45
COPYRIGHT INFORMATION:
Copyleft (C) 2020 <NAME>
this software is licensed under Unlicense license
This is free and unencumbered software released into the public domain.
THE SOFTWARE IS PROVIDED "AS IS", WITH... | |
with self.client._join_party_lock:
try:
await self.client.http.party_leave(self.party.id)
except HTTPException as e:
m = 'errors.com.epicgames.social.party.party_not_found'
if e.message_code != m:
raise
await self.client.xmpp.leave_muc()
p = await self.client._create_party(acquire=False)
return p
async def ... | |
<filename>script/process_raw_data_to_vscode.py
#!/usr/bin/env python3
import os
import sys
from pylib import *
from multiprocessing.dummy import Pool as ThreadPool
#from functools import partial
import re
import xml.etree.ElementTree as ET
import json
import drcctprof_data_builder as ddb
output_root = sys.argv[1]
... | |
SEARCH_LOCATIONS = [
[-54.1962894, -69.223033],
[-51.7628454, -58.8519393],
[-48.263197, -70.2777205],
[-45.8935737, 168.8783417],
[-44.0028155, -68.519908],
[-42.8152797, 171.8666229],
[-42.1020234, 146.8177948],
[-39.1408438, -72.3870955],
[-38.7580781, 175.8217011],
[-38.7306509, -63.598033],
[-37.4311589... | |
same activation and callbacks already saved!
self.input_vals.append(ins)
# aggregate callbacks
if callback is not None:
if self.callbacks is None:
self.callbacks = []
self.callbacks.append(callback)
# reset explanation
self.explanation = None
# apply layer only if all inputs collected. Then reset inputs
if... | |
<reponame>zmdismai/tcf
#! /usr/bin/python2
#
# Copyright (c) 2017 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
"""
Run commands to the target and copy files back and forth using SSH
------------------------------------------------------------------
"""
import subprocess
import commonl
import tc
class... | |
"""
Date: Feb 11st 2020
Author: <NAME>
Abstract: MetaLeaner model
"""
from task_generator import TaskGenerator
import tensorflow as tf
import tensorflow.keras as keras
import tensorflow.keras.backend as keras_backend
import os
import numpy as np
from seg_commonblocks import Conv2dBn
from seg_utils import freeze_... | |
<reponame>kimnnmadsen/eve-inc-waitlist<filename>waitlist/blueprints/settings/fleetoptions.py
import logging
from datetime import datetime
from flask import Response, jsonify, make_response
from flask import flash
from flask import redirect
from flask import request
from flask import url_for
from waitlist.blueprints.s... | |
<gh_stars>1-10
import collections
import json
import os
import re
from requests.exceptions import HTTPError
import uuid
import sys
from gevent.wsgi import WSGIServer
import thread
from kafka import KafkaConsumer, KafkaProducer
from kafka.errors import KafkaError
import flask
proxy = flask.Flask(__... | |
# (c) Copyright 2015,2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE 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.... | |
<reponame>J-E-J-S/aaRS-Pipeline
## Automatically adapted for numpy.oldnumeric Jul 30, 2007 by
#
# Copyright_notice
#
import _prmlib as prmlib
import re
import os
import numpy.oldnumeric as Numeric
from types import StringType
realType = Numeric.Float
intType = Numeric.Int
pyArrayInt = prmlib.PyArray_INT
pyArrayDou... | |
formats.DATA_SCHEMA.check_match(data)
formats.RSA_SCHEME_SCHEMA.check_match(scheme)
# Signing 'data' requires a private key. Currently supported RSA signature
# schemes are defined in `securesystemslib.keys.RSA_SIGNATURE_SCHEMES`.
signature = None
# Verify the signature, but only if the private key has been set.... | |
it present in migration args
if intf.enable_redirection:
if not is_package: # we do not package packages
argv += ["--enable-redirection"]
# add buffered tapemark argument it present in migration args
if intf.buffered_tape_marks:
argv += ["--buffered-tape-marks"]
# Mover waits for 'dismount delay' minutes befor... | |
'ppag'
if caracter == 'backspace':
ubicx-=1
if ubicx<=len(msg)+3:
ubicx=len(msg)+3
codobt=codobt[:-1]
win.addstr(1,ubicx,' ')
caracter=''
if (caracter>='0' and caracter<='9') or (caracter>='a' and caracter<='z') or (caracter>='A' and caracter<='Z') or (caracter == '-') or (caracter == '.'):
ubicx+=1
codobt+=s... | |
self.leibniz_sum.next_to(self.euler_sum.get_part_by_tex("="), DOWN,
buff = self.eq_spacing,
submobject_to_align = self.leibniz_sum.get_part_by_tex("=")
)
self.wallis_product.next_to(self.leibniz_sum.get_part_by_tex("="), DOWN,
buff = self.eq_spacing,
submobject_to_align = self.wallis_product.get_part_by_tex("=")... | |
#!/usr/bin/env python3
import argparse
import logging
import sys
import subprocess
import re
import os
from datetime import datetime, timedelta, timezone
from operator import attrgetter
import fcntl
import time
import fnmatch
from distutils.version import StrictVersion
import hashlib
import json
import contextlib
from... | |
<filename>magneticalc/GUI.py<gh_stars>10-100
""" GUI module. """
# ISC License
#
# Copyright (c) 2020–2021, <NAME>, <NAME>. <<EMAIL>>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permiss... | |
= "https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gipool_c.html"
#########################################
CSPYCE_SIGNATURES ["gnpool"] = ["string", "int"]
CSPYCE_ARGNAMES ["gnpool"] = ["name", "start"]
CSPYCE_DEFAULTS ["gnpool"] = [0]
CSPYCE_RETURNS ["gnpool"] = ["string[*]", "bool"]
CSPYCE_RETNAMES ["gnpoo... | |
indicator=="nextLine":
# advance to nextLine
(i, endallmarks) = opcode
x = self.x
y = self.y
newy = self.y = self.y-self.leading
newx = self.x = xstart
thislineindent = self.indent
thislinerightIndent = self.rightIndent
indented = 0
for handler in self.lineOpHandlers:
handler.end_at(x, y, self, canvas, texto... | |
'''
A status combo box for quickly choosing statuses.
Also doubles as a searchbox for the buddylist.
'''
from __future__ import with_statement
import wx
from gui import skin
from gui.uberwidgets.UberCombo import UberCombo
from gui.uberwidgets.UberButton import UberButton
from gui.uberwidgets.simpleme... | |
<gh_stars>0
"""
Copyright (c) 2018 <NAME> <<EMAIL>>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publis... | |
# Name: params.py
# Purpose: Classes for parameter introduction
# Author: <NAME> <<EMAIL>>
# Created: 22.08.2001
# RCS-ID: $Id: params.py 54812 2008-07-29 13:39:00Z ROL $
'''
Visual C{Param*} classes for populating C{AtrtibutePanel} with attribute editing
blocks.
'''
import string
import os
import wx.combo
from glob... | |
#!/bin/env python2.7
import sys
import os
import argparse
from collections import defaultdict
import pickle
import fileinput
'''
License:
This is free and unencumbered software released into the public domain. All authors are or
were bona fide officers or employees of the U.S. Government at the time the software was
... | |
"""Test of the dependence library.
TODO:
New tests to add:
- additive gaussian problem
* grid search with rand, lhs, fixed
* on several function of interest
* with bounds on the parameter
* with kendall or not
* same with the iterative
* with perfect dependencies
- saving/loading data
"""
import numpy as n... | |
# This file implements file system operations at the level of inodes.
import time
import secfs.crypto
import secfs.tables
import secfs.access
import secfs.store.tree
import secfs.store.block
from secfs.store.inode import Inode
from secfs.store.tree import Directory
from cryptography.fernet import Fernet
from secfs.typ... | |
None:
"""
.. note::
:class: toggle
CAA V5 Visual Basic Help (2020-07-06 14:02:20.222384))
| o Sub GetPieceCutter(long iRank,
| long iCutterIndex,
| long oCutterElemIdx,
| long oOrientation)
|
| Gets piece Cutting element and its orientation. Used for trim pieces of
| shells only
|
| Parameters:
|
| i... | |
argument.
if args and args[-1][0] == (token.OP, '*'):
if len(args[-1]) != 2 or args[-1][1][0] != token.NAME:
raise ParseError("Expected name after * in argument list")
func_doc.vararg = args[-1][1][1]
args.pop()
# Positional arguments.
for arg in args:
func_doc.posargs.append(parse_funcdef_arg(arg[0]))
if len... | |
# Copyright (c) 1999 <NAME>
# Copyright (c) 2000-2002 by <NAME> <<EMAIL>>
# Copyright (c) 2005 by <NAME> <<EMAIL>>
#
# See main module for license.
#
__all__ = ['Token', 'Scanner', 'getscanner']
import types
import dis
from collections import namedtuple
from array import array
from operator import itemgetter
HAVE_AR... | |
#$FFFF (-1), A will be 2
self._write(mpu.memory, 0x0000, (0xC9, 0xFF, 0XFF))
mpu.a = 2
mpu.step()
self.assertEqual(0x0003, mpu.pc)
self.assertEqual(0, mpu.p & mpu.NEGATIVE) # 0x02-0xFF=0x01
self.assertEqual(0, mpu.p & mpu.ZERO)
self.assertEqual(0, mpu.p & mpu.CARRY) # A<m unsigned
def test_cmp_imm_clears_zero_... | |
<reponame>phymhan/essl
from pathlib import Path
import argparse
import os
import sys
import shutil
import random
import subprocess
import time
import json
import math
import numpy as np
from PIL import Image, ImageOps, ImageFilter
from torch import nn, optim
import torch
import torchvision
import torchvision.transform... | |
# coding: utf-8
# Copyright (c) Materials Virtual Lab
# Distributed under the terms of the BSD License.
from __future__ import division, print_function, unicode_literals, \
absolute_import
import itertools
import subprocess
import io
import re
import numpy as np
import pandas as pd
from monty.io import zopen
from mo... | |
# Copyright 2020 Hitachi 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 in writing, softw... | |
<reponame>drix00/synthetic-micrograph<filename>examples/simulate_image_brostom2022.py
# -*- coding: utf-8 -*-
"""
Created on Tue May 19 09:45:56 2020
This code can be used to simulate a SEM image with specified parameters. The
procedure used in the script was based on the work of Cizmar et al. (2008)
"Simulated SEm Ima... | |
is None:
return await ctx.send("Invalid Syntax\nPlease input something to remove from your tags\n`.tag remove <tag_name>`")
elif ctx.guild is None:
return await self.remove_global_tag(ctx, txt)
sql = "SELECT guild FROM `tags` WHERE guild=%s AND user=%s AND tag=%s"
q = await self.cursor.execute(sql, (ctx.gui... | |
< vertices[5][1]:
proj = y
elif proj > vertices[6][1]:
proj = y
### Return final projection
ret_edge = edge.copy()
if edge_idx == 0:
## Z
ret_edge[2] = proj
elif edge_idx == 1:
## Y
ret_edge[1] = proj
elif edge_idx == 2:
## Z
ret_edge[2] = proj
elif edge_idx == 3:
## Y
ret_edge[1] = proj
elif edg... | |
ticket["wrapper"]["fullname"],
ticket["unique_id"],
ticket["wrapper"]["pnfsFilename"],
ticket["vc"]["library"],
ticket["vc"]["volume_family"],
ticket["wrapper"]["uname"]))
#Trace.trace(self.my_trace_level+100, "call back %s pending callback %s"%(ticket["callback_addr"], rq.callback))
Trace.trace(self.my_trace_l... | |
# mesma coisa
times_nordeste
## Fatiamento de listas
O fatiamento ("slicing") permite que selecionemos partes da lista através do modelo `start:stop`, em que `start` é um índice incluído na iteração, e `stop` não.
letras = ['a','b','c','d','e','f','g']
letras[0:2]
letras[1:4]
letras[5:6]
letras[0:7] # toda a li... | |
dest="run_steps", type=int, default=None, nargs="+", metavar="cfg", help="Run given pipeline steps idenfified by the step id")
execution_group.add_argument('--force', dest="force", default=None, action="store_true", help="Force running all steps and skip checking for completed steps")
class BwaMemPipeline(BasePipel... | |
#coding=utf-8
import re
import logging
from netaddr import IPNetwork
from networkapi.rack.models import RackConfigError
from networkapi.system.facade import get_value as get_variable
from networkapi.system import exceptions as var_exceptions
from django.core.exceptions import ObjectDoesNotExist
log = logging.getLogger... | |
<reponame>Princeton-CDH/parasolr
"""
Object-oriented approach to Solr searching and filtering modeled
on :class:`django.models.queryset.QuerySet`. Supports iteration,
slicing, counting, and boolean check to see if a search has results.
Filter, search and sort methods return a new queryset, and can be
chained. For exam... | |
def test_tensor_number_math(self):
self._test_tensor_number_math()
def test_torch_tensor_bad_input(self):
with self.assertRaisesRegex(RuntimeError, "must be of ints, floats, "
"or bools, got None"):
@torch.jit.script
def test():
return torch.tensor([None])
test()
with self.assertRaisesRegex(RuntimeError, r"E... | |
-9.02761392e-16, 1.08200086e-15, 4.29829341e-06,
# -9.31181400e-07, -4.21932902e-09, 4.97211032e-10], [-4.83307265e-07, -1.16313397e-12, -2.98442124e-13, 3.07807144e-11,
# -9.80710225e-11, -8.94346291e-16, 1.25148773e-15, 3.72602180e-06,
# -1.31183699e-06, -3.91203734e-09, 4.77754743e-10], [-5.07111674e-07, -1.44725275... | |
# -*- coding: utf-8 -*-
from manimlib.imports import *
class Chapter7OpeningQuote(OpeningQuote):
CONFIG = {
"quote" : [
" Calculus required ",
"continuity",
", and ",
"continuity ",
"was supposed to require the ",
"infinitely little",
"; but nobody could discover what the ",
"infinitely little",
" might be... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.