gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import re from textwrap import dedent from typing import Iterable, Set, cast import pytest from pants.base.exceptions import ResolveError from pants.base.specs import ( AddressLitera...
# -*- encoding: utf-8 -*- # # 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, softwar...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import simple_audit import logging import datetime from datetime import date, timedelta from django.db import models, transaction, Error from django.db.models.signals import pre_save, post_save, pre_delete from django.contrib.auth.models i...
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.8.2 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
#!/usr/bin/env python # -*- coding: UTF-8 -*- import os import os.path import re import shutil import codecs import threading import string import tarfile import random import datetime import logging from flask import current_app, send_from_directory from werkzeug.utils import cached_property from . import compat fr...
import json import unittest2 from google.appengine.ext import ndb from google.appengine.ext import testbed from helpers.event_simulator import EventSimulator from helpers.match_helper import MatchHelper from models.event import Event from models.event_details import EventDetails from models.match import Match class...
# 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...
######## # Copyright (c) 2015 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...
"""Module/script to byte-compile all .py files to .pyc (or .pyo) files. When called as a script with arguments, this compiles the directories given as arguments recursively; the -l option prevents it from recursing into directories. Without arguments, if compiles all modules on sys.path, without recursing into subdir...
"""Various helper functions""" import asyncio import base64 import binascii import cgi import datetime import functools import inspect import os import re import sys import time import warnings import weakref from collections import namedtuple from collections.abc import Coroutine from contextlib import suppress from ...
from django import template from ttag import utils, args class Options(object): def __init__(self, meta, *args, **kwargs): super(Options, self).__init__(*args, **kwargs) self.positional_args = [] self.named_args = {} # A list of argument names that are inherited from bases ...
import django from django.apps import apps from django.conf import settings from django.db.models import AutoField, CharField, ForeignKey, BigIntegerField, OneToOneField from django_sharding_library.constants import Backends from django_sharding_library.utils import create_postgres_global_sequence, create_postgres_sha...
#!/usr/bin/env python """Usage: python suppress_output.py COMMAND... Run the given command and print "in progress..." messages to stderr, one per minute, as long as the command is producing some output. If the command has not recently produced any output, no further messages will be printed until it does. When the c...
# 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...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import functools import os from builtins import object, open, str from multiprocessing im...
# Copyright 2012 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 by applicable law or agreed t...
from django.core.urlresolvers import reverse from django.utils.translation import ugettext_noop, ugettext_lazy from django.utils.translation import ugettext as _ from corehq.apps.es import users as user_es, filters from corehq.apps.domain.models import Domain from corehq.apps.groups.models import Group from corehq.app...
# -*- coding: utf-8 -*- # Copyright (c) 2012-2015, Anima Istanbul # # This module is part of anima-tools and is released under the BSD 2 # License: http://www.opensource.org/licenses/BSD-2-Clause import pymel.core as pm from shapes import Shape from character import Character from joint import SpineJoints, JointChain...
# 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 sys import time import unittest from django.conf import settings from django.db import transaction, connection from django.db.utils import ConnectionHandler, DEFAULT_DB_ALIAS, DatabaseError from django.test import (TransactionTestCase, skipIfDBFeature, skipUnlessDBFeature) from django.utils import unittest ...
# 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...
# 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 pygame import stale import random from gracz import Player from platforma import Platform from wrogowie import Enemy class Level(object): """ Ogolna klasa poziomow gry """ def __init__(self): self.platform_list = pygame.sprite.Group() self.enemy_list = pygame.sprite.Group() #...
import time from copy import deepcopy from typing import Any, Dict, List, Optional import orjson from zerver.lib.test_classes import ZulipTestCase from zerver.models import Draft class DraftCreationTests(ZulipTestCase): def create_and_check_drafts_for_success( self, draft_dicts: List[Dict[str, A...
import datetime from unittest.mock import patch from django.core import mail from django.utils import timezone from freezegun import freeze_time from rest_framework import test from waldur_core.core import utils as core_utils from waldur_core.structure.tests import factories as structure_factories from waldur_core.st...
# tests.test_experiment # Tests for the experiment generation utility. # # Author: Benjamin Bengfort <bengfort@cs.umd.edu> # Created: Tue Feb 23 08:09:12 2016 -0500 # # Copyright (C) 2015 University of Maryland # For license information, see LICENSE.txt # # ID: test_experiment.py [26c65a7] benjamin@bengfort.com $ "...
# The MIT License (MIT) # # Copyright (c) 2016-2018 Albert Kottke # # 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...
''' Copyright 2010-2013 DIMA Research Group, TU Berlin 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...
from ..common.geometry import Point, Polygon, Envelope, SpatialReference from .. import AGOLTokenSecurityHandler from .._abstract.abstract import BaseGeoEnrichment from ..manageorg import Administration import json import csv import os import numpy as np #################################################################...
#!/usr/bin/env python import os import re from optparse import OptionParser from jinja2 import Environment, PackageLoader from reviewboard import get_version_string env = Environment(loader=PackageLoader('reviewboard', '../contrib/tools/templates/extensions')) options = None def get_confirmation(question): ...
''' =============================================================================== Interactive Image Segmentation using GrabCut algorithm. This sample shows interactive image segmentation using grabcut algorithm. USAGE: python grabcut.py <filename> README FIRST: Two windows will show up, one for input and one ...
import numpy as np import os, imageio ########## Slightly modified version of LLFF data loading code ########## see https://github.com/Fyusion/LLFF for original def _minify(basedir, factors=[], resolutions=[]): needtoload = False for r in factors: imgdir = os.path.join(basedir, 'images_{}'.format(r...
# -*- coding: utf-8 -*- import re from os.path import abspath, join from sqlparse import sql, tokens as T from sqlparse.engine import FilterStack from sqlparse.lexer import tokenize from sqlparse.pipeline import Pipeline from sqlparse.tokens import (Comment, Comparison, Keyword, Name, Punctuation, ...
# # wc.py: functions for interacting with a Subversion working copy # # Subversion is a tool for revision control. # See http://subversion.tigris.org for more information. # # ==================================================================== # Licensed to the Apache Software Foundation (ASF) under one # or ...
# 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 # This file is part of the Soletta Project # # Copyright (C) 2015 Intel Corporation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code ...
########################################### # VCZ calibration (fine landscape) FLUX dance 1 ########################################### # Align flux pulses swf2 = swf.flux_t_middle_sweep(fl_lm_tm = [flux_lm_X3, flux_lm_D8, flux_lm_D6, flux_lm_X2], ...
import logging from ctf_gameserver.lib.database import transaction_cursor from ctf_gameserver.lib.exceptions import DBDataError def get_control_info(db_conn, prohibit_changes=False): """ Returns a dictionary containing relevant information about the competion, as stored in the game database. """ wit...
#!/usr/bin/python2 # Copyright 2008 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. """ This module implements a fuzzer for sel_ldr's ELF parsing / NaCl module loading functions. The fuzzer takes as arguments a pre...
#!/usr/bin/env python # The MIT License (MIT) # # Copyright (c) 2016 Fabio Calefato # # 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 rig...
#!/usr/bin/python # -*- coding: UTF-8 -*- import numpy as np from scipy import sparse import csv from scipy.spatial import ConvexHull import matplotlib # Pytorch requirements import unicodedata import string import re import random import torch import torch.nn as nn from torch.autograd import Variable # Force mat...
# Copyright 2020 The Matrix.org Foundation C.I.C. # # 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...
# Heavily based on the XML-RPC implementation in python. # Based on the json-rpc specs: http://json-rpc.org/wiki/specification # The main deviation is on the error treatment. The official spec # would set the 'error' attribute to a string. This implementation # sets it to a dictionary with keys: message/traceback/type ...
# coding: utf-8 """ Server API Reference for Server API (REST/Json) OpenAPI spec version: 2.0.6 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import sys import os import re # python 2 and python 3 compatibility library from six im...
# 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...
# Copyright 2009-2014 MongoDB, 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 writin...
""" Mazhalai ------- Custom code interpreter. :copyright: (c) 2017 by Gokul Sridhar. :license: MIT """ from mazhalai import ast from mazhalai.errors import MazhalaiSyntaxError class ParserError(MazhalaiSyntaxError): def __init__(self, message, token): super(ParserError, self).__init__(message, token....
from operator import attrgetter from django.db import connection from django.db.models import FileField, Value from django.db.models.functions import Lower from django.test import ( TestCase, override_settings, skipIfDBFeature, skipUnlessDBFeature, ) from .models import ( Country, NoFields, NullableFields, Pi...
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
#!/usr/bin/env python import argparse import yaml import logging from cloudify_rest_client.client import CloudifyClient from cloudify_cli.cli import cfy from cloudify_cli.execution_events_fetcher import wait_for_execution from cloudify.logs import create_event_message_prefix from prettytable import PrettyTable, ALL ...
# 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...
#!/usr/bin/python3 import tkinter as tk from tkinter import ttk import matplotlib matplotlib.use("TkAgg") from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk from matplotlib.figure import Figure import numpy as np import math #TODO add time measurement #TODO save cluster affiliatio...
''' Created on May 10, 2016 @author: David R. Darling ''' import logging import os import time import ftplib import ftputil from ftputil.error import FTPError import pysftp from ensure import ensure_annotations from FetcherClasses.Classes.EnumCommons import FtpLibNameEnum from FetcherClasses.Classes.LoggingCommons...
import numpy as np import scipy.sparse as sp from scipy.constants import mu_0 import properties from ...utils.code_utils import deprecate_class from discretize.utils import Zero from ... import props from ...data import Data from ...utils import mkvc from ..base import BaseEMSimulation from ..utils import omega from ....
""" mbed CMSIS-DAP debugger Copyright (c) 2016 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 http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law o...
# # 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...
# 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 # # Unless required by applica...
"""=========================== Pipeline Splicing =========================== Overview ======== This pipeline enables differential exon usage testing through the implementation of * rMATS-turbo * DEXSeq rMATS is a computational tool to detect differential alternative splicing events from RNA-Seq data. The statistica...
import os.path import sys import cStringIO import xml.etree.cElementTree as ET import HTMLParser import json from collections import defaultdict from jinja2 import Template from jinja2 import FileSystemLoader from jinja2.environment import Environment from dummy_data_layout import LAYOUT_SCHEMA from service_api impor...
"""Download and install structured genome data and aligner index files. Downloads prepared FASTA, indexes for aligners like BWA, Bowtie and novoalign and other genome data in automated pipelines. Specify the genomes and aligners to use in an input biodata.yaml configuration file. The main targets are fabric functions...
import threading import shared import sqlite3 import time import shutil # used for moving the messages.dat file import sys import os from debug import logger from namecoin import ensureNamecoinOptions import random import string import tr#anslate # This thread exists because SQLITE3 is so un-threadsafe that we must #...
import unittest from chainer import testing, Variable, grad, cuda import numpy as np from chainer.functions import as_strided from chainer.functions.array.as_strided import _stride_array def _broadcast_to(xp, x, shape): if hasattr(xp, 'broadcast_to'): return xp.broadcast_to(x, shape) else: ...
from __future__ import unicode_literals from __future__ import absolute_import from collections import namedtuple import logging import re import os from operator import attrgetter import sys from docker.errors import APIError from .container import Container, get_container_name from .progress_stream import stream_ou...
############################################################################### ## ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## "Redistribution and use in source and binary forms, with or without ## modification, ...
# 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. """Cloud Endpoints API for Content Addressable Storage.""" import endpoints from protorpc import message_types from protorpc import messages from protorpc ...
#!/usr/bin/python # Copyright 2011 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
#!/bin/env python3 import selectors import socket import loopfunction import logging import queue import maxthreads class Log: INDENTATION = 4 def __init__(self, *args_): self.do = {'errors': False, 'enter': False, 'exit': False, 'args': False}...
# Copyright (c) 2012-2013 Paul Tagliamonte <paultag@debian.org> # # 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, ...
"""Get ride details and liveboard details for NMBS (Belgian railway).""" import logging from pyrail import iRail import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity from homeassistant.const import ( ATTR_ATTRIBUTION, ATTR_LATITUDE, ATTR_LONGITUDE, CONF_NA...
# Copyright 2012 Nicira, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
#!/usr/bin/env python import os import rlp from ethereum import utils from ethereum.utils import to_string from ethereum.utils import is_string import copy from rlp.utils import decode_hex, encode_hex, ascii_chr, str_to_bytes import sys bin_to_nibbles_cache = {} hti = {} for i, c in enumerate(b'0123456789abcdef'): ...
""" This is a placeholder for code that uses the SQLAlchemy ORM. In contains helper functions that should make it easier to query the database An example how to use this is shown in an IPython notebook: https://github.com/transientskp/notebooks/blob/master/transients.ipynb """ from sqlalchemy.orm import aliased fro...
""" Here is probably the place to write the docs, since the test-cases show how the type behave. Later... """ from ctypes import * from ctypes.test import need_symbol import sys, unittest from ctypes.test import xfail from test.support import impl_detail try: WINFUNCTYPE except NameError: # fake to enable th...
# Michelle Deng # fallDown.py # Import modules: import os, sys, random import pygame from pygame.locals import * # Uploads an image file # I did NOT write this function! # Credits: http://www.pygame.org/docs/tut/chimp/ChimpLineByLine.html def load_image(name, colorkey = None): fullname = os.path.join('', name) ...
import sys from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.core.cache import caches from django.db import models from django.forms.models import fields_for_model from django.template import RequestContext, loader from django.template.loader import render_to_stri...
# coding: utf-8 # In[1]: import tsyganenko as tsyg import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.colors as colors from spacepy import coordinates as coord import spacepy.time as spt from spacepy.time import Ticktock import datetime as dt from mpl_toolkits.mplot3d import Axe...
# 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 # # Unless required by applica...
"""Representation of Data .. contents:: :local: Before loading data, you need to define it. A single subclass of DataSet represents a database relation in Python code. Think of the class as a table, each inner class as a row, and each attribute per row as a column value. For example:: >>> from fixture import Da...
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com> # # 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 applicabl...
# -*- coding: utf-8 -*- """Fake Windows Registry objects implementation.""" import calendar import construct from plaso import dependencies from plaso.dfwinreg import definitions from plaso.dfwinreg import errors from plaso.dfwinreg import interface dependencies.CheckModuleVersion(u'construct') # TODO: give this...
""" MZ Component manager: run run_em.py from this script. This script manages components and decides what fits need to be done with run_em. It reads in the data, splits comps and prepares input data to the run_em.py. It also decides what model is the best. """ import warnings warnings.filterwarnings("ignore") print('f...
""" Example generation for the scikit learn Generate the rst files for the examples by iterating over the python example files. Files that generate images should start with 'plot' """ from time import time import ast import os import re import shutil import traceback import glob import sys import gzip import posixp...
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function, absolute_import import codecs from contextlib import contextmanager import locale import os import shutil import subprocess import sys import tempfile import unittest import lxml.html from nose.plugins.skip import SkipTest from nikola i...
""" adbwp.message ~~~~~~~~~~~~~ Object representation of a message. """ import collections import typing from . import consts, enums, exceptions, header, hints, payload __all__ = ['Message', 'new', 'from_header', 'connect', 'auth_signature', 'auth_rsa_public_key', 'open', 'ready', 'write', 'cl...
import numpy as np def iterate(fn, x0, T, args=()): """Iterate fn T times, starting at x0. Parameters ---------- fn : function A function whose first argument is x x0 : float Initial condition/seed T : int The number of iterations to calculate args : tuple,...
#!/usr/bin/env python # OpenCenter(TM) is Copyright 2013 by Rackspace US, Inc. ############################################################################## # # OpenCenter is licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License....
# 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...
#!/usr/bin/env python3 import os import glob import json import copy import timeit from collections import OrderedDict as odict from ruamel import yaml as yaml from ruamel.yaml.comments import CommentedMap as CommentedMap from . import util from . import conf from .build_flags import BuildFlags from .build_item imp...
import networkx as nx from collections import defaultdict import csv import numpy as np import numpy as np import matplotlib as mpl font = {'family' : 'normal', 'weight' : 'normal', 'size' : 16} mpl.rc('font', **font) def effective_size(G, nodes=None, weight=None): """Returns the effective s...
# 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...
# -*- coding: utf-8 -*- import datetime, sys, os import xlwt import env import common import htmlreport def generate_result_xls(): wbk = xlwt.Workbook() style_red = xlwt.easyxf('font: colour red, bold False;') style_green = xlwt.easyxf('font: colour green, bold False;') style_bold = xlwt....
# 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...
import numpy as np import gensim from keras.preprocessing import sequence from pyshm import SharedNPArray import time import re import os MAX_CHILDREN = 10 OUT_PATH = '../../' DATA_PATH = 'cnntweets/data/rt-data-nlp4jtok/' W2VBASE_PATH = 'cnntweets/data/emory_w2v/w2v-%d-amazon.gnsm' # relation_index={'punct': 1, # ...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): db.delete_column('auth_user', 'last_name') def backwards(self, orm): ...
# 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 python ''' This module contains helper functions to make plugins simpler to read and write, centralising common functionality easy to reuse ''' import os import re import cgi import logging from tornado.template import Template from framework.dependency_management.dependency_resolver import BaseCompone...
## Ordinary Least Squares from __future__ import print_function import numpy as np import statsmodels.api as sm import matplotlib.pyplot as plt from statsmodels.sandbox.regression.predstd import wls_prediction_std np.random.seed(9876789) # ## OLS estimation # # Artificial data: nsample = 100 x = np.linspace(0, 1...
# TODO: Temporarily disabled due to importing old code into openshift-ansible # repo. We will work on these over time. # pylint: disable=bad-continuation,missing-docstring,no-self-use,invalid-name,too-many-instance-attributes,too-few-public-methods import os import yaml from pkg_resources import resource_filename PER...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import tensorflow.python.platform from six.moves import xrange # pylint: disable=redefined-builtin import tensorflow as tf from tensorflow.python.platform import gfile from tensorflow.python.summa...
""" pygments.lexers ~~~~~~~~~~~~~~~ Pygments lexers. :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re import sys import types import fnmatch from os.path import basename from pip._vendor.pygments.lexers._mapping import LEXER...