gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# Copyright 2016 Cloudbase Solutions Srl # # 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...
from sys import exit from click import BOOL, argument, option, prompt from flask.cli import AppGroup from sqlalchemy.orm.exc import NoResultFound from sqlalchemy.exc import IntegrityError from redash import models from redash.handlers.users import invite_user manager = AppGroup(help="Users management commands.") d...
#!/usr/bin/env python from __future__ import absolute_import, division, print_function import base64 import binascii from contextlib import closing import copy import functools import sys import threading import datetime from io import BytesIO from tornado.escape import utf8, native_str from tornado import gen from ...
# 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...
import json import logging from django.http import ( HttpResponse, HttpResponseBadRequest, HttpResponseForbidden, HttpResponseNotAllowed, HttpResponseServerError, ) from django.utils.encoding import force_str from django.utils.text import slugify from django.views.decorators.csrf import csrf_exempt...
# Copyright 2013-2015 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 contextlib import imp import inspect import os import sys from .config import ConfigContext from .config_types import Path, ModuleBasePath, RECI...
from nose.tools import * import mock from tests.factories import UserFactory, ProjectFactory from framework.auth.decorators import Auth from website.addons.dataverse.model import ( AddonDataverseUserSettings, AddonDataverseNodeSettings, DataverseFile ) from website.addons.dataverse.tests.utils import DataverseAddo...
''' Author: Tobi and Gundram ''' from __future__ import print_function import tensorflow as tf from tensorflow.python.ops import ctc_ops as ctc from tensorflow.contrib.layers import batch_norm from tensorflow.python.ops import rnn_cell from tensorflow.python.ops import control_flow_ops from tensorflow.python.ops.rnn ...
"""Default values and other various configuration for projects, including available theme names and repository types. """ import re from django.utils.translation import ugettext_lazy as _ THEME_DEFAULT = 'default' THEME_SPHINX = 'sphinxdoc' THEME_SCROLLS = 'scrolls' THEME_AGOGO = 'agogo' THEME_TRADITIONAL = 'traditi...
import datetime from django.conf import settings from django.core.exceptions import FieldError from django.db.backends.utils import truncate_name from django.db.models.constants import LOOKUP_SEP from django.db.models.query_utils import select_related_descend, QueryWrapper from django.db.models.sql.constants import (C...
import subprocess from typing import Any, Dict, List from zulint.printer import ENDC, GREEN from .template_parser import is_django_block_tag, tokenize def pretty_print_html(html: str, num_spaces: int = 4) -> str: # We use 1-based indexing for both rows and columns. tokens = tokenize(html) lines = html.s...
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:14101") else: access = Se...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2013 Mirantis, 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...
# -*- coding: utf-8 -*- import os import sys import types import numpy as np from sklearn.metrics import accuracy_score from sklearn.tree.tree import DecisionTreeClassifier from sklearn.ensemble.weight_boosting import AdaBoostClassifier from sklearn.ensemble.forest import RandomForestClassifier from sklearn.ensemble...
from io import BytesIO from unittest import TestCase from eve.io.media import MediaStorage from eve.io.mongo import GridFSMediaStorage from eve.tests import TestBase, MONGO_DBNAME from eve import STATUS_OK, ID_FIELD, STATUS, STATUS_ERR, ISSUES, ETAG import base64 from bson import ObjectId class TestMediaStorage(TestC...
"""UI classes like StringWriter and Buttons""" import pygame import sys def update_resolution(settings, player, width, height): pixel_width = ((player.segment_height + player.segment_margin) * width) + player.segment_margin pixel_height = ((player.segment_height + player.segment_margin) * height) + (player.s...
# Copyright 2012 VMware, 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 ...
# Copyright (c) 2012-2022, Mark Peek <[email protected]> # All rights reserved. # # See LICENSE file for full license. # # *** Do not modify - this file is autogenerated *** from . import AWSObject, AWSProperty, PropsDictType, Tags from .validators import boolean, integer class LoggingProperties(AWSProperty): """ ...
""" A sudoku game solver. (c) 2015 Brandon L. Reiss """ from collections import Counter from copy import copy, deepcopy from itertools import ifilter import logging from random import shuffle, randint LOGGER = logging.getLogger(__name__) def format_board(board): """ Pretty format a board. #############...
# Copyright 2012 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...
import imp import re import sys from django import forms from django.contrib.admin.widgets import FilteredSelectMultiple from django.utils.datastructures import SortedDict from django.utils.translation import ugettext_lazy as _ from djblets.util.filesystem import is_exe_in_path from reviewboard.scmtools import sshuti...
#!/usr/bin/env python ''' The reporter module is in charge of producing the HTML Report as well as provide plugins with common HTML Rendering functions ''' import cgi import codecs from tornado.template import Template, Loader from framework.dependency_management.dependency_resolver import BaseComponent from framewor...
#! /usr/bin/env python # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions ...
import unittest from the_ark.actions import Actions, ActionException from the_ark.field_handlers import STRING_FIELD, EMAIL_FIELD, PHONE_FIELD, ZIP_CODE_FIELD, DATE_FIELD from the_ark.resources.action_constants import * from the_ark.selenium_helpers import SeleniumHelpers, SeleniumHelperExceptions from mock import pat...
# -*- coding: utf-8 -*- """ Missing Person Registry @author: nursix """ module = request.controller prefix = request.controller resourcename = request.function if prefix not in deployment_settings.modules: raise HTTP(404, body="Module disabled: %s" % prefix) MISSING = str(T("Missing")) FOUND = str(T("F...
# Simple Arp Handler v2 # Jack Zhao # [email protected] from operator import attrgetter from ryu.base import app_manager from ryu.controller import ofp_event from ryu.controller.handler import CONFIG_DISPATCHER from ryu.controller.handler import MAIN_DISPATCHER from ryu.controller.handler import set_ev_cls from ry...
""" voxel.py ----------- Convert meshes to a simple voxel data structure and back again. """ import numpy as np from . import ops from . import transforms from . import morphology from . import encoding as enc from .. import bounds as bounds_module from .. import caching from .. import transformations as tr from .....
""" Converts a "TCGA format" tab-delimited ASCII feature matrix into the binary format consumed by the pairwise executable. Basically this just carries out a number of inspections, validations, and conversions on each row of the data that would otherwise 1. be done redundantly in the C executable 2. and would be m...
""" Testing DKI microstructure """ import numpy as np import random import dipy.reconst.dki_micro as dki_micro from numpy.testing import (assert_array_almost_equal, assert_almost_equal, assert_, assert_raises) from dipy.sims.voxel import (multi_tensor_dki, _check_directions, multi_tensor) fr...
""" Django settings for gge_storage project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ......
from __future__ import unicode_literals import requests import time from bs4 import BeautifulSoup from datetime import datetime, timedelta from decimal import Decimal from .exceptions import ( PageError, DisambiguationError, RedirectError, HTTPTimeoutError, WikipediaException, ODD_ERROR_MESSAGE) from .util import...
# Lint as: python2, python3 # Copyright 2018 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 # ...
""" This is the *abstract* django models for many of the database objects in Evennia. A django abstract (obs, not the same as a Python metaclass!) is a model which is not actually created in the database, but which only exists for other models to inherit from, to avoid code duplication. Any model can import and inherit...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2011 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
#!/usr/bin/env python # # Copyright 2015 The AMP HTML 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 # # Unl...
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 appli...
from utils import * from sensationdriver.pattern import BezierPath from sensationdriver.pattern import Track class Point(object): def __init__(self, time, value): self.time = time self.value = value class Keyframe(object): def __init__(self, control_point, out_tangent_end=None, in_tangent_s...
import xmlrpclib import time import solr import os import json import urllib2 import logging class WorkflowManagerClient(object): ''' Python client used to interact with a remote Labcas Workflow Manager. Available methods are defined in Java class org.apache.oodt.cas.workflow.system.XmlRpcWorkflowManager. ...
from __future__ import absolute_import, print_function, unicode_literals import os import sys from attr import attrib, attrs from twisted.python import failure from twisted.internet.task import Cooperator from zope.interface import implementer from ._boss import Boss from ._dilation.manager import DILATION_VERSIONS ...
from __future__ import division, unicode_literals import warnings import unittest as unittest import numpy as np from scipy.spatial import ConvexHull from pymatgen import Composition from pymatgen.entries.computed_entries import ComputedEntry from pymatgen.analysis.phase_diagram import PhaseDiagram, \ GrandPotent...
import numpy as np import pytest from pandas import DataFrame pytest.importorskip("jinja2") def bar_grad(a=None, b=None, c=None, d=None): """Used in multiple tests to simplify formatting of expected result""" ret = [("width", "10em")] if all(x is None for x in [a, b, c, d]): return ret retur...
import csv def count(fileName): numRows = 0 with open(fileName, 'r') as f: reader = csv.reader(f,delimiter = ",") data = list(reader) row_count = len(data)-1 return row_count def lm_predict(a,b,intercept,fileName): rr_values = [] leastSquared = 0 acceptedPredictions = 0 total = count(fileName) ...
from collections.abc import Iterable from numbers import Real, Integral from warnings import warn import numpy as np import openmc.checkvalue as cv from openmc.stats import Tabular, Univariate, Discrete, Mixture from .function import Tabulated1D, INTERPOLATION_SCHEME from .angle_energy import AngleEnergy from .data i...
"""Provide a registry to track entity IDs. The Entity Registry keeps a registry of entities. Entities are uniquely identified by their domain, platform and a unique id provided by that platform. The Entity Registry will persist itself 10 seconds after a new entity is registered. Registering a new entity while a timer...
# 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 u...
from __future__ import with_statement import sys import os import subprocess from contextlib import contextmanager from cStringIO import StringIO from virtstrap.log import logger as main_logger # The following function is taken from werkzeug.utils def import_string(import_name, silent=False): """Imports an object ...
#!/usr/bin/env python # Copyright 2011 Google Inc. All Rights Reserved. """Tests for the stats classes.""" import time from grr.lib import flags from grr.lib import rdfvalue from grr.lib import stats from grr.lib import test_lib class StatsTests(test_lib.GRRBaseTest): """Stats collection tests.""" def Sleep(...
# Copyright 2019 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, ...
# -*- coding: utf-8 -*- # Copyright (C) 2014 Yahoo! 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...
import os from itertools import chain, product import copy from tkinter import * from tkinter.messagebox import showerror, showinfo, askokcancel from tkinter.filedialog import asksaveasfile from PIL import ImageTk, Image, ImageOps # These are in Utils folder import sys sys.path.append(os.path.join('.', 'Utils' )) im...
# Wrapper module for _socket, providing some additional facilities # implemented in Python. """\ This module provides socket operations and some related functions. On Unix, it supports IP (Internet Protocol) and Unix domain sockets. On other systems, it only supports IP. Functions specific for a socket are available a...
from argparse import ArgumentParser from multiprocessing import set_start_method from re import split as re_split from fabric.api import cd, local, run from logger import logger from perfrunner.helpers.remote import RemoteHelper from perfrunner.helpers.rest import RestHelper from perfrunner.remote.context import all_...
#!/usr/bin/env ambari-python-wrap """ 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...
import unittest from unittest import mock import tethys_cli.manage_commands as manage_commands from tethys_cli.manage_commands import ( MANAGE_START, MANAGE_COLLECTSTATIC, MANAGE_COLLECTWORKSPACES, MANAGE_COLLECT, MANAGE_CREATESUPERUSER ) class TestManageCommands(unittest.TestCase): def setU...
# Copyright (c) 2013 Marion Zepf # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribu...
######## # Copyright (c) 2013 GigaSpaces Technologies Ltd. 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 -*- from django.conf import settings from django.db import models as djangomodels from django.utils import translation from django.utils.functional import lazy from django.utils import six import base64 """ Translation methods """ def _get_details_in_lang(field, lang): if field.translatio...
# Copyright 2012 Nebula, Inc. # Copyright 2013 IBM Corp. # # 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...
#!/usr/bin/env python # # Copyright 2009 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
from config import Configuration from corpus import Corpus, Sentence, Token, getTokens from param import FeatParams class Extractor: @staticmethod def extract(sent): transition = sent.initialTransition labels, features = [], [] while transition.next: if transition.next is ...
"""The tests for the MQTT Template light platform. Configuration example with all features: light: platform: mqtt_template name: mqtt_template_light_1 state_topic: 'home/rgb1' command_topic: 'home/rgb1/set' command_on_template: > on,{{ brightness|d }},{{ red|d }}-{{ green|d }}-{{ blue|d }} command_off...
#!/usr/bin/env python # # Copyright 2018 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
import argparse import json import requests import urlparse def step(instructions, func=None, wait=True): val = None for line in instructions.split('\n'): print line.strip() if func: val = func() if wait: raw_input('Press enter when you are done.') return val def setu...
""" Astra-Viso star map module. """ from __future__ import division import pickle import numpy as np import pkg_resources as pkg import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D class StarMap: """ Star map class. """ def __init__(self, preset=None): """ Initializ...
"""The unit test for runtime.ast""" import unittest from runtime import ast, env, lib NULL_LITERAL = ast.Literal(env.Value(env.NULL)) INT_LITERAL = ast.Literal(env.Value(lib.INTEGER, 0)) TRUE_LITERAL = ast.Literal(env.Value(lib.BOOLEAN, True)) FALSE_LITERAL = ast.Literal(env.Value(lib.BOOLEAN, False)) STRING_LITERAL =...
# -*- coding: utf-8 -*- """ Django settings for video_village project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ from __future__ import absolute_import, unico...
# -*- coding: utf-8 -*- import logging import secrets import webapp2 from webapp2_extras import auth, sessions, jinja2 from jinja2.runtime import TemplateNotFound from simpleauth import SimpleAuthHandler import tweepy import random from tweepy.error import TweepError # Consumer keys and access tokens, used for OAut...
""" This collection of functions scrapes most of the important data about movie observable characteristics from the film's summary page on Box Office Mojo. Last Run: December, 2016 """ import requests from bs4 import BeautifulSoup import re import dateutil.parser from string import ascii_uppercase import pandas as pd...
# Copyright (c) 2005-2017 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 law...
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
import logging import random import json import time import numpy from influxdb import InfluxDBClient from influxdb.exceptions import InfluxDBClientError, InfluxDBServerError from requests.exceptions import ConnectionError from ryu.lib import hub from nsodbc import nsodbc_factory, init_switch_db, init_flow_db def w...
# # Copyright (c) 2008-2015 Citrix 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.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
""" read_flashes filterer.filt_ev_fl brancher(events_flashes_receiever, other_analysis_targets=timeframe_targets) ev_fl_rx -> histogrammer energy calculation plotter timeframe_targets is ev_fl_rx -> bound_filt (on time) read_flashes -> filterer.filt_ev_fl -> length_for_these_flashes -> brancher -> timeframe_target...
import sys sys.path.append('..') import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import random import os from time import time import numpy as np from tqdm import tqdm from sklearn.externals import joblib import theano import theano.tensor as T from lib import activations from lib import ini...
import Tkinter from Tkinter import* def mod(a,b): return ( a % b) def StandardKnot(): global m knot = [] L = len(points) - 2 if L <= m -2 : print 'make more points than m' return [] for i in range(m - 1): knot.append(0) for i in range(L - m + 3): knot.append...
"""Module with main classes related to Authentication.""" import datetime import getpass import hashlib import logging import time from functools import wraps from http import HTTPStatus import jwt from flask import jsonify, request from kytos.core.config import KytosConfig from kytos.core.events import KytosEvent _...
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from collections import defaultdict from operator import itemgetter from flask import flash, jsonify, red...
#!/usr/bin/env python #coding=utf-8 # by Qiyuan Gong # [email protected] # http://github.com/qiyuangong # http://cn.linkedin.com/pub/qiyuan-gong/6b/831/407/ import pdb from models.gentree import GenTree from models.bucket import Bucket from itertools import combinations _DEBUG = True gl_treelist = {} gl_att_tree...
# 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 req...
import time import datetime import requests_mock from django.conf import settings from selenium.common.exceptions import NoSuchElementException from events.models import User, Playlist from functional_tests.selenium_test_case import SeleniumTestCase from functional_tests.utils import navbar_active_element_text clas...
# -*- coding: utf-8 -*- import os import time from datetime import datetime import click import pythoncom from selenium.common.exceptions import TimeoutException from selenium.webdriver.common.alert import Alert from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.w...
from __future__ import unicode_literals from django import template from django.utils.html import escape from django.utils.safestring import mark_safe from .compat import parse_bits from ..cachefiles import ImageCacheFile from ..registry import generator_registry from ..lib import force_text register = template.Lib...
from __future__ import unicode_literals import json import sure # noqa import boto3 from moto import mock_iot @mock_iot def test_things(): client = boto3.client('iot', region_name='ap-northeast-1') name = 'my-thing' type_name = 'my-type-name' # thing type thing_type = client.create_thing_type(...
# -*- coding: utf-8 -*- # # 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 #...
__author__ = "Mihaela Rosca" __contact__ = "[email protected]" import heapq import matplotlib.pyplot as plt import numpy import os import scipy import scipy.linalg from os.path import isfile, join from scipy import misc # Import all common functions from common import * # The directory path to the images P...
#! /usr/bin/env nix-shell #! nix-shell -i python3 -p "python3.withPackages (ps: with ps; [ mypy attrs packaging rich ]) # # This script downloads Home Assistant's source tarball. # Inside the homeassistant/components directory, each integration has an associated manifest.json, # specifying required packages and other i...
# 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...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # vim: ts=2 sw=2 et ai ############################################################################### # Copyright (c) 2012,2013 Andreas Vogel [email protected] # parts of this software are based on tiler_tools (...) # the license terms (see below) apply to the c...
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
# # Copyright 2019 The FATE 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 appli...
from numpy.distutils.core import setup, Extension import distutils.sysconfig import sys import os import os.path import re # Get BUILDTYPE for checking if this is intel-mac buildtype = os.getenv("BUILDTYPE") if buildtype: buildtype = buildtype.strip() if not buildtype: raise ValueError("Environment variable BU...
import sqlalchemy from sqlalchemy import orm, Column, types, ForeignKey from alchy import model, query, manager, events from .base import TestQueryBase Model = model.make_declarative_base() class TestEventsBase(TestQueryBase): @classmethod def setUpClass(cls): cls.db = manager.Manager(Model=Model...
""" The goal is to build JSON dictionaries that can be used to search for codes in sources and map to elements in the CDM vocabulary. """ import csv import json import os import argparse import sys def open_csv_file(file_name, mode="r"): ver_info = sys.version_info[0] if ver_info == 2: retur...
import gdb import sys import os import omniplay.gdbscripts import ctypes counter = 1 def exitHandler(event): pid = event.inferior.pid print "Goodbye! Pid %d exited" % pid def grabParameterRegs(): eax = gdb.parse_and_eval("$eax") ebx = gdb.parse_and_eval("$ebx") ecx = gdb.parse_and_eval("$ecx") ...
import os import re import subprocess from collections import namedtuple import logging import bisect from common import SushiError, get_extension import chapters MediaStreamInfo = namedtuple('MediaStreamInfo', ['id', 'info', 'default', 'title']) SubtitlesStreamInfo = namedtuple('SubtitlesStreamInfo', ['id', 'info', ...
# 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 u...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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 compli...
#!/usr/bin/env python # encoding: utf-8 class Stack(object): """Docstring for Stack """ def __init__(self): """@todo: to be defined1 """ self.items = [] def pushFromList(self, list): """Push the list in the stack :param list: a list """ for i in list[::-1...
# Copyright (c) 2013 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 ...
## IAN with randomized IAF from math import sqrt import os import sys import numpy as np import lasagne import lasagne.layers import lasagne.layers.dnn from lasagne.layers import SliceLayer as SL from lasagne.layers import batch_norm as BN from lasagne.layers import ElemwiseSumLayer as ESL from lasagne.layers import E...