gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#
# The Python Imaging Library
# $Id$
#
# map CSS3-style colour description strings to RGB
#
# History:
# 2002-10-24 fl Added support for CSS-style color strings
# 2002-12-15 fl Added RGBA support
# 2004-03-27 fl Fixed remaining int() problems for Python 1.5.2
# 2004-07-19 fl Fixed gray/grey spelling issues
# 2... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from datetime import datetime
from hurry.filesize import size
from clint.textui import progress
from django.conf import settings
from django.core.management import call_command
from django.core.management.base import CommandError
from django.template.loader import... | |
# Copyright ClusterHQ Inc. See LICENSE file for details.
"""
Acceptance tests for flocker-plugin which can be run against the same
acceptance testing infrastructure (Vagrant, etc) as Flocker itself.
Eventually flocker-plugin should have unit tests, but starting with integration
tests is a reasonable first pass, since... | |
# coding: utf-8
"""
Cloudbreak API
Cloudbreak is a powerful left surf that breaks over a coral reef, a mile off southwest the island of Tavarua, Fiji. Cloudbreak is a cloud agnostic Hadoop as a Service API. Abstracts the provisioning and ease management and monitoring of on-demand clusters. SequenceIQ's Cloud... | |
from __future__ import unicode_literals
import difflib
import errno
import json
import os
import posixpath
import re
import socket
import sys
import threading
import unittest
import warnings
from collections import Counter
from copy import copy
from functools import wraps
from unittest.util import safe_repr
from djan... | |
"""
FROWNS LICENSE
Copyright (c) 2001-2003, Brian Kelley
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... | |
#!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... | |
from collections import defaultdict
import hashlib
from couchdbkit import ResourceConflict
from casexml.apps.stock.consumption import compute_consumption_or_default
from dimagi.utils.decorators.memoized import memoized
from dimagi.utils.parsing import json_format_datetime
from casexml.apps.case.exceptions import BadSta... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test REST interface
#
from test_framework.test_framework import BitcoinTestFramework
from test_fram... | |
# orm/interfaces.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
Contains various base classes used throughout the ORM.
Defines some key base... | |
#!/usr/bin/env python
from __future__ import print_function
################################################################################
#
# graph.py
#
#
# Copyright (c) 10/9/2009 Leo Goodstadt
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
from __future__ import unicode_literals
from datetime import datetime
from operator import attrgetter
from django.core.exceptions import FieldError
from django.test import TestCase, skipUnlessDBFeature
from .models import Author, Article, Tag, Game, Season, Player
class LookupTests(TestCase):
def setUp(self):... | |
from __future__ import with_statement
import os, time, socket
from mparts.manager import Task
from mparts.host import CAPTURE, DISCARD, STDERR
from mparts.util import *
__all__ = ["InitDB", "Postgres", "PGVal", "PGOptsProvider"]
USE_DEBUG_LIBC = False
class InitDB(Task):
__info__ = ["host", "dbdir"]
def _... | |
"""
Internal shared-state variables such as config settings and host lists.
"""
import os
import sys
from optparse import make_option
from fabric.network import HostConnectionCache
from fabric.version import get_version
#
# Win32 flag
#
# Impacts a handful of platform specific behaviors. Note that Cygwin's Python
... | |
import numpy as np
import shutil, time, math, itertools, os
import h5netcdf as h5py
import netCDF4 as nc
from tqdm import tqdm
import tensorflow as tf
import threading
import random
from colorama import Fore, Back, Style
from config import get_config
import sys
from folderDefs import *
import glob
class DataLoader:
... | |
# Copyright (c) 2015 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 required by applicable law or agreed to in writin... | |
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
__author__ = 'croxis'
from datetime import datetime
from io import BytesIO
import os
from queue import Empty
import random
from subprocess import PIPE
import time
import urllib.parse
import zipfile
import eventlet
from eventlet import Queue
from eventlet.green.subprocess import Popen
from flask import make_response, ... | |
import numba
import numpy as np
def initialize():
pass
@numba.njit
def make_rbnimon():
rrange = np.arange(9.0)
rbinom = np.zeros((9, 9))
for n in range(9):
for m in range(9):
if m > n:
rbinom[n, m] = 1
else:
rbinom[n, m] = np.prod(rran... | |
#!/usr/bin/env python
# Copyright 2011 The Closure Linter 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
#
#... | |
"""Platform that supports scanning iCloud."""
import logging
import os
import random
from pyicloud import PyiCloudService
from pyicloud.exceptions import (
PyiCloudException,
PyiCloudFailedLoginException,
PyiCloudNoDevicesException,
)
import voluptuous as vol
from homeassistant.components.device_tracker i... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# Copyright (c) 2013-2016 Christian Geier et al.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, ... | |
# 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... | |
# Copyright (c) 2016 GigaSpaces Technologies Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | |
# Copyright 2021 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import abc
import subprocess
import jinja2
import tempfile
import datetime
import logging
import typing
import os
import pyautogui
from AppKit import NSBundl... | |
import re
from clang.cindex import CursorKind
from util import trim
semicolon = ';'
open_paren = '('
close_paren = ')'
const_token = 'const'
open_brace = '{'
close_brace = '}'
open_bracket = '<'
close_bracket = '>'
comma = ','
brackets = [open_paren, close_paren, open_brace, close_brace]
def get_tokens(tu, cursor):... | |
# Copyright 2016 Red Hat, Inc
# Copyright 2017 Rackspace Australia
#
# 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
#
# Unles... | |
"""Univariate features selection."""
# Authors: V. Michel, B. Thirion, G. Varoquaux, A. Gramfort, E. Duchesnay.
# L. Buitinck, A. Joly
# License: BSD 3 clause
import numpy as np
import warnings
from scipy import special, stats
from scipy.sparse import issparse
from ..base import BaseEstimator
from ..prepr... | |
#!/usr/bin/python
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Simple script to be run inside the chroot. Used as a fast approximation of
emerge-$board autotest-all, by simply rsync'ing cha... | |
import inspect # This might get nasty.
# Hope my future me does not have to regret this xD
import copy
import itertools
from core.expression import BaseExpression, Sequence
import core.exceptions as myexc
from core.TOS import _TOS as TOS
class _Eval( object ):
def __init__( self, to_eval ):
... | |
#!/bin/py
#
# Integrate exodus II file in space
#
import sys
import glob
#
# need vtk environment to read EXOII
#
try:
import vtk
except ImportError:
sys.stderr.write("Error: Can't find the file 'vtk.py'...\n")
sys.stderr.write("Did you invoke with pvpython?\n")
sys.stderr.write("Is the paraview modu... | |
from typing import Tuple
from ..base import ParametrizedValue
from ..utils import listify
if False: # pragma: nocover
from .routing_modifiers import Modifier # noqa
class Socket(ParametrizedValue):
opt_key = ''
args_joiner = ','
def __init__(self, address, *, bound_workers=None, modifier=None):... | |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
float_or_none,
int_or_none,
)
class LimelightBaseIE(InfoExtractor):
_PLAYLIST_SERVICE_URL = 'http://production-ps.lvp.llnw.net/r/PlaylistService/%s/%s/%s'
_API... | |
from __future__ import unicode_literals
import logging
from importlib import import_module
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.translation import ugettext as _
from djblets.siteconfig.models import SiteConfiguration
from paramiko.hostkeys import H... | |
#
# 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
# ... | |
"""
Utilities for generating random numbers, random sequences, and
random selections.
"""
# 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.
import random
import sys
import networkx as... | |
"""The tests for the Google Wifi platform."""
from datetime import datetime, timedelta
from http import HTTPStatus
from unittest.mock import Mock, patch
import homeassistant.components.google_wifi.sensor as google_wifi
from homeassistant.const import STATE_UNKNOWN
from homeassistant.setup import async_setup_component
... | |
#!/usr/bin/python3
"""
Re-write "gps_win.pl" to "GPS.py"
by Qige <qigezhao@gmail.com>
2017.10.10-2017.10.13 compatible with u-blox6 GMOUSE GPS VK-162
2017.10.16 compatible with u-blox7, Stoton GPS+BDS GNSS100B
2017.10.17 final re-format
2017.10.17 read hex & ascii GPS Sensor data. not verified yet
Done:
* verify w... | |
import pytest
from codecs import decode, encode
from six import text_type
from springfield import fields, Entity
def test_slug():
"""
Assure that slugs are generated properly
"""
slugify = fields.SlugField().adapt
for input, expect in [
('01 HDR test', '01-hdr-test'),
('--&*$#(8$j... | |
#!/usr/bin/env python
"""
This is the top level script that runs "commands" for Wavefront.
In the longer term, the INSTALLED_COMMANDS constant should be dyanmically
generated from the commands currently installed.
"""
from __future__ import print_function
import ConfigParser
import importlib
import logging
import log... | |
import numpy as NP
from astropy.io import fits
from astropy.io import ascii
import progressbar as PGB
import interferometry as RI
import ipdb as PDB
rootdir = '/data3/t_nithyanandan/'
# rootdir = '/data3/MWA/lstbin_RA0/NT/'
filenaming_convention = 'new'
# filenaming_convention = 'old'
project_MWA = False
project_LS... | |
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# 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... | |
#!/usr/bin/env python
"""
Parse training log
Evolved from parse_log.sh
"""
import os
import re
import extract_seconds
import argparse
import csv
from collections import OrderedDict
def parse_log(path_to_log):
"""Parse log file
Returns (train_dict_list, test_dict_list)
train_dict_list and test_dict_lis... | |
import json
import logging
import os
import re
from cerberus import Validator
from query_dsl import dsl as query_dsl
from schema import entity_types
logger = logging.getLogger('grafanizer.query')
# Dictionary to save queries. Should be updated with functions from
# this module.
_QUERIES = {}
class QueryResult(ob... | |
# Copyright (C) 2014,2015 VA Linux Systems Japan K.K.
# Copyright (C) 2014,2015 YAMAMOTO Takashi <yamamoto at valinux co jp>
# 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 t... | |
from collections.abc import Iterable
from multiprocessing import Pool
import warnings
import tempfile
import numpy as np
import scipy
from scipy import special
import scipy.signal
from astropy import log
from astropy.table import Table
import matplotlib.pyplot as plt
try:
from tqdm import tqdm as show_progress
ex... | |
import csv
import datetime
import numpy as np
import os
import random
import time
from math import ceil, floor
from numpy.random import randint
from plot_data import data_plotter
from plot_lattice import lattice_plotter
from plot_plasmids import plasmid_plotter_wrapper
"""
TODO
-make conj rate nutrient dependent
-re... | |
import sys
import os
from math import sqrt
if len(sys.argv) != 2:
print "python generateSummaryStat.py [simpl-stat file]"
def getAvg(list):
total = 0
for x in list:
total += x
return (float(total)/float(len(list)))
def getStdDev(list):
avg = getAvg(list)
deviation_list = []
for x... | |
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 26 20:16:47 2019
@author: sayala
"""
#from load import *
def _sensorupsampletocellsbyInterpolation(df, cellsy):
'''
Function for when sensorsy in the results are less than cellsy desired.
Interpolates the dataframe.
#2DO: improve interpo... | |
"""Package for learning complete games from data
The API of this individual module is still unstable and may change as
improvements or refinements are made.
There are two general game types in this module: learned games and deviation
games. Learned games vary by the method, but generally expose methods for
computing ... | |
"""`main` is the top level module for your Flask application."""
# Import the Flask Framework and modules
from flask import Flask
from flask.ext.dropbox import Dropbox, DropboxBlueprint
from flask import url_for, redirect, request, render_template
from flask import g, request, session as flask_session, url_for
# Goog... | |
# -*- coding: utf-8 -*-
"""
The Struct is a convenient way to access data in a hash.
Makes it possible to load data from redis as an object and access the fields.
Then store changes back into redis.
"""
from six import add_metaclass
from json.encoder import JSONEncoder
from functools import wraps
from .pipelines import... | |
# 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... | |
# App.py
# Application stuff.
# The application is responsible for managing the main frame window.
#
# We also grab the FileOpen command, to invoke our Python editor
" The PythonWin application code. Manages most aspects of MDI, etc "
import win32con
import win32api
import win32ui
import sys
import string
import os
fro... | |
# :[diStorm64}: Python binding
# Copyright (c) 2009, Mario Vilas
# 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,
# ... | |
from __future__ import print_function
from datetime import datetime
import time
import json
def donotchange(fn):
return fn
class ComputeBaseType:
# users = {}
# tenants = {}
# : the dict for the flavors
flavors = {}
# : the dict for the images
images = {}
# : the dict for the ser... | |
#!/usr/bin/env python
# Copyright (c) 2006-2010 Tampere University of Technology
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rig... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
"""Simple HTTP client implementation based on the ``httplib`` module in the
standar... | |
#! /usr/bin/env python
# coding: utf-8
"""Pocketwalk tool runner."""
# [ Imports ]
# [ -Python ]
import os
import pathlib
import pty
import selectors
import subprocess
import sys
from pprint import pprint
# [ -Third Party ]
import pytoml as toml
from runaway import signals
# [ API ]
def get_tool_runner():
"""... | |
import sublime
from heapq import heapify, heappop, heapreplace
from lisp_highlight_configuration \
import ColorMode, RegionColor, Configuration
from types import Region, Scope, ColorableSpan
def color_scopes(scopes, config, cursors, supported_brackets):
"""Splits and transforms the scopes into colorable re... | |
#
# 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
# ... | |
from __future__ import unicode_literals
import re
import xml.etree.ElementTree
from .common import InfoExtractor
from ..compat import (
compat_urllib_request,
)
from ..utils import (
ExtractorError,
int_or_none,
)
class VevoIE(InfoExtractor):
"""
Accepts urls from vevo.com or in the format 'vevo... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
"""Robot module."""
from typing import Any, Optional, Sequence, Sized, Union
import attr
import numpy as np # type: ignore
import scipy.optimize # type: ignore
from pybotics.errors import PyboticsError
from pybotics.json_encoder import JSONEncoder
from pybotics.kinematic_chain import KinematicChain, MDHKinematicCha... | |
#!/usr/bin/env python
import sys
import nltk
import inflect
import re
import string
from textblob import TextBlob
import grammars as g
import util
import backup_answer as b
import parse as p
import sentence_edit_distance as edit
import np_util as n
extractor = p.SuperNPExtractor()
def compare_phrases(q_phrase, t_phr... | |
# Copyright 2014 Brocade Communications System, 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
#
#... | |
# 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... | |
#|############################################################################################################
#
# NAME:
# cameraFrustum
#
# AUTHOR:
# Kiel Gnebba (ksg@kielgnebba.com)
#
# VERSION:
# v. 1.0
#
# DESCRIPTION:
# This script will...
# - allow you to select differents types of ob... | |
# coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | |
##########################################################################
#
# Copyright (c) 2012, John Haddon. 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 so... | |
# Copyright The IETF Trust 2007, All Rights Reserved
# Portion Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
# All rights reserved. Contact: Pasi Eronen <pasi.eronen@nokia.com>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that t... | |
"""The tests for the TTS component."""
from unittest.mock import PropertyMock, patch
import pytest
import yarl
from homeassistant.components.demo.tts import DemoProvider
from homeassistant.components.media_player.const import (
ATTR_MEDIA_CONTENT_ID,
ATTR_MEDIA_CONTENT_TYPE,
DOMAIN as DOMAIN_MP,
MEDIA... | |
#
#
# Copyright (C) 2013 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and ... | |
#!/usr/bin/env python
# Copyright 2016 the V8 project authors. All rights reserved.
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""MB - the Meta-Build wrapper around GN.
MB is a wrapper script for GN ... | |
'''
Port of the R seg.lm.fit function.
'''
import statsmodels.api as sm
import numpy as np
import warnings
from copy import copy
class Lm_Seg(object):
"""
"""
def __init__(self, x, y, brk):
super(Lm_Seg, self).__init__()
self.x = x
self.y = y
self.brk = brk
# Ma... | |
import gtk
import dialog
import utils
import random
from fract4d import gradient
def show_gradients(parent,f):
GradientDialog.show(parent,f)
class GradientDialog(dialog.T):
def __init__(self,main_window,f):
global userPrefs
dialog.T.__init__(
self,
_("Gradients"),
... | |
# -*- coding: utf-8 -*-
"""
This module contains some utility functions for Streams.
You may wonder why do we need for such simple ``filter-*`` functions. The
reason is simple and this is about how :py:mod:`multiprocessing` and therefore
:py:class:`concurrent.futures.ProcessPoolExecutor` works. It can't pickle
lambdas... | |
gCategories = [
{'name':'All', 'desc': '*',
'sub': [
{'name':'Computers & Electronics', 'desc':'Computers, Laptops, tablets, Phones, Desktops, Computer Accessories',
'sub': [
{'name':'Laptops', 'desc':'Laptop computers'},
{'name':'Desktops', 'desc':'Desktop computers'},
{'name':'Mobile Phones',... | |
# A little helper module for plotting of broadbean objects
from typing import Tuple, Union, Dict, List
import numpy as np
import matplotlib.pyplot as plt
from broadbean import Sequence, BluePrint, Element
from broadbean.sequence import SequenceConsistencyError
# The object we can/want to plot
BBObject = Union[Seque... | |
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import fetch_olivetti_faces
from sklearn.utils.validation import check_random_state
from sklearn.ensemble import ExtraTreesRegressor
from sklearn.neighbors import KNeighborsRegressor
from sklearn.linear_model import LinearRegress... | |
import copy
class Pentomino(object):
def __init__(self, name, coos):
self.name = name
self.coos = coos
self.dim = len(coos[0])
def normalize_coo(self, coo):
a=self.coos[0][coo]
for i in self.coos :
if a > self.coos[i][coo] :
a... | |
#!/usr/bin/python
#
# This is a test-case-maintenance script that updates the jamtests
# repository with output that was created by the JAM policy weaver.
#
import sys
MAJOR = sys.version_info[0]
import os
import re
import subprocess
from subprocess import PIPE
import shutil
import time
import imp
from optparse impor... | |
# Lint as: python2, python3
# Copyright 2018 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | |
# ----------------------------------------------------------------------
# Ckan synchronization client
# Extracted from the API client in order to be able to insert
# progress reporting, etc.
# ----------------------------------------------------------------------
# ------------------------------ TODO ----------------... | |
from test.lib import fixtures, testing
from test.lib.testing import assert_raises_message
from sqlalchemy.sql import column, desc, asc, literal, collate
from sqlalchemy.sql.expression import _BinaryExpression as BinaryExpression, \
ClauseList, _Grouping as Grouping, \
_UnaryExpression as... | |
"""
data hash pandas / numpy objects
"""
import itertools
import numpy as np
from pandas._libs import hashing, tslib
from pandas.core.dtypes.generic import (
ABCMultiIndex,
ABCIndexClass,
ABCSeries,
ABCDataFrame)
from pandas.core.dtypes.common import (
is_categorical_dtype, is_list_like)
from panda... | |
from copy import copy
from sympy.tensor.array.dense_ndim_array import MutableDenseNDimArray
from sympy import Symbol, Rational, SparseMatrix
from sympy.matrices import Matrix
from sympy.tensor.array.sparse_ndim_array import MutableSparseNDimArray
def test_ndim_array_initiation():
arr_with_one_element = MutableDe... | |
# Copyright 2013: Mirantis 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 b... | |
# -*- coding: utf-8 -*-
# Copyright (C) 2012, Almar Klein, Ant1, Marius van Voorden
#
# This code is subject to the (new) BSD license:
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of s... | |
# Copyright (c) 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | |
# The 6.00 Word Game
import random
import string
VOWELS = 'aeiou'
CONSONANTS = 'bcdfghjklmnpqrstvwxyz'
HAND_SIZE = 7
SCRABBLE_LETTER_VALUES = {
'a': 1, 'b': 3, 'c': 3, 'd': 2, 'e': 1, 'f': 4, 'g': 2, 'h': 4, 'i': 1, 'j': 8, 'k': 5, 'l': 1, 'm': 3, 'n': 1, 'o': 1, 'p': 3, 'q': 10, 'r': 1, 's': 1, 't': 1, 'u': 1, ... | |
"""Tests for the HomeKit component."""
from __future__ import annotations
import asyncio
import os
from unittest.mock import ANY, AsyncMock, MagicMock, Mock, patch
from pyhap.accessory import Accessory
from pyhap.const import CATEGORY_CAMERA, CATEGORY_TELEVISION
import pytest
from homeassistant import config as hass... | |
import uuid
from datetime import datetime
from amqpstorm import Message
from amqpstorm.exception import AMQPMessageError
from amqpstorm.tests.utility import FakeChannel
from amqpstorm.tests.utility import TestFramework
class MessageTests(TestFramework):
def test_message_create_new_message(self):
body = s... | |
#!/usr/bin/python
import os
import re
from datetime import datetime, timedelta
from trac.tests.functional import *
from trac.util.datefmt import utc, localtz, format_date
class TestTickets(FunctionalTwillTestCaseSetup):
def runTest(self):
"""Create a ticket, comment on it, and attach a file"""
#... | |
'''
BSD 3-Clause License
Copyright (c) 2019, Donald N. Bockoven III
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 ... | |
import os
import logging
import numpy as np
import scipy.signal as signal
import scipy.ndimage as ndimage
import astropy.io.fits as pyfits
"""
About
=====
cosmics.py is a small and simple python module to detect and clean cosmic ray hits on images (numpy arrays or FITS), using scipy, and based on Pieter van Dokkum's... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.