input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
parents
if 'parents' in metadata:
for parent in metadata['parents']:
if parent not in self.items:
raise HTTPNotFound()
if parent in self.lostPermission:
return Response(status=403, content_type="application/json", text='{"error": {"errors": [{"reason": "forbidden"}]}}')
self.upload_info['size'] = size
self.uplo... | |
7.73686],
[691200, 10, 3, 2, 0, 0.945754],
[691488, 5, 2, 0, 4, 1.13066],
[694575, 0, 4, 2, 3, 8.40395],
[699840, 6, 7, 1, 0, 1.01206],
[700000, 5, 0, 5, 1, 1.07746],
[702464, 11, 0, 0, 3, 1.0266],
[703125, 0, 2, 7, 0, 8.57421],
[705600, 6, 2, 2, 2, 1.06551],
[705894, 1, 1, 0, 6, 8.57376],
[708588, 2, 11, 0, 0, 1.1192]... | |
False,
# }
# # Check if a record for the licence_activity_id already exists, if
# # not, add.
# if not merged_activities.get(activity.licence_activity_id):
# issued_list = [
# p for p in activity.proposed_purposes.all() if p.is_issued]
# if not len(issued_list):
# continue
# merged_activities[activity.lice... | |
<reponame>okcashpro/okshop
from django.test import TestCase, Client
from django.contrib.auth.models import User
from .models import *
from django.urls import reverse
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.files.uploadedfile import InMemoryUploadedFile
from io import BytesIO
impor... | |
<reponame>gatgui/excons<filename>tools/python.py
# MIT License
#
# Copyright (c) 2009 <NAME>
#
# This file is part of excons.
#
# 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 restric... | |
<reponame>So-dal/Keras_FasterRCNN_CustomDataset
from __future__ import division
import os
import cv2
import numpy as np
import pandas as pd
import sys
import pickle
from optparse import OptionParser
import time
import re
import tensorflow as tf
from keras_frcnn import config
from keras import backend as K
from keras.la... | |
# pylint: disable-msg=W0611, W0612, W0511,R0201
"""Tests suite for MaskedArray.
Adapted from the original test_ma by <NAME>
:author: <NAME> & <NAME>
:contact: pierregm_at_uga_dot_edu & mattknox_ca_at_hotmail_dot_com
:version: $Id: test_timeseries.py 3836 2008-01-15 13:09:03Z <EMAIL> $
"""
__author__ = "<NAME> & <NAME>... | |
Image.open(_fp)
_rgb_im = _img.convert('RGB')
_rgb_im.save(os.path.join(_path, _file_no_ext + '.jpg'))
_fp.close()
# 删除原文件,修改xml中的文件名
FileTool.remove_file(_img_file)
_xml_file = os.path.join(_path, _file_no_ext + '.xml')
if os.path.exists(_xml_file):
_tree = ET.parse(os.path.join(_path, _xml_file))
_root = _... | |
""" pylabnet measurement and service classes for Swabian Instruments TimeTagger
which implements qudi's SlowCounter interface.
This file contains pylabnet wrapper and service classes to allow qudi to
access Swabian Instruments TT through pylabnet network as SlowCounter.
Steps:
- instantiate TimeTagger
- instantiate p... | |
%s != %s' % (ds.GetGeoTransform(), gt))
ds = None
gdaltest.tiff_drv.Delete('tmp/tiff_write_60.tif')
assert not os.path.exists(options_tuple[1])
###############################################################################
# Test BigTIFF=IF_NEEDED creation option
def test_tiff_write_61():
ds = gdaltest.tiff... | |
<filename>chrono_figure/host/usb2snes.py
# USB2SNES interface library and command line tool
# Copyright (c) 2020, <NAME>
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of so... | |
# Copyright (c) Facebook, Inc. and its affiliates
# Copyright (c) MTRF authors
import collections
from enum import Enum
from gym import utils
import numpy as np
import os
from pathlib import Path
import pickle
from typing import Any, Dict, Optional, NewType, Sequence, Union, Tuple
from r3l.r3l_envs.base_env.base_env_... | |
# coding: utf-8
# Goal: Rename multiple mp3 files with their properties to get them ready for iTunes
"""
Idea space:
- Ask user to delete the Cover_Images folder on end
"""
import eyed3 as d3
import os, os.path, datetime, requests, re, string, PIL.Image, youtube_dl, json
from bs4 import BeautifulSoup
# path = "C:\\U... | |
= np.zeros(grid.number_of_nodes, dtype=int)
>>> ca = HexCTS(grid, nsd, trn_list, ins)
>>> cap = CAPlotter(ca, cmap=matplotlib.cm.pink)
>>> cap.gridtype
'hex'
>>> cap._cmap.name
'pink'
"""
def __init__(self, ca, cmap=None, **kwds):
"""CAPlotter() constructor keeps a reference to the CA model, and
optionally a... | |
<reponame>rsuprun/ocropy
import glob
import copy
import PIL
import cv2
import numpy as np
import scipy.ndimage as ndimage
import matplotlib.pyplot as plt
class record:
def __init__(self,**kw): self.__dict__.update(kw)
def disp_img(img, title, h, w):
cv2.namedWindow(title, flags=cv2.WINDOW_NORMAL)
cv2.imshow(tit... | |
text
:rtype: List[Tuple[str, str]]
"""
pass
@abstractmethod
def _get_normal_text(self, choice) -> List[Tuple[str, str]]:
"""Generate the formatted text for non-hovered choices.
:return: list of formatted text
:rtype: List[Tuple[str, str]]]
"""
pass
@property
def choice_count(self) -> int:
"""Get the cho... | |
del self.__virtual_pins[(str2pin_dict['subcomponent_str'], str2pin_dict['subcomponent_pin_str'])]
net = self.__pin_connectivity[pin]
self.__net_connectivity[net].remove(pin)
del self.__pin_connectivity[pin]
def disconnect_bus(self, pinbus_str):
if not isinstance(pinbus_str, str):
raise Exception('pinbus_str shou... | |
LsGermsStruct to a list if needed:
validStructTypes = (_objs.LsGermsStructure, _objs.LsGermsSerialStructure)
if isinstance(circuit_structs, validStructTypes):
master = circuit_structs
circuit_structs = [master.truncate(Ls=master.Ls[0:i + 1])
for i in range(len(master.Ls))]
nested = True # (by this construction)
... | |
announce for low level players
if int(death_level) < announce_threshold:
return
if char is None:
if char_name is None:
log.error("announce_death: no character or character name passed.")
return
char = yield from get_character(char_name)
if type(char) is not dict:
log.warning("announce_death: couldn't ... | |
parametric position
* a list of float values for evaluation at the multiple parametric positions
The return value will be in the order of the input parametric position list.
This method accepts the following keyword arguments:
* ``normalize``: normalizes the output vector. Default value is *True*.
:param parpo... | |
indicator from 0, 1, 2 range"
assert isinstance(query, list), "The parameter query must be a list"
print("=================================================================")
print("Data Loading..")
assert isinstance(data,
(str, list)), "The data should be string or list object"
if isinstance(data, str):
with o... | |
print("Test Completed... Cleaning up Stations")
lf_test.Client_disconnect(station_name=station_names_fiveg)
assert station
else:
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2453", name="WIFI-2453")
@pytest.mark.wpa2_personal
@pytest.mark.fiveg
@pytest.mark.mcs7
@py... | |
import numpy as np
import cv2
import cv2.aruco as aruco
import math
"""
**************************************************************************
* E-Yantra Robotics Competition
* ================================
* This software is intended to check version compatiability of open source software
* Theme: Thirsty Crow
... | |
according to the same network of the previous cp_out.
If the VNF is the first one, then the first CP is chosen (disregarding the management interface)
- cp_out: if the given VNF has just one CP for VNF chaining, then cp_out = cp_in. Otherwise,
cp_out is chosen taking into account NFVO requirements implemented in the... | |
<reponame>whisller/aws-lambda-powertools-python<gh_stars>0
import base64
import json
import logging
import os
import re
import traceback
import warnings
import zlib
from abc import ABC, abstractmethod
from enum import Enum
from functools import partial
from http import HTTPStatus
from typing import Any, Callable, Dict,... | |
= 78
kNurbsToSubdiv = 752
kObjectAttrFilter = 672
kObjectBinFilter = 933
kObjectFilter = 668
kObjectMultiFilter = 669
kObjectNameFilter = 670
kObjectRenderFilter = 673
kObjectScriptFilter = 674
kObjectTypeFilter = 671
kOcean = 866
kOceanShader = 889
kOffsetCos... | |
for import-like statements.
Arguments:
src: The Python source code to analyze for dependencies.
module_name: The name of the module that ``src`` corresponds to.
is_package: Whether this module should be treated as a package.
See :py:meth:`save_source_string` for more info.
Returns:
A list containing modules de... | |
<filename>mechanistic/ssn.py
#!/usr/bin/env python
###
# A mini library containing the functions typically used when running
# simulations using the supralinear stabilized network (Rubin et al., 2015).
#
# <NAME>, September 2015
import numpy as np
import scipy.io
import matplotlib.image as mpimg
class SSNetwork:
... | |
headers = {}
return await self.get_loadbalance_health_ex_async(request, headers, runtime)
def get_loadbalance_health_ex(
self,
request: cas_models.GetLoadbalanceHealthRequest,
headers: Dict[str, str],
runtime: util_models.RuntimeOptions,
) -> cas_models.GetLoadbalanceHealthResponse:
"""
Description: 获取单个LB的健康... | |
#
# 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, Version 2.0
# (the "License"); you may not use... | |
v1 API"""
if "Token" in www_authenticate:
return self.v1_auth_header
return ""
def get_v1_image_tags(self, endpoint, imagerepo):
"""Get list of tags in a repo from Docker Hub"""
url = endpoint + "/v1/repositories/" + imagerepo + "/tags"
Msg().err("tags url:", url, l=Msg.DBG)
(hdr, buf) = self._get_url(url)
tr... | |
<gh_stars>10-100
"""
The module contains a set of auxiliary functions facilitating the tight-binding computations
"""
from __future__ import print_function
from __future__ import absolute_import
from itertools import product
import numpy as np
import yaml
def accum(accmap, input, func=None, size=None, fill_value=0, d... | |
<reponame>AlfredoSequeida/termtosvg
import io
import logging
from collections import namedtuple
from itertools import groupby
from typing import Dict, List, Iterable, Iterator, Union, Tuple
import pyte.graphics
import pyte.screens
from lxml import etree
# Ugliest hack: Replace the first 16 colors rgb values by their ... | |
returned errors
:type continue_on_error: bool
:param context: A dictionary of extra values to include in the context header
:type context: dict
:param control_extra: A dictionary of extra values to include in the control header
:type control_extra: dict
:return: The job response
:rtype: list[union(JobResponse, ... | |
<reponame>Atokulus/flora-tools
from copy import copy
from typing import List, Union, Tuple, Optional
import numpy as np
import flora_tools.lwb_round as lwb_round
import flora_tools.lwb_slot as lwb_slot
import flora_tools.sim.lwb_service as service
import flora_tools.sim.sim_node as sim_node
from flora_tools.sim.sim_m... | |
= True
if (epoch + 1) % self.VALIDATION_EPOCH_NUM == 0:
is_validation_step = True
return is_checkpoint_step, is_validation_step
def run_batches(self,
dataset,
total_samples,
epoch,
train_dev_test = 'train'
):
n_batches_per_epoch = total_samples//self.batch_size + 1
total_training_loss = 0
f... | |
node unoccupied"""
if self.free is not None and self.free:
raise LauncherException("Attempting to release a free node")
self.free = True
self.taskid = -1
self.tasks_on_this_node += 1
def isfree(self):
"""Test whether a node is occupied"""
return self.free
def nodestring(self):
if self.free:
return "X"
els... | |
value.
self.primary_key = list()
if isinstance(primary_key, str):
self.primary_key.append(primary_key)
elif isinstance(primary_key, list):
self.primary_key.extend(primary_key)
else:
raise ValueError(
"Primary keys must be a string or list instead of %s."
% type(primary_key)
)
def add_foreign_key(
self,
fo... | |
Leaf":0x5f674b,
"Fiddle-Leaf Fig":0xa6c875,
"Fiddlehead Fern":0xc8c387,
"Fiddler":0x5a9589,
"Fiddlesticks":0xbb9fb1,
"Field Blue":0x4477aa,
"Field Day":0xc5e6a4,
"Field Drab":0x6c541e,
"Field Green":0x60b922,
"Field Khaki":0xb1a891,
"Field Maple":0x80884e,
"Field of Wheat":0xdeb699,
"Field Poppy":0xd86f3c,
"Fieldstone"... | |
<reponame>CSMMLab/neuralEntropyClosures<filename>callNeuralClosure.py<gh_stars>1-10
'''
This is the script that gets called from the C++ KiT-RT method MLOptimizer.cpp
It initializes and loads a neural Closure
The call method performs a prediction
Author: <NAME>
Version: 0.0
Date 29.10.2020
'''
### imports ###
# intern... | |
from __future__ import annotations
import re
import pytz
from textwrap import TextWrapper
from typing import Callable
from unicodedata import normalize
from datetime import datetime
from random import uniform
from arrow import Arrow
from math import ceil, floor
from py_reportit.crawler.post_processors import abstrac... | |
<filename>analysis.py
"""
Functions used to save model data and to perform analysis
"""
import numpy as np
from parameters import *
from sklearn import svm
import time
import pickle
def analyze_model(trial_info, y_hat, h, syn_x, syn_u, model_performance, weights):
"""
Converts neuronal and synaptic values, stored ... | |
= QtWidgets.QAction(self.tr("&Web Parser"), self,
shortcut=QtGui.QKeySequence(QtCore.Qt.Key_W),
statusTip=self.tr("Settings for web parser"),
triggered=self.action_web_profile)
actions['reload'] = QtWidgets.QAction(self.tr("Reload Archive"), self,
shortcut=QtGui.QKeySequence.Refresh,
statusTip=self.tr("Reload the... | |
n) -> SedChange
removeChange(SedModel self, string sid) -> SedChange
"""
return _libsedml.SedModel_removeChange(self, *args)
def getElementName(self):
"""getElementName(SedModel self) -> string"""
return _libsedml.SedModel_getElementName(self)
def getTypeCode(self):
"""getTypeCode(SedModel self) -> int"""
re... | |
<reponame>TyranicMoron/dotfiles<gh_stars>1-10
# -*- coding: utf-8 -*-
# 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 3 of the License, or
# (at your option) any later version.
#... | |
predetermined entity with its Spawner. This is supposed to be used
with things like grenades and Molotov cocktails that fly in the arc and
explode upon hitting the ground.
"""
def __init__(self, *args, spawned_item='flame', target_y=None,
explosion_sound=None, **kwargs):
super().__init__(*args, **kwargs)
self.s... | |
options.unused_without_snapshot:
warn('building --without-snapshot is no longer possible')
o['variables']['want_separate_host_toolset'] = int(cross_compiling)
if options.without_node_snapshot or options.node_builtin_modules_path:
o['variables']['node_use_node_snapshot'] = 'false'
else:
o['variables']['node_use_... | |
<reponame>pcguruuu/git-git.nvaccess.org-nvda
# -*- coding: UTF-8 -*-
#NVDAObjects/__init__.py
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2006-2014 NV Access Limited, <NAME>, <NAME>, <NAME>
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
"""Module t... | |
#!/usr/bin/env python
# ___INFO__MARK_BEGIN__
#######################################################################################
# Copyright 2008-2021 Univa Corporation (acquired and owned by Altair Engineering Inc.)
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file exce... | |
<reponame>joaofbsm/upgraded-guacamole
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Feature extractor and model builder"""
from __future__ import print_function
import os
import sys
import MySQLdb
import pandas as pd
import numpy as np
from tqdm import tqdm
#==================================FUNCTIONS===========... | |
is, the
extrapolation is considered valid for all temperatures and pressures.
It is not guaranteed that a method will work or give an accurate
prediction simply because this method considers the method valid.
Parameters
----------
T : float
Temperature at which to test the method, [K]
P : float
Pressure at w... | |
+ self.start)
class BoolGenerator(RandomGenerator):
"""Generate True/False at a given 'rate'.
- float rate: truth's rate, defaults to 0.5
"""
DIRS = { 'rate':float }
def __init__(self, att, params=None):
RandomGenerator.__init__(self, att, params)
self.rate = self.params.get('rate', 0.5)
assert 0.0 <= self.ra... | |
deaths.
If no character is provided, the timeline of all registered characters in the server will be shown.
Characters must be registered in order to see their timelines.
- 🌟 Indicates level ups
- 💀 Indicates deaths
"""
permissions = ctx.bot_permissions
if not permissions.embed_links:
await ctx.send("Sorry... | |
power = {'BUSES': {'Area': 1.33155,
'Bus/Area': 1.33155,
'Bus/Gate Leakage': 0.00662954,
'Bus/Peak Dynamic': 0.0,
'Bus/Runtime Dynamic': 0.0,
'Bus/Subthreshold Leakage': 0.0691322,
'Bus/Subthreshold Leakage with power gating': 0.0259246,
'Gate Leakage': 0.00662954,
'Peak Dynamic': 0.0,
'Runtime Dynamic': 0.0,
... | |
<gh_stars>0
from google.appengine.api import users
from google.appengine.api import users as app_engine_users
from google.appengine.ext import ndb
from google.appengine.ext import blobstore
from google.appengine.ext.webapp.util import run_wsgi_app
from webapp2_extras import security
from webapp2_extras import routes
fr... | |
# Copyright 2019 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... | |
#
# This file defines the layer that talks to lldb
#
import os
import re
import sys
import lldb
import vim
from vim_ui import UI
# =================================================
# Convert some enum value to its string counterpart
# =================================================
# Shamelessly copy/pasted from ... | |
<reponame>w3c/tracecontext-spec
#!/usr/bin/env python
import os
import sys
import unittest
from client import TestClient
from server import TestServer
from tracecontext import Traceparent, Tracestate
client = None
server = None
def environ(name, default = None):
if not name in os.environ:
if default:
os.enviro... | |
<gh_stars>1-10
import asyncio
import copy
import sentinels
import typing
import uuid
from .. import aio
from ..context import Context
from ..message import (
Envelope,
Message,
)
from .messages import (
ShutdownMessage,
TimerConfiguration,
TimerDoneMessage,
ActletDoneMessage,
)
from .router import Router
UNHA... | |
<reponame>mao-example/End-to-End-Incremental-Learning
import pickle
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
# import matplotlib.pyplot as plt
import time
import torchvision.transforms as transforms
import torchvision.models.resne... | |
<reponame>WesCoomber/582Wcoomber3
#!/usr/bin/env python2.7
import json, random, time, string, inspect
import os, sys, signal, io, operator
import geocoder as gc
from randomdict import RandomDict
from PIL import Image
from sets import Set
from glob import glob
from yelp.client import Client
from yelp.oauth1_authenticat... | |
import torch
import torch.nn.functional as F
import queue
from itertools import count
import numpy as np
from ..models import RecurrentDESMILES
class AstarTree:
def __init__(self, fp, desmiles, max_length=30, max_branches=5000):
assert type(fp) is torch.Tensor
assert type(desmiles) is RecurrentDESMILES
assert next... | |
import gevent
from gevent import monkey, GreenletExit
import six
from six.moves import xrange
monkey.patch_all(thread=False)
from time import time
import sys
import random
import traceback
import logging
from .clients import HttpSession
from . import events
from .exception import LocustError, InterruptTaskSet, Resc... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
"""
from __future__ import division
import numpy as np
import shapely.geometry.point as point
import pycity_base.classes.Weather as Weather
import pycity_base.classes.demand.SpaceHeating as spaceheat
import pycity_base.classes.demand.ElectricalDemand as elecdemand
im... | |
<gh_stars>10-100
"""
=========================
User Interaction Handlers
=========================
User interaction handlers for a :class:`~.SchemeEditWidget`.
User interactions encapsulate the logic of user interactions with the
scheme document.
All interactions are subclasses of :class:`UserInteraction`.
"""
im... | |
<gh_stars>10-100
import functools
import click
from gradient import clilogger
from gradient.api_sdk import constants, workspace
from gradient.cli import common, validators
from gradient.cli.cli import cli
from gradient.cli.cli_types import json_string, ChoiceType
from gradient.cli.common import api_key_option, ClickG... | |
<filename>src/1-Phenotype-web/ext/db_generator.py
#!/usr/bin/python
from wikitools import wiki, category
import os
import re
import urllib2
import urllib
from bs4 import BeautifulSoup
from bs4 import Comment
import sys
import csv
import sqlite3
from lxml import etree
def load_accepted_rsnumbers(filename):
return rs... | |
<filename>loader/hthh_nxo64.py
# hthh_nxo64.py: IDA loader and library for reading nso/nro/kip files
# Copyright 2017 Reswitched Team
#
# 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 permissio... | |
ends_visible(self, size, focus=False):
"""Return a list that may contain 'top' and/or 'bottom'.
convenience function for checking whether the top and bottom
of the list are visible
"""
(maxcol, maxrow) = size
l = []
middle,top,bottom = self.calculate_visible( (maxcol,maxrow),
focus=focus )
if mid... | |
import os
import sys
import random
import warnings
import math
import numpy as np
import pylab
import scipy.ndimage as ndi
from concurrent.futures import ThreadPoolExecutor
import PIL
from PIL import Image, ImageDraw
from tqdm import tqdm
def autoinvert(image):
assert np.amin(image) >= 0
assert np.amax(image) <= ... | |
t)
item = self.anal_type(t.args[0])
return TypeType.make_normalized(item, line=t.line)
elif fullname == 'typing.ClassVar':
if self.nesting_level > 0:
self.fail('Invalid type: ClassVar nested inside other type', t)
if len(t.args) == 0:
return AnyType(TypeOfAny.from_omitted_generics, line=t.line, column=t.column)
... | |
# Copyright 2018 The Bazel 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 law o... | |
#!/usr/bin/env python
""" Replication of CoordConv Paper.
"""
import os
import numpy as np
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.modules.conv as conv
import torch.utils.data as utils
import torch.nn.functional as F
from torch.autograd import Variable
from sklearn.model_sel... | |
mask positions in action_prob that are not used
# (tgt_action_len, batch_size)
action_mask_pad = torch.eq(batch.apply_rule_mask + batch.gen_token_mask + batch.primitive_copy_mask, 0.)
action_mask = 1. - action_mask_pad.float()
# (tgt_action_len, batch_size)
action_prob = tgt_apply_rule_prob * batch.apply_rule_mas... | |
<gh_stars>0
from time import time
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import PermissionDenied
from django.db.models import Count
from django.http import Http404, HttpResponse, JsonResponse
from django.http.request import QueryDict
from django.shortcuts import get_obje... | |
<reponame>BAMresearch/ctsimu-toolbox
# -*- coding: UTF-8 -*-
"""
This module provides classes for the virtual processing of images.
* `Image` reads, stores, writes and handles image data.
* `ImageFile` gathers information about an image file: file name, data type,
byte order. It is used to instruct the `Image.r... | |
<gh_stars>100-1000
from .models import Account
DB_HOST = ["localhost"]
DB_PORT = 27017
def get_db(db_name):
import pymongo
DB_HOST = ["localhost"]
DB_PORT = 27017
db = pymongo.Connection(DB_HOST, DB_PORT)[db_name]
return db
def get_mongo_cursor(db_name, collection_name, max_docs=100):
import pymongo
db = p... | |
_prefix = 'infra-xtc-oper'
_revision = '2017-08-24'
def __init__(self):
super(Pce.TopologyNodes.TopologyNode.Ipv6Link.RemoteNodeProtocolIdentifier.SrgbInformation, self).__init__()
self.yang_name = "srgb-information"
self.yang_parent_name = "remote-node-protocol-identifier"
self.is_top_level_class = False
self... | |
in e.es))
def visit_ETupleGet(self, e):
return "({}).{}".format(self.visit(e.e), e.index)
def visit_ELet(self, e):
return "{} {} = {} in {}".format(self.format_keyword("let"), e.body_function.arg.id, self.visit(e.e), self.visit(e.body_function.body))
def visit_CPull(self, c):
return "{} {lt}- {}".format(c.id, ... | |
<filename>old_projects/eoc/chapter9.py
import scipy
import fractions
from big_ol_pile_of_manim_imports import *
class Chapter9OpeningQuote(OpeningQuote):
CONFIG = {
"quote" : [
"We often hear that mathematics consists mainly of",
"proving theorems.",
"Is a writer's job mainly that of\\\\",
"writing sentences?"... | |
self.cached_enemies:
#get old position.
o_pos = None
moved = False
if self.unit_positions.get(unit.tag):
o_pos = self.unit_positions.get(unit.tag)
if o_pos:
if o_pos != unit.position:
#moved.
moved = True
#update the new_moves dict
new_moves.update({unit.tag:moved})
... | |
request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.__change_artifact_dep_setting_with_http_info(bt_locator, artifact_dep_locator, field_name, **kwargs) # noqa: E501
else:
(data) = self.__change_artifact_dep_setting_with_http_info(bt_locator, artifact_dep_locator, f... | |
<reponame>AlexaVillaume/irtf_website
# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# * Make sure each ForeignKey has `on_delete` set to the desired behavior.
# * Remov... | |
<filename>test/azure/version-tolerant/Expected/AcceptanceTests/LroVersionTolerant/lroversiontolerant/aio/operations/_operations.py
# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Li... | |
"""storeReleasePublishLogs_get # noqa: E501
Returns publish logs for a particular release published to a particular store # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.storeReleasePublishLogs_get(store_name, relea... | |
from wallaby import *
import constants as c
import movement as m
import utils as u
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~HOW TO USE LFOLLOW COMMANDS~~~~~~~~~~~~~~~~~~~~~~~~
# All lfollow commands follow a certain pattern which if you learn, you can come up
# with commands without the need to look in this file. Keep in mind ... | |
<filename>pineboolib/plugins/sql/flqpsql.py
from PyQt5.QtCore import QTime, QDate, QDateTime, Qt # type: ignore
from PyQt5.Qt import qWarning, QDomDocument, QRegExp # type: ignore
from PyQt5.QtWidgets import QMessageBox, QProgressDialog, QWidget # type: ignore
from pineboolib.core.utils.utils_base import text2bool, au... | |
import hashlib
import json
import logging
import os
import time
from typing import Any
from typing import Dict
from typing import List
from typing import Mapping
from typing import MutableMapping
from typing import Optional
from typing import Tuple
from urllib.parse import urlparse
import boto3
import ephemeral_port_r... | |
"""
pass
def list_applied_schema_arns(DirectoryArn=None, NextToken=None, MaxResults=None):
"""
Lists schemas applied to a directory.
See also: AWS API Documentation
:example: response = client.list_applied_schema_arns(
DirectoryArn='string',
NextToken='string',
MaxResults=123
)
:type DirectoryArn: st... | |
#!/usr/bin/env python3
import os
import json
import dateutil.parser
from datetime import *
import requests
import zlib
from lxml import etree
import argparse
from shapely.geometry import Point
from shapely.geometry.polygon import Polygon
from osmosis_postgis import OsmosisPostgis
from project_postgis import ProjectPo... | |
<gh_stars>1-10
#!/usr/bin/env python3
"""
Funtional Data Analysis on multifrequency acoustic data.
Adapted from the R package 'fda.oce' (https://github.com/EPauthenet/fda.oce)
to work on multifrequency and depth-varying acoustic data, as explained in
"Ariza et al. (under review). Acoustic seascape partitioning throug... | |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | |
<reponame>Laogeodritt/KazTron
import asyncio
import logging
from asyncio import Event
from collections.abc import Hashable
from datetime import datetime, timedelta
from typing import Callable, Union, Dict, Awaitable, Any, List, Sequence, Mapping, Optional
import discord
from discord.ext import commands
from kaztron.... | |
<gh_stars>0
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
# | | |___| | | | __/ (__| < | | | | . \ |
# | \____|_| |... | |
`tensor` with shape `shape`.
If one component of 1-D tensor `shape` is the special value -1, the size of that
dimension is computed so that the total size remains constant. In particular, a
`shape` of `[-1]` flattens into 1-D. At most one component of `shape` may be
unknown.
The `shape` must be 1-D and the opera... | |
# -*- coding: utf8 -*-
# Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. 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/LI... | |
<gh_stars>0
import os
import random
from random import seed
import numpy
import pandas as pd
from keras_preprocessing.image import ImageDataGenerator
from sklearn.metrics import confusion_matrix, plot_confusion_matrix
from sklearn.model_selection import KFold, cross_val_score, StratifiedKFold
from sklearn.pre... | |
<gh_stars>0
from __future__ import print_function
from itertools import product
import os
import pickle
import bdpy
from bdpy.dataform import Features
from bdpy.util import dump_info, makedir_ifnot
import numpy as np
from stability_selection import stability_selection
from sklearn.decomposition import PCA
from scipy im... | |
import random, os, httplib2
from biothings.tests.test_helper import BiothingTestHelperMixin, _d, TornadoRequestHelper
from nose.tools import ok_, eq_
from tornado.testing import AsyncHTTPTestCase
import www.index as index
from biothings.settings import BiothingSettings
import config
class MyGeneTest(BiothingTestHelp... | |
thread = api.view_distinctionsv3_with_http_info(orcid, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str orcid: (required)
:return: DistinctionsSummaryV30
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['orcid'] # noqa: E501
all_params.append('as... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.