text
stringlengths
17
737k
""" An implementation of :class:`XBlockUserStateClient`, which stores XBlock Scope.user_state data in a Django ORM model. """ import itertools import logging from operator import attrgetter from time import time from django.contrib.auth.models import User from django.db import transaction from django.db.utils import ...
# coding=utf-8 from django.core.management.base import BaseCommand from registration.models import RegistrationProfile class Command(BaseCommand): help = 'Cleanup expired registrations' OPT_SIMULATE = 'dry-run' def add_arguments(self, parser): parser.add_argument(''.join(['--', self.OPT_SIMULAT...
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. 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 must retain the above copyright # notice, this list ...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2015-2017 GEM Foundation # # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the Licen...
import json import re import pytest import snafu.versions version_paths = list(snafu.versions.VERSIONS_DIR_PATH.iterdir()) version_names = [p.stem for p in version_paths] @pytest.mark.parametrize('path', version_paths, ids=version_names) def test_version_definitions(path): assert path.suffix == '.json', 'wron...
from django.contrib.auth.backends import ModelBackend from django.contrib.auth.models import User from django.contrib.auth import signals as auth_signals from django.test import TransactionTestCase from djactasauth.backends import FilteredModelBackend, ActAsModelBackend class FilteredBackendTestCase(TransactionTestC...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from oauthlib.common import Request from oauthlib.oauth1 import (SIGNATURE_PLAINTEXT, SIGNATURE_HMAC_SHA1, SIGNATURE_HMAC_SHA256, SIGNATURE_RSA, SIGNATURE_TYPE_BODY, SIGNATURE_TYPE...
from pyrsistent import pvector, pset #import pytest import time def run_big_iterator_initialization(): """ The results are comparable to those of doing it with a list since most of the code is shared. """ before = time.time() iterator = (x for x in range(1000000)) print "Big iterator: " + ...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010-2011, GEM Foundation. # # OpenQuake is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # only, as published by the Free Software Foundation. # # OpenQuak...
# Copyright (c) 2014 Scopely, Inc. # Copyright (c) 2015 Mitch Garnaat # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompanyin...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010-2012, GEM Foundation. # # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the Lice...
# Copyright (c) 2015 Cloudera, 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 o...
# Copyright (c) 2015 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. import configparser #For reading the legacy profile INI files. import json #For reading the Dictionary of Doom. import math #For mathematical operations included in the Dictionary of Doom. import os.path #For concatenating ...
import re import pytest from marshmallow import fields, validate from apispec import APISpec from apispec.ext.marshmallow import MarshmallowPlugin from .schemas import CategorySchema, CustomList, CustomStringField, CustomIntegerField from .utils import build_ref def test_field2choices_preserving_order(openapi): ...
# ###################################################################################################################### # Object Database functionality # # ###################################################################################################################### import ZODB, ZODB.FileStorage, BTrees.OOBTr...
# # Copyright (c) 2004 Specifix, Inc. # All rights reserved # import util import re import os import policy """ Module used by recipes to effect packaging policy; things like setting hints, flags, and dependencies. Classes from this module are not used directly; instead, they are used through eponymous interfaces in ...
import functools import numpy as np import pandas as pd import warnings from collections import defaultdict from datetime import datetime from .core import indexing, utils from .core.variable import as_variable, Variable from .core.pycompat import iteritems, bytes_type, unicode_type, OrderedDict # standard calendars...
#!/usr/bin/env python # # This program returns the gray matter segmentation given anatomical, spinal cord segmentation and t2star images # # --------------------------------------------------------------------------------------- # Copyright (c) 2013 Polytechnique Montreal <www.neuro.polymtl.ca> # Authors: Sara Dupont #...
# Copyright 2018 Reahl Software Services (Pty) Ltd. All rights reserved. # # This file is part of Reahl. # # Reahl is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation; version 3 of the License. #...
# Copyright 2014-2015 Open Source Robotics Foundation, 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 applicabl...
# coding=utf-8 __author__ = "Daniel Arroyo <daniel@3dagogo.com>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' import os import json import uuid from flask import request, jsonify, abort from octoprint.settings import settings from octoprint.server import restricted_access, ...
import os import time import sys import subprocess import glob import shutil from distutils import dir_util import re import fnmatch import Queue import threading import getpass import platform import multiprocessing # import psutil try: import psutil except: pass # Helpers #########################################...
#!/Users/sma/anaconda/bin/python """ nrc.py is a python program designed to calculate the Nonlinear reflection coefficient for silicon surfaces. It works in conjunction with the matrix elements calculated umath.sing ABINIT, and open source ab initio software, and TINIBA, our in-house optical calculation software. The ...
import glob, json, collections, re, zipfile import os, configparser, tarfile from PyQt5.QtCore import Qt from PyQt5.QtGui import QStandardItemModel, QStandardItem, QFont import ConfigViewerUi from PyQt5.QtWidgets import QWidget, QStyle class Widget(QWidget): def __init__(self, config:str): super().__in...
#! /usr/bin/env python3 import collections import csv import glob import gzip import itertools import jinja2 import json import logging import os import pprint import pysam import requests import shutil import subprocess import tempfile import wand.color import wand.image __version__ = '0.1.0' logger = logging.getLo...
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() import yawf yawf.autodiscover() urlpatterns = patterns('', url(r'^describe/(?P<workflow_id>\w+)/$', 'yawf.views.describe_workflow', name='describe'...
""" flask.ext.restless.search ~~~~~~~~~~~~~~~~~~~~~~~~~ Provides querying, searching, and function evaluation on SQLAlchemy models. The most important functions in this module are the :func:`create_query` and :func:`search` functions, which create a SQLAlchemy query object and execute that que...
from rest_framework import serializers from movie.models import Movie, Genre import six import re from django.contrib.auth import get_user_model User = get_user_model() def match(field,value): if not re.match(r'[A-Za-z]', value): raise serializers.ValidationError({field:"%s should be valid string ch...
import os.path from ConfigParser import SafeConfigParser class Appconfig: home = os.path.expanduser("~") #Reading all varibale from eSim config.ini parser_esim = SafeConfigParser() parser_esim.read(os.path.join(home, os.path.join('.esim','config.ini'))) try: src_home = parser_esim.get('eSi...
# by ME # snoopify.py # changes comments into snoop dog/lions language import praw import re import pprint import os import time import sys #gets password with open('passwords.txt', 'r') as passFile: password = passFile.read() with open('user.txt', 'r') as uFile: userName = uFile.read() r = praw.Reddit('Snoop ...
# -*- coding: utf-8 -*- """Clip model.""" from balistos.models.playlist import Playlist from balistos.models.user import User from pyramid_basemodel import Base from pyramid_basemodel import BaseMixin from pyramid_basemodel import Session from sqlalchemy import Column from sqlalchemy import DateTime from sqlalchemy im...
# -*- coding: utf-8 -*- """Widgets for form fields.""" from __future__ import unicode_literals from django.forms import PasswordInput from django.utils.safestring import mark_safe from django.utils.translation import ugettext as _ class PasswordStrengthInput(PasswordInput): """Form widget to show the user how s...
# -*- coding: utf-8 -*- from __future__ import (absolute_import, print_function, unicode_literals) from boto3.session import Session from acli.output.ec2 import (output_ec2_list, output_ec2_info, output_ami_list, output_ami_info, output_ec2_summary) from acli.co...
"""Visual Attention Based OCR Model.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import random, time, os, shutil, math, sys, logging,ipdb import numpy as np from six.moves import xrange # pylint: disable=redefined-builtin from PIL import Image impor...
#!/usr/bin/python # # occi_api.py - common functions, classes, and variables for Vcycle # # Andrew McNab, University of Manchester. # Luis Villazon Esteban, CERN. # Copyright (c) 2013-5. All rights reserved. # # Redistribution and use in source and binary forms, with or # without modification, are permitted provi...
from urllib.parse import urlparse, parse_qs from io import StringIO import json class MockRequest: def getmethod(self, path): apiend = "v2/" start = path.find(apiend) + len(apiend) return path[start:] def urlopen(self, url): output = StringIO() parsed = urlparse(url) ...
""" Module holds all stuff regarding Gatling tool usage Copyright 2015 BlazeMeter 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 require...
import warnings import numpy as np import astropy.units as u from astropy.constants import c from astropy.coordinates import SkyCoord, ICRS, Distance, GCRS from astropy.coordinates.baseframe import BaseCoordinateFrame, FrameMeta from astropy.utils.compat import NUMPY_LT_1_14 from astropy.utils.exceptions import Astro...
#!/usr/bin/env python # encoding: utf-8 # The MIT License (MIT) # Copyright (c) 2017-2018 CNRS # 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 limita...
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import time import rospy import math from raspimouse_ros.msg import LightSensorValues from sensor_msgs.msg import LaserScan def range_to_led(range_value): try: distance = int(range_value[0]*1000) # distance[mm] if distance < 4: distance = ...
from sqlalchemy import select, and_, asc, desc, func from flask import Blueprint, render_template, Response from app import config import json import datetime from datetime import timedelta import collections discord_charting = Blueprint( 'discord_charting', __name__, ) user_blacklist = [ 1291322402391982...
# -*- coding: utf-8 -*- """ Creates a new folder for running SeleniumBase scripts. Usage: seleniumbase mkdir [DIRECTORY] [OPTIONS] OR sbase mkdir [DIRECTORY] [OPTIONS] Example: sbase mkdir ui_tests Options: -b / --basic (Only config files. No tests added.) Output: Creates a new folder for r...
""" A command to record system metrics (CUP, Memory, Disk usage). Run this as a cron job to periodically caputes sysem resource usage. Requires psutil. Usage: manage.py system_metric <metric> [device|interface] [category] Examples: manage.py system_metric cpu -- Records total CPU usage as a percent mana...
""" awslimitchecker/tests/test_versioncheck.py The latest version of this package is available at: <https://github.com/jantman/awslimitchecker> ############################################################################## Copyright 2015 Jason Antman <jason@jasonantman.com> <http://www.jasonantman.com> This file...
import json import logging import operator import os import pickle import threading from collections import deque, namedtuple from functools import reduce from itertools import chain from typing import Optional import numpy as np from django.conf import settings from django.core.cache import cache from django.utils.fu...
#!/usr/bin/env python3 """ Functionality for accessing wireless network. Automation of MitM Attack on WiFi Networks Bachelor's Thesis UIFS FIT VUT Martin Vondracek 2016 """ import logging import os import re import subprocess from typing import Union from .model import WirelessInterface, WirelessAccessPoint from .wep...
# -- coding: UTF-8 -- # Django settings for tf_arsfest project. import os, sys DEBUG = False TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Oskar Ehnström', 'oskar.ehnstrom@teknolog.fi'), ) MANAGERS = ADMINS PROJECT_PATH = os.path.realpath(os.path.dirname(__file__)) DATABASES = { 'default': { 'ENGINE': 'djan...
# 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...
__author__ = "John Kirkham <kirkhamj@janelia.hhmi.org>" __date__ = "$Mar 30, 2015 08:25:33 EDT$" import collections import itertools import json import os import os.path import shutil import tempfile import numpy import h5py import vigra import vigra.impex import nanshe.util.iters import nanshe.util.xnumpy import...
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2014 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) a...
# 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...
# # Extend environment extend the environment variables # so that the program runs on any linux machine. # # # import os def set_environment(environment_variables): for environ, value in environment_variables.items(): environ = environ.upper() if(environ in os.environ): os.environ[envir...
''' An orchestrating control flow that invokes replayer several times to find the minimal causal set (MCS) of a failure. ''' from sts.util.console import msg from sts.util.convenience import timestamp_string from sts.replay_event import * from sts.event_dag import EventDag, split_list import sts.log_processing.superlo...
import collections import claripy class SimVariable(object): def __init__(self, name=None): self.name = name class SimConstantVariable(SimVariable): def __init__(self, value=None): super(SimConstantVariable, self).__init__() self.value = value def __repr__(self): s = "<con...
# -*- coding: utf-8 -*- VERSION = (0, 1, 14) def get_version(): """Returns the version as a human-format string.""" return '.'.join([str(i) for i in VERSION]) __author__ = 'dlancer' __docformat__ = 'restructuredtext en' __copyright__ = 'Copyright 2014-2015, dlancer' __license__ = 'BSD' __version__ = get_ver...
""" Akshay Tambe Pachter and Doudna groups Split reads for dropseq data 1. Index kmers Produce a dict kmer_index kmer_index[kmer] -> list of read line numbers that contain this kmer 2. Find cyclic paths pick a popular kmer get all reads that contain the kmer make subgraph from that subset of reads get be...
import types as pytypes import numba from numba import types from numba.typing.templates import infer_global, AbstractTemplate from numba.typing import signature from numba import ir_utils, ir, utils, array_analysis from numba.ir_utils import get_call_table, find_topo_order, mk_unique_var from operator import add def ...
# -*- coding: utf-8 -*- ## $Id$ ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006 CERN. ## ## CDS Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of...
# -*- coding: utf-8 -*- ## $Id$ ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN. ## ## CDS Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either ...
# -*- coding: utf-8 -*- from django.contrib import admin from components.accounts.admin import ContributorMixin from .models import Clip, Videodisc, VideodiscFormat class ClipInline(admin.StackedInline): extra = 1 fieldsets = ( (None, {'fields': (('disc', 'position'), 'track', ('romanized_name', 'nam...
import unittest from django.contrib.auth.models import User from django.http import QueryDict from kgb import SpyAgency from reviewboard.hostingsvcs.models import HostingServiceAccount from reviewboard.hostingsvcs.github import GitHub from reviewboard.hostingsvcs.service import (get_hosting_service, ...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # Sharoon Thomas, Raphaël Valyi # Copyright (C) 2011-2012 Camptocamp Guewen Baconn...
from wine_env import wine_rc import argparse import os import re import sys def main() -> None: parser = argparse.ArgumentParser() parser.add_argument('bottle', help='The name of the Wine bottle, e.g. PvZ', type=is_valid_bottle) parser.add_argument('--wine', help='The path to the Wine executable to use')...
# -*- coding: utf-8 -*- import urllib import urllib2 import hashlib class WoopraUnknownIdentifierException(Exception): """ This exception is thrown when trying to identify() with an unsupported value. """ pass class WoopraUserProperties(object): """ This class represents a Woopra user's inf...
# util.py # Copyright (C) 2005, 2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import inspect, itertools, new, operator, sets, sys, warnings, weakref import __builtin__ types = __i...
# coding: utf-8 from __future__ import unicode_literals import datetime import json import logging import re import unicodedata from appconf import AppConf from django.core import urlresolvers from django.db import models, transaction from django.template.defaultfilters import slugify from django.utils.encoding impor...
#!/usr/bin/env python2.5 # # Copyright 2011 the Melange 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 applic...
# Copyright (c) 2012, Eucalyptus Systems, Inc. # # Permission to use, copy, modify, and/or distribute this software for # any purpose with or without fee is hereby granted, provided that the # above copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DIS...
from bottle import run, route import bottle.ext.sqlite, sqlite3 db = sqlite3.connect('models/offers.db') c = db.cursor() c.execute("SELECT id, department, course_number, price, description, email FROM offers") data = c.fetchall() c.close() print(data[0][4]) @route('/') def show_picnic(): print("hello") ...
"""Created on 24 June 2017. @author: Alex Kost @description: Main python code file for Applying CNN as a TPMS. Attributes: DEFAULT_FORMAT (str): Logging format LOGFILE_NAME (str): Logging file name SIM_DATA_PATH (str): Local simulation data output folder path SIM_LENGTH_FIX (int): bias to datapoint len...
from django import forms from django.contrib.auth.models import User from django.db.models import Q from django.forms.extras.widgets import SelectDateWidget from django.utils.translation import ugettext_lazy as _, ugettext from l10n.models import Country from livesettings import config_value, config_get_group, SettingN...
# -*- encoding: utf-8 -*- # # Copyright © 2013 Rackspace Hosting # # Author: Thomas Maddox <thomas.maddox@rackspace.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.ap...
""" Bring-Your-Own-Attention Network A flexible network w/ dataclass based config for stacking NN blocks including self-attention (or similar) layers. Currently used to implement experimental variants of: * Bottleneck Transformers * Lambda ResNets * HaloNets Consider all of the models definitions here as exper...
#!/usr/bin/env python ''' Consumer and Normalizer for the eScholarship Repo at the University of California ''' from lxml import etree from xml.etree import ElementTree from datetime import date, timedelta import requests from scrapi_tools import lint from scrapi_tools.document import RawDocument, NormalizedDocument...
import pkg_resources from tod import model ALEXA_SKILL_ID = "" with open(pkg_resources.resource_filename("resources", "alexa_skill_id.txt"), 'r') as alexa_skill_id_file: ALEXA_SKILL_ID = alexa_skill_id_file.read().strip() TOD_MODEL = model.Model() TOD_MODEL.populate_from_json(pkg_resources.resource_filename("reso...
from __future__ import absolute_import, unicode_literals from .base import * import os DEBUG = False try: from .local import * except ImportError: pass DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'fpf', 'USER': os.environ['DJANGO_DB_USER...
# License: EPL import os import sys import traceback try: xrange except: xrange = range #=============================================================================== # Things that are dependent on having the pydevd debugger #=============================================================================== de...
import thumbor_botornado.s3_loader as S3Loader import tornado.concurrent.return_future import thumbor.loaders.http_loader as HttpLoader import re HTTP_RE = re.compile(r'\Ahttps?:', re.IGNORECASE) @return_future def load(context, url, callback): if HTTP_RE.match(url): HttpLoader.load(context, url, callback...
import yaml from os.path import expanduser import os import json import jsonschema import copy class Config(object): """ Class in charge to configuration management """ def __init__(self, log, config_path = expanduser('~') + '/.jav/'): self.log = log self.__config_path = self.prep...
### # Copyright (c) 2005-2009, Jeremiah Fincher # Copyright (c) 2009-2010, James McCoy # 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 must retain the above ...
# -*- coding: utf-8 -*- #------------------------------------------------------------------------------- import socket import random import string import time import contextlib import os from nimp.utilities.build import * from nimp.utilities.deployment import * from nimp.utilities.file_mapper import * from nimp.utili...
import operator import numpy as np import sys if sys.argv[0] != "gen_py.py": from api_autogen import * import cgt from . import core, utils # Every non-underscored function in this file should have a docstring, and it should enforce that the input data is valid # ==================================================...
""" NIPAP XML-RPC ============= This module contains the actual functions presented over the XML-RPC API. All functions are quite thin and mostly wrap around the functionality provided by the backend module. """ import time from functools import wraps from flask import Flask from flask import request, ...
""" An abstract base class for console-type widgets. """ #----------------------------------------------------------------------------- # Imports #----------------------------------------------------------------------------- # Standard library imports from os.path import commonprefix import re import sys from textwrap...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt # metadata from __future__ import unicode_literals import frappe, os from frappe.model.meta import Meta from frappe.modules import scrub, get_module_path, load_doctype_module from frappe.utils import get_html_format fr...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import cstr import mimetypes, json from werkzeug.wrappers import Response from werkzeug.routing import Map, Rule, NotFound fr...
"""Plotting methods for model evaluation. This module can be used to evaluate any kind of weather model (machine learning, NWP, heuristics, human forecasting, etc.). This module is completely agnostic of where the forecasts come from. --- REFERENCES --- Hsu, W., and A. Murphy, 1986: "The attributes diagram: A geome...
#!/usr/bin/env python """Sequential tests (num_threads == 0) for RazerS 3. See run_tests.py for the actual tests. We only call the code from there. """ import logging import os.path import sys # Automagically add util/py_lib to PYTHONPATH environment variable. path = os.path.abspath(os.path.join(os.path.dirname(__f...
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2009, Willow Garage, Inc. # 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...
# -*- coding: utf-8 -*- # Natural Language Toolkit: Interface to the CoreNLP REST API. # # Copyright (C) 2001-2016 NLTK Project # Author: Dmitrijs Milajevs <dimazest@gmail.com> # # URL: <http://nltk.org/> # For license information, see LICENSE.TXT from __future__ import unicode_literals import os import re import jso...
""" Author: Justin Cappos Modified by Brent Couvrette to make use of circular logging. Module: Node Manager main program. It initializes the other modules and doesn't do much else. Start date: September 3rd, 2008 This is the node manager for Seattle. It ensures that sandboxes are correctly assigned t...
## $Id$ ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006 CERN. ## ## CDS Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at ...
import logging; _L = logging.getLogger('openaddr.ci.collect') from ..compat import standard_library from argparse import ArgumentParser from os import close, remove, utime, environ from zipfile import ZipFile, ZIP_DEFLATED from os.path import relpath, splitext, exists from urllib.parse import urlparse from tempfile i...
# -*- coding: utf-8 -*- # Copyright (C) 2004-2016 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. # # Authors: Aric Hagberg <hagberg@lanl.gov> # Loïc Séguin-C. <loicseguin@gmail.com> # Da...
import json import os import environ from django.conf.global_settings import LANGUAGES as GLOBAL_LANGUAGES from django.core.exceptions import ImproperlyConfigured CONFIG_FILE_NAME = "config_dev.env" root = environ.Path(__file__) - 2 # two levels back in hierarchy env = environ.Env( DEBUG=(bool, False), LAN...
import re import string import datetime import tldextract import logging from lxml import html from operator import add from sparkUtils import SparkDo from pyspark.sql.functions import udf from pyspark.sql import Row, SQLContext from pyspark import SparkContext, SparkConf from pyspark.sql.types import StringType, Ti...
from .models import Span from itertools import chain from utils import tokens_to_ngrams def get_text_splits(c): """ Given a k-arity Candidate defined over k Spans, return the chunked parent context (e.g. Sentence) split around the k constituent Spans. NOTE: Currently assumes that these Spans are in t...
# -*- coding: utf-8 -*- # # core.py # # Copyright 2016 Johan Lundberg <lundberg@nordu.net> # # This started as an extension to the Neo4j REST client made by Versae, continued # as an extension for the official Neo4j python bindings when they were released # (Neo4j 1.5, python-embedded). # # After the relea...
""" This class is the workhorse of CARTOframes by providing all functionality related to data access to CARTO, map creation, and Data Observatory functionality. """ from __future__ import absolute_import import json import os import random import sys import time import collections import binascii as ba from warnings im...