input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<reponame>mutaihillary/mycalculator
# Copyright (c) 2003-2013 <NAME>.A. (Paris, FRANCE).
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) an... | |
2,
"course_project": False
},
{
"id": 26062,
"name": "Основы естественнонаучных процессов",
"term": 2,
"course_project": False
},
{
"id": 36991,
"name": "Основы иммунологии/ Basics of Immunology",
"term": 2,
"course_project": False
},
{
"id": 19214,
"name": "Основы информационных оптических технологий"... | |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
__source__ = 'https://github.com/kamyu104/LeetCode/blob/master/Python/count-of-smaller-numbers-after-self.py'
# https://leetcode.com/problems/count-of-smaller-numbers-after-self/#/description
# Time: O(nlogn)
# Space: O(n)
#
# Description: Leetcode # 315. Count of Smaller Numbers After Self
#
# You are given an integer... | |
<reponame>agilman/django_maps2
from maps.models import *
from maps.serializers import *
from maps.forms import *
from django.http import JsonResponse
from collections import OrderedDict
from django.contrib.auth.models import User
from rest_framework.parsers import JSONParser
from django.views.decorators.csrf import ... | |
AttributeError as atre:
raise atre
@property
def scaler(self):
try:
return self._scaler
except AttributeError as atre:
raise atre
@scaler.setter
def scaler(self, scaler):
"""
Setter for the model scaler.
:param scaler: The object which will handle data scaling.
:type scaler: ChemometricsScaler object, ... | |
import array
import errno
import json
import os
import random
import zipfile
from argparse import ArgumentParser
from collections import Counter
from os.path import dirname, abspath
import nltk
import six
import torch
from six.moves.urllib.request import urlretrieve
from tqdm import trange, tqdm
URL = {
'glove.42B':... | |
#@String input_file_location
#@String subdir
#@String out_subdir_tag
#@String rows
#@String columns
#@String imperwell
#@String stitchorder
#@String channame
#@String size
#@String overlap_pct
#@String tileperside
#@String filterstring
#@String scalingstring
#@String awsdownload
#@String bucketname
#@String localtemp
#... | |
INT, self.FOLLOW_INT_in_assign_types2319)
INT206_tree = self._adaptor.createWithPayload(INT206)
self._adaptor.addChild(root_0, INT206_tree)
elif alt33 == 6:
# /home/tux/PycharmProjects/ProtoGen_public/Parser/ProtoCC.g:248:78: BOOL
pass
root_0 = self._adaptor.nil()
BOOL207 = self.match(self.input, BOOL, se... | |
import collections
import copy
import tensorflow as tf
import numpy as np
import os
import multiprocessing
import functools
from abc import ABC, abstractmethod
from rl.tools.utils.misc_utils import unflatten, flatten, cprint
tf_float = tf.float32
tf_int = tf.int32
"""
For compatibility with stop_gradient
"""
def t... | |
there
#> StringInsert["abcdefghijklm", "X", -15]
: Cannot insert at position -15 in abcdefghijklm.
= StringInsert[abcdefghijklm, X, -15]
>> StringInsert["adac", "he", {1, 5}]
= headache
#> StringInsert["abcdefghijklm", "X", {1, -1, 14, -14}]
= XXabcdefghijklmXX
#> StringInsert["abcdefghijklm", "X", {1, 0}]
... | |
u'徭'),
(0xFA86, 'M', u'惘'),
(0xFA87, 'M', u'慎'),
(0xFA88, 'M', u'愈'),
(0xFA89, 'M', u'憎'),
(0xFA8A, 'M', u'慠'),
(0xFA8B, 'M', u'懲'),
(0xFA8C, 'M', u'戴'),
(0xFA8D, 'M', u'揄'),
(0xFA8E, 'M', u'搜'),
(0xFA8F, 'M', u'摒'),
(0xFA90, 'M', u'敖'),
(0xFA91, 'M', u'晴'),
(0xFA92, 'M', u'朗'),
(0xFA93, 'M'... | |
unit = 1
else:
unit = u.Unit(unitstr)
value = fitsext[keyword]
is_string = isinstance(value, str)
is_iterable = isinstance(value, Iterable)
if is_string or (is_iterable and isinstance(value[0], str)):
return value
else:
return value * unit
def adjust_temperature_size_rough(temp, comparison_array):
"""Adjust... | |
<reponame>dougthor42/pynuget
# -*- coding: utf-8 -*-
"""
"""
import os
import re
import shutil
import subprocess
import sys
from datetime import datetime as dt
from pathlib import Path
import requests
from sqlalchemy import create_engine
from pynuget import db
from pynuget import _logging
logger = _logging.setup_lo... | |
# Copyright 2018, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | |
<reponame>masonng-astro/nicerpy_xrayanalysis<filename>Lv2_average_ps_methods.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Tues Jul 16 1:48pm 2019
Getting averaged power spectra from M segments to the whole data, where the data
was pre-processed using NICERsoft!
"""
from __future__ import division, ... | |
from __future__ import annotations
from datetime import timedelta
import operator
from sys import getsizeof
from typing import (
TYPE_CHECKING,
Any,
Callable,
Hashable,
List,
cast,
)
import warnings
import numpy as np
from pandas._libs import index as libindex
from pandas._libs.lib import no_default
from panda... | |
item
from the list(action_past[n])
NOTE: action_past attribute is bad for translations and should be
avoided. Please use the action_past method instead.
This form is kept for legacy.
.. attribute:: data_type_singular
Optional display name (if the data_type method is not defined) for the
type of data that rece... | |
<filename>sunpy/map/mapbase.py<gh_stars>1-10
"""
Map is a generic Map class from which all other Map classes inherit from.
"""
import copy
import html
import textwrap
import warnings
import webbrowser
from io import BytesIO
from base64 import b64encode
from tempfile import NamedTemporaryFile
from collections import nam... | |
source: str, reference: datetime, date_ers: [ExtractResult],
time_ers: [ExtractResult]) -> List[Token]:
tokens = []
ers_datetime = self.config.single_date_time_extractor.extract(source, reference)
time_points = []
# Handle the overlap problem
j = 0
for er_datetime in ers_datetime:
time_points.append(er_datetim... | |
<reponame>efortuna/minigo
# 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 a... | |
from typing import Any, List, Optional
import numpy as np
from rdkit.Chem import rdchem, rdmolfiles, rdmolops, rdDistGeom, rdPartialCharges
class MolFeatureExtractionError(Exception):
pass
def one_hot(x: Any, allowable_set: List[Any]) -> List[int]:
"""One hot encode labels.
If label `x` is not included in the ... | |
-3): (0, 1),
(9, 2, -5, -2): (0, 0),
(9, 2, -5, -1): (0, 1),
(9, 2, -5, 0): (0, 1),
(9, 2, -5, 1): (0, 1),
(9, 2, -5, 2): (0, 1),
(9, 2, -5, 3): (0, 1),
(9, 2, -5, 4): (0, 1),
(9, 2, -5, 5): (0, 1),
(9, 2, -4, -5): (-1, 1),
(9, 2, -4, -4): (-1, 1),
(9, 2, -4, -3): (-1, 1),
(9, 2, -4, -2): (-1, 0),
(9, 2, -... | |
+
0.3016*m.x383*m.x191 - m.x167*m.x391 == 0)
m.c193 = Constraint(expr=0.2369*m.x328*m.x136 + 0.0415*m.x336*m.x144 + 0.1653*m.x360*m.x168 + 0.2546*m.x368*m.x176 +
0.3016*m.x384*m.x192 - m.x168*m.x392 == 0)
m.c194 = Constraint(expr=0.07*m.x321*m.x129 + 0.0293*m.x329*m.x137 + 0.068*m.x337*m.x145 + 0.0442*m.x353*m.x1... | |
sensor.index)
elif sensor.sens_type == 6 and sensor.multi_type == 6:
try:
state = sensor.last_read_value[6] # multi Moisture
except:
sensor.last_read_value[6] = -127
pass
if state == -127:
if sensor.show_in_footer:
self.start_status(sensor.name, _(u'Probe Error'), sensor.index)
else:
if sensor.show_in_foote... | |
'choro_graph.relayoutData':
if type(click_value).__name__ == 'dict' and 'mapbox.zoom' in click_value.keys() and toggle_value is True:
fig_info['data'][0]['marker']['size'] = click_value['mapbox.zoom'] * 4
# fig_info['data'][0]['radius'] = math.ceil(click_value['mapbox.zoom'] * 3 + 1)
return 'output_tab', toggle_val... | |
* qa * qc) ** 0.5) / (2 * qa)
cuts.append(x1 + x)
if len(cuts) == npieces - 1:
return cuts
segment_remaining -= needed
needed = size
needed -= segment_remaining
return qc
def func_23576a1c407d4bfca4fd093d67be1f4f(npieces, x2, h1, x1, cuts, size, h2):
area_from_left = 0
while segment_remaining >= needed:
are... | |
<gh_stars>1-10
import numpy as np
import random
import copy
from collections import namedtuple, deque
import torch
from ddpg_agent import Agent
import torch.nn.functional as F
# Default hyperparameters
SEED = 10 # Random seed
NB_EPISODES = 10000 # Max nb of episodes
NB_STEPS = 1000 # Max nb of steps per episodes ... | |
<filename>src/autogluon_contrib_nlp/data/tokenizers/huggingface.py
__all__ = ['HuggingFaceTokenizer', 'HuggingFaceBPETokenizer', 'HuggingFaceWordPieceTokenizer',
'HuggingFaceByteBPETokenizer']
import os
import json
from pkg_resources import parse_version
from typing import Optional, Union, List, Tuple
from collection... | |
import re
from sympy import S, Symbol, EmptySet, Interval, FiniteSet
from sympy.solvers import solveset
import numpy as np
from src.solveminmax.minmax_term import MinMaxTerm
from src.solveminmax.cons_var_term import ConsVarTerm
# TODO: what if the equation starts with a -?
# TODO: what if the interval is infinity on on... | |
import ncls
from collections import defaultdict
import numpy as np
import vcf
import operator
import datetime
import pkg_resources
import copy
import pickle
from sys import stderr, stdin
import gzip
import time
from io import StringIO
import networkx as nx
from collections import Counter
import pandas as pd
import os
... | |
y + 5, text=self.logReader.currentSystem, font="Ebrima 13 bold",
fill='green', anchor='nw')
else:
self.canvas.create_text(x + 5, y + 5, text=self.logReader.currentSystem, font="Ebrima 13 bold",
fill='orange', anchor='nw')
self.canvas.create_rectangle(x + 150, y, x + 500, y + 30, fill='black')
self.canvas.... | |
import tensorflow as tf
from tensorflow.image import rot90 as img_rot90
from tensorflow.image import flip_left_right as img_flip
from tensorflow.keras.optimizers import Adam
import logging
import numpy as np
from sklearn.metrics import mean_absolute_error, mean_squared_error, r2_score
import pandas as pd
import copy
im... | |
= QtGui.QPushButton(self.nw_lpvp) #load Profile
self.pushButton_adp.setGeometry(QtCore.QRect(18, 18, 100, 28))
self.pushButton_adp.setText("Add Profile")
self.pushButton_adp.setFont(font)
self.pushButton_rmp = QtGui.QPushButton(self.nw_lpvp)
self.pushButton_rmp.setGeometry(QtCore.QRect(135, 18, 100, 28))
... | |
import json
from collections import Counter
from django.db import models
from django.core.urlresolvers import reverse
from django.db.models.loading import get_model
from imagekit.models import ImageSpecField
from imagekit.processors import ResizeToFit, ResizeCanvas
from common.models import EmptyModelBase, ResultBas... | |
header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod]
... | |
= ("table_id", table_id, "lookup_id", lookup_id)
_result = _execute.execute(b"TPUEmbeddingActivations", 1,
inputs=_inputs_flat, attrs=_attrs, ctx=ctx,
name=name)
if _execute.must_record_gradient():
_execute.record_gradient(
"TPUEmbeddingActivations", _inputs_flat, _attrs, _result)
_result, = _result
return _res... | |
consistent_kwargs_dict['plot_projection'] = \
do_allowed_projections[ppl]
else:
consistent_kwargs_dict['plot_projection'] = 'stereo'
except Exception:
pass
if args.plot_show_upper_hemis:
consistent_kwargs_dict['plot_show_upper_hemis'] = True
if args.plot_n_points and args.plot_n_points > 360:
consistent_kwar... | |
<filename>seaice/data/test/test_getter.py
from datetime import date
from unittest.mock import patch
import copy
import datetime as dt
import os
import unittest
from nose.tools import assert_equals, assert_true, raises
import numpy as np
import numpy.testing as npt
import pandas as pd
import pandas.util.testing as pdt
... | |
from __future__ import division
import numpy as np
import pandas as pd
from sklearn import metrics
import lightgbm as lgb
import time
from multiprocessing import cpu_count
import warnings
from sklearn.cross_validation import train_test_split
warnings.filterwarnings('ignore')
# Constants define
ROOT_PATH ... | |
call signatures
if int(vim_eval("g:jedi#show_call_signatures")) == 2:
vim_command('echo ""')
return
cursor = vim.current.window.cursor
e = vim_eval('g:jedi#call_signature_escape')
# We need two turns here to search and replace certain lines:
# 1. Search for a line with a call signature and save the appended
# c... | |
originals, and point to the same
`Component <Component>` object : `Graph`
"""
g = Graph()
for vertex in self.vertices:
g.add_vertex(Vertex(vertex.component, feedback=vertex.feedback))
for i in range(len(self.vertices)):
g.vertices[i].parents = [g.comp_to_vertex[parent_vertex.component] for parent_vertex in
se... | |
import unittest
from datetime import datetime
from rx.observable import Observable
from rx.testing import TestScheduler, ReactiveTest, is_prime
from rx.disposables import SerialDisposable
on_next = ReactiveTest.on_next
on_completed = ReactiveTest.on_completed
on_error = ReactiveTest.on_error
subscribe = ReactiveTest.... | |
import string
def filter(c):
ret = '#'
if c in string.letters:
ret = c
return ret
def totcscore(str):
ret = 0;
for i in range(len(str)):
symbol = chr(str[i])
try:
if symbol in (string.letters + string.digits + ' '):
ret = ret + totc[symbol]*totc_magic
except:
pass
return ret
# Score based ... | |
# -*- coding: utf-8 -*-
# Copyright 2020 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | |
"-5",
"гов": "-5",
"ебар": "-5",
"насасыва": "-5",
"отъеба": "-5",
"шибздик": "-5",
"блядствова": "-5",
"дристун": "-5",
"пиздецов": "-5",
"наебк": "-5",
"кун": "0",
"шиш": "0",
"анус": "-5",
"покака": "-5",
"жопк": "-5",
"целк": "-5",
"подмахива": "-5",
"минетчиц": "-5",
"поджопник": "-5",
"накака":... | |
in the batch
errorEpoch += errorBatch/batchSize
# print(errorBatch)
# Get the derivative of the output cost function wrt to the output vector of the output layer
# The input arguments should always be an array
dc_daL = gradErrorFunc(a[nLayers], outExpected)
# if np.isnan(dc_daL).any():
# print('loss grad is nan'... | |
"""
Code here stores automatic analysis routines for ABF files given their protocol.
There are several analysis routines which are general (show all sweeps
continuously, show sweeps stacked, show sweeps overlayed, etc) and can be used
for almost any protocol (or ABFs with unknown protocol).
Some analysis routines ar... | |
<filename>improved_str_r-tree/improved_str_r-tree.py
# 2015-08-29
# stored items in containers are id values
# have root entry instead of solely root node
# updated on 2016-08-22 to fix some auxiliary bugs
# updated on 2016-08-23 to fix traditional/non-traditional isLeafNode() distinction
# updated on 2016-11-03 t... | |
: False
.. versionadded:: 2016.11.7
Interpret backslashes as literal backslashes for the repl and not
escape characters. This will help when using append/prepend so that
the backslashes are not interpreted for the repl on the second run of
the state.
For complex regex patterns, it can be useful to avoid the nee... | |
"""Tests for API endpoints that performs stack analysis."""
import requests
import time
import os
from behave import given, then, when
from urllib.parse import urljoin
import jsonschema
from src.attribute_checks import *
from src.parsing import *
from src.utils import *
from src.json_utils import *
from src.authoriza... | |
# Set default on both
member_set.__dict__[DEFAULT_OPTION_NAME] = defaultValue
member_get.__dict__[DEFAULT_OPTION_NAME] = defaultValue
# Add to list
setters[name.lower()] = member_set
# Done
return setters
def __setOptions(self, setters, options):
"""Sets the options, given the list-of-tuples methods and an
o... | |
#!/usr/bin/env python3
import unittest as ut
import os.path
import c4.cmany.util as util
import c4.cmany.vsinfo as vsinfo
_sfx = " Win64" if util.in_64bit() else ""
_arc = "x64" if util.in_64bit() else "Win32"
class Test01VisualStudioInfo(ut.TestCase):
def test00_instances(self):
if not util.in_windows():
ret... | |
*any* ObjBase, but I don't like the idea of
# forcibly upgrading those, since they might do, for example, some
# different comparison operation or something. This seems like a
# much safer bet.
if isinstance(other, ProxyBase):
# Other proxies are very likely to fail, since the reveresed call
# would normally ha... | |
35s","nikto4",["ERROR: Cannot resolve hostname","0 item(s) reported","No web server found","0 host(s) tested"]],
["0 item(s) reported",1,proc_low," < 35s","nikto5",["ERROR: Cannot resolve hostname","0 item(s) reported","No web server found","0 host(s) tested"]],
["0 item(s) reported",1,proc_low," < 35s","nikto6",["ER... | |
<reponame>MatthewTe/ETL_pipelines
# Importing Data Manipulation packages:
import pandas as pd
import sqlite3
import bonobo
import os
# Python Reddit API Wrapper:
import praw
# Importing the Base Pipeline API Object:
from ETL_pipelines.base_pipeline import Pipeline
class RedditContentPipeline(Pipeline):
"""An object... | |
= child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
ival_ = self.gds_validate_integer(ival_, node, 'indSitPJ')
self.indSitPJ = ival_
# end class situacaoPJ
class indSitPJ(GeneratedsSuper):
subclass = None
superclass = None
def _... | |
<reponame>odinn13/Tilings
import json
from itertools import chain, product
import pytest
import sympy
from permuta import Perm
from tilings import GriddedPerm, Tiling
from tilings.exception import InvalidOperationError
@pytest.fixture
def compresstil():
"""Returns a tiling that has both obstructions and requiremen... | |
/ (1 + w * 1j * t_values[50]))
+ (R_values[51] / (1 + w * 1j * t_values[51]))
+ (R_values[52] / (1 + w * 1j * t_values[52]))
+ (R_values[53] / (1 + w * 1j * t_values[53]))
+ (R_values[54] / (1 + w * 1j * t_values[54]))
+ (R_values[55] / (1 + w * 1j * t_values[55]))
+ (R_values[56] / (1 + w * 1j * t_values[56]))
... | |
<reponame>pkarande/Benchmarks-1
#! /usr/bin/env python
"""Multilayer Perceptron for drug response problem"""
from __future__ import division, print_function
import argparse
import csv
import logging
import sys
import numpy as np
import pandas as pd
from itertools import tee, islice
from keras import backend as K
... | |
<filename>lib/services/vautoscaling/ncloud_vautoscaling/api/v2_api.py
# coding: utf-8
"""
vautoscaling
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import six
from ncloud_vautos... | |
lw_entrances.append('Desert Palace Entrance (West)')
else:
lw_dungeon_entrances_must_exit.append('Desert Palace Entrance (West)')
lw_entrances.append('Desert Palace Entrance (North)')
dungeon_exits.append(('Hyrule Castle Exit (South)', 'Hyrule Castle Exit (West)', 'Hyrule Castle Exit (East)'))
lw_entrances.appen... | |
0)
toolbar = Gtk.Toolbar()
save_btn = Gtk.ToolButton.new_from_stock(Gtk.STOCK_SAVE)
save_btn.connect("clicked", self.on_bat_name_save_clicked)
toolbar.insert(save_btn, 1)
# bat_name_box.pack_start(toolbar, False, True, 0)
scrolledwindow = Gtk.ScrolledWindow()
scrolledwindow.set_hexpand(True)
scrolledwindow.se... | |
<filename>pyscf/dh/polar/udfdh.py<gh_stars>1-10
from __future__ import annotations
# dh import
try:
from dh.udfdh import UDFDH
from dh.polar.rdfdh import Polar as RPolar
from dh.dhutil import gen_batch, get_rho_from_dm_gga, tot_size, hermi_sum_last2dim
except ImportError:
from pyscf.dh.udfdh import UDFDH
from pysc... | |
<reponame>Z1R343L/dislash.py<filename>dislash/application_commands/slash_client.py
import asyncio
import discord
from discord.abc import Messageable
from discord.state import ConnectionState
from discord.http import Route
from discord.ext.commands import Context
from typing import Any, Dict, List
from .slash_core impo... | |
<gh_stars>10-100
""" Routines to:
Parse cat files
Run SPFIT and/or SPCAT
"""
import os
import subprocess
import shutil
import json
import types
from typing import List, Any, Union, Dict, Tuple
from glob import glob
from warnings import warn
import ruamel.yaml as yaml
import numpy as np
import joblib
import paramiko... | |
"""
Some utility functions for the data analysis project.
"""
import numpy as np
import healpy as hp
import pylab as plt
import os
from pixell import curvedsky
from pspy import pspy_utils, so_cov, so_spectra, so_mcm, so_map_preprocessing
from pspy.cov_fortran.cov_fortran import cov_compute as cov_fortran
from pspy.mcm_... | |
= get_ontology().get_graph(clean)
for t in ontology[::]:
graph.add(t)
return graph
# Provide information about the things described by the knowledge graph
def check_property_value(self, property_uri, value):
"""Checks if the value is valid and transforms it into a corresponding rdflib Literal or URIRef
Returns... | |
<filename>mlprodict/testing/einsum/einsum_impl_classes.py
# pylint: disable=C0302
"""
@file
@brief Classes representing the sequence of matrix operations to
implement einsum computation.
"""
import numpy
from onnx import helper, numpy_helper
from skl2onnx.common.data_types import guess_proto_type
from ...onnx_tools.onn... | |
# MINLP written by GAMS Convert at 04/21/18 13:55:13
#
# Equation counts
# Total E G L N X C B
# 384 180 64 140 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc si
# Total cont binary integer sos1 sos2 scont sint
# 630 182 56 0 392 0 0 0
# FX 0 0 0 0 0 0 0 0
#
# Nonzero counts
# Total const NL DLL
# 2479 2363 116 0
# ... | |
# encoding: utf-8
# ------------------------------------------------------------------------
# Copyright 2020 All Histolab Contributors
#
# 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
#
# ht... | |
<gh_stars>0
import inspect as insp
import dask
import numpy as np
from edt import edt
import operator as op
import scipy.ndimage as spim
from skimage.morphology import reconstruction
from skimage.segmentation import clear_border
from skimage.morphology import ball, disk, square, cube, diamond, octahedron
from porespy.t... | |
self . packet [ 0 : 60 ] ) ) )
return
if 60 - 60: i11iIiiIii . O0 * iIii1I11I1II1 * OoOoOO00
if 99 - 99: iIii1I11I1II1 - oO0o - OoOoOO00 / iIii1I11I1II1 * Oo0Ooo - oO0o
if ( s_or_r . find ( "Receive" ) != - 1 ) :
o0ooo0oooO = "decap"
o0ooo0oooO += "-vxlan" if self . udp_dport == LISP_VXLAN_DATA_PORT else ""
else... | |
we find non-null data for each column in `sample`
sample = [col for col in df.columns if df[col].dtype == "object"]
if sample and schema == "infer":
delayed_schema_from_pandas = delayed(pa.Schema.from_pandas)
for i in range(df.npartitions):
# Keep data on worker
_s = delayed_schema_from_pandas(
df[sample].to_del... | |
a pipeline, all commands to this instance will be
pipelined.
:param pipe: optional Pipeline or NestedPipeline
"""
self._pipe = pipe
@property
def pipe(self):
"""
Get a fresh pipeline() to be used in a `with` block.
:return: Pipeline or NestedPipeline with autoexec set to true.
"""
return autoexec(self._pi... | |
import logging
import math
from protocols import reports_4_0_0 as reports_4_0_0
from protocols import reports_5_0_0 as reports_5_0_0
from protocols import opencb_1_3_0 as opencb_1_3_0
from protocols.migration import MigrationParticipants103To110, MigrationParticipants100To103
from protocols.migration.base_migration im... | |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... | |
# -*- coding: utf-8 -*-
from django.db import models
from const.country import *
from const.postaladdressprefix import *
from const.purpose import *
from const.status import *
from datetime import *
from django.utils.translation import ugettext as _
from decimal import Decimal
from django.core import serializers
from ... | |
# 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.
import copy
import logging
import os
import collections
import third_party.json_schema_compiler.json_parse as json_parse
import third_party.json_schema_... | |
<reponame>byrdie/ndcube
import copy
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import astropy.units as u
try:
from sunpy.visualization.animator import ImageAnimatorWCS, LineAnimator
except ImportError:
from sunpy.visualization.imageanimator import ImageAnimatorWCS, LineAnimator
from... | |
new resource to be created.
:param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['WindowsVirtualMachineScaleSetNetworkInterfaceArgs']]]] network_interfaces: One or more `network_interface` blocks as defined below.
:param pulumi.Input[pulumi.InputType['WindowsVirtualMachineScaleSetOsDiskArgs']] os_disk: An `os_d... | |
#!/usr/bin/python
import pymysql
import pymysql.cursors
import subprocess as sp
import json
from datetime import date
from random import randint
# Open database connection
# a = 5005
# prepare a cursor object using cursor() method
# abstraction meant for data set traversal
def execute_query(query, x):
try:
# Execute ... | |
#!/usr/local/sci/bin/python
#*****************************
#
# Repeated Streaks Check (RSC)
#
# Checks for replication of
# 1) checks for consecutive repeating values
# 2) checks if one year has more repeating strings than expected
# 3) checks for repeats at a given hour across a number of days
# 4) checks for repeats... | |
from __future__ import print_function
import kosh
import shutil
import getpass
import socket
import random
import os
import shlex
from subprocess import Popen, PIPE
import sys
sys.path.insert(0, "tests")
from koshbase import KoshTest # noqa
user = getpass.getuser()
hostname = socket.gethostname()
def create_file(file... | |
<gh_stars>100-1000
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup -----------------------------------------... | |
import datetime
import logging
import sys
from migrate import ForeignKeyConstraint
from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Index, Integer, MetaData, String, Table, TEXT
from sqlalchemy.exc import NoSuchTableError
# Need our custom types, but don't import anything else from model
from galaxy.mode... | |
# Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | |
>>> assert os.path.isfile('out.err')
Test groupr and errorr:
>>> out = endf6.get_errorr(verbose=True, groupr=True)
moder
20 -21 /
reconr
-21 -22 /
'sandy runs njoy'/
125 0 0 /
0.005 0. /
0/
groupr
-21 -22 0 -23 /
125 2 0 2 0 1 1 0 /
'sandy runs groupr' /
0.0/
10000000000.0/
3/
0/
0/
errorr
-21 0 -... | |
<reponame>pulumi/pulumi-f5bigip<filename>sdk/python/pulumi_f5bigip/big_iq_as3.py
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
fr... | |
fh = next(values.iteritems())
fh.close()
del values[filename]
def open_files(file_format=None):
'''Return the open files containing sub-arrays of master data arrays.
By default all such files are returned, but the selection may be
restricted to files of a particular format.
.. seealso:: `cf.close_files`, `cf... | |
"""RDF datasets
Datasets from "A Collection of Benchmark Datasets for
Systematic Evaluations of Machine Learning on
the Semantic Web"
"""
import os
from collections import OrderedDict
import itertools
import rdflib as rdf
import abc
import re
import networkx as nx
import numpy as np
import dgl
import dgl.backend as ... | |
# 根据op的身体节点坐标,根据决策树,返回命令
from math import atan2, degrees, sqrt, pi, fabs
from simple_pid import PID
import time
def distance(a, b):
if a[0] is None or b[0] is None:
return None
return int(sqrt((b[0]-a[0])**2+(b[1]-a[1])**2))
def angle(A, B, C):
if A[0] is None or B[0] is None or C[0] is None:
return None
dg =... | |
import cv2
import sys, datetime
import glob
import dlib
import math
import os
from time import sleep
from shapely.geometry import Polygon
import numpy as np
# Kinect Azure intrinsics
FX = -622.359
CX = 641.666
FY = -620.594
CY = 352.072
FRAME_W, FRAME_H = 1280, 720
GREEN = (0, 255, 0)
BLUE = (255, 0, 0)
RED = (0, 0... | |
"""
The module that offers access to the Paxton Net2 server
"""
import clr
import os
import sys
import Net2Scripting.settings
from Net2Scripting.net2xs.conversions import date_time_to_net, flex_date_time_to_net, \
time_zones_to_py, access_levels_to_py, access_level_detail_to_py
from datetime import datetime
from Net2... | |
import re
import torch
import unicodedata
from abc import abstractmethod
from typing import List, Union, Dict, Set, Optional
from .import_utils import (
is_available_kss,
is_available_nltk,
)
SPACE_NORMALIZER = re.compile(r"\s+")
InputTexts = Union[str, List[str]]
TokenizedOutput = Union[List[str], List[List[str]... | |
<gh_stars>1-10
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless r... | |
tpr
self.register_performance_stats(config, time=duration, TPR=tpr)
return self._true_positive_rate
def run_on_negative(self, config, **kwargs):
"""
Optionally test the detection strategy on negative client packets, call this
instead of :meth:`negative_run`.
:param tuple config: a consistently-formatted tupl... | |
stat.S_IEXEC)
# spawn the sub-agent
cmdline = './%s' % ls_name
self._log.info ('create services: %s' % cmdline)
ru.sh_callout_bg(cmdline, stdout='services.out', stderr='services.err')
self._log.debug('services started done')
# --------------------------------------------------------------------------
#
def... | |
<reponame>Swiffers/puretabix
import gzip
import io
import itertools
import logging
import struct
import zlib
logger = logging.getLogger(__name__)
class TabixIndex:
def __init__(self, fileobj):
"""
In-memory representation of a Tabix index. See https://samtools.github.io/hts-specs/tabix.pdf
for more information.
... | |
<reponame>akjmicro/pystepseq
#!/usr/bin/python3 -i
# -*- coding: utf-8 -*-
#
# pystepseq.py
#
# Copyright 2013-2019 <NAME> <<EMAIL>>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either vers... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.