gt
stringclasses
1 value
context
stringlengths
2.49k
119k
from graphics import * import random ############################################################ # BLOCK CLASS ############################################################ class Block(Rectangle): ''' Block class: Implement a block for a tetris piece Attributes: x - type: int y...
from config.api2_0_config import * from modules.logger import Log from on_http_api2_0 import ApiApi as Api from on_http_api2_0.rest import ApiException from proboscis.asserts import * from proboscis import SkipTest from proboscis import test from json import dumps, loads from on_http_api2_0 import rest import time impo...
from sqlalchemy import schema as sa_schema, types as sqltypes from sqlalchemy.engine.reflection import Inspector from sqlalchemy import event from ..operations import ops import logging from .. import util from ..util import compat from ..util import sqla_compat from sqlalchemy.util import OrderedSet import re from .re...
# # Module providing the `SyncManager` class for dealing # with shared objects # # multiprocessing/managers.py # # Copyright (c) 2006-2008, R Oudkerk # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are m...
import os from subprocess import call from flask import Flask, render_template, request, redirect, url_for, send_from_directory, jsonify from flask.ext.sqlalchemy import SQLAlchemy from wtforms import form, fields, validators from flask.ext import admin, login from flask.ext.admin.contrib import sqla from flask.ext.adm...
""" Functions which are not listed in the maya documentation, such as commands created by plugins, as well as the name parsing classes `DependNodeName`, `DagNodeName`, and `AttributeName`. """ import re import pymel.internal.pmcmds as cmds import pymel.internal.factories as _factories _factories.createFunctions( __nam...
""" Python code imitating ROS node (both publisher and subscriber) targeted to control Husky platform. usage: ./node.py [<node IP> <master IP> | <metalog>] """ # for test run on server: # terminalA: roscore # terminalB: rostopic pub /hello std_msgs/String "Hello Robot" # terminalC: rostopic echo /hel...
# ---------------------------------------------------------------------------- # Copyright 2015-2016 Nervana Systems 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.apa...
from django.http import HttpResponse from django.http import HttpResponseRedirect from django.template import RequestContext from django.shortcuts import render_to_response from models import Project,ProjectAllocation,ProjectMetadata,Egroups from forms import ProjectForm from django.db import transaction from getPrivil...
from django.utils import unittest from django.db import models from django.contrib.auth.models import User, AnonymousUser from django.template import Template, Context from django.test import client from bookmarks import settings, exceptions, backends, handlers, forms, views from bookmarks.models import annotate_book...
""" The file preprocesses the data/NER-de-train.tsv, data/NER-de-dev.tsv and data/NER-de-test.tsv from the GermEval 2014 shared task on German NER It requires pre-trained word embeddings for German. It tries to download those from https://www.ukp.tu-darmstadt.de/research/ukp-in-challenges/germeval-2014/ using wget. ...
from collections import defaultdict from copy import deepcopy import logging import re class Dependencies(): dep_regex = re.compile("(.*?)\((.*?)-([0-9]*)'*, (.*?)-([0-9]*)'*\)") @staticmethod def parse_dependency(string): dep_match = Dependencies.dep_regex.match(string) if not dep_match: ...
""" Assertion test module ~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2016 by Roland Hedberg. :license: APACHE 2.0, see LICENSE for more details. """ from future.backports.urllib.parse import parse_qs import json import inspect import traceback import sys from otest.events import EV_PROTOCOL_REQUEST from o...
""" DB utilities and configuration. """ import cloudscheduler.lib.schema as schema_na import logging import os import signal import socket import sys import time import yaml import ipaddress from subprocess import Popen, PIPE from inspect import stack import mysql.connector class Config: def __init__(self, db_...
""" Tests for _statespace module Author: Chad Fulton License: Simplified-BSD References ---------- Kim, Chang-Jin, and Charles R. Nelson. 1999. "State-Space Models with Regime Switching: Classical and Gibbs-Sampling Approaches with Applications". MIT Press Books. The MIT Press. Hamilton, James D. 1994. Time Series ...
import math import geometry as geom from meshutils import mesh import sfepy.base.progressbar as progressbar def numlist2str(x): s="" for i in x: s+="%d "%i return s[:-1] def getinsidepoint(pts): direct=(pts[0]+pts[1]+pts[2])/3-pts[0] return pts[0]+0.001*direct def write_tetgen(g,filenam...
import sys import os import pandas as pd import numpy as np import matplotlib.pyplot as plt # from multiprocessing import Pool from scipy import stats from scipy.stats import norm,t from keras.models import Sequential from keras.optimizers import SGD from keras.layers.core import Dense, Activation from keras.callba...
#!/usr/bin/env python """Common code for converting proto to other formats, such as JSON.""" import base64 import collections import datetime import json import logging from protorpc import message_types from protorpc import messages from protorpc import protojson import six from apitools.base.py import exceptions ...
""" Starter fabfile for deploying the corredor project. Change all the things marked CHANGEME. Other things can be left at their defaults if you are happy with the default layout. """ import posixpath from fabric.api import run, local, env, settings, cd, task from fabric.contrib.files import exists from fabric.opera...
from time import sleep from boto.ec2.connection import EC2Connection from boto.ec2.regioninfo import EC2RegionInfo from flask import current_app from multistack.providers.base import BaseProvider class EC2Provider(BaseProvider): """ A provider class specific to support EC2 API. The features of this cla...
import vstruct from vstruct.primitives import * class IMAGE_BASE_RELOCATION(vstruct.VStruct): def __init__(self): vstruct.VStruct.__init__(self) self.VirtualAddress = v_uint32() self.SizeOfBlock = v_uint32() class IMAGE_DATA_DIRECTORY(vstruct.VStruct): def __init__(self): v...
# coding=utf-8 # Copyright 2022 The Google Research 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 applicab...
#!/usr/bin/env python # This file has been imported into the Kudu source tree from # the IWYU source tree as of version 0.8 # https://github.com/include-what-you-use/include-what-you-use/blob/master/iwyu_tool.py # and corresponding license has been added: # https://github.com/include-what-you-use/include-what-you-...
import json import pytest from flex.exceptions import ValidationError from flex.constants import ( INTEGER, OBJECT, ARRAY, STRING, ) from flex.validation.response import ( validate_response, ) from flex.error_messages import MESSAGES from tests.factories import ( SchemaFactory, ResponseFac...
# # Copyright 2015 Geoff MacGill # # 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 writi...
#!/usr/bin/python # 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 # "Licens...
#!/usr/bin/env python2 from __future__ import print_function from os.path import join as path_join from fnmatch import fnmatch from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter, FileType from json import load as json_load, dumps as json_dumps, loads as json_loads from itertools import chain from sys i...
# Copyright (c) 2018 PaddlePaddle 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 app...
# Copyright 2015 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 applica...
""" mflpf module. Contains the ModflowLpf class. Note that the user can access the ModflowLpf class as `flopy.modflow.ModflowLpf`. Additional information for this MODFLOW package can be found at the `Online MODFLOW Guide <http://water.usgs.gov/ogw/modflow/MODFLOW-2005-Guide/index.html?lpf.htm>`_. """ import sys im...
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) 2019 Western Digital Corporation or its affiliates. import warnings import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import (ConvModule, bias_init_with_prob, constant_init, is_norm, normal_init) from ...
from datetime import datetime from mako.template import Template from custom_sql import CustomSQL # crontable = [] outputs = [] def send_response(template_name, channel, context=None): import os context = context or {} template_path = os.path.join('templates', template_name) + '.txt' template = Temp...
# -*- coding: utf-8 -*- """ lantz_core.backends.visa ~~~~~~~~~~~~~~~~~~~~~~~~ Module importing the pyvisa module components and implementing the base drivers for instrument communicating through the VISA protocol. :copyright: 2015 by The Lantz Authors :license: BSD, see LICENSE for more detail...
""" Load npy xy, plot and save """ import os, sys import matplotlib matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! import matplotlib.pyplot as plt import matplotlib.cm as mpl_cm from matplotlib import rc from matplotlib.font_manager import FontProperties from matplotlib import rcPa...
# Copyright (c) 2019 PaddlePaddle 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 app...
# No shebang line, this module is meant to be imported # # Copyright 2014 Oliver Palmer # # 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 # # Unle...
import logging import logging.handlers h = logging.handlers.RotatingFileHandler logger = logging.getLogger() print logger.name exit() from slugify import slugify def create_slug(title): slug = None slug_counter = 0 _slug = slugify(title).lower() while True: slug = _slug if slug_coun...
import logging import os from six.moves import xrange from kafka import ( KafkaConsumer, MultiProcessConsumer, SimpleConsumer, create_message ) from kafka.common import ( ProduceRequest, ConsumerFetchSizeTooSmall, ConsumerTimeout, OffsetOutOfRangeError ) from kafka.consumer.base import MAX_FETCH_BUFFER_SI...
# Copyright 2014 NEC Corporation. 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 ...
import functools import os.path import yaml import viki.fabric.helpers as fabric_helpers from fabric.api import env, run, task from fabric.colors import red from fabric.context_managers import hide, settings from fabric.contrib.files import exists, upload_template from fabric.operations import local from viki.fabric ...
# Copyright 2017 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 applica...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import logging import copy from flexget import plugin from flexget.config_schema import one_or_more from flexget.event import event from flexget.plugin import PluginWarnin...
# Copyright 2014 CloudFounders NV # # 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 writ...
""" Widget classes specific to saludinnova project (based on Community project) """ from datetime import datetime import os from django import forms from django.conf import settings from django.contrib.admin.widgets import RelatedFieldWidgetWrapper from django.db import models from django.db.models.manager import Man...
__all__ = ['PySource', 'PyCFunction', 'PyCModule', 'PyCTypeSpec', 'PyCArgument', 'PyCReturn'] import os import sys from base import Component from utils import * from c_support import * class PySource(FileSource): template_py_header = '''\ #!/usr/bin/env python # This file %(path)r is generated using ExtGen too...
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <codecell> import functools, glob, itertools import numpy as np import scipy.io as sio from scikits.audiolab import Sndfile, Format import librosa from librosa.display import * import npof as pof # <codecell> %cd nmf/ import beta_nmf %cd .. # <codecell> fig =...
#!/usr/bin/env python # Copyright 2015 gRPC 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 o...
# Copyright 2015 Mario Graff Guerrero # 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 wri...
# Copyright 2020 The StackStorm Authors. # Copyright 2019 Extreme Networks, 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 ...
import cherrypy import hashlib import mock import mongomock import os import pytest import shutil from .utils import MockSmtpReceiver, request as restRequest def _uid(node): """ Generate a unique name from a pytest request node object. """ return '_'.join((node.module.__name__, node.cls.__name__ if n...
""" Extended attributes extend the basic attributes of files and directories in the file system. They are stored as name:data pairs associated with file system objects (files, directories, symlinks, etc). The xattr type wraps a path or file descriptor with a dict-like interface that exposes these extended attributes....
"""Hybrid Script Parser""" import ast import operator import sys from .util import make_nop, halide_imm_types, is_docstring from .intrin import LOOP_INTRIN, MATH_INTRIN from .var_decl import determine_variable_usage from ..api import thread_axis from .. import expr as _expr from .. import make as _make from .. import ...
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import glob import json import os import re import subprocess import sys import unittest import PRESUBMIT from PRESUBMIT_test_mock...
#!/usr/bin/env python # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
# -*- coding: utf-8 -*- """Pretty-print tabular data.""" from __future__ import print_function from __future__ import unicode_literals from collections import namedtuple from platform import python_version_tuple import re if python_version_tuple()[0] < "3": from itertools import izip_longest from functools ...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
#!/usr/bin/env python3 # Copyright (c) 2014-2015 The Bitcoin Core developers # Copyright (c) 2018-2020 The Ion Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test addressindex generation and fetching # from t...
from .connectivity_graph import * from misc.utils import * from .utils import PRUNE_INACTIVE, CYCLE_INACTIVE, UPDATE_INACTIVE # TODO # - make the levels based on subproblem switches (use problem_reachable_sources). Don't count things moved by the same controller # - flag to terminate costs/levels when the goals are re...
#!/usr/bin/python # Copyright 2017 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 r...
# Copyright (c) 2015,2016,2017 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """Test the `nexrad` module.""" import contextlib from datetime import datetime from io import BytesIO import logging from pathlib import Path import numpy as np import py...
# -*- coding: utf-8 -*- """ PyQtGraph - Scientific Graphics and GUI Library for Python www.pyqtgraph.org """ __version__ = '0.9.10' ### import all the goodies and add some helper functions for easy CLI use ## 'Qt' is a local module; it is intended mainly to cover up the differences ## between PyQt4 and PySide. from ...
# -*- coding: utf-8 -*- """ This module implements the GenNetwork class, which implements generic network logic. Also implements Population and GenConnection classes @author: DanielM """ from neuron import h import random import numpy as np import matplotlib.pyplot as plt import math import time import os import shel...
''' Copyright (c) 2013-2014, Joshua Pitts All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and t...
import requests import json from getpass import getpass import time def pprint(jdata): print json.dumps(jdata, indent=4, sort_keys=True) def parse_portfolio(entry): """ Given a blob of JSON data (as a dict) that describes a portfolio, return a dictionary with the important data. """ portfolio = { 'title' : ent...
"""The tests for the Input select component.""" # pylint: disable=protected-access from unittest.mock import patch import pytest from homeassistant.components.input_select import ( ATTR_OPTION, ATTR_OPTIONS, CONF_INITIAL, DOMAIN, SERVICE_SELECT_FIRST, SERVICE_SELECT_LAST, SERVICE_SELECT_NE...
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
import logging import unittest from unittest import mock from betfairlightweight import BetfairError, exceptions from flumine import worker class BackgroundWorkerTest(unittest.TestCase): def setUp(self): self.mock_function = mock.Mock(__name__="test") self.mock_flumine = mock.Mock() self....
# Copyright (C) 2010 Google Inc. All rights reserved. # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged # Copyright (C) 2011 Apple Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following ...
# encoding: utf-8 """ImagePart and related objects.""" from __future__ import ( absolute_import, division, print_function, unicode_literals ) import hashlib import os try: from PIL import Image as PIL_Image except ImportError: import Image as PIL_Image from ..compat import BytesIO, is_string from ..opc...
# -*- coding: utf-8 -*- """ celery.app.base ~~~~~~~~~~~~~~~ Actual App instance implementation. """ from __future__ import absolute_import from __future__ import with_statement import os import threading import warnings from collections import deque from contextlib import contextmanager from copy import...
import sys messages = [] # C++ typesMap = { "i8": "uint8_t", "i32": "uint32_t", "i64": "uint64_t", "bool": "bool", "ip": "IPAddress", "mac": "MACAddress", "string": "string", "match": "Match&", "match[]": "std::vector<Match>", "action": "Action&", "action[]": "std::vector<Action>", "option": "Option&", "option[]": "s...
#!/usr/bin/env python # encoding: utf-8 """ networking.py Created by Nikolaus Sonnenschein on 2008-04-21. Copyright (c) 2008 Jacobs University of Bremen. All rights reserved. """ import sys import socket import pickle import threading import select import Queue, heapq, time from ifba.general.util import sumDicts, fil...
# Author: Simon Liedtke <liedtke.simon@googlemail.com> # # This module was developed with funding provided by # the Google Summer of Code (2013). import os import glob import shutil import os.path import configparser import pytest import sqlalchemy from astropy import units from astropy.utils.exceptions import Astro...
# Copyright 2016 Joel Dunham # # 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 writi...
# Copyright 2013: Mirantis 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 b...
#!/usr/bin/env python """ Copyright (c) 2015-2019 Alex Forencich 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,...
# -*- coding: utf-8 -*- # # Copyright 2014-2020 BigML # # 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 ...
# Copyright (c) 2019 PaddlePaddle 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 app...
''' Created on 7. aug. 2012 @author: jpaasen ''' import framework.mynumpy as np from framework.System import System from framework.beamformer.capon import getCaponCUDA as getCaponCUDA VERBOSE = True class Parameter: def __init__(self, name, initValue, minValue, maxValue, increment=1, needReProcessing=True): ...
# coding: utf-8 """ ASN.1 type classes for various algorithms using in various aspects of public key cryptography. Exports the following items: - AlgorithmIdentifier() - DigestAlgorithm() - DigestInfo() - EncryptionAlgorithm() - HmacAlgorithm() - KdfAlgorithm() - Pkcs5MacAlgorithm() - SignedDigestAlgorithm() ...
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-02-16 23:12:48 import sys import inspect import functools import fractions import six from six import add_metaclass, iteritems from pyspider.libs.ur...
import json from datetime import datetime import mock from django.contrib.admin.sites import AdminSite from django.db.models.deletion import ProtectedError from django.test import TestCase from rest_framework import serializers as rf_serializers from waldur_core.structure import admin as structure_admin from waldur_c...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe import _, msgprint from frappe.utils import flt, cstr, now, get_datetime_str from frappe.model.base_document import BaseDocument, get_controller from fra...
# -*- coding: utf-8 -*- """ Created on Thu Jun 23 2016 10:37UTC @author: Mathias Aschwanden (mathias.aschwanden@gmail.com) """ import pdb import re import random import copy import time as time_module import numpy as np import matplotlib.pyplot as plt from attrdict import AttrDict # import all submodules with prefi...
import pickle import gzip import os, sys, errno import time import math import glob import struct file_location = os.path.split(os.path.realpath(os.path.abspath(os.path.dirname(__file__))))[0]+'/' sys.path.append(file_location + '/../') # numpy & theano imports need to be done in this order (only for some numpy in...
# Copyright 2014 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. """Classes for polling a git repository via the gitiles web interface. The advantage of using gitiles is that a local clone is not needed.""" import datet...
# -*- coding: utf-8 -*- # Copyright 2022 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...
# -*- coding: utf-8 -*- """ jinja2.debug ~~~~~~~~~~~~ Implements the debug interface for Jinja. This module does some pretty ugly stuff with the Python traceback system in order to achieve tracebacks with correct line numbers, locals and contents. :copyright: (c) 2010 by the Jinja Team. :...
# Mofidied work: # -------------------------------------------------------- # Copyright (c) 2017 Preferred Networks, Inc. # -------------------------------------------------------- # # Original works by: # -------------------------------------------------------- # Faster R-CNN implementation by Chainer # Copyright (c) ...
#!/usr/local/bin/python3 from subprocess import Popen, PIPE, run import socket def network_stat(): cmd = "netstat -rn | grep default" netstat = run(cmd, shell=True) return "UP" if netstat.returncode == 0 else 'DOWN' def repo_online(): cmd = "pkg -vv | grep -B 1 'enabled.*yes' | grep url" raw_ur...
import h5py import numpy as np import scipy.linalg import scipy.spatial.distance as ssd import argparse from tps import tps_kernel_matrix from transformations import unit_boxify from rapprentice import clouds, plotting_plt from culinalg_exts import dot_batch, get_gpu_ptrs, dot_batch_nocheck, m_dot_batch import pycu...
import sys import os import io import psycopg2 import xml.etree.ElementTree as ET from lxml import etree import math from collections import Counter from operator import itemgetter import datetime import collections #Intended for use with CWar def block(ch): ''' Return the Unicode block name for ch, or None...
# -*- coding: utf-8 -*- from fractions import gcd import networkx as nx """Algorithms for directed acyclic graphs (DAGs).""" # Copyright (C) 2006-2011 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. __author...
import re from rest_framework import generics from rest_framework.exceptions import NotFound, PermissionDenied, NotAuthenticated from rest_framework import permissions as drf_permissions from framework.auth.oauth_scopes import CoreScopes from osf.models import ReviewAction, PreprintService from osf.utils.requests imp...
#!/usr/bin/env python # manuf.py: Parser library for Wireshark's OUI database. # Copyright (c) 2017 Michael Huang # # This library is free software. It is dual licensed under the terms of the GNU Lesser General # Public License version 3.0 (or any later version) and the Apache License version 2.0. # # For more informa...
# # Copyright (c) 2017-2018 Future Electronics # Copyright (c) 2018-2019 Cypress Semiconductor Corporation # Copyright (c) 2020 Arm Limited # # 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 # #...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import random import parlai.utils.logging as logging from typing import Any, Dict, Optional from parlai.core.agents imp...
# Copyright 2011 OpenStack Foundation. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance w...
# BenchExec is a framework for reliable benchmarking. # This file is part of BenchExec. # # Copyright (C) 2007-2015 Dirk Beyer # 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 Lic...
__all__ = ['threshold_adaptive', 'threshold_otsu', 'threshold_yen', 'threshold_isodata', 'threshold_li', ] import numpy as np from scipy import ndimage as ndi from ..exposure import histogram from .._shared.utils import assert_nD, warn def threshold_adaptive(image, block_s...