gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import time
import numpy as np
import roslaunch
import rosparam
import subprocess
import imageio
from core.env import Env
from core.minisim.minisim_client import MinisimClient
from utils.... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
HashMe.
Calculate multiple checksum digests reading each input file once.
"""
import hashlib
import os
import queue
import sys
import time
from multiprocessing import cpu_count
from queue import Queue
from threading import Thread
from argparse import ArgumentParser... | |
import os
import re
from docutils import nodes
from sphinx import addnodes
from sphinx.errors import SphinxError
from sphinx.util import logging
import aplus_nodes
import directives.meta
import lib.yaml_writer as yaml_writer
import lib.html_tools as html_tools
import lib.toc_languages as toc_languages
from lib.revea... | |
# Copyright 2015 Knowledge Economy Developments Ltd
#
# Henry Gomersall
# heng@kedevelopments.co.uk
#
# 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 reta... | |
"""
Module otsun.math with mathematical helper functions
"""
import numpy as np
from FreeCAD import Base
import random
import time
from functools import wraps
EPSILON = 1E-6
# Tolerance for considering equal to zero
INF = 1E20
# Infinite
try:
from functools import lru_cache
except ImportError:
from backports... | |
# Copyright (c) 2011-13 Walter Bender
# Copyright (c) 2011 Collabora Ltd. <http://www.collabora.co.uk/>
# 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... | |
# -*- test-case-name: twistedchecker.test.test_runner -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
import sys
import os
import re
from astroid.modutils import file_from_modpath
from pylint.checkers.base import NameChecker
from pylint.lint import PyLinter
from twisted.python.compat impo... | |
#!/usr/bin/env python
# coding=utf-8
"""
Read/write Bookeen dictionaries.
"""
from __future__ import absolute_import
import imp
import io
import os
import sqlite3
import zipfile
from penelope.collation_default import collate_function as collate_function_default
from penelope.utilities import print_debug
from penelop... | |
'''
..
Red9 Studio Pack: Maya Pipeline Solutions
Author: Mark Jackson
email: rednineinfo@gmail.com
Red9 blog : http://red9-consultancy.blogspot.co.uk/
MarkJ blog: http://markj3d.blogspot.co.uk
This is the General library of utils used throughout the modules
These are abstract gene... | |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from six.moves import map
from matplotlib.gridspec import GridSpec, SubplotSpec
from matplotlib import docstring
import matplotlib.artist as martist
from matplotlib.axes._axes import Axes
import wa... | |
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | |
from __future__ import print_function
from __future__ import division
from builtins import next
from builtins import str
from past.utils import old_div
from builtins import object
import collections
from copy import copy
import pandas as pd
import PyAnalysisTools.PlottingUtils.Formatting as FM
import PyAnalysisTools... | |
# stdlib
from typing import Any
from typing import Generator
from typing import Optional
import uuid
from uuid import UUID as uuid_type
# third party
from google.protobuf.reflection import GeneratedProtocolMessageType
# relative
from ...logger import critical
from ...logger import traceback_and_raise
from ...proto.co... | |
"""Tests for tools for manipulating of large commutative expressions. """
from sympy import (S, Add, sin, Mul, Symbol, oo, Integral, sqrt, Tuple, I,
Interval, O, symbols, simplify, collect, Sum, Basic, Dict,
root, exp, cos, sin)
from sympy.abc import a, b, t, x, y, z
from sympy.co... | |
#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, 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 cod... | |
# -*- coding: utf-8 -*-
"""
Deployments
The model for this is in templates.RMS.deploy.py
"""
if not settings.has_module(c):
raise HTTP(404, body="Module disabled: %s" % c)
# -----------------------------------------------------------------------------
def index():
""" Customisable module homepage ""... | |
from datetime import datetime, timedelta
import datetime as pydt
import numpy as np
from dateutil.relativedelta import relativedelta
import matplotlib.units as units
import matplotlib.dates as dates
from matplotlib.ticker import Formatter, AutoLocator, Locator
from matplotlib.transforms import nonsingular
from pand... | |
"""SCons.Scanner.Fortran
This module implements the dependency scanner for Fortran code.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and asso... | |
# Copyright 2013 Nebula 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... | |
"""
The `compat` module provides support for backwards compatibility with older
versions of Django/Python, and compatibility wrappers around optional packages.
"""
# flake8: noqa
from __future__ import unicode_literals
import django
from django.conf import settings
from django.db import connection, transaction
from d... | |
from subprocess import check_call
import datetime
import itertools
import json
import logging
import os
import shutil
import re
import concurrent.futures
from sgfs import SGFS
from sgsession import Session, Entity
from shotgun_api3.shotgun import Fault as ShotgunFault
from . import utils
from . import versions
log... | |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.23
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | |
#!/usr/bin/env python
from __future__ import absolute_import, print_function, unicode_literals
import argparse
import os
import platform
import subprocess
import sys
import tempfile
# -----------------------------------------------------------------------------
# Constants
PACKAGE_DIR = os.path.dirname(os.path.re... | |
"""
Support for Alexa skill service end point.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/alexa/
"""
import asyncio
import enum
import logging
from homeassistant.components import http
from homeassistant.core import callback
from homeassistant.exce... | |
import numpy as np
import nibabel as nb
class Masker(object):
""" Handles vectorization/masking/unmasking of images. """
def __init__(self, volume, layers=None):
""" Initialize a new Masker.
Args:
volume: A volume indicating the global space within which all
subse... | |
import logging
from dateutil.relativedelta import relativedelta
from dataactbroker.helpers.generation_helper import a_file_query, d_file_query, copy_file_generation_to_job
from dataactcore.config import CONFIG_BROKER
from dataactcore.interfaces.function_bag import (mark_job_status, filename_fyp_sub_format, filename_... | |
#!/usr/bin/env python
#
# Copyright 2015 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 o... | |
import sys
import struct
if len(sys.argv) < 2:
usage();
sys.exit(0)
def usage():
print("%s [filename]"%(sys.argv[0]))
class NotMP4FormatException(Exception):
pass
class CHUNK(object):
def __init__(self, pos):
self.pos = pos
self.samples_count = 0
self.samples_de... | |
# MANSEDS Lunar Rover -- Arm Controller
# Author: Ethan Ramsay
# Import dependencies
import argparse
import RPi.GPIO as GPIO
import Adafruit_PCA9685
# import ikpy
import numpy as np
# from ikpy import plot_utils
import logging
import time
from math import sqrt, pow, atan2, cos, sin
# Logging config
logging.basicCon... | |
# Copyright (c) 2006-2007 The Regents of The University of Michigan
# Copyright (c) 2009 Advanced Micro Devices, 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 co... | |
## GOX-kerosene sim
#@ Author Juha Nieminen
#import sys
#sys.path.insert(0, '/Users/juhanieminen/Documents/adamrocket')
import RocketComponents as rc
from physical_constants import poise, inches, Runiv, gallons, lbm, \
gearth, atm, psi, lbf
from numpy import pi, linspace, cos, radians, sqrt, exp, log, array, full... | |
import wx
from wx import glcanvas
from OpenGL.GL import *
from OpenGL.GLUT import *
from jumeg.tsv.plot2d.jumeg_tsv_plot2d_ogl import JuMEG_TSV_PLOT2D_OGL
# from jumeg.tsv.test.axis01 import JuMEG_TSV_AXIS
attribList = (glcanvas.WX_GL_RGBA, # RGBA
glcanvas.WX_GL_DOUBLEBUFFER, # Double Buffer... | |
"""
SEP: 0002
Title: Federation protocol
Author: stellar.org
Status: Final
Created: 2017-10-30
Updated: 2019-10-10
Version 1.1.0
"""
from typing import Dict, Optional
from .. import AiohttpClient
from ..client.base_async_client import BaseAsyncClient
from ..client.base_sync_client import BaseSyncClient
from ..client.r... | |
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# Author: Kiall Mac Innes <kiall@hp.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/L... | |
#!/usr/bin/env python3
import asyncio
import json
import logging
import os
import shlex
import subprocess
import time
import urllib.request
# Setup the Logger
logging.basicConfig(format='%(message)s')
log = logging.getLogger()
log.setLevel(logging.INFO)
DEFAULT_TIMEOUT = 120
LONG_TIMEOUT = 500
def find_fbsimctl_pat... | |
# -*- coding: utf-8 -*-
# Copyright 2013 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | |
# 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... | |
#! /usr/bin/env python
from __future__ import print_function
import cv2
import numpy as np
import struct
import pandas as pd
import random
from os.path import join
from golfr.definitions import ROOT_DIR
'''
Given a bunch of points, we want to be able to
- filter out extraneous points
- fill in missed points
... | |
#!/usr/bin/env python2.7
'''
For more information on daemons in python, see:
* http://pypi.python.org/pypi/python-daemon
* http://www.python.org/dev/peps/pep-3143/
* http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66012
* http://en.wikipedia.org/wiki/Daemon_(computing)
Here are some similar implementations:
... | |
# Copyright (c) 2008, Casey Duncan (casey dot duncan at gmail dot com)
# see LICENSE.txt for details
"""Perlin noise -- pure python implementation"""
__version__ = '$Id: perlin.py 521 2008-12-15 03:03:52Z casey.duncan $'
from math import floor, fmod, sqrt
from random import randint
# 3D Gradient vectors
_GRAD3 = ((... | |
#!/usr/bin/env python
#
# Copyright 2015-2021 Flavio Garcia
#
# 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... | |
import pytest
from collections import OrderedDict
from modularodm.exceptions import ValidationError
from addons.box.models import BoxFile
from addons.dropbox.models import DropboxFile
from addons.github.models import GithubFile
from addons.googledrive.models import GoogleDriveFile
from addons.osfstorage.models impor... | |
from django.conf import settings
from numbers import Number
import json
import os
def check_for_target_url_duplication_and_generate_error_message(self, partner=False):
"""
Filter for partners (PROXY and BUNDLE) where the
target_url is the same as self. On filtering, if we have
a non-zero number of mat... | |
import json
from fjord.base.tests import (
AnalyzerProfileFactory,
LocalizingClient,
TestCase,
reverse,
)
from fjord.feedback.tests import ResponseFactory
class TestTriggerRuleMatchViewAPI(TestCase):
client_class = LocalizingClient
def test_not_logged_in(self):
data = {}
res... | |
#!/usr/bin/env python3
# Python implementations of HALCON's radial distortion models.
# These are intended to work both element-wise for numpy arrays,
# and also for scalars.
# Transcribed from the documentation for the "calibrate_cameras" HALCON operator.
#
# I performed some manual common subexpresson elimination si... | |
###############################################################################
# Copyright (c) 2018-2021, National Research Foundation (SARAO)
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy
# of the License at
#
# ... | |
"""
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize cop... | |
#!/usr/bin/env python
"""
==============================================================================
Program: wb1.grp.py
Author: Kyle Reese Almryde
Date: 11/19/2012 @ 04:00:46 PM
Description: The purpose of this program is to perform a Group 1 sample ttest
on the imaging data for the Word Bou... | |
# 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... | |
from copy import deepcopy
from string import replace
from django.conf import settings
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from openbudgets.apps.transport.incoming.errors import DataValidationError
ITEM_SEPARATOR = settings.OPENBUDGETS_IMPORT_INTRA... | |
"""Server for watching and updating hue devices."""
import logging
import sys
import time
from datetime import (
datetime,
timedelta,
)
from tornado import (
gen,
locks,
)
from huegely import Bridge
from huegely.exceptions import HueError
from device import Device
from .device_server import DeviceSe... | |
# 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... | |
import tensorflow as tf
import numpy as np
from datasets.twitter import data
from datasets.twitter import data_utils
class enc_lm_seq2seq(object):
def __init__(self, state_size, vocab_size, num_layers,
model_name= 'enc_langmodel',
ckpt_path= 'ckpt/enc_langmodel/'):
self.model_nam... | |
""" experimental data """
from collections import defaultdict
from itertools import compress
import logging
import pickle
from urllib.request import urlopen
import numpy as np
import yaml
from . import cachedir, systems
# TODO improve flow cumulant observable keys:
# cumulant v_n{k} should have obs == 'vnk' and su... | |
#!/usr/bin/env python
'''
See GDoc "Prepare GYB"
This data-prep script MUST be modified for the needs of each project
Requires stands, treeslist and climate tables
'''
import os
import sqlite3
import json
import glob
import sys
class GYBError(Exception):
pass
TF = [
# See "G:\projects\projects2011\LandOwnerT... | |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | |
"""Logic expressions handling
NOTE
----
at present this is mainly needed for facts.py , feel free however to improve
this stuff for general purpose.
"""
from __future__ import print_function, division
from sympy.core.compatibility import range
def _fuzzy_group(args, quick_exit=False):
"""Return True if all arg... | |
#!/usr/bin/env python
# Copyright (c) 2014, Illumina
# 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... | |
#
# File : building.py
# This file is part of RT-Thread RTOS
# COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
#
# This program 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... | |
XXXXXXXXX XXXXX
XXXXXX
XXXXXX
XXXXX XXXXXXXXXXXXXXXX
XXXXX XXXXXXXXXXXXX XXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXX XXXXXXX X XXXXXXX XXX XXX XXXXXXXXXXXX
XXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXX... | |
import unittest
import maya.OpenMaya as om
import maya.standalone
maya.standalone.initialize()
import maya.cmds as cmds
import os
import sys
sys.path.append(os.path.dirname(__file__))
cmds.loadPlugin("rbfblender")
class TestRbfBlender(unittest.TestCase):
def setUp(self):
cmds.file(new=True, f=True)
... | |
# -*- coding: utf-8 -*-
import json
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseForbidden, HttpResponse
from django.shortcuts import render
from django.utils import timezone
from django.utils.translation import ugettext as _
from djang... | |
"""
Python USBTMC driver
Copyright (c) 2012-2017 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify,... | |
"""
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 this ... | |
import os
import sys
import lib.io
import lib.geo
from lib.exif import EXIF, verify_exif
from collections import OrderedDict
import datetime
'''
Sequence class for organizing/cleaning up photos in a folder
- split to sequences based on time intervals
- split to sequences based on gps distances
- remove dup... | |
"""
Copyright (c) 2014-2015 F-Secure
See LICENSE for details
"""
from datetime import datetime
import unittest
import mock
from werkzeug.test import Client as HttpClient
from resource_api.errors import ValidationError, DoesNotExist, Forbidden
from resource_api.schema import DateTimeField, IntegerField
from resource... | |
#! /usr/bin/env python
"""
Module with detection algorithms.
"""
from __future__ import division
from __future__ import print_function
__author__ = 'C. Gomez @ ULg'
__all__ = ['detection',
'mask_source_centers',
'peak_coordinates']
import numpy as np
from matplotlib import pyplot as plt
from s... | |
# -*- coding: utf-8 -*-
"""
Convert 3D DC/IP Data to 2D Lines
=================================
3D DC/IP surveys are frequently comprised of a set of 2D survey lines.
In this case, the 3D survey can be parsed into a list of
2D surveys; which can be imaged or inverted independently.
In this tutorial, we focus on the fo... | |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
# -*- coding: utf-8 -*-
"""
sphinx.util.docfields
~~~~~~~~~~~~~~~~~~~~~
"Doc fields" are reST field lists in object descriptions that will
be domain-specifically transformed to a more appealing presentation.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:license: BSD, see LI... | |
# 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... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
# Copyright (c) 2015 Intel Corporation
#
# 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 ... | |
# Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.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, modi... | |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | |
'''
Defines the manager for plugin layout and loading.
@author: Eitan Isaacson
@organization: IBM Corporation
@copyright: Copyright (c) 2006, 2007 IBM Corporation
@license: BSD
All rights reserved. This program and the accompanying materials are made
available under the terms of the BSD which accompanies this distri... | |
# Copyright 2017 Google LLC 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 ag... | |
import asyncio
import gc
import os
import tracemalloc
from contextlib import suppress
from functools import partial
import aiormq
import pamqp
import pytest
from aiomisc import awaitable
from aiormq.connection import DEFAULT_PORTS
from yarl import URL
import aio_pika
@pytest.fixture
async def add_cleanup(loop):
... | |
'''
***
Modified generic daemon class
***
Author: http://www.jejik.com/articles/2007/02/
a_simple_unix_linux_daemon_in_python/www.boxedice.com
License: http://creativecommons.org/licenses/by-sa/3.0/
Changes: 23rd Jan 2009 (David Mytton <david@boxedice.com>)
... | |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Comment.jurisdiction'
db.add_column('website_comment', 'jurisdiction',
... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Rhys Elsmore <me@rhys.io>
#
# 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 ... | |
# internal imports
import ctable_ext
# external imports
import numpy as np
import bcolz
from collections import namedtuple
import os
class ctable(bcolz.ctable):
def cache_factor(self, col_list, refresh=False):
"""
Existing todos here are: these should be hidden helper carrays
As in: not n... | |
from hashlib import md5
from django.conf import settings
from django.db import models
from django.core import paginator
from django.core.cache import cache
from djangae.contrib.pagination.decorators import _field_name_for_ordering
from djangae.db.backends.appengine.query import extract_ordering
# TODO: it would be n... | |
#!/usr/bin/env ipython
# dotfiles.venv.ipython_magics
from __future__ import print_function
"""
IPython ``%magic`` commands
* ``cd`` aliases
* ``ds`` (``dotfiles_status``)
* ``dr`` (``dotfiles_reload``)
Installation
--------------
.. code-block:: bash
__DOTFILES="${HOME}/-dotfiles"
ipython_profile="profile_... | |
__author__ = 'Copyright (c) 2013 Alan Yorinks All rights reserved.'
"""
Copyright (c) 2013-15 Alan Yorinks All rights reserved.
This program 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 3 of t... | |
#!/usr/bin/env python
# Copyright (c) 2013 GitHub, Inc.
# Copyright (c) 2013 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.
"""A tool to generate symbols for a binary suitable for breakpad.
Currently, the tool only suppo... | |
from __future__ import unicode_literals
import base64
import os
import posixpath
import re
from itertools import takewhile
from django.utils.encoding import smart_bytes, force_text
from pipeline.conf import settings
from pipeline.storage import default_storage
from pipeline.utils import to_class, relpath
from pipel... | |
import pytest
from libweasyl import staff
from libweasyl.models.helpers import CharSettings
from weasyl import profile, searchtag
from weasyl.error import WeasylError
from weasyl.test import db_utils
# Tag sets for testing
tags = searchtag.parse_tags("omega_ruby, alpha_sapphire, diamond, pearl")
tags_two = searchtag... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import throw, _
from frappe.utils import cstr
from frappe.model.document import Document
from jinja2 import TemplateSy... | |
from __future__ import division
from itertools import count
from math import ceil, sqrt
from functools import wraps
import bisect
import os
from toolz import (merge, partial, accumulate, unique, first, dissoc, valmap,
first, partition)
import toolz
from operator import getitem, setitem
from datetime import dat... | |
# -*- coding: utf-8 -*-
# Copyright 2020 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... | |
#!/usr/bin/env python
import os
import sys
import imp
import uuid
import argparse
import subprocess
# ==============================================================================
def _find_files(path, recursive=True):
found_files = []
for root, folders, files in os.walk(path):
for file_name in fi... | |
# -*- coding: utf-8 -*-
"""
flask.sessions
~~~~~~~~~~~~~~
Implements cookie based sessions based on itsdangerous.
:copyright: (c) 2016 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import uuid
import hashlib
from base64 import b64encode, b64decode
from datetime import dateti... | |
from common_fixtures import * # NOQA
from test_shared_volumes import add_storage_pool
def test_inactive_agent(super_client, new_context):
host = super_client.reload(new_context.host)
agent = host.agent()
c = new_context.create_container()
assert c.state == 'running'
agent = super_client.wait_su... | |
# Copyright (c) 2018 PaddlePaddle 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 app... | |
# 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... | |
"""
Glue's fitting classes are designed to be easily subclassed for performing
custom model fitting in Glue.
See the guide on :ref:`writing custom fit plugins <fit_plugins>` for
help with using custom fitting utilities in Glue.
"""
import numpy as np
from .simpleforms import IntOption, Option
__all__ = ['BaseFitte... | |
__author__ = 'leif'
from ifind.seeker.list_reader import ListReader
from ifind.search.engine import Engine
from ifind.search.response import Response
from ifind.search.exceptions import EngineConnectionException, QueryParamException
from whoosh.index import open_dir
from whoosh.query import *
from whoosh.qparser import... | |
# -*- coding: utf-8 -*-
#
# Copyright 2017 Open Targets
#
# 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... | |
# Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# pylint: disable=invalid-name
"""Tests for notifications for models with assignable mixin."""
from datetime import datetime
from freezegun import freeze_time
from mock import patch
from sqlalchemy import ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.