text stringlengths 12 6.59M |
|---|
#!/usr/bin/env python
"""
untangle
Converts xml to python objects.
Author: Christian Stefanescu (http://0chris.com)
License: MIT License - http://www.opensource.org/licenses/mit-license.php
"""
from xml.sax import make_parser, handler
from StringIO import StringIO
class Element():
def __init__(self, name,... |
"""
Cross-validation dataset iterators.
"""
from collections import OrderedDict
import numpy as np
import warnings
try:
from sklearn.cross_validation import (KFold, StratifiedKFold, ShuffleSplit,
StratifiedShuffleSplit)
except ImportError:
warnings.warn("Could not impo... |
#
# This file is part of the PyMeasure package.
#
# Copyright (c) 2013-2019 PyMeasure Developers
#
# 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 limit... |
# -*- coding: utf-8 -*-
#######################################################################################
# #
# This file is part of the updater4pyi Project. #
# ... |
import unittest
import pysal
from pysal.core.IOHandlers.arcgis_dbf import ArcGISDbfIO
import tempfile
import os
import warnings
class test_ArcGISDbfIO(unittest.TestCase):
def setUp(self):
self.test_file = test_file = pysal.examples.get_path('arcgis_ohio.dbf')
self.obj = ArcGISDbfIO(test_file, 'r')
... |
import os
import sqlite3
import om10
import pandas as pd
import numpy as np
import gzip
import shutil
import copy
import json
from lsst.utils import getPackageDir
import lsst.sims.utils.htmModule as htm
from lsst.sims.photUtils import Bandpass, BandpassDict, Sed, getImsimFluxNorm
from lsst.sims.catUtils.supernovae impo... |
import getpass
from numbers import Number
import requests
from vcards import VCardParser
class OperationFailed(Exception):
def __init__(self, method, path, expected_code, actual_code, response_text):
self.method = method
self.path = path
self.expected_code = expected_code
self.actu... |
"""Utility class to inspect an extracted wheel directory"""
import configparser
import glob
import os
import stat
import zipfile
from typing import Dict, Optional, Set
import pkg_resources
import pkginfo
def current_umask() -> int:
"""Get the current umask which involves having to set it temporarily."""
mask... |
#!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 Isaku Yamahata <yamahata at private email ne jp>
# Based on openvswitch agent.
#
# Copyright 2011 Nicira Networks, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use ... |
# flake8: noqa
# Ignore pep8 linting for a while - the code matching the JS calculated field it will make it easier to find the difference.
# This decision was taken in August 2019 - by 2020 the code should have been in prod for some time - you can then fix all pep8
# WARNING: you CANNOT change the name of the CDE func... |
# Functions from the following SciPy document
# https://docs.scipy.org/doc/scipy/reference/sparse.linalg.html
# "NOQA" to suppress flake8 warning
from cupyx.scipy.sparse.linalg.solve import lsqr # NOQA
from cupyx.scipy.sparse.linalg._norm import norm # NOQA
|
"""mrecords
Defines a class of record arrays supporting masked arrays.
:author: Pierre Gerard-Marchant
:contact: pierregm_at_uga_dot_edu
:version: $Id$
"""
__author__ = "Pierre GF Gerard-Marchant ($Author$)"
__version__ = '1.0'
__revision__ = "$Revision$"
__date__ = '$Date$'
import sys
import types
import numpy
... |
import csv
import json
import os
import string
import time
import zipfile
from collections import defaultdict
from datetime import datetime, timedelta, date
from dateutil.parser import parse
from functools import wraps
from memoized import memoized
from tempfile import mkstemp
import attr
import operator
import pytz... |
#!/usr/bin/env python
#
# GAM
#
# Copyright 2015, 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 requi... |
import socket
import types
from dataclasses import dataclass
from typing import List, Optional
import pydantic
from nassl._nassl import WantReadError
from sslyze.json.scan_attempt_json import ScanCommandAttemptAsJson
from sslyze.plugins.plugin_base import (
ScanCommandResult,
ScanCommandImplementation,
Sc... |
import sys
stdout = sys.stdout
reload(sys)
sys.setdefaultencoding('utf-8')
sys.stdout = stdout
# import all extractors
from spacy_extractors import age_extractor as spacy_age_extractor
from spacy_extractors import social_media_extractor as spacy_social_media_extractor
from spacy_extractors import date_extractor as spac... |
import mimetypes
__author__ = 'nampnq'
import os
import urllib
import posixpath
import sys
import importlib
from flask import Flask, Response, render_template_string, abort, escape, render_template, redirect
app = Flask(__name__, template_folder=os.getcwd(), static_folder=None)
def translate_path(path):
"""T... |
"""Logic for line following."""
import sys
from time import time
from time import sleep
import numpy as np
import bot.lib.lib as lib
import bot.hardware.ir_hub as ir_hub_mod
import bot.driver.mec_driver as mec_driver_mod
import pid as pid_mod
import bot.hardware.color_sensor as color_sensor_mod
from error_cases impo... |
# import all extractors
from data_extractors import spacy_extractor
from data_extractors import landmark_extraction
from data_extractors import dictionary_extractor
from data_extractors import regex_extractor
from data_extractors import height_extractor
from data_extractors import weight_extractor
from data_extractors ... |
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2011, Luis Pedro Coelho <luis@luispedro.org>
# vim: set ts=4 sts=4 sw=4 expandtab smartindent:
#
# License: MIT. See COPYING.MIT file in the milk distribution
"""
================
Tree Classifier
================
A decision tree classifier
Implements Classification and Reg... |
# 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... |
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
SPEED: Module 05: Calculating Vapor Pressure Deficit.
Computes values of VPD for a 24 hour period at a meteorological station in the Dry Creek Experimental Watershed
Note: methods (and their specific names) included in this module are here to meet the listed requireme... |
#!/usr/bin/env python
import time
if __name__=="__main__":
start = time.time()
count = 0
a, b = 1, 2
sum = b # 1 is not even
while True:
c = a + b
if c > 4000000:
break
# if c < 100000:
# print c, " "
count += 1
if c % 2 == 0:
... |
"""
Generalized linear models currently supports estimation using the one-parameter
exponential families
References
----------
Gill, Jeff. 2000. Generalized Linear Models: A Unified Approach.
SAGE QASS Series.
Green, PJ. 1984. "Iteratively reweighted least squares for maximum
likelihood estimation, and some ... |
# Copyright (c) 2006-2009 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... |
"""
A top-level linear programming interface. Currently this interface only
solves linear programming problems via the Simplex Method.
.. versionadded:: 0.14.0
Functions
---------
.. autosummary::
:toctree: generated/
linprog
linprog_verbose_callback
linprog_terse_callback
"""
from __future__ import... |
import discord
from discord.ext import commands
from random import choice
class Bottlespin:
"""Spins a bottle and lands on a random user."""
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True, no_pm=True, alias=["bottlespin"])
async def spin(self, ctx, role):
... |
#__docformat__ = "restructuredtext en"
# ******NOTICE***************
# optimize.py module by Travis E. Oliphant
#
# You may copy and use this module as you see fit with no
# guarantee implied provided you keep this notice in all copies.
# *****END NOTICE************
# A collection of optimization algorithms. Version ... |
from django.conf import settings
from django.conf.urls import include
from django.contrib import admin
from django.contrib.sitemaps.views import sitemap
from django.template.response import TemplateResponse
from django.urls import path
from django.views.generic import TemplateView
from grandchallenge.algorithms.sitema... |
import numpy as np
from statsmodels.discrete.conditional_models import (
ConditionalLogit, ConditionalPoisson, ConditionalMlogit)
from statsmodels.tools.numdiff import approx_fprime
from numpy.testing import assert_allclose
import pandas as pd
def test_logit_1d():
y = np.r_[0, 1, 0, 1, 0, 1, 0, 1, 1, 1]
... |
#__docformat__ = "restructuredtext en"
# ******NOTICE***************
# optimize.py module by Travis E. Oliphant
#
# You may copy and use this module as you see fit with no
# guarantee implied provided you keep this notice in all copies.
# *****END NOTICE************
# A collection of optimization algorithms. Version ... |
"""
Test functions for genmod.families.links
"""
from statsmodels.compat.python import range
import numpy as np
from numpy.testing import assert_allclose, assert_equal
import statsmodels.genmod.families as families
# Family instances
links = families.links
logit = links.Logit()
inverse_power = links.inverse_power()
sq... |
"""
The MIT License (MIT)
Copyright (c) 2018 SML
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, publish,... |
"""Base class for sparse matrix formats using compressed storage."""
from __future__ import division, print_function, absolute_import
__all__ = []
from warnings import warn
import operator
import numpy as np
from scipy._lib.six import xrange, zip as izip
from .base import spmatrix, isspmatrix, SparseEfficiencyWarni... |
"""
Generalized linear models currently supports estimation using the one-parameter
exponential families
References
----------
Gill, Jeff. 2000. Generalized Linear Models: A Unified Approach.
SAGE QASS Series.
Green, PJ. 1984. "Iteratively reweighted least squares for maximum
likelihood estimation, and some ... |
from Tkinter import *
import ttk
import teamClass
import playerClass
class Application(Frame):
def __init__(self, master=None):
Frame.__init__(self, master)
self.teamList = []
self.pack()
self.loadData()
self.teamNames = []
for team in self.teamList:
sel... |
#__BEGIN_LICENSE__
# Copyright (c) 2015, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All rights reserved.
#
# The xGDS platform is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance ... |
import os
import numpy.testing as test
import numpy as np
from unittest import TestCase
from datetime import datetime
from dateutil.relativedelta import relativedelta
from PyFVCOM.read import FileReader
from PyFVCOM.utilities import StubFile
class FileReader_test(TestCase):
def setUp(self):
self.start... |
from django.test import TestCase, Client, RequestFactory
from django.contrib.auth.models import User
from ..models import Score, Report
# Create your tests here.
class CreateScoreTest(TestCase):
def setUp(self):
self.client = Client()
self.client.post('/report/user_register/',
... |
import scipy.constants
def get_constant(value):
"""
When `value` is a string, get the corresponding constant
from `scipy.constants`.
"""
if type(value) is str:
if hasattr(scipy.constants, value):
return getattr(scipy.constants, value)
else:
return scipy.const... |
#!/usr/bin/python2.7
# Copyright 2015 Google 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 ... |
import types
from decimal import Decimal
from datetime import date
from ..exceptions import ValidationError, ProgrammingError
class Campo(object):
field_name = None
size = None
required = None
base_type = None
default = None
def __init__(self, nombre, size, default=None, required=False):
... |
from bsym import Configuration, SymmetryOperation
import numpy as np
class ColourOperation( SymmetryOperation ):
"""
This class subclasses `SymmetryOperation`.
It defines a class of object for performing a compound operation on a
configuration.
First, a matrix transform applied to the configuratio... |
print('hello world')
print('I am a second print statement in PyCharm')
print('I am a thrid print statement in PyCharm')
print('I am a forth print statement in PyCharm')
print('I am a 5. print statement in PyCharm')
print('I am a 6. print statement in PyCharm')
print('I am a 7. print statement in PyCharm')
... |
#!/usr/bin/env python
#
# diff_tests.py: some basic diff tests
#
# Subversion is a tool for revision control.
# See http://subversion.tigris.org for more information.
#
# ====================================================================
# Copyright (c) 2000-2004 CollabNet. All rights reserved.
#
# This software... |
# -*- coding: utf-8 -*-
# Copyright 2015 OpenMarket Ltd
#
# 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 la... |
"""
********************************************************************************
* Name: collectworkspaces.py
* Author: Nathan Swain
* Created On: August 6, 2015
* Copyright: (c) Brigham Young University 2015
* License: BSD 2-Clause
********************************************************************************
""... |
#!/usr/bin/env python
#
# lock_tests.py: testing versioned properties
#
# Subversion is a tool for revision control.
# See http://subversion.tigris.org for more information.
#
# ====================================================================
# Copyright (c) 2005 CollabNet. All rights reserved.
#
# This softwa... |
# coding=utf-8
import os,re,sys,sublime
from unittest import TestCase
VERSION = sublime.version()
def loadfile(filename):
file = os.path.join(os.path.dirname(__file__), filename)
return open(file).read()
# for testing internal function
# if VERSION < '3000':
# # st2
# MarkdownTOC = sys.modules["Markd... |
# -*- coding: utf-8 -*-
# Copyright 2015 OpenMarket Ltd
#
# 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 la... |
#!/usr/bin/env python
import os
import re
from datetime import datetime, timedelta
from publicsuffix2 import PublicSuffixList
from moulinette.utils.process import check_output
from yunohost.utils.network import dig
from yunohost.diagnosis import Diagnoser
from yunohost.domain import domain_list, _build_dns_conf, _g... |
from core.models import TenantPrivilege
from plus import PlusSerializerMixin
from rest_framework import serializers
from services.vpn.models import VPNService, VPNTenant, VPN_KIND
from xos.apibase import XOSListCreateAPIView
if hasattr(serializers, "ReadOnlyField"):
# rest_framework 3.x
ReadOnlyField = seriali... |
# Copyright 2013 dotCloud 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 w... |
#!/usr/bin/env python3
from a_star import AStar
a_star = AStar()
from time import sleep
from math import pi
heartbeat = 0
wheel_diameter = 0.07
wheelbase = 0.141
ticks_per_output_revolution = 12*120
ticks_per_meter = ticks_per_output_revolution/(pi*wheel_diameter)
meters_per_tick = 1.0/ticks_per_meter
old_x_dist = 0... |
#!/bin/env python
from __future__ import print_function
import sys
import os
import time
from .. import mbusTime
class ToggleElement(object):
def __init__(self, mbusTimeFormat="microsHex"):
super().__init__()
self.time = mbusTime.MbusTime(val=0, mbusTimeFormat=mbusTimeFormat)
self.val = No... |
import os
import base64
from datetime import datetime
from xos.config import Config
from util.logger import Logger, logging
from observer.steps import *
from django.db.models import F, Q
from core.models import *
from django.db import reset_queries
from observer.ansible import *
import json
import time
import pdb
log... |
import numpy as np
from Utility import setAllArgs
# compute the gradient of an arbitrary function at a particular point
# using the definitoin, x must be an 1d array
def gradient(f, x, delta):
res = np.empty(np.shape(x)[0])
for i in range(np.shape(x)[0]):
deltaArr = np.zeros(np.shape(x)[0])
d... |
# Copyright 2013 dotCloud 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 w... |
from __future__ import print_function, unicode_literals
import six
import sqlparse
from collections import OrderedDict
from datetime import datetime
from django.core.management.base import BaseCommand
from django.db.migrations import RunSQL
from django.db.migrations.executor import MigrationExecutor
from enum import ... |
"""
Celery setup and wraper tasks to periodically update the database.
"""
import requests
import logging
import traceback
from celery import task
import time
import json
import os
from queue import Full
import shutil
from multiprocessing import Queue
from datetime import datetime, timedelta
import pytz
import yaml
fr... |
# coding=utf-8
import os,re,sys,sublime
from unittest import TestCase
VERSION = sublime.version()
def loadfile(filename):
file = os.path.join(os.path.dirname(__file__), filename)
return open(file).read()
# for testing internal function
# if VERSION < '3000':
# # st2
# MarkdownTOC = sys.modules["Markd... |
"""
Define a few commands
"""
from .meeseeksbox.utils import Session, fix_issue_body, fix_comment_body
from .meeseeksbox.scopes import admin, write
@write
def close(*, session, payload, arguments):
session.ghrequest('PATCH', payload['issue']
['url'], json={'state': 'closed'})
@write
def ... |
#!/usr/bin/env python
from __future__ import print_function
import sys, os, subprocess, distutils.spawn, argparse, re
class CompilerLookup:
''' Helper class that resolves the paths needed to run the compiler '''
def __init__(self, compilerArg, lliArg):
self.compiler = ''
self.lli = ''
... |
from wordfreq import (
word_frequency, available_languages, cB_to_freq, iter_wordlist,
top_n_list, random_words, random_ascii_words, tokenize,
half_harmonic_mean
)
from nose.tools import (
eq_, assert_almost_equal, assert_greater, assert_less, raises
)
def test_freq_examples():
# Stopwords are mos... |
# -*- coding: utf-8 -*-
import unittest
import neuroml
import neuroml.writers as writers
import sys
sys.path.insert(0,".")
import PyOpenWorm
from PyOpenWorm import *
import test_data as TD
import networkx
import rdflib
import rdflib as R
import pint as Q
import os
import subprocess
import tempfile
try:
import bs... |
# -*- coding: utf-8 -*-
from django import forms
from django.utils.translation import ugettext as _
from extended_choices import Choices
from dynamiq.forms.haystack import HaystackForm
from dynamiq.forms.constants import YES_NO
from dynamiq.forms.base import SearchOptionsForm, AdvancedFormset
from dynamiq.fields imp... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 3 10:41:34 2017
@author: leo
"""
import os
import sys
cwd = os.getcwd()
cwd = os.path.split((os.path.join(cwd, sys.argv[0])))[0]
DATA_PATH = os.path.join(cwd, 'data')
LINK_DATA_PATH = os.path.join(cwd, 'data/link')
NORMALIZE_DATA_PATH = os.pat... |
#!/usr/bin/env python
# Copyright (c) 2010, Code Aurora Forum. 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 .common import _gmsh_to_meshio_type as gmsh_to_meshio_type
from .common import _meshio_to_gmsh_type as meshio_to_gmsh_type
from .main import read, write
__all__ = ["read", "write", "gmsh_to_meshio_type"]
|
# -*- coding: utf-8 -*-
__version__ = '0.5-dev'
|
# -*- coding: utf-8 -*-
#
"""
I/O for Gmsh's msh format (version 4.1, as used by Gmsh 4.2.0), cf.
<http://gmsh.info/dev/doc/texinfo/gmsh.html#MSH-file-format-_0028version-4_0029>.
"""
from ctypes import c_ulong, c_double, c_int, c_size_t
from functools import partial
import logging
import struct
import numpy
from .co... |
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
from django_dbdev.backends.postgres import DBSETTINGS
BASE_DIR = os.path.dirname(
os.path.dirname(
os.path.dirname(
os.path.dirname(
os.path.dirname(__file__)))))
# SECURITY WARNING: keep the sec... |
# -*- coding: utf-8 -*-
#
"""
I/O for Gmsh's msh format (version 4.1, as used by Gmsh 4.2.0), cf.
<http://gmsh.info/dev/doc/texinfo/gmsh.html#MSH-file-format-_0028version-4_0029>.
"""
from ctypes import c_ulong, c_double, c_int, c_size_t
from functools import partial
import logging
import struct
import numpy
from .co... |
# Copyright 2012-2014 The Meson development team
# 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 agree... |
import datetime
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core.management import BaseCommand
from education.models import Role, UserProfile
from rapidsms.contrib.locations.models import Location, LocationType
from poll.models import Poll, Category
class Comma... |
import logging
from django.core.paginator import Paginator, InvalidPage
from django.contrib.auth.models import User
from django.conf.urls.defaults import url
from django.shortcuts import get_object_or_404
from django.http import Http404
from haystack.query import SearchQuerySet
from haystack.utils import Highlighter
... |
import json
import requests_mock
from tests import settings
def register_uris(requirements, requests_mocker):
"""
Given a list of required fixtures and an requests_mocker object,
register each fixture as a uri with the mocker.
:param base_url: str
:param requirements: dict
:param requests_m... |
from __future__ import print_function, division, absolute_import#, unicode_literals # not casa compatible
from builtins import bytes, dict, object, range, map, input#, str # not casa compatible
from future.utils import itervalues, viewitems, iteritems, listvalues, listitems
from io import open
import pickle
import os.... |
#!/usr/bin/env python
from socket import *
from flask import json
from gevent_zeromq import zmq
TCP_TERMINATOR = "$$$"
SUCCESS_FIELD = "success"
TCP_TIMEOUT = 86400.00
def callback_func(out_dict, extra_prms=None):
# connect to VISOR backend service
sock = socket(AF_INET, SOCK_STREAM)
try:
sock.co... |
#!/usr/bin/python
import serial, commands, sys, time
port = serial.Serial('/dev/ttyACM0', 9600, timeout=10)
serial.dsrdtr = False
time.sleep(0.5)
def gettelegram(cmd):
# flag used to exit the while-loop
abort = 0
# countdown counter used to prevent infinite loops
loops2go = 10
#
telegram = "NaN";
whil... |
from __future__ import print_function, division, absolute_import#, unicode_literals # not casa compatible
from builtins import bytes, dict, object, range, map, input#, str # not casa compatible
from future.utils import itervalues, viewitems, iteritems, listvalues, listitems
from io import open
import pickle
import os.... |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
# 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... |
# Copyright 2021 gRPC 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 or agreed to in writing... |
# HysteresisQuery.py
# MIT LICENSE 2016
# Shaun Harker
from Graph import *
from AlignmentGraph import *
from MonostableFixedPointQuery import *
from DoubleFixedPointQuery import *
from SingleGeneQuery import *
class HysteresisQuery:
"""
HysteresisQuery
A HysteresisQuery post-processes the result graph of a Si... |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
# Copyright 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... |
import cv2
import math
import os
BLACK = [0, 0, 0]
IMAGES_INPUT_FOLDER = "/home/bruno/Documents/AVA/nature2/photos/positive"
IMAGES_OUTPUT_FOLDER = "/home/bruno/Documents/AVA/nature_resized/photos/positive"
def resize(input_image, size):
height, width, channels = input_image.shape
if height > width:
r... |
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from .converters import resolve_identifier, get_identifier, convert_iterable_to_prefs
from .filtering import calculate_similar_items, get_recommended_items
from .storages import DummyStorage, DjangoOrmStorage
class Recommendation... |
"""
This app doesn't have any models, per se, but the following ``R`` class is a
lightweight wrapper around Redis.
"""
import datetime
import redis
from django.conf import settings
from django.template.defaultfilters import slugify
class R(object):
def __init__(self, *args, **kwargs):
self.host = getat... |
import fitsio
import numpy as np
class Background:
""" docstring """
def __init__(self, filename, scale=1.0):
self._filename = filename
self._read_background(confdict)
def _read_background(self, confdict):
if confdict is None:
pass # populate dictionary
# the... |
from fontParts.base.errors import FontPartsError
from fontParts.base.base import (
BaseObject,
TransformationMixin,
InterpolationMixin,
SelectionMixin,
IdentifierMixin,
dynamicProperty,
reference
)
from fontParts.base import normalizers
from fontParts.base.compatibility import ContourCompati... |
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import itertools
def version():
version_py = os.path.join(os.path.dirname(__file__), "zulip", "__init__.py")
with open(version_py) as in_handle:
version_line = next(itertools.dropwhile(lambda x... |
"""Calculate the area of a glyph."""
from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
from fontTools.pens.basePen import BasePen
class AreaPen(BasePen):
def __init__(self, glyphset=None):
BasePen.__init__(self, glyphset)
self.value = 0
def _moveTo(self, p0):
... |
"""TurboGears project related information"""
version = "2.0b2"
description = "Next generation TurboGears built on Pylons"
long_description="""
TurboGears brings together a best of breed python tools
to create a flexible, full featured, and easy to use web
framework.
TurboGears 2 provides and integrated and well tested... |
# EasyShells Module - API for easier Shell Model Construction in Salome
# SurfaceExtraction.py : Module for extraction groups of certain faces
#
# Copyright (C) 2013 Stefan Reiterer - stefan.reiterer@magnasteyr.com or maldun.finsterschreck@gmail.com
#
# This library is free software; you can redistribute it and/or
# m... |
# -*- coding: utf-8 -*-
"""
Font Bakery CheckRunner is the driver of a font bakery suite of checks.
Separation of Concerns Disclaimer:
While created specifically for checking fonts and font-families this
module has no domain knowledge about fonts. It can be used for any kind
of (document) checking. Please keep it so.... |
"""
----------
theia.rdbs
----------
Relational database EventStore implementation.
"""
import re
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, String, Float, create_engine, desc
from sqlalchemy.orm import sessionmaker
from theia.storeapi import (EventStore,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.