text stringlengths 17 737k |
|---|
# Copyright 2014 NDP Systèmes (<https://www.ndp-systemes.fr>)
# Copyright 2020 ACSONE SA/NV (<https://acsone.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.tests.common import SavepointCase
class TestStockAutoMove(SavepointCase):
@classmethod
def setUpClass(cls):
supe... |
from __future__ import unicode_literals
import calendar
import json
import logging
import os
import pytz
import random
import re
import stripe
import traceback
from dateutil.relativedelta import relativedelta
from datetime import datetime, timedelta
from decimal import Decimal
from django.core.urlresolvers import rev... |
__author__ = 'jrx'
import numpy as np
from encoder.bit_density import pad_bit_array, truncate_bit_array, convert_to_bit_density, convert_from_bit_density
from encoder.utilities import add_length_info, strip_length_info
class XorEncoding:
def __init__(self, block_size):
self.block_size = block_size
... |
import binascii
import json
import logging
import os
from datetime import timedelta
from functools import update_wrapper
from logging.handlers import TimedRotatingFileHandler
from multiprocessing import Process
import subprocess
import click
import git
import pushover
import yaml
from flask import Flask, Response, cur... |
import webapp2
import jinja2
import os
import csv
import datetime
from google.appengine.api import users
from google.appengine.ext import blobstore
from google.appengine.ext.webapp import blobstore_handlers
from google.appengine.ext import db
template_dir = os.path.join(os.path.dirname(__file__), 'templates')
jinja_e... |
#!/usr/bin/env python
import sys
import django
from django.conf import settings
if not settings.configured:
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
},
INSTALLED_APPS=... |
from datetime import date, timedelta
from django.test import TestCase, SimpleTestCase
from corehq.apps.accounting.models import SoftwarePlanEdition, Subscription, DefaultProductPlan, BillingAccount, \
SubscriptionAdjustment
from corehq.apps.export.models import FormExportInstance, TableConfiguration, ExportColumn... |
import http.server
from threading import Thread
import os.path
class HTTPHandler:
def __init__(self, config):
self.config = config
handler = HTTPHandler.make_http_handler(self.config['media_dir'])
self.httpd = http.server.HTTPServer(('', self.config['media']['port']), handler)
se... |
#
#
# 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 n... |
"""
The NetworKit benchmark
This module implements a comprehensive benchmark of NetworKit's analytics algorithms
"""
import pandas
import sys
import warnings
import math
import os
import numpy
import matplotlib.pyplot as plt
import seaborn
from time import gmtime, strftime
import signal
import networkit
from u... |
"""
homeassistant.components.sensor.rfxtrx
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Shows sensor values from rfxtrx sensors.
Possible config keys:
device="path to rfxtrx device"
Example:
sensor 2:
platform: rfxtrx
device : /dev/serial/by-id/usb-RFXCOM_RFXtrx433_A1Y0NJGR-if00-port0
"""
import logging
from collections imp... |
import time
import os
from dtest import Tester, debug
from tools import *
from assertions import *
from ccmlib.cluster import Cluster
from ccmlib import common as ccmcommon
import loadmaker
try:
CASSANDRA_VERSION = os.environ['CASSANDRA_VERSION']
except KeyError:
CASSANDRA_VERSION = 'git:trunk'
class TestRo... |
#!/usr/bin/python
import re
import socket
host = socket.gethostname()
if host == 'glh-mbp':
group = 'work'
elif host == 'retiro':
group = 'personal'
elif re.match(r'dev(vm)?\d+', host):
group = 'devservers'
else:
group = 'local'
print """
{
"%s": {
"hosts": [
"localhost"
],
"vars... |
#!/usr/bin/python
# filename: output.py
#
# Copyright (c) 2015 Bryan Briney
# License: The MIT license (http://opensource.org/licenses/MIT)
#
# 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 wi... |
# Copyright 2016 TensorLayer. 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 or... |
"""
==========
Statistics
==========
Demonstrates the different statistics you can use with ChainConsumer.
"""
###############################################################################
# By default, ChainConsumer uses maximum likelihood statistics. Thus you do not
# need to explicitly enable maximum likelihoo... |
from flask import render_template, request
import flask, time
import json
from aggrerate import app, util
from aggrerate.loginCode import loginCode, flogin
from aggrerate.scraper import ReviewScraper
from aggrerate.scraper.specifications import SpecificationScraper
from flask.ext import login
def cookie_params(reques... |
# dataset.py
"""Module for Dataset class
Overview of Dicom object model:
Dataset(derived class of Python's dict class)
contains DataElement instances (DataElement is a class with tag, VR, value)
the value can be a Sequence instance (Sequence is derived from Python's list),
... |
import sys, re, os.path
from IPython import embed
from teafacto.util import argprun, tokenize, ticktock
from teafacto.blocks.memory import LinearGateMemAddr, DotMemAddr
from teafacto.blocks.match import MatchScore
from teafacto.blocks.lang.wordvec import Glove
from teafacto.blocks.basic import VectorEmbed
from teafacto... |
"""Support for WeMo device discovery."""
import asyncio
import logging
import pywemo
import requests
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.dispatche... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 IBM Corp.
# 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/lice... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import print_function
import re
import astropy.units as u
try:
import astropy.io.ascii as asciitable
except ImportError:
import asciitable
from ..query import BaseQuery
from ..utils.class_or_instance import class_or_instance
from... |
"""
Support for an interface to work with a remote instance of Home Assistant.
If a connection error occurs while communicating with the API a
HomeAssistantError will be raised.
For more details about the Python API, please refer to the documentation at
https://home-assistant.io/developers/python_api/
"""
from dateti... |
from blinker import signal
import logging
logger = logging.getLogger("asyncirc.plugins.cap")
capabilities_requested = {}
capabilities_available = {}
capabilities_pending = {}
registration_state = {}
def request_capability(netid, cap):
if netid not in capabilities_requested:
capabilities_requested[netid] ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import re
from HTMLParser import HTMLParseError
from time import time
from urlparse import urlparse
import requests
from bs4 import BeautifulSoup
from app import logger
from http_cache import http_get
from http_cache import is_response_too_large
from oa_local impor... |
#!/usr/bin/env python3
import argparse
import os
from tempfile import NamedTemporaryFile
from textwrap import dedent
import shutil
from qlmdm import top_dir
from qlmdm.prompts import get_bool
os.chdir(top_dir)
parser = argparse.ArgumentParser(
description='Finalize installation of the qlmdm client.',
)
parser... |
import unittest
from django.contrib.auth.models import Group, AnonymousUser
from django.core.exceptions import PermissionDenied
from django.test import TestCase, RequestFactory
from rest_framework.exceptions import NotFound
from hs_core.hydroshare import resource
from hs_core.hydroshare import users
from hs_core.test... |
"""
Created on Wed Nov 8 11:00:05 2017
@author: Stefan Peidli
License: MIT
Tags: Policy-net, Neural Network
"""
import numpy as np
import matplotlib.pyplot as plt
from Hashable import Hashable
from TrainingDataFromSgf import TrainingData
import os
def softmax(x):
"""Compute softmax values for each sets of sco... |
# 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, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
impor... |
# Copyright 2019 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 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime, timedelta, date
from dateutil.relativedelta import relativedelta
import logging
from operator import itemgetter
from werkzeug import url_encode
from openerp import SUPERUSER_ID
from opener... |
from __future__ import absolute_import
from .adjustText import *
|
import pyminizip
import argparse
import os.path
import ConfigParser
def get_out_name(files):
broker = os.path.basename(files[0].split('@')[0])
date = os.path.basename(files[0].split('@')[1]).split('-')[:-1]
operations = set(
[os.path.basename(f).split('-')[-1].split('.')[0] for f in files]
)
... |
import json
import logging
import os
import sys
import traceback
from argparse import ArgumentParser
from pulse_actions.authentication import (
AuthenticationError,
get_user_and_password,
)
from pulse_actions.handlers import config, route_functions
from mozci.mozci import disable_validations
from mozci.utils... |
#!/usr/bin/env python2.7
# batchutils
# A helper utility to do stuff on multiple incidents based on filter
#
# Stuff can be closing incidents, running a command, changing type or changing playbook
#
# Author: Slavik Markovich
# Version: 1.0
#
import sys
import json
import argparse
from datetime import date... |
"""
billow AutoScaleGroup API
"""
import billow
from billow import aws
import boto
import boto.ec2
import boto.ec2.autoscale
import time
import fnmatch
import re
class asg(object):
def __init__(self, region):
self.region = region
self.aws = aws.aws()
self.asg = None
self.ec2 = Non... |
#!/usr/bin/env python3
"""Module containing handlers for REST API calls, Swagger UI etc."""
import os
import json
import connexion
import logging
from flask import redirect, jsonify
from datetime import datetime
from flask_script import Manager
from f8a_jobs.scheduler import Scheduler
import f8a_jobs.defaults as defa... |
import codecs
import calendar
import datetime
import hashlib
import hmac
import io
import json
import logging
import mimetypes
import sys
import urllib
import urllib2
import uuid
FACEBOOK_API = 'https://graph.facebook.com'
logger = logging.getLogger(__name__)
class MultipartFormdataEncoder(object):
def __init__... |
import codecs
import datetime
import hashlib
import hmac
import io
import json
import logging
import mimetypes
import sys
import urllib
import urllib2
import uuid
FACEBOOK_API = 'https://graph.facebook.com'
logger = logging.getLogger(__name__)
class MultipartFormdataEncoder(object):
def __init__(self):
... |
import urllib2
CODEC = 'gb2312'
debug = True
# debug = False
class StockInfo:
def __init__(self, symbol):
self.symbol = symbol
def read(self):
'''
-> str
Return empty string if TimeOut
'''
url = 'http://hq.sinajs.cn/list=' + self.symbol
... |
# 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 python2
import server
import client
import controller
import signal
class Device():
def __init__(self, ipfile, gamecontroller):
self.ipfile = open(ipfile, 'r')
self.iplist = []
self.gamecontroller = gamecontroller
self.is_server= False
self.remote_server = None
self.server = None
d... |
import logging
from logging.handlers import RotatingFileHandler, SysLogHandler
from flask import Flask
app = Flask(__name__)
app.config.from_object('alerta.default_settings')
app.config.from_object('alerta.settings')
if app.config['LOG_FILE']:
file_handler = RotatingFileHandler(filename=app.config['LOG_FILE'], ... |
import os
import sys
import urllib
import urllib2
import json
import time
import datetime
import prettytable
import pytz
from email import utils
from alerta.common import log as logging
from alerta.common import status_code, severity_code
from alerta.common import config
from alerta.common.utils import relative_date
... |
###
# Copyright (c) 2002-2005, Jeremiah Fincher
# 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 of co... |
from django.db import models
from socket import gethostname
from django.contrib.auth.models import User
from django.utils.safestring import mark_safe
import os
host = gethostname()
stage = {0: 'failed (check settings and restart)',1:'preprocessing', 1001:'preprocessing image stack', 2:'initial alignment', 1002:'calcu... |
# Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
# -*- encoding: utf-8 -*-
import traceback
from functools import wraps
import collections
# from collections import namedtupla
import pika
import logging
import threading
import time
import json
import sys
import os
# add amqppy path
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file_... |
"""JS-Tree output plugin
Generates a html/javascript page that presents a tree-navigator
to the YANG module(s).
"""
import optparse
import sys
from pyang import plugin
from pyang import statements
def pyang_plugin_init():
plugin.register_plugin(JSTreePlugin())
class JSTreePlugin(plugin.PyangPlugin):
def ad... |
# Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
# Copyright (c) 2017 Fortinet, 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 requir... |
#
# Jasy - Web Tooling Framework
# Copyright 2010-2012 Zynga Inc.
#
import os, logging, json, re
from jasy.core.Cache import Cache
from jasy.core.Repository import cloneGit, isGitRepositoryUrl
from jasy.core.Error import JasyError
# Item types
from jasy.core.Item import Item
from jasy.core.Doc import Doc
from jasy.j... |
# Most code in this file was shamelessly borrowed from MoviePy
# http://zulko.github.io/moviepy/
# The MIT License (MIT)
#
# Copyright (c) 2015 Zulko
# Copyright (c) 2015 CNRS
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "So... |
# TessuMod: Mod for integrating TeamSpeak into World of Tanks
# Copyright (C) 2014 Janne Hakonen
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the Licen... |
# -*- coding: utf-8 -*-
"""
Django settings for {{cookiecutter.project_name}} 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/
"""
import environ
import os
imp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Python implementation of the Adaptable Seismic Data Format (ASDF).
:copyright:
Lion Krischer (krischer@geophysik.uni-muenchen.de), 2013-2015
:license:
BSD 3-Clause ("BSD New" or "BSD Simplified")
"""
from __future__ import (absolute_import, division, print_func... |
# Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
#... |
from django import forms
from haystack.forms import SearchForm as HaystackSearchForm
from haystack.inputs import AutoQuery
from haystack.query import SQ
class SearchForm(HaystackSearchForm):
has_releases = forms.BooleanField(label="Has Releases", required=False, initial=True)
def __init__(self, *args, **kwar... |
import boto3
import uuid
class CaseBucket(object):
def __init__(self, case_number, region):
self.region = region
self.case_number = case_number
self.client = boto3.client(
's3',
region_name=region
)
self.session = boto3.Session(
regio... |
import logging
from functools import wraps
from flask import g
from dataactcore.interfaces.db import GlobalDB
from dataactcore.models.jobModels import Submission
from dataactcore.models.lookups import PERMISSION_TYPE_DICT, PERMISSION_SHORT_DICT
from dataactcore.utils.jsonResponse import JsonResponse
from dataactcore... |
"""
PGP Harvard data extraction.
Copyright (C) 2015 PersonalGenomes.org
This software is shared under the "MIT License" license (aka "Expat License"),
see LICENSE.TXT for full license text.
May be used on the command line from this project's base directory, e.g.
python -m sources.pgp hu43860C files
...assembles... |
import math
from backend.Node import Node
class BoardManager:
boardSizeX = None
boardSizeY = None
p1Node = None
p2Node = None
_next_id = -1
#flags
newBoardState = False
#config settings
maxDistance = -1
distanceMetric = 'euclidean'
numChildren = -1
''' for best re... |
#!/usr/bin/python
# Reddit pics downloader
import threading
from requests import get
from json import loads
from os.path import exists
from os import mkdir
import re
import sys
class UsageError(Exception):
pass
class InvalidURLError(BaseException):
pass
class ExistsError(Exception):
pass
def find_ur... |
from collections import defaultdict
import gzip
import os
import argparse
import json
import numpy as np
from sklearn.decomposition import PCA
parser = argparse.ArgumentParser(description="PCA")
parser.add_argument('samples', help="All samples (comma separated)")
parser.add_argument('sample_ids', help="Sample IDs (co... |
# -*- coding: utf-8 -*-
"""
Module: anlffr.spectral
A collection of spectral analysis functions for FFR data, curated for
correctness. :)
Includes functions to estimate frequency content / phase locking of
single-channel or individual data channels, as well as functions that produce
estimates by combining across chan... |
"""
subdown.py
==========
This is a script that is made to quickly access the reddit API and download
images from specified subreddits.
Future goals include the ability to visit linked pages and scrape for large
images.
It is also to aid me in learning best practices with the Twisted framework.
"""
import os, sys
... |
#pylint:disable=too-many-instance-attributes
#pylint:disable=too-few-public-methods
#pylint:disable=attribute-defined-outside-init
#pylint:disable=bare-except
#pylint:disable=no-value-for-parameter
""" Class Research and auxiliary classes for multiple experiments. """
import os
from copy import copy
from collections ... |
import logging
from cubes.common import get_logger
from cubes.errors import *
from cubes.browser import *
from cubes.computation import *
from cubes.workspace import Workspace
from cubes import statutils
from .mapper import MongoCollectionMapper, coalesce_physical
import collections
import copy
import pymongo
import b... |
#!/usr/bin/env python
# coding: utf-8
import datetime
from collections import namedtuple
import os, time
import simplejson as json
import requests
from clint.textui import puts, indent, colored
import gevent
from gevent import socket
from gevent import monkey; monkey.patch_socket()
subreddits = ['HistoryPorn',]
max_... |
# Copyright 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
# This turns on e.g. the filename-based detection of which
# platforms to include source files on (e.g. files ending in
# _mac... |
import logging
from cubes.common import get_logger
from cubes.errors import *
from cubes.browser import *
from cubes.computation import *
from cubes.workspace import Workspace
from cubes import statutils
from .mapper import MongoCollectionMapper, coalesce_physical
import collections
import copy
import pymongo
import b... |
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.contrib.sites.models import Site
from django.contrib.syndication.feeds import Feed, FeedDoesNotExist
from tagging.models import TaggedItem, Tag
from asgard.blog.models import Post, Category
current_site = Site.object... |
import sys
import argparse
import json
import urllib
import collections
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
def main(_):
"""Executed only if run as a script."""
print('Fetiching data...')
url = 'http://localhost:3000/api/handwriting'
response = urllib.urlopen(ur... |
from django.db import models
from django.db.models import OneToOneField
from django.core.serializers.json import DjangoJSONEncoder
try:
from django.db.models.fields.related import SingleRelatedObjectDescriptor
except ImportError:
from django.db.models.fields.related_descriptors import ForwardManyToOneDescriptor... |
import datetime
from django.conf import settings
from rest_framework import serializers
from rest_framework.reverse import reverse
from waldur_core.core import serializers as core_serializers
from waldur_core.core import signals as core_signals
from waldur_core.core import utils as core_utils
from waldur_core.structu... |
from settings import * # noqa
import os
TEST_DISCOVER_ROOT = os.path.abspath(os.path.join(__file__, '../..'))
# Comment this line for turn on debug on tests
LOGGING = {}
DEBUG = 0
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
NOSE_ARGS = [
'--verbosity=2',
'--no-byte-compile',
'--debug-log=error_test.... |
#
# Forked from m9dicts.{api,dicts}.
#
# Copyright (C) 2011 - 2015 Red Hat, Inc.
# Copyright (C) 2011 - 2017 Satoru SATOH <ssato redhat.com>
# License: MIT
#
r"""Utility functions to operate on mapping objects such as get, set and merge.
.. versionadded: 0.8.3
define _update_* and merge functions based on classes i... |
from art_brain_robot_interface import ArtBrainRobotInterface
from geometry_msgs.msg import PoseStamped
import rospy
from art_gripper import ArtGripper
from brain_utils import ArtBrainUtils
from art_msgs.srv import ReinitArmsRequest, ReinitArmsResponse
from art_msgs.msg import ObjInstance
from std_srvs.srv import Trigge... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
"""Script to prepare config files for selection of MARC records to convert
to Researcher Format"""
# Import required modules
import getopt
from marc2rf import *
__author__ = 'Victoria Morris'
__license__ = 'MIT License'
__version__ = '1.0.0'
__status__ = '4 -... |
"""Store statistics into influxdb."""
import collections
from datetime import datetime
import time
from flask import current_app
from sqlalchemy.orm import joinedload
from APITaxi_models2 import db, Taxi, Town, User, VehicleDescription, ZUPC
from . import celery
from .. import influx_backend
from .. import redis_ba... |
# -*- coding: utf-8 -*-
import factory
from factory import django
from django.contrib.auth.models import User
from rynda.users.models import Profile
class ProfileFactory(django.DjangoModelFactory):
class Meta:
model = Profile
user = factory.SubFactory('test.factories.UserFactory', profile=None)
... |
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import sys
import json
import time
import glob
import shutil
import string
import itertools
import numpy as np
import mdtraj as md
import multiprocessing as mp
from builtins import range
from AdaptivePELE.constants import const... |
#!/usr/bin/env python
# coding:utf-8
# vi:tabstop=4:shiftwidth=4:expandtab:sts=4
#from pympler import tracker
#tr = tracker.SummaryTracker()
from deepstacks.macros import *
#from memory_profiler import memory_usage
#using_nolearn=False
from ..util.floatXconst import *
from ..lasagne.utils import ordered_errors as ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
from six import text_type
from itertools import chain
class MosesPunctNormalizer:
"""
This is a Python port of the Moses punctuation normalizer from
https://github.com/moses-smt/mosesdecoder/blob/master/scripts/tokenizer/normalize-punctuation.perl... |
import os
import sys
import time
import functools
import unittest
from mpi4py import MPI
from mpi4py import futures
try:
from concurrent.futures._base import (
PENDING, RUNNING, CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED)
except ImportError:
from mpi4py.futures._base import (
PENDING, RUNNING,... |
import pandas as pd
import numpy as np
import scipy as sp
import utils
def factor_information_coefficient(factor, forward_returns, sector_adjust=False, by_sector=False):
"""
Computes Spearman Rank Correlation based Information Coefficient (IC) between
factor values and N day forward returns. If a time_rul... |
# -*- coding: utf-8 -*-
# noinspection PyCompatibility
import math
import regex
from json.decoder import JSONDecodeError
from difflib import SequenceMatcher
from urllib.parse import urlparse, unquote_plus
from itertools import chain
from collections import Counter
from datetime import datetime
import os.path as path
... |
# -*- coding: utf-8 -*-
import regex
import phonenumbers
from bs4 import BeautifulSoup
def all_caps_title(s, site):
if regex.compile(ur"SQL|\b(ERROR|PHP|QUERY|ANDROID|CASE|SELECT|HAVING|COUNT)\b").search(s):
return False # common words in non-spam all-caps titles
return bool(regex.compile(ur"^(?=.*\... |
import logging
import ibmsecurity.utilities.tools
import os.path
logger = logging.getLogger(__name__)
def get_all(isamAppliance, check_mode=False, force=False):
"""
Get information on existing users
"""
return isamAppliance.invoke_get("Retrieving users", "/sysaccount/users/v1")
def get(isamApplianc... |
# -*- coding: utf-8 -*-
import regex
import phonenumbers
def all_caps_text(s, site):
s = regex.sub("<[^>]*>", "", s) # remove HTML tags
s = regex.sub("&\w+;", "", s) # remove HTML entities
if len(s) <= 150 and regex.compile(ur"SQL|\b(ERROR|PHP|QUERY|ANDROID|CASE|SELECT|HAVING|COUNT|GROUP|ORDER BY|IN... |
# coding=utf-8
# Copyright 2021 The Uncertainty Baselines 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 ap... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.math
~~~~~~~~~~~~~~~~~~~~
Lexers for math languages.
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, bygroups, include, \
combine... |
# -*- coding: utf-8 -*-
import regex
import phonenumbers
def all_caps_text(s, site):
s = regex.sub("<[^>]*>", "", s) # remove HTML tags
s = regex.sub("&\w+;", "", s) # remove HTML entities
if len(s) <= 150 and regex.compile(ur"SQL|\b(ERROR|PHP|QUERY|ANDROID|CASE|SELECT|HAVING|COUNT|GROUP|ORDER BY|IN... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.text
~~~~~~~~~~~~~~~~~~~~
Lexers for non-source code file types.
:copyright: 2006-2008 by Armin Ronacher, Georg Brandl,
Tim Hatch <tim@timhatch.com>,
Ronny Pfannschmidt,
Dennis Kaarsemaker,
Kuma... |
# -*- coding: utf-8 -*-
# noinspection PyCompatibility
import sys
import math
import regex
from difflib import SequenceMatcher
from urllib.parse import urlparse, unquote_plus
from itertools import chain
from collections import Counter
from datetime import datetime
import time
import os
import os.path as path
# noinsp... |
from lxml import etree
def parse_site_values(content_io, namespace):
"""
"""
data_dict = {}
for (event, ele) in etree.iterparse(content_io):
if ele.tag == namespace + "timeSeries":
values_element = ele.find(namespace + 'values')
values = _parse_values(values_element)
... |
# -*- coding: utf-8 -*-
# noinspection PyCompatibility
import math
import regex
from difflib import SequenceMatcher
from urllib.parse import urlparse
from itertools import chain
from collections import Counter
from datetime import datetime
import os.path as path
# noinspection PyPackageRequirements
import tld
# noins... |
import numpy as np
import matplotlib.pyplot as plt
from astropy.io import fits
from astropy.stats.funcs import median_absolute_deviation
from astropy.visualization import (PercentileInterval, ImageNormalize,
SqrtStretch, LogStretch, LinearStretch)
import scipy.ndimage
from .lightcurve... |
# Create your views here.
from django.shortcuts import render_to_response, render, redirect
from django.core.urlresolvers import reverse
from django.http.response import HttpResponseRedirect, HttpResponse,\
JsonResponse
from settings.settings import AUTHORIZED_KEYS_FILE, SITE_URL
from bioshareX.models import Share,... |
import subprocess
from bipy.utils import append_stem
import os
import sh
from bipy.toolbox.fastqc import detect_fastq_format
import logging
logger = logging.getLogger("bipy")
_FASTQ_TYPE_TO_FLAG = {"sanger": "sanger",
"illumina_1.3+": "illumina",
"illumina_1.5+": "illumin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.