gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# coding: utf-8 from __future__ import print_function # partially from package six by Benjamin Peterson import sys import os import types import traceback from abc import abstractmethod from collections import OrderedDict # type: ignore # fmt: off if False: # MYPY from typing import Any, Dict, Optional, List...
# Copyright 2014 Cloudbase Solutions Srl # 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...
#BEGIN_HEADER # The header block is where all import statments should live import sys import traceback import uuid from pprint import pprint, pformat from biokbase.workspace.client import Workspace as workspaceService #END_HEADER class psd_count_contigs: ''' Module Name: psd_count_contigs Module Desc...
# -*- coding: utf-8 -*- # Most unit tests are based on the tests from Redcarpet. import re import codecs from os import path from glob import glob from subprocess import Popen, PIPE, STDOUT import hoedown from hoedown import Markdown, BaseRenderer, HtmlRenderer, SmartyPants, \ EXT_NO_INTRA_EMPHASIS, EXT_TABLES,...
# Author: Braedy Kuzma from django.http import HttpResponse, JsonResponse, HttpResponseForbidden from django.shortcuts import render, redirect, get_object_or_404 from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import LoginRequiredMixin from django.views.decorators.http import ...
########################################################################## # # Copyright (c) 2011-2012, John Haddon. All rights reserved. # Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted ...
#------------------------------------------------------------------------- # Copyright (c) Microsoft. 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.apac...
# Copyright 2016 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...
#Author - Evan Leister import numpy as np import matplotlib.pyplot as plt import matplotlib import time import string from operator import itemgetter import CO2Properties_1_0 as co2 class T2grid(object): """ This class represents an overarching structure to post-process a TOUGH2 simulation. ...
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Oakcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test BIP 9 soft forks. Connect to a single node. regtest lock-in with 108/144 block signalling activat...
#!/usr/bin/env python # # Copyright 2010 The Rhizosphere 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 # # U...
# 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 featuretools import Relationship, Timedelta, primitives from featuretools.entityset.relationship import RelationshipPath from featuretools.primitives.base import ( AggregationPrimitive, PrimitiveBase, TransformPrimitive ) from featuretools.primitives.utils import serialize_primitive from featuretools.u...
# -*- coding: utf-8 -*- # # Copyright (c) 2014-2015, Ghislain Antony Vaillant # All rights reserved. # # This file is distributed under the BSD License, see the LICENSE file or # checkout the license terms at http://opensource.org/licenses/BSD-2-Clause). from __future__ import absolute_import, division, print_function...
# Copyright (c) 2013 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
#!python """Bootstrap distribute installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from distribute_setup import use_setuptools use_setuptools() If you want to require a specific version of se...
from __future__ import unicode_literals import os from django.template import Context, Engine, TemplateSyntaxError from django.template.base import Node from django.test import SimpleTestCase, ignore_warnings from django.test.utils import extend_sys_path from django.utils.deprecation import RemovedInDjango20Warning ...
#!/usr/bin/python2.5 # # Copyright 2009 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 ...
## @file # process GUIDed section generation # # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.<BR> # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD L...
#!/usr/bin/env python # this only exists because sympy crashes IDAPython # for general use sympy is much more complete import traceback import types import copy import operator import random import string from memoize import Memoize import numpy import util def collect(exp, fn): rv = set() def _collect(exp): ...
from __future__ import annotations import logging import os.path import sys from typing import MutableMapping from pre_commit.errors import FatalError from pre_commit.util import CalledProcessError from pre_commit.util import cmd_output from pre_commit.util import cmd_output_b logger = logging.getLogger(__name__) #...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
# Copyright (c) 2012 OpenStack Foundation. # # 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...
import argparse import os import subprocess from pylab import * mtlr_train = 'mtlr_train'; mtlr_test = 'mtlr_test'; model_temp = './model.tmp'; train_data = None; test_data = None; intervals_file = None; intervals_number = 0; cv_dirs = []; def findc(k, start, end, loss): """ Simple way to find the best C1 value, us...
from __future__ import print_function import os from time import time import random import numpy as np import tables # in order to always generate the same random sequence random.seed(19) np.random.seed((19, 20)) def open_db(filename, remove=0): if remove and os.path.exists(filename): os.remove(filename)...
# -*- coding: utf-8 -*- """ Created on Thu Feb 2 12:02:56 2017 @author: ubuntu """ ######################SHAPEFILE################# def listfeature(dirshp): import osgeo from osgeo import ogr from osgeo import osr from osgeo import gdal import os from osgeo.gdalconst import GA_ReadOnly, GDT_...
# -*- 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...
from __future__ import print_function import re import sys import warnings from collections import deque from functools import partial from inspect import isclass from inspect import isfunction from inspect import isgenerator from inspect import isgeneratorfunction from inspect import ismethod from inspect import isme...
"""Test the Panasonic Viera config flow.""" from panasonic_viera import TV_TYPE_ENCRYPTED, TV_TYPE_NONENCRYPTED, SOAPError import pytest from homeassistant import config_entries from homeassistant.components.panasonic_viera.const import ( ATTR_DEVICE_INFO, ATTR_FRIENDLY_NAME, ATTR_MANUFACTURER, ATTR_MO...
# Copyright 2013 Google, Inc. All Rights Reserved. # # Google Author(s): Behdad Esfahbod, Roozbeh Pournader from fontTools.misc.timeTools import timestampNow from fontTools import ttLib, cffLib from fontTools.ttLib.tables import otTables, _h_e_a_d from fontTools.ttLib.tables.DefaultTable import DefaultTable from fontT...
# -*- coding:utf-8 -*- __author__ = 'q00222219@huawei' import sys sys.path.append('/usr/bin/install_tool') import os import json import cps_server import log as logger from collections import deque logger.init('cascaded_config') class ExecuteStack(object): def __init__(self, max_retry_time): self.tod...
# superdoodle.py """ This module implements the SuperDoodle demo application. It takes the DoodleWindow previously presented and reuses it in a much more intelligent Frame. This one has a menu and a statusbar, is able to save and reload doodles, clear the workspace, and has a simple control panel for setting color a...
"""Utilities shared by tests.""" import collections import contextlib import io import os import re import socket import socketserver import sys import tempfile import threading import time import unittest from unittest import mock from http.server import HTTPServer from wsgiref.simple_server import WSGIRequestHandle...
# coding: utf-8 """ ORCID Member No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: Latest Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import si...
""" Requirements file parsing """ from __future__ import absolute_import import os import re import shlex import optparse from pip._vendor.six.moves.urllib import parse as urllib_parse from pip._vendor.six.moves import filterfalse import pip from pip.download import get_file_content from pip.req.req_install import ...
import logging from coapthon import defines from coapthon.messages.request import Request from coapthon.messages.response import Response logger = logging.getLogger(__name__) __author__ = 'Giacomo Tanganelli' class BlockItem(object): def __init__(self, byte, num, m, size, payload=None, content_type=None): ...
# Standard library from collections import OrderedDict import inspect # Third-party from celerite import terms, GP from celerite.solver import LinAlgError import matplotlib.pyplot as plt import numpy as np from scipy.optimize import minimize from scipy.signal import argrelmin # Project from ..utils import argmedian f...
# Copyright 2013 Hewlett-Packard Development Company, L.P. # 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...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation # 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.apach...
from __future__ import print_function import os, sys, json, re, unicodedata from six.moves.urllib_parse import urlencode from binascii import hexlify, unhexlify from zope.interface import implementer from twisted.internet import reactor, defer from twisted.web import client as web_client from twisted.web import error a...
import wx import generic_class from .constants import control, dtype, substitution_map import os import ast import modelconfig_window ID_RUN = 11 class ModelDesign(wx.Frame): def __init__(self, parent, gpa_settings, varlist): wx.Frame.__init__( self, parent=parent, title="CPAC - Create Ne...
# Copyright 2015 Tesora 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 a...
#!/usr/bin/python # # Copyright 2007 Google Inc. # Licensed to PSF under a Contributor Agreement. # # 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/LICE...
# # 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...
""" The OGRGeometry is a wrapper for using the OGR Geometry class (see http://www.gdal.org/classOGRGeometry.html). OGRGeometry may be instantiated when reading geometries from OGR Data Sources (e.g. SHP files), or when given OGC WKT (a string). While the 'full' API is not present yet, the API is "pythonic" unlik...
# -*- coding: utf-8 -*- """ bokeh_warnings_graphs.py Usage: bokeh_warnings_graphs.py <project_code> [options] Arguments: project_code unique project code consisting of 'projectnumber_projectModelPart' like 456_11 , 416_T99 or 123_N Options: -h...
# -*- coding: utf-8 -*- import operator from django.db import models from django.db.models import Q from django.utils.translation import ugettext_lazy as _ from django.core.exceptions import ValidationError from django.core.cache import cache from django.utils import timezone from django.conf import settings from djan...
# coding: utf-8 """ Tests for template filters (as opposed to template tags). The tests are hidden inside a function so that things like timestamps and timezones are only evaluated at the moment of execution and will therefore be consistent. """ from datetime import date, datetime, timedelta from django.utils.tzinfo...
from upol_search_engine import settings from upol_search_engine.celery_app import app def indexer_task(crawler_settings, indexer_settings, task_id): from upol_search_engine.db import mongodb from upol_search_engine.db import postgresql import locale from celery.result import AsyncResult from celer...
# -*- coding: utf-8 -*- r""" werkzeug.contrib.iterio ~~~~~~~~~~~~~~~~~~~~~~~ This module implements a :class:`IterIO` that converts an iterator into a stream object and the other way round. Converting streams into iterators requires the `greenlet`_ module. To convert an iterator into a stream...
"""File event module These classes are registered in event_registry and are callable through the register. The main way these are used is with the signals blinker module that catches the signal with the file_updated function. FileEvent and ComplexFileEvent are parent classes with shared functionality. """ from furl...
import binascii import re import time import zlib import keyfmt as KeyFormatting import crypto as Crypto import parsing as Parsing p = Parsing.Parser() class EncryptMessage(object): '''Main encryption class''' def __init__(self, their_id, your_id = None, keypass = None): self.timestamp = (time.strf...
from decimal import Decimal from datetime import date from datetime import timedelta from django.core.exceptions import ImproperlyConfigured, ValidationError from django.test import TestCase from django.contrib.auth.models import User from django.conf import settings from django.core import mail from django.db.models ...
import abc import logging from lxml import etree from regparser.layer.key_terms import KeyTerms from regparser.layer.formatting import table_xml_to_plaintext from regparser.tree.depth import heuristics, markers as mtypes from regparser.tree.depth.markers import deemphasize from regparser.tree.depth.derive import debu...
## # Copyright (c) 2010-2015 Apple 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 l...
# # Copyright 2014 OpenStack Foundation # 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 req...
## # Copyright (c) 2008-2014 Apple 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 l...
# dispatch.py - command dispatching for mercurial # # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from i18n import _ import os, sys, atexit, signal, pdb, socket, errno, shlex,...
# Copyright 2020 The Pigweed 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
# Copyright 2012 OpenStack Foundation # # 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 2011 OpenStack Foundation # 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 requ...
# 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...
import unittest from feedly.storage.redis.structures.hash import RedisHashCache,\ ShardedHashCache, FallbackHashCache from feedly.storage.redis.structures.list import RedisListCache,\ FallbackRedisListCache from feedly.storage.redis.connection import get_redis_connection from functools import partial from feedl...
from blocktrail import connection class APIClient(object): def __init__(self, api_key, api_secret, network='BTC', testnet=False, api_version='v1', api_endpoint=None, debug=False): """ :param str api_key: the API_KEY to use for authentication :param str api_secret: the ...
from operator import itemgetter import sys import urllib import urlparse sys.path.append('./resources/lib') import requests def build_url(query): return base_url + '?' + urllib.urlencode(dict([k.encode('utf-8'),unicode(v).encode('utf-8')] for k,v in query.items())) class Subsonic(object): def __init__(self...
import sys import unittest from django.conf import settings from django.contrib.sites.models import Site from django.contrib.admindocs import utils from django.contrib.admindocs.views import get_return_data_type from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.test i...
# Copyright (c) 2011 OpenStack Foundation # 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 ...
# -*- coding: utf-8 -*- import re import datetime import os.path import contextlib import sys import textwrap from subprocess import Popen, PIPE from kids.sh import ShellError, wrap from kids.file import normpath, File from kids.cache import cache try: basestring # attempt to evaluate basestring def isstr...
from __future__ import division from libtbx.queuing_system_utils import communication import threading import Queue import time class SchedulerActor(object): """ Interface to a scheduling.Manager object that is polled by another thread """ def __init__(self, manager, waittime): self.manager = manager ...
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # Copyright (c) 2012 VMware, Inc. # Copyright (c) 2011 Citrix Systems, Inc. # Copyright 2011 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. Yo...
# Copyright 2009 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 agreed to in writing, ...
from direct.fsm import ClassicFSM, State from direct.fsm import State from direct.gui.DirectGui import * from direct.interval.IntervalGlobal import * from pandac.PandaModules import * from pandac.PandaModules import * import random import string import ArrowKeys from DistributedMinigame import * import PatternGameGlob...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import base64 from datetime import datetime import json import logging import os import boto from six.moves.urllib import parse from scrapy.exceptions import NotConfigured from scrapy.http import TextResponse, Headers from scrapy.respons...
#!/usr/bin/python # # Copyright (c) 2019 Zim Kalinowski, (@zikalino) # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributi...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
# Copyright 2016 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...
# Django from django.http import HttpResponse from django.template import Context from django.template.loader import select_template from copy import deepcopy #from django.utils.datastructures import SortedDict from collections import OrderedDict from django.utils.safestring import mark_safe from django.db.models impor...
# -*- coding: utf-8 -*- """ This file is part of pyCMBS. (c) 2012- Alexander Loew For COPYING and LICENSE details, please refer to the LICENSE file """ """ HOVMOELLER CLASS class to generate hovmoeller diagrams """ import matplotlib.pylab as pl import matplotlib.dates as mdates import sys import matplotlib.pyplot as ...
import pytest import pathlib import os from CommonServerPython import ( FeedIndicatorType, DemistoException, Common, set_integration_context, get_integration_context ) from CyrenThreatInDepth import ( Client, fetch_indicators_command, get_indicators_command, test_module_command as _test_module_command...
from __future__ import print_function, division from sympy.core import S, sympify, diff from sympy.core.function import Function, ArgumentIndexError from sympy.core.relational import Eq from sympy.polys.polyerrors import PolynomialError from sympy.functions.elementary.complexes import im from sympy.functions.elementar...
"""PyPI and direct package downloading""" import sys, os.path, re, urlparse, urllib, urllib2, shutil, random, socket, cStringIO import itertools import base64 import httplib from pkg_resources import * from distutils import log from distutils.errors import DistutilsError try: from hashlib import md5 except ImportEr...
import sys import json from PyQt5.QtWidgets import QDialog, QApplication, QGridLayout, QLabel, \ QSpinBox, QDoubleSpinBox, QCheckBox, QPushButton, QLineEdit, QSizePolicy, \ QMessageBox, QSpacerItem, QComboBox, QHBoxLayout, QVBoxLayout from PyQt5.QtCore import Qt, pyqtSignal from tierpsy.helper.params.tracke...
# -*- coding: utf-8 -*- import sys import numpy as np import pytest from pandas.compat import PYPY from pandas import Categorical, Index, Series import pandas.util.testing as tm class TestCategoricalAnalytics(object): def test_min_max(self): # unordered cats have no min/max cat = Categorical...
# Copyright 2013 Big Switch Networks, 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 ...
# 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, software # distributed under t...
import os import glob import shutil import re import json from traitlets import Bool from .baseapp import TransferApp, transfer_aliases, transfer_flags aliases = {} aliases.update(transfer_aliases) aliases.update({ }) flags = {} flags.update(transfer_flags) flags.update({ 'inbound': ( {'ListApp' : {'in...
# Copyright 2020 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. """Utilities for interacting with the Skia Gold image diffing service.""" import json import logging import os import shutil import tempfile from devil.util...
#!/usr/bin/env python # Copyright 2015 The Native Client 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 argparse import difflib import fnmatch import multiprocessing import os import Queue import re import shlex import shutil i...
import sys from xdis import iscode from uncompyle6.parsers.treenode import SyntaxTree from uncompyle6 import PYTHON3 if PYTHON3: minint = -sys.maxsize-1 maxint = sys.maxsize else: minint = -sys.maxint-1 maxint = sys.maxint read_write_global_ops = frozenset(('STORE_GLOBAL', 'DELETE_GLOBAL', 'LOAD_GLOB...
#!/usr/bin/env python # -*- coding: utf-8 -*- import re import logging import six # Python 2+3 compatibility from . import settings log = logging.getLogger(__name__) def bytesindex(s,i,j=None): """implements s[i], s[i:], s[i:j] for Python2 and Python3""" if i<0 : i=len(s)+i if j is None: j=i+1 i...
import flask as f import peewee import models as md import re from functools import wraps import hashlib from gitgate import __version__ app = f.Flask(__name__) ### ---------------------------------------------------------------------------- ### Helper functions ### ---------------------------------------------------...
# -*- coding: utf-8 -*- """ .. module:: pytfa :platform: Unix, Windows :synopsis: Thermodynamics-based Flux Analysis .. moduleauthor:: pyTFA team Relaxation of models with constraint too tight """ from collections import OrderedDict from copy import deepcopy from tqdm import tqdm import pandas as pd from cob...
# 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, software # d...
import pylons, sys from weberror import errormiddleware, collector, reporter from weberror.evalexception import EvalException, get_debug_count, DebugInfo from weberror.errormiddleware import ErrorMiddleware, handle_exception from pylons.middleware import head_html, footer_html, media_path, report_libs from pylons.error...
from collections import OrderedDict import sys import warnings from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured from django.core.paginator import InvalidPage from django.core.urlresolvers import reverse from django.db import models from django.db.models.fields import FieldDoesNotExist from ...
from __future__ import annotations from functools import wraps import inspect from textwrap import dedent from typing import ( Any, Callable, Mapping, cast, ) import warnings from pandas._libs.properties import cache_readonly # noqa from pandas._typing import F def deprecate( name: str, alt...
# -*- coding:utf-8 -*- import sys import re import codecs from collections import defaultdict, namedtuple ANY_SPACE = '<SPACE>' class FormatError(Exception): pass Metrics = namedtuple('Metrics', 'tp fp fn prec rec fscore') class EvalCounts(object): def __init__(self): self.correct_chunk = 0 # ...
#ipython27 wing_minimizer6.py data dimofPSF dimofPSFext x1 y1 x2 y2 x3 y3 x4 y4 import numpy as np from sympy import * import pyfits, sys config = sys.argv[1] #input the file array=[] with open("config", "r") as f: tmp3 = f.readlines() for line in tmp3: words=line.split() ...
import threading #TODO ON SEGMENTED FILES PAD THE CHUNKS TO 64K # Copyright (c) 2010-2011 OpenStack, 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/licens...