gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# platonic.py
# run "python platonic.py help" for help/instructions on running the program.
from math import sin, cos, asin, acos, pi
from numpy import *
import itertools
import sys
from sys import argv
import os.path
class platonic:
def __init__(self,name,scale=1):
self.name = name.lower() # keep name
... | |
import math
import Queue
import copy
from BitStream.bitStream import BitStream
from FrequencyCounter.freqCounter import FreqCounter
def numToBytearray(num):
result = bytearray()
while num > 0:
result.insert(0, num % 256)
num /= 256
return result
def BinaryToUnary(num):
return 2... | |
#Vasileios: legacy ch_api of optin_manager. This worked with Expedient,
#so we keep the function calls and modify the internal code
#in order to utilize FOAM functionality
#legacy django imports
'''
from expedient.common.rpc4django import rpcmethod
from django.contrib.auth.models import User
from decorator import dec... | |
################################################################
# Ryu Application:
# App for testing switch's features and capabilities
# - Orginal code: from Ryu repository
# - Modified version: Hyojoon Kim (joonk@princeton.edu)
################################################################
###################... | |
from django.db.models import Manager
from django.db.models import Sum
from django.db.models.query import RawQuerySet
from le_utils.constants import content_kinds
from rest_framework import serializers
from kolibri.core.content.models import ChannelMetadata
from kolibri.core.content.models import ContentNode
from kolib... | |
#!/usr/bin/env python
#
# 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
# "... | |
# -*- coding: utf-8 -*-
"""
This module provides a web-based GUI interface to tarbell.
"""
import traceback
import os
import json
import multiprocessing
import imp
import time
import requests
import re
import sh
import shutil
import tempfile
import StringIO
from .utils import puts
from flask import Flask, request, ren... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
PyCOMPSs Testbench
========================
"""
# Imports
import unittest
from pycompss.api.api import compss_wait_on
from pycompss.api.task import task
class testMultiReturnIntInstanceMethods(unittest.TestCase):
@task(returns=2)
def argTask(self, *args):
... | |
"""
Open ugrid-ish subdomains and approximate a global domain
Currently this is pretty slow, due to the add_grid() step.
The ghost-cell handling is also very basic, and does not
properly distinguish ghost cells along land boundaries.
TODO: handling isel for partitioned dimensions
handling DFM output with FlowLink ... | |
# -*- coding: utf-8 -*-
"""This file contains classes used for preprocessing in plaso."""
import abc
from dfwinreg import registry_searcher
from artifacts import definitions as artifact_definitions
from dfvfs.helpers import file_system_searcher
from plaso.lib import errors
class ArtifactPreprocessorPlugin(object)... | |
# Copyright (c) 2010-2011 OpenStack, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | |
# Copyright (c) 2012-2021 Manfred Moitzi
# License: MIT License
import pytest
from ezdxf.math import Vec3, BSpline, close_vectors
from ezdxf.math.bspline import normalize_knots, subdivide_params, linspace
DEFPOINTS = [
(0.0, 0.0, 0.0),
(10.0, 20.0, 20.0),
(30.0, 10.0, 25.0),
(40.0, 10.0, 25.0),
(50... | |
# -*- coding: utf-8 -*-
"""Abstract interface to .tacacsrc credentials file.
Designed to interoperate with the legacy DeviceV2 implementation, but
provide a reasonable API on top of that. The name and format of the
.tacacsrc file are not ideal, but compatibility matters.
"""
__author__ = 'Jathan McCollum, Mark Thom... | |
# Copyright 2016 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.
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import collections
try:
from itertools impor... | |
"""Arcam media player."""
import logging
from arcam.fmj import SourceCodes
from arcam.fmj.state import State
from homeassistant import config_entries
from homeassistant.components.media_player import BrowseMedia, MediaPlayerEntity
from homeassistant.components.media_player.const import (
MEDIA_CLASS_DIRECTORY,
... | |
import datetime
import re
import uuid
from django.conf import settings
from django.db.backends.base.operations import BaseDatabaseOperations
from django.db.backends.utils import strip_quotes, truncate_name
from django.utils import timezone
from django.utils.encoding import force_bytes
from .base import Database
from ... | |
from functools import reduce
from dateutil.parser import parse
from django.db.models import Case
from django.db.models import Count
from django.db.models import F
from django.db.models import IntegerField
from django.db.models import Manager
from django.db.models import Max
from django.db.models import Sum
from django... | |
# Copyright 2014 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 time
from telemetry.page.actions.javascript_click import ClickElementAction
from telemetry.page.actions.navigate import NavigateAction
from telemetry... | |
# pylint: disable=W0232,R0903
"""Module for interacting with postgres database."""
from sqlalchemy import create_engine, MetaData
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship, backref, scoped_session, sessionmaker
__engine__ = create_engine(
'postgresql://postgr... | |
# Copyright 2014 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.
"""Fetches a copy of the latest state of a W3C test repository and commits.
If this script is given the argument --auto-update, it will also:
1. Upload a CL... | |
#!/usr/bin/python
# coding=utf-8
# Copyright 2012-2014 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 appl... | |
#!/usr/bin/env python
# Copyright (C) 2014, PAL Robotics S.L.
#
# 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 conditions and the... | |
"""Task runner"""
import sys
from multiprocessing import Process, Queue
from .exceptions import InvalidTask, CatchedException
from .exceptions import TaskFailed, SetupError, DependencyError, UnmetDependency
from .dependency import Dependency
from .control import ExecNode
# execution result.
SUCCESS = 0
FAILURE = 1
E... | |
"""Config flow for Plex."""
import copy
import logging
from aiohttp import web_response
import plexapi.exceptions
from plexapi.gdm import GDM
from plexauth import PlexAuth
import requests.exceptions
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components.http.view import HomeAs... | |
# 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 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Ticket.last_name'
db.delete_column(u'attendees_ticket', 'last_name')
# Deleting f... | |
# Copyright 2012 the V8 project authors. 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 conditi... | |
# Copyright 2014 Cloudera 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 writing, so... | |
# 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 ... | |
# Full implementation: http://sourceforge.net/projects/pynetwork/
class _GetterSetter(object):
def __init__(self, g, n1):
self._g = g
self._n1 = n1
def __setitem__(self, n2, arcw):
self._g.addArc(self._n1, n2, arcw)
def __getitem__(self, n2):
return self._g.getArcw(self._n1,... | |
# -*- coding: utf-8 -*-
import csv
from cStringIO import StringIO
from django.conf import settings
from django.core import mail
from django.core.cache import cache
from django.core.urlresolvers import reverse
from nose.tools import eq_
import mkt
import mkt.site.tests
from mkt.access.models import Group, GroupUser
f... | |
# 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... | |
"""This module defines utilities for accessing deeply nested properties.
Exported items:
Path -- Class representing an nbt path, inherits from `tuple`
InvalidPath -- Exception raised when creating an invalid nbt path
"""
__all__ = ["Path", "InvalidPath", "NamedKey", "ListIndex", "CompoundMatch"]
imp... | |
# 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... | |
"""Unit tests for the copy module."""
import copy
import copyreg
import weakref
from operator import le, lt, ge, gt, eq, ne
import unittest
from test import support
order_comparisons = le, lt, ge, gt
equality_comparisons = eq, ne
comparisons = order_comparisons + equality_comparisons
class TestCopy(unittest.TestCas... | |
from __future__ import print_function, unicode_literals
from future.builtins import open
import os
import re
import sys
from contextlib import contextmanager
from functools import wraps
from getpass import getpass, getuser
from glob import glob
from importlib import import_module
from posixpath import join
from mezza... | |
# The clearinghouse testlib must be imported first. We do this in case this
# module gets executed as a test to prevent it from "failing".
from clearinghouse.tests import testlib
import random
from clearinghouse.common.api import backend
from clearinghouse.common.api import lockserver
from clearinghouse.common.api i... | |
"""
Implementations for small services
Copyright 2015 BlazeMeter Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable l... | |
# Copyright 2016 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | |
"""Support for executing Docker containers using the Singularity 2.x engine."""
from __future__ import absolute_import
import os
import os.path
import re
import shutil
import tempfile
import sys
from distutils import spawn
from io import open # pylint: disable=redefined-builtin
from typing import Dict, List, MutableM... | |
#
# 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
# ... | |
###
# Copyright (c) 2002-2005, Jeremiah Fincher
# Copyright (c) 2009, James McCoy
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyr... | |
import datetime
import os
import uuid
from decimal import Decimal
import django
import pytest
from django.http import QueryDict
from django.utils import timezone
import rest_framework
from rest_framework import serializers
# Tests for field keyword arguments and core functionality.
# -------------------------------... | |
#
# Copyright (C) 2000-2008 greg Landrum
#
""" code for dealing with forests (collections) of decision trees
**NOTE** This code should be obsolete now that ML.Composite.Composite is up and running.
"""
import cPickle
import numpy
from rdkit.ML.DecTree import CrossValidate,PruneTree
class Forest(object):
"""a for... | |
import re
import math
ip = {
'hl': '(ip[0] & 0xf)',
'ecn': '(ip[1] & 0x2)',
'tl': 'ip[2:2]',
'ipid': 'ip[4:2]',
'df': '(ip[6] & 0x40)',
'zero': '(ip[6] & 0x80)',
'ttl': 'ip[8]',
}
ip6 = {
'pl': '(ip6[4:2])',
'ttl': '(ip6[7])',
'flow': '(ip6[2:2])',
}
tcp = {
'win_... | |
"""Lights on Zigbee Home Automation networks."""
from __future__ import annotations
from collections import Counter
from datetime import timedelta
import enum
import functools
import itertools
import logging
import random
from typing import Any
from zigpy.zcl.clusters.general import Identify, LevelControl, OnOff
from... | |
"""Support for ZHA covers."""
import asyncio
import functools
import logging
from typing import List, Optional
from zigpy.zcl.foundation import Status
from homeassistant.components.cover import (
ATTR_CURRENT_POSITION,
ATTR_POSITION,
DEVICE_CLASS_DAMPER,
DEVICE_CLASS_SHADE,
DOMAIN,
CoverEntity... | |
# Copyright 2013 NEC Corporation.
# 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... | |
#!/usr/bin/env python2.7
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this lis... | |
import datetime
from django.conf import settings
from django.core.exceptions import FieldError
from django.db.backends.utils import truncate_name
from django.db.models.constants import LOOKUP_SEP
from django.db.models.query_utils import select_related_descend, QueryWrapper
from django.db.models.sql.constants import (C... | |
# Copyright (c) 2008, Media Modifications Ltd.
# 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, pub... | |
"""
Printing tools.
"""
import sys
from typing import (
Any,
Callable,
Dict,
Iterable,
List,
Mapping,
Optional,
Sequence,
Sized,
Tuple,
TypeVar,
Union,
)
from pandas._config import get_option
from pandas.core.dtypes.inference import is_sequence
EscapeChars = Union[Map... | |
#!/usr/bin/env python
# import libraries
import os
import sys
import datetime
import time
import argparse
# import constants from stat library
from stat import * # ST_SIZE ST_MTIME
# format date method
def formatDate(dt):
return dt.strftime("%a, %d %b %Y %H:%M:%S +0000")
# get the item/@type based on file exten... | |
import IPython
from IPython.display import display, HTML, Javascript
import os
import fnmatch
from collections import OrderedDict
import uuid
import itertools
from .file import FileBase
from .render import render_table, render_preamble, render_refresh_button, render_url, rich_string
import radiopadre
from radiopadre... | |
"""Notify platform tests for mobile_app."""
from datetime import datetime, timedelta
from unittest.mock import patch
import pytest
from homeassistant.components.mobile_app.const import DOMAIN
from homeassistant.exceptions import HomeAssistantError
from homeassistant.setup import async_setup_component
from tests.comm... | |
from __future__ import division, unicode_literals, print_function
import sys
import os
import copy
import operator
import traceback
from functools import cmp_to_key
import pandas as pd
import numpy as np
import six
if six.PY3:
xrange = range
from itertools import groupby, combinations
from collections import Or... | |
import sys
import string
import binwalk.core.common as common
from binwalk.core.compat import *
from binwalk.core.module import Module, Option, Kwarg
class HexDiff(Module):
COLORS = {
'red': '31',
'green': '32',
'blue': '34',
}
SEPERATORS = ['\\', '/']
DEFAULT_BLOCK_SIZE = 16... | |
#
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | |
#!/usr/bin/python
#
# File : gen_appbin.py
# This file is part of Espressif's generate bin script.
#
# ESPRSSIF MIT License
#
# Copyright (c) 2016 <ESPRESSIF SYSTEMS (SHANGHAI) PTE LTD>
#
# Permission is hereby granted for use on ESPRESSIF SYSTEMS ESP8266 only, in which case,
# it is free of charge, to any person ob... | |
import tensorflow as tf
import argparse
import numpy as np
from copy import deepcopy
import time
import pandas as pd
import sys, os
from collections import defaultdict
from utils import TextLoader
tf.set_random_seed(99)
class Model():
def __init__(self, config):
self._result_path = config.result_path
... | |
# 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... | |
# -*- encoding: utf-8 -*-
#
# Author: John Tran <jhtran@att.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/LICENSE-2.0
#
# Unless required by app... | |
#
# 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 us... | |
# Copyright (c) 2009 StudioNow, Inc <patrick@studionow.com>
#
# 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... | |
"""Cgroup management service."""
import errno
import logging
import os
import select
from .. import cgroups
from .. import cgutils
from .. import logcontext as lc
from .. import sysinfo
from .. import utils
from .. import supervisor
from ._base_service import BaseResourceServiceImpl
_LOGGER = lc.ContainerAdapter(l... | |
# Copyright 2012 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 requ... | |
import unittest
import Mariana.layers as ML
import Mariana.initializations as MI
import Mariana.decorators as MD
import Mariana.costs as MC
import Mariana.regularizations as MR
import Mariana.scenari as MS
import Mariana.activations as MA
import theano.tensor as tt
import numpy
def getMLP(self, nbInputs=2, nbClasses... | |
"""Script to ensure a configuration file exists."""
import argparse
import logging
import os
from collections import OrderedDict
from glob import glob
from platform import system
from unittest.mock import patch
from typing import Dict, List, Sequence
import homeassistant.bootstrap as bootstrap
import homeassistant.co... | |
# file eulxml/xpath/parserules.py
#
# Copyright 2010,2011 Emory University Libraries
#
# 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... | |
"""
ImageViewer class for viewing and interacting with images.
"""
import numpy as np
from ... import io, img_as_float
from ...util.dtype import dtype_range
from ...exposure import rescale_intensity
from ..qt import QtWidgets, Qt, Signal
from ..widgets import Slider
from ..utils import (dialogs, init_qtapp, figimage, ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
"""
import re
import cgi
__all__ = ['highlight']
class Highlighter(object):
"""
Do syntax highl... | |
# 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 ... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# called from wnf.py
# lib/wnf.py --install [rootpassword] [dbname] [source]
from __future__ import unicode_literals
import os, json
import frappe
import frappe.database
import getpass
import importlib
from frappe.mod... | |
# 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
# d... | |
import logging
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from django.db import connections, router, transaction
from django.db.models import Manager, Q
from django.db.models.query import QuerySet
from djblets.db.managers import ConcurrencyManager
from reviewboar... | |
# -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function
import operator
import os
import sys
from collections import defaultdict
from itertools import chain
from pipenv.vendor import attr
import six
from cached_property import cached_property
from ..compat import Path, fs_str
from ..environment... | |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Script that reads omahaproxy and gsutil to determine version of SDK to put
in manifest.
"""
# pylint is convinced the email mod... | |
import re
from corehq.apps.app_manager.const import USERCASE_TYPE
from corehq.apps.app_manager.exceptions import LocationXpathValidationError
from django.utils.translation import ugettext as _
def dot_interpolate(string, replacement):
"""
Replaces non-decimal dots in `string` with `replacement`
"""
pa... | |
"""
Decorators for labeling and modifying behavior of test objects.
Decorators that merely return a modified version of the original
function object are straightforward. Decorators that return a new
function object need to use
::
nose.tools.make_decorator(original_function)(decorator)
in returning the decorator, i... | |
UIList = []
tab = {}
UIList.append(tab)
tab['name'] = 'common'
tab['entries'] = []
entry = {}
entry['name'] = 'None'
entry['type'] = 'frame'
tab['entries'].append(entry)
entry = {}
entry['name'] = 'white_point'
entry['type'] = 'enum'
entry['displayName'] = 'White Point'
entry['default'] = 'D50'
entry['addInfo'] = 'User... | |
# 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.
from __future__ import print_function
# TODO(https://crbug.com/1262296): Update this after Python2 trybots retire.
# pylint: disable=deprecated-module
import... | |
import collections
import logging
import math
from tool import Tool
logger = logging.getLogger('app.pipette')
class Pipette(Tool):
"""Representation of a pipette on the robot head
Class for holding a pipette's calibrated values, and includes functions
for mapping locations and such.
Each pipette i... | |
import os
import threading
import warnings
import keras.backend as K
import numpy as np
from keras.preprocessing.image import load_img, img_to_array, array_to_img, NumpyArrayIterator, flip_axis, \
random_channel_shift, apply_transform, transform_matrix_offset_center
from scipy import linalg, random
from six.moves ... | |
from __future__ import unicode_literals
from . import __version__ as app_version
app_name = "frappe"
app_title = "Frappe Framework"
app_publisher = "Frappe Technologies"
app_description = "Full stack web framework with Python, Javascript, MariaDB, Redis, Node"
app_icon = "octicon octicon-circuit-board"
app_color = "o... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import re
import copy
from collections import OrderedDict
from . import core
from astropy.table import Table
from . import cparser
from astropy.utils.misc import _set_locale
class FastBasic(metaclass=core.MetaBaseReader):
"""
This class is inte... | |
# -*- coding: utf-8 -*-
"""
Helper functions used in views.
"""
from calendar import day_abbr
from csv import reader
from datetime import datetime
from functools import wraps
from json import dumps
from logging import getLogger
from threading import Lock
from flask import Response
from lxml import etree
from presence... | |
from importlib import import_module
import os
from fabric.api import put, run, sudo, settings, env, local
from shuttle.hooks import hook
from shuttle.services.s3 import S3, get_aws_access_key
from shuttle.shared import *
def reboot():
"""Reboot the server."""
with hook('reboot'):
sudo('shutdown -r n... | |
import pytz
from registrasion.models import conditions
from registrasion.controllers.product import ProductController
from symposion.conference import models as conference_models
from symposion.proposals import models as proposal_models
from symposion.reviews.models import promote_proposal
from symposion.schedule imp... | |
import pickle
import pylab as pl
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import optparse
def not_within_range(element, list):
for item in list:
if np.allclose(element, item, 0, 20):
return False
return True
def save_data(filename, data):
print("Saving data... | |
__version__ = '1.0.3.2'
__author__ = 'Vi Grey (https://vigrey.com)'
def get_centres(mem):
centres = []
for i in range(6):
centres.append(mem[i][4])
return centres
def get_full_mem(mem):
full_mem = []
for x in mem:
for i in x:
full_mem.append(i)
return full_mem
d... | |
import sys
from compass import CompassOverlay
from raycaster import TooFarException
import raycaster
import keys
import pygame
import math
import copy
import numpy
from config import config
import frustum
import logging
import glutils
import mceutils
import itertools
import pymclevel
from math import isnan
from datet... | |
"""
@package mi.dataset.parser.parad_j_cspp
@file marine-integrations/mi/dataset/parser/parad_j_cspp.py
@author Joe Padula
@brief Parser for the parad_j_cspp dataset driver
Release notes:
initial release
"""
__author__ = 'Joe Padula'
__license__ = 'Apache 2.0'
import re
import numpy
from mi.core.log import get_logg... | |
"""
Swaggy Jenkins
Jenkins API clients generated from Swagger / Open API specification # noqa: E501
The version of the OpenAPI document: 1.1.2-pre.0
Contact: blah@cliffano.com
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from swaggyjenkins.m... | |
from __future__ import unicode_literals, division, absolute_import
import logging
import os
import re
import shutil
import zipfile
from flexget import plugin
from flexget.entry import Entry
from flexget.event import event
from flexget.utils.template import render_from_entry, RenderError
try:
import rarfile
except... | |
"""
izh.py
Python/NEURON GUI for the different celltypes of Izhikevich neuron (versions from 2 publications).
* 2003 Izhikevich artificial neuron model from
EM Izhikevich "Simple Model of Spiking Neurons"
IEEE Transactions On Neural Networks, Vol. 14, No. 6, November 2003 pp 1569-1572
* 2007 Izhikevich artificial ... | |
import deep_architect.utils as ut
def get_search_folderpath(folderpath, search_name):
return ut.join_paths([folderpath, search_name])
def get_search_data_folderpath(folderpath, search_name):
return ut.join_paths(
[get_search_folderpath(folderpath, search_name), "search_data"])
def get_all_evaluati... | |
# PyAlgoTrade
#
# Copyright 2011-2015 Gabriel Martin Becedillas Ruiz
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# Copyright (c) 2012 NTT DOCOMO, INC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from abc import abstractmethod, ABCMeta
from qsrlib_qsrs.qsr_dyadic_abstractclass import QSR_Dyadic_Abstractclass
from qsrlib_io.world_qsr_trace import *
from exceptions import Exception, AttributeError
import numpy as np
# todo /use/bin/env python not needed here.
class ... | |
from __future__ import print_function, unicode_literals, absolute_import
import hashlib
from os import urandom
import sys
from struct import Struct
if sys.version_info >= (3, 0):
unicode = str
short_map = map
else:
from itertools import imap as short_map
try:
from bytesop import op_xor
except ImportE... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.