gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Copyright (c) 2013-2016 Cisco Systems, 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 a... | |
# import demistomock as demisto
from CommonServerPython import *
from datetime import datetime
import urllib3
import dateparser
import traceback
from typing import Any, Dict, List, Optional, Tuple, cast, Iterable
urllib3.disable_warnings()
''' CONSTANTS '''
DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
MAX_EVENTS_TO_FETCH = 5... | |
# (C) Datadog, Inc. 2010-2017
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
from urlparse import urljoin
import os
# 3rd party
import mock
import json
from tests.checks.common import AgentCheckTest, Fixtures
# ID
APP_ID = 'application_1453738555560_0001'
APP_NAME = 'WordCount'... | |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | |
import pygame
from pygame.locals import *
from .const import *
from . import widget
from . import table
from . import basic
from . import pguglobals
from .errors import PguError
_SLIDER_HORIZONTAL = 0
_SLIDER_VERTICAL = 1
class _slider(widget.Widget):
_value = None
def __init__(self,value,orient,min,max,siz... | |
#!/usr/bin/env python
# missing tests:
# DONE: vv time offset (needs root)
# DONE: NTP offset is small
# DONE: all 8 disks are present
# DONE: disks are not too full (rtime?)
# DONE: modules are in open state ready to record (dplane status? should work)
# DONE: input stream is sensible
# DONE: GPS PPS of... | |
import logging
import sys
import time
from copy import deepcopy
from datetime import datetime
from re import search
import asyncio
import types
from concurrent.futures import ThreadPoolExecutor
from importlib import import_module
from mbot.config import Config
from mbot.exceptions import ShuttingDown
from mbot.middle... | |
from django.conf import settings
from django.contrib.auth import authenticate
from django.contrib.auth.models import User, Group, Permission, AnonymousUser
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase
from .models import UserPermissionList, \
GroupPermissionList
from... | |
import threading
from copy import deepcopy
import numpy as np
import cv2
from cv2 import cv
from cv_bridge import CvBridge
import rospy
import baxter_interface
from geometry_msgs.msg import (
PolygonStamped,
)
from sensor_msgs.msg import (
Image,
)
from std_msgs.msg import (
String,
)
class LPVision(obje... | |
import os
import random
import storjnode
from storjnode.common import STORJ_HOME
DEFAULT_SHARD_SIZE = 1024 * 1024 * 128 # 128M
DEFAULT_STORE_PATH = os.path.join(STORJ_HOME, "store")
DEFAULT_STORE_CONFIG = {
DEFAULT_STORE_PATH: {"limit": 0, "use_folder_tree": False}
}
_log = storjnode.log.getLogger(__name__)
_b... | |
#!/usr/bin/env python
# This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
import errno
import json
import os
import re
import shutil
import subprocess
import ... | |
from __future__ import absolute_import, print_function, division
import sys
import pytest
pytestmark = pytest.mark.skipif(sys.version_info[0] == 3,
reason="PyHive doesn't work with Python 3.x")
pyspark = pytest.importorskip('pyspark')
py4j = pytest.importorskip('py4j')
sa = pytest.imp... | |
# Copyright 2012 OpenStack Foundation
#
# 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... | |
# encoding: utf-8
# Copyright 2013 maker
# License
"""
Project management forms
"""
from django.forms import ModelForm, CharField, TextInput, Form, ModelChoiceField, IntegerField, ChoiceField
from maker.projects.models import Project, Milestone, Task, TaskTimeSlot, TaskStatus
from maker.core.models import Object, ... | |
available = [
'fa-automobile',
'fa-bank',
'fa-behance',
'fa-behance-square',
'fa-bomb',
'fa-building',
'fa-cab',
'fa-car',
'fa-child',
'fa-circle-o-notch',
'fa-circle-thin',
'fa-codepen',
'fa-cube',
'fa-cubes',
'fa-database',
'fa-delicious',
'fa-devian... | |
# 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 ... | |
"""Alexa message handlers."""
import logging
import math
from homeassistant import core as ha
from homeassistant.components import (
camera,
cover,
fan,
group,
input_number,
light,
media_player,
timer,
vacuum,
)
from homeassistant.components.climate import const as climate
from home... | |
#!/usr/bin/env python
# Copyright 2013 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... | |
import sys, unittest, struct, math, ctypes
from binascii import hexlify
from ctypes import *
from ctypes.test import xfail
def bin(s):
return hexlify(memoryview(s)).upper()
# Each *simple* type that supports different byte orders has an
# __ctype_be__ attribute that specifies the same type in BIG ENDIAN
# byte o... | |
from __future__ import division
'''
NeuroLearn Analysis Tools
=========================
These tools provide the ability to quickly run
machine-learning analyses on imaging data
'''
__all__ = ['Roc']
__author__ = ["Luke Chang"]
__license__ = "MIT"
import pandas as pd
import numpy as np
from nltools.pl... | |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent 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
# no... | |
# 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 applicable ... | |
#!/usr/bin/env python
################################################################################
# Created by Oscar Martinez #
# o.rubi@esciencecenter.nl #
#######################################################... | |
#!/usr/bin/env python
# pylint: disable-msg=W0404,W0622,W0704,W0613,W0152
# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or mo... | |
"""Parameters module."""
import argparse
import simple_parsing
import os
import random
# import getpass
# import torch
# import torch.nn.parallel
# import torch.backends.cudnn as cudnn
# import torch.utils.data
from dataclasses import dataclass, field
from typing import ClassVar, Optional, Tuple
from simple_parsing i... | |
"""
Base typeclass for in-game Channels.
"""
from evennia.typeclasses.models import TypeclassBase
from evennia.comms.models import Msg, TempMsg, ChannelDB
from evennia.comms.managers import ChannelManager
from evennia.utils import logger
from evennia.utils.utils import make_iter
class DefaultChannel(ChannelDB):
... | |
"""
Support for magicseaweed data from magicseaweed.com.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.magicseaweed/
"""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
#!/usr/bin/env python
DOCUMENTATION = """
---
module: igw_purge
short_description: Provide a purge capability to remove an iSCSI gateway
environment
description:
- This module handles the removal of a gateway configuration from a ceph
environment.
The playbook that calls this module prompts the user for the ... | |
#!/usr/bin/env python
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright 2010 OpenStack LLC.
# 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 "Licens... | |
from contextlib import contextmanager
from ctypes import (CDLL, c_bool, c_int, c_int32, c_int64, c_double, c_char_p,
c_char, POINTER, Structure, c_void_p, create_string_buffer)
from warnings import warn
import numpy as np
from numpy.ctypeslib import as_array
from openmc.exceptions import Allocatio... | |
import requests
import os
from functools import wraps
import inspect
import sys
import re
# Pandas became an optional dependency, but we still want to track it
try:
import pandas
_PANDAS_FOUND = True
except ImportError:
_PANDAS_FOUND = False
import csv
class AlphaVantage(object):
""" Base class where ... | |
"""
Seamless communion server
Upon startup:
- Reads all comma-separated URLs in SEAMLESS_COMMUNION_INCOMING and tries to establish communion with them
- Reads the port in SEAMLESS_COMMUNION_OUTGOING and listens on that port for incoming communion attempts
- Every Seamless instance has a unique and random identifier; co... | |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -----------------------------------------------------------------------------
"... | |
# Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe, re, frappe.utils
from frappe.desk.notifications import get_notifications
from frappe import _
class BotParser(object):
'''Base class for bot parser'''
def __init__(self, rep... | |
import os
import numpy as np
import tensorflow as tf
from layer_factory import layer_factory
from tensorflow.python.framework import tensor_shape
class vae_wo_skipconn:
def __init__(self, flags, nch=2, condinference_flag=False):
self.flags = flags
self.nch = nch
self.layer_factory = layer_factory()
self.cond... | |
# Copyright 2012 OpenStack Foundation
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.apach... | |
import ee, getpass, time, math, sys
from flask import Flask, render_template, request
from eeMad import imad
from eeWishart import omnibus
ee.Initialize()
app = Flask(__name__, static_url_path='/static')
def simon(path):
images = ee.List(
[ee.call("S1.dB",ee.Image(path+'S1A_IW_GRDH_1SDV_20160305T171... | |
# Copyright 2012-2013 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 ... | |
#!/usr/bin/python
import participantCollection
import re
import datetime
import pyperclip
currentMonthIndex = datetime.date.today().month
#TODO: need to figure out how to get total days in current month...
currentMonthTotalDays = 30
currentMonthPenultimateDayIndex = currentMonthTotalDays - 1
currentMonthName = {1:'Jan... | |
# Copyright 2013, Big Switch Networks, 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 applic... | |
# 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... | |
# Natural Language Toolkit: Interface to the Mace4 Model Builder
#
# Author: Dan Garrette <dhgarrette@gmail.com>
# Ewan Klein <ewan@inf.ed.ac.uk>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
A model builder that makes use of the external 'Mace4' package.
"""
import os
import t... | |
import builtins
import os
import select
import socket
import sys
import unittest
import errno
from errno import EEXIST
class SubOSError(OSError):
pass
class SubOSErrorWithInit(OSError):
def __init__(self, message, bar):
self.bar = bar
super().__init__(message)
class SubOSErrorWithNew(OSError... | |
import copy
import json
import logging
import traceback
from dart.context.database import db
from dart.context.locator import injectable
from dart.model.action import Action
from dart.model.dataset import Dataset
from dart.model.datastore import Datastore
from dart.model.event import Event
from dart.model.graph import ... | |
#
# 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
# ... | |
import datetime
import time
import warnings
import sys
import pymysql
from pymysql.tests import base
import unittest2
try:
import imp
reload = imp.reload
except AttributeError:
pass
__all__ = ["TestOldIssues", "TestNewIssues", "TestGitHubIssues"]
class TestOldIssues(base.PyMySQLTestCase):
def test_... | |
# encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
"""
Events module views
"""
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from django.http import HttpResponseRedirect, HttpResponse
from django.core.urlresolvers ... | |
# -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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... | |
"""
Support for LG TV running on NetCast 3 or 4.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.lg_netcast/
"""
from datetime import timedelta
import logging
from requests import RequestException
import voluptuous as vol
import homeassista... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import ctypes
import argparse
from ctypes import sizeof, pointer
import elf
def add_symbols(elff, symbols):
#
# THE PLAN:
#
# - Keep the exiting file structure but create our own sections.
# - add our data (symtab + symstrtab + shstrtab)
# -... | |
# Copyright 2017 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 ... | |
#!/usr/bin/python2.4
# Copyright 2009 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 ... | |
#!/usr/bin/env python
#
# Joint copyright:
# - Copyright 2012,2013 Wikimedia Foundation
# - Copyright 2012,2013 Antoine "hashar" Musso
# - Copyright 2013 Arnaud Fabre
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtai... | |
import ply.yacc as yacc
from parseractions import *
from fetchlexer import tokens
class ParserError(Exception):
def __init__(self, msg):
self.msg = msg
############
# Main rules
##########
precedence = (
('left', 'AND', 'OR'),
('right', 'BANG'),
)
def p_fetchsection(p):
"""fetchcode : fetc... | |
#
# 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 division, print_function
import os
import numpy as np
from astropy.table import Table, hstack
from lsst.pipe.base import Struct
from ..sep_stepper import SepLsstStepper, sep_ellipse_mask
from ..stats import get_clipped_sig_task
from ..utils import pixscale, zpt
from .. import utils
from .. impor... | |
# -*- coding: utf-8 -*-
"""Provide authentication and authorization policy."""
__all__ = [
'VALID_API_KEY',
'VALID_PASS_KEY',
'VALID_TOKEN',
'APIKeyAuthenticationPolicy',
'BearerAuthenticationPolicy',
'GlobalKeyAuthorizationPolicy',
'HybridAuthenticationPolicy',
'PassKeyAuthenticationP... | |
"""Contains classes solr_query, node and sisters."""
# -*- coding: utf-8 -*-
from urllib.request import urlopen
import simplejson
import json
import numpy as np
import pandas as pd
import contextlib
# import copy
class solr_query():
"""
A solr_query class that stores URLs.
Attbts:
solr_url - the mai... | |
import sys
from flexmock import flexmock
import inject
from mcloud.events import EventBus
from mcloud.txdocker import IDockerClient, DockerTwistedClient
from mcloud.util import txtimeout
import pytest
from mcloud.remote import Server, Client, ApiError, Task, ApiRpcServer
from twisted.internet import reactor, defer
fr... | |
"""
PlexAPI MyPlex
"""
import plexapi, requests
from plexapi import TIMEOUT, log, utils
from plexapi.exceptions import BadRequest, NotFound, Unauthorized
from plexapi.utils import cast, toDatetime
from requests.status_codes import _codes as codes
from threading import Thread
from xml.etree import ElementTree
class My... | |
"""Simplified retina model."""
import logging
import numpy as np
import cv2
import cv2.cv as cv
from collections import OrderedDict
from lumos.context import Context
from lumos.input import Projector, run
from ..photoreceptor import Rod, Cone
class Retina(object):
"""
A multi-layered surface for hosting differ... | |
# 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 ... | |
# 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 ... | |
#!/usr/bin/env python
#
# Copyright 2007 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 o... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 The SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
import functools
from prjxray.tile_segbits i... | |
from collections import OrderedDict
from datetime import datetime
import json
from classytags.core import Options, Tag
from classytags.arguments import Argument
from django import template
from django.conf import settings
from cms.plugin_rendering import PluginContext
from smartsnippets.models import SmartSnippet, S... | |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import json
import os
from enum import Enum
from typing import List, Optional, Tuple
from parlai.core.messag... | |
#!/usr/bin/env python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance... | |
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import configparser
from abc import ABC, abstractmethod
from dataclasses import dataclass
from enum import Enum
from textwrap import dedent
from typing import Dict
import pytest
from pan... | |
# -*- 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):
# Changing field 'ProjectPlan.latitude'
db.alter_column(u'projects_projectplan', 'latitude', self.gf('djang... | |
# plugin.py vi:ts=4:sw=4:expandtab:
#
# Splat plugins
# Authors:
# Landon Fuller <landonf@opendarwin.org>
# Will Barton <wbb4@opendarwin.org>
#
# Copyright (c) 2005 Three Rings Design, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are perm... | |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy import stats
from collections import OrderedDict
def latex_matrix_string(mean, title,
row_labels, col_labels,
best_bold_row=True, best_bold_column=False):
"""
Latex Matrix String ... | |
import datetime
import json
import mock
from sqlalchemy.exc import IntegrityError
from werkzeug.exceptions import BadRequest, Forbidden
from rdr_service import config, singletons
from rdr_service.api_util import open_cloud_file
from rdr_service.clock import FakeClock
from rdr_service.code_constants import (
COHORT... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
# http://pythonhosted.org/dxfgrabber/#dxfgrabber
import pcbnew
import dxfgrabber
import re
import sys, os.path, inspect
import numpy as np
oldpath = sys.path
# inspect.stack()[0][1] is the full path to the current file.
sys.path.insert(0, os.path.dirname(inspect.stack()[0][1]))
import bulge
import pcbpoint
sys.path... | |
#!/usr/bin/env python
#
# Copyright 2016 Qumulo, 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 ... | |
import numpy as np
from mpi4py import MPI
from pmesh.pm import ParticleMesh
from pySDC.core.Errors import ParameterError, ProblemError
from pySDC.core.Problem import ptype
from pySDC.playgrounds.pmesh.PMESH_datatype_NEW import pmesh_datatype, rhs_imex_pmesh
class allencahn_imex(ptype):
"""
Example implementi... | |
# -*- coding:utf-8 -*-
import datetime
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import login_required
from django... | |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import unittest
import os
from numbers import Number
import warnings
from pathlib import Path
from pymatgen.analysis.phase_diagram import *
from pymatgen.entries.computed_entries import ComputedEntry
from pyma... | |
from __future__ import absolute_import
from tempfile import NamedTemporaryFile
from django.conf import settings
from django.http import HttpResponse
from django.template.response import TemplateResponse
from django.views.generic import TemplateView
from django.utils.encoding import smart_text
from .utils import (con... | |
# Copyright (c) 2016-present, Facebook, 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... | |
# ----------------------------------------------------------------------------
# cocos2d
# Copyright (c) 2008 Daniel Moisset, Ricardo Quesada, Rayentray Tappa, Lucio Torre
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the follow... | |
import os
import urllib2
from urlparse import urlparse
from cStringIO import StringIO
from PIL import Image
import markdown
import datetime
from time import strftime
from hashlib import md5
import uuid
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.template.defaultfilt... | |
from __future__ import print_function
from past.builtins import xrange
from io import open
import vstruct
from vstruct.primitives import *
#const tag descriptions from wikipedia
#Tag byte Additional bytes Description of constant
#1 2+x bytes utf-8 string
#3 4 bytes Integer: a signed 32-bit two's complement ... | |
# ===================================================================
#
# Copyright (c) 2014, Legrandin <helderijs@gmail.com>
# 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. Redistributio... | |
#!/usr/bin/env python27
# -*- coding: utf-8 -*-
import urllib2
import StringIO
import gzip
import pprint
import time
import pandas as pd
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score
import csv
import boto
import gcs_oauth2_boto_plugin
import httpli... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
High-level history functions. These wrap the basic his_read function to allow
some alternate representations of the historical data.
"""
import hszinc
import fysom
import pytz
from copy import deepcopy
from datetime import tzinfo
from six import string_types
from ..... | |
"""
-*- coding: utf-8 -*- {{{
vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
Copyright (c) 2017, Battelle Memorial Institute
All rights reserved.
1. Battelle Memorial Institute (hereinafter Battelle) hereby grants
permission to any person or entity lawfully obtaining a copy of this
software and associated... | |
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
JahnTeller distortion analysis.
"""
import os
import warnings
from typing import Any, Dict, Literal, Optional, Tuple, Union, cast
import numpy as np
from pymatgen.analysis.bond_valence import BVAnalyzer
from pymatgen.a... | |
# Copyright 2016-2017 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 ... | |
#!/usr/bin/env python3
import argparse
from datetime import timedelta, datetime
from glob import glob
"""matplotlib gets imported when needed"""
from time import strptime, mktime
def OpenFile(InputFile):
"""Try to open the data file, raise an error if opening fails"""
try:
InputData = open(InputFile... | |
import re
from xml.sax.saxutils import escape, unescape
from tokenizer import HTMLTokenizer
from constants import tokenTypes
class HTMLSanitizerMixin(object):
""" sanitization of XHTML+MathML+SVG and of inline style attributes."""
acceptable_elements = ['a', 'abbr', 'acronym', 'address', 'area',
'art... | |
import ctypes
import mock
import unittest
import sys
import warnings
from contextlib import contextmanager
from nose import SkipTest
import nifpga
from nifpga.statuscheckedlibrary import (check_status,
NamedArgtype,
LibraryFunctionInfo,
... | |
"""
Binary serialization
NPY format
==========
A simple format for saving numpy arrays to disk with the full
information about them.
The ``.npy`` format is the standard binary file format in NumPy for
persisting a *single* arbitrary NumPy array on disk. The format stores all
of the shape and dtype information necess... | |
# Copyright 2022 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
# Copyright (c) 2009, 2010, 2011 Nicira, 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 agre... | |
# import_export_open_people/controllers.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from .models import OpenPeopleApiCounterManager
from config.base import get_environment_variable
from concurrent.futures import ThreadPoolExecutor, as_completed
from exception.models import handle_exception, handle... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.