gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
################################# LICENSE ##################################
# Copyright (c) 2009, South African Astronomical Observatory (SAAO) #
# All rights reserved. #
# #
# Redistribu... | |
# -*- coding: utf-8 -*-
from exceptions import BufferNotFound, BufferNotInSync
from liborgmode import Document, Heading, MultiPurposeList, DIRECTION_BACKWARD
import settings
import vim
from UserList import UserList
class VimBufferContent(MultiPurposeList):
u""" Vim Buffer Content is a UTF-8 wrapper around a vim buff... | |
# Copyright 2017-2021 TensorHub, 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 writ... | |
#!/usr/bin/env python3
# Copyright (c) 2017-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test recovery from a crash during chainstate writing.
- 4 nodes
* node0, node1, and node2 will have ... | |
# 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... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# 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... | |
#!/usr/bin/env python
import click
import itertools
import json
import os
import sys
from pyspark import SparkConf
from pyspark.mllib.recommendation import ALS
from pyspark.sql.types import StructType
from pyspark.mllib.util import MLUtils
from pyspark.mllib.classification import LogisticRegressionWithLBFGS
from pysp... | |
"""
Wraps leaflet Polyline, Polygon, Rectangle, Circle, and CircleMarker
"""
from branca.element import MacroElement
from folium.map import Marker, Popup, Tooltip
from folium.utilities import validate_locations, get_bounds
from jinja2 import Template
def path_options(line=False, radius=False, **kwargs):
"""
... | |
# Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions... | |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | |
"""Test letsencrypt.display.ops."""
import os
import sys
import tempfile
import unittest
import mock
import zope.component
from acme import jose
from acme import messages
from letsencrypt import account
from letsencrypt import interfaces
from letsencrypt.display import util as display_util
from letsencrypt.tests i... | |
#!/usr/bin/env python3
import subprocess
import sys
import logging
from datetime import datetime
from pathlib import Path
from Pegasus.api import *
logging.basicConfig(level=logging.DEBUG)
# --- Work Directory Setup -----------------------------------------------------
RUN_ID = "local-hierarchy-sharedfs-" + datetim... | |
#!/usr/bin/python
#----------------------------------------------------------------------
# Be sure to add the python path that points to the LLDB shared library.
#
# To use this in the embedded python interpreter using "lldb":
#
# cd /path/containing/crashlog.py
# lldb
# (lldb) script import crashlog
# "crash... | |
# Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# pylint: disable=maybe-no-member
"""Test request import and updates."""
from datetime import date, timedelta
from flask.json import dumps
from ggrc import models
from ggrc.converters import errors
from i... | |
#Requirements
import sys
import os
import random
import pygame
from pygame.locals import *
import constants
#import player
import bricks
import player
pygame.init()
#Start Class Declaration
class PyBreakout:
def __init__(self):
self.initialize()
self.mainLoop()
#Declare variables and initiali... | |
# 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 (c) SAS Institute 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... | |
# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file ac... | |
#Copyright (c) 2017 Andre Santos
#
#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, distribute... | |
from functools import partial
import sys
import textwrap
from .vendor import six
from .context import Context
from .loader import Loader
from .parser import Parser, Context as ParserContext, Argument
from .executor import Executor
from .exceptions import Failure, CollectionNotFound, ParseError
from .util import debug... | |
from collections import OrderedDict, defaultdict, namedtuple, Counter
from collections.abc import Iterable
from copy import deepcopy
from numbers import Real
from pathlib import Path
import re
import warnings
from xml.etree import ElementTree as ET
import numpy as np
import openmc
import openmc.data
import openmc.che... | |
# Copyright (c) 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 ... | |
""" Generic Unification algorithm for expression trees with lists of children
This implementation is a direct translation of
Artificial Intelligence: A Modern Approach by Stuart Russel and Peter Norvig
Second edition, section 9.2, page 276
It is modified in the following ways:
1. We allow associative and commutati... | |
'''
Read and write data to a Lego Mindstorm NXT brick using serial bluetooth
connection. You'll need to modify __init__ for unix style serial port
identification in order to use this on Linux.
Blue enables raw byte transfer
TypeBlue utilizes NXT mailbox number for type identification.
Usage:
1. Enable a bluetooth s... | |
import logging
import sys
import os
import json
from collections import namedtuple, OrderedDict
import numpy as np
import pandas as pd
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from plottingscripts.plotting.scatter import plot_scatter_plot
from aslib_scenario.aslib_scenario import ASli... | |
import datetime
import json
import re
import colorsys
import difflib
import logging
import tagging
import auxiliary.tag_suggestions
from actstream import action
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.contenttypes.models import ContentType
from... | |
# Copyright 2014 - Rackspace Hosting.
#
# 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... | |
import json
import os
import gettext as gettext_module
from django import http
from django.conf import settings
from django.template import Context, Template
from django.utils import importlib
from django.utils.translation import check_for_language, to_locale, get_language
from django.utils.encoding import smart_text
... | |
import sys
import datetime
from tornado import gen
from storm.db import Database, ConnectionPool
from storm import error
import tornado_mysql
from tornado_mysql.pools import Pool
cursor_type = tornado_mysql.cursors.DictCursor
class MySql(Database):
@gen.coroutine
def connect(self, callback=None):
if ... | |
import urllib2
import urlparse
from datetime import datetime, timedelta
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils import unittest
from django.test.client import Client
from djpubsubhubbub.models import Subscription, SubscriptionManager
from djpubsubhubbub.signals... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Python wrapper around the C extension for the pair counter in
``theory/DDsmu/``. This wrapper is in :py:mod:`Corrfunc.theory.DDsmu`
"""
from __future__ import (division, print_function, absolute_import,
unicode_literals)
__author__ = ('Manodee... | |
import numpy as np
import scipy.sparse as sp
from scipy import linalg, optimize, sparse
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.util... | |
import torch
import torch.nn as nn
from torch.nn import init
import functools
from torch.autograd import Variable
from torch.optim import lr_scheduler
import torch.nn.parallel
import numpy as np
###############################################################################
# Functions
################################... | |
#!/usr/bin/env python
from wsgiref.simple_server import make_server
import sys
import json
import traceback
import datetime
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, ServerError, InvalidRequestE... | |
# Configuration file for jupyter-notebook.
#------------------------------------------------------------------------------
# Application(SingletonConfigurable) configuration
#------------------------------------------------------------------------------
## This is an application.
## The date format used by logging f... | |
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2017 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the... | |
import boto3
import re
from flask import render_template
from flask_mail import Message
from boto3.dynamodb.conditions import Key, Attr
from utils.ResponseCreation import ControllerResponse
from utils import db_utils as dbUtils
import utils.MentiiLogging as MentiiLogging
import uuid
import hashlib
import class_ctrl as ... | |
"""
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... | |
# Copyright (c) 2014 Hoang Do, Phuc Vo, P. Michiardi, D. Venzano
#
# 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 appli... | |
#!/usr/bin/env python
# Landsat Util
# License: CC0 1.0 Universal
import argparse
import textwrap
import json
from dateutil.parser import parse
import pycurl
from downloader import Downloader, IncorrectSceneId
from search import Search
from utils import reformat_date, convert_to_integer_list, timer, exit
from mixin... | |
# -*- coding: utf-8 -*-
import os
import json
import uuid
import copy
import logging
import mimetypes
import warnings
from . import utils
from . import feedreader
from . import exceptions as exp
from .resource import Resource
logger = logging.getLogger(__name__)
DEFAULT_BASE_URL = os.environ.get('COUCHDB_URL', 'h... | |
# -*- coding: utf-8 -*-
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | |
# -*- coding: utf-8 -*-
# test cases for HOT Export Tasks
import cPickle
import logging
import os
import sys
import uuid
from mock import Mock, PropertyMock, patch
from django.conf import settings
from django.contrib.auth.models import Group, User
from django.contrib.gis.geos import GEOSGeometry, Polygon
from django.... | |
#!/usr/bin/env python
# The MIT License (MIT)
#
# Copyright (c) 2013 Bartosz Zaczynski
#
# 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... | |
import collections
import inspect
import re
from functools import wraps
import sys
from contextlib import contextmanager
import itertools
from voluptuous import error as er
if sys.version_info >= (3,):
long = int
unicode = str
basestring = str
ifilter = filter
def iteritems(d):
return d.i... | |
import json
from django.contrib.auth import get_user_model
from django.test import TestCase, override_settings
from django.urls import reverse
from django.utils.http import urlencode
from wagtail.admin.views.chooser import can_choose_page
from wagtail.core.models import Locale, Page, UserPagePermissionsProxy
from wag... | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | |
# Copyright 2015 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... | |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import shu... | |
# Copyright (c) 2006-2013 Regents of the University of Minnesota.
# For licensing terms, see the file LICENSE.
# BUG nnnn: 2012.09.26: Search for a route from DT Mpls to DT St Paul (i.e.,
# the 94) at 9 AM and you may have to bike to a slow bus -- why
# isn't the express bus suggested?
import os
#... | |
import collections
import copy
import logging
import os
import Queue
import socket
import sys
import threading
import time
import ujson
import bisect
import zmq
import utils
logger = logging.getLogger(__name__)
def _gauge_pair():
""" Track gauge as a pair of (sum, count) """
return [0, 0]
class Speakeasy(... | |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from grpc.framework.common import cardinality
from grpc.framework.interfaces.face import utilities as face_utilities
import google.cloud.proto.pubsub.v1.pubsub_pb2 as google_dot_cloud_dot_proto_dot_pubsub_dot_v1_dot_pubsub__pb2
import go... | |
# -*- coding: utf-8 -*-
from rest_framework import permissions
from rest_framework import exceptions
from addons.base.models import BaseAddonSettings
from osf.models import AbstractNode, OSFUser as User, Institution, DraftRegistration, PrivateLink, PreprintService, NodeRelation
from website.project.metadata.utils impo... | |
#!/usr/bin/env python
from __future__ import division, print_function
import numpy as np
import argparse
import re
import os, sys
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from mpl_toolkits.axes_grid1 import make_axes_locatable
from ase.data import ... | |
# Copyright 2015 The Bazel 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 la... | |
# 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 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of t... | |
# -*- coding: utf-8 -*-
import io
import ssl
import sys
import copy
import base64
import socket
import httplib
import urlparse
import functools
import contextlib
import collections
import h2.errors
import h2.events
import h2.settings
import h2.connection
import h2.exceptions
from tornado import (
httputil, log, s... | |
from operator import itemgetter
from corehq.apps.groups.models import Group
from corehq.apps.reports import util
from corehq.apps.reports.standard import CommCareUserMemoizer
from corehq.apps.reports.util import format_datatables_data, make_ctable_table_name
from .filters import ALL_CVSU_GROUP
from dimagi.utils.decorat... | |
#!/usr/bin/env python
"""
insta_raider.py
usage: insta_raider.py [-h] -u USERNAME
@amirkurtovic
"""
import argparse
import logging
import os
import os.path as op
import re
import email.utils as eut
import requests
import calendar
try:
from requests.packages.urllib3.exceptions import InsecurePlatformWarning
excep... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This bot applies to wikisource sites to upload text.
Text is uploaded to pages in Page ns, for a specified Index.
Text to be stored, if the page is not-existing, is preloaded from the file used
to create the Index page, making the upload feature independent from the forma... | |
# -*- coding: utf-8 -*-
"""
lantz.drivers.legacy.andor.andor
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Low level driver wrapping atcore andor library.
Sources::
- Andor Manual
:copyright: 2015 by Lantz Authors, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
i... | |
""" Data objects in group "Parametrics"
"""
from collections import OrderedDict
import logging
from pyidf.helper import DataObject
logger = logging.getLogger("pyidf")
logger.addHandler(logging.NullHandler())
class ParametricSetValueForRun(DataObject):
""" Corresponds to IDD object `Parametric:SetValueForRun`
... | |
# -*- coding: utf-8 -*-
"""
celery.app
~~~~~~~~~~
Celery Application.
:copyright: (c) 2009 - 2012 by Ask Solem.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import os
import threading
from .. import registry
from ..utils import cached_property, instan... | |
#!/usr/bin/env python
"""Utilities working with Flask UIs"""
__author__ = 'Michael Meisinger, Stephen Henrie'
import traceback
import flask
from flask import request, jsonify
import sys
import json
import simplejson
from pyon.public import BadRequest, OT, get_ion_ts_millis
from pyon.util.containers import get_datet... | |
"""
FlexGet build and development utilities - unfortunately this file is somewhat messy
"""
from __future__ import print_function
import glob
import os
import shutil
import sys
from paver.easy import environment, task, cmdopts, Bunch, path, call_task, might_call, consume_args
# These 2 packages do magic on import, eve... | |
import sublime
import sys
import os
from unittesting import DeferrableTestCase
####################
# TESTS FOR FUNCTIONS
####################
core = sys.modules['Requester.core']
class TestFunctions(DeferrableTestCase):
def test_prepare_request(self):
s = "get('http://httpbin.org/get')"
req... | |
import os
import glob
import shutil
import sys
import math
import datetime as dt
import subprocess as sp
import numpy as np
import warnings
import xml.etree.ElementTree as ET
from astropy import __version__ as astropy_version
from astropy import wcs
from astropy.io import fits, votable
from astropy.table import Table, ... | |
#!/usr/bin/python3
# -*- coding:utf-8 -*-
""" Gtk textbuffer with undo functionality """
#Copyright (C) 2009 Florian Heinle
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# ve... | |
#
# Copyright 2018 Analytics Zoo 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... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from lib.mongo import MongoDB
from lib.protomemes import get_protomemes
from lib.vectorizer import vectorize_text, tdidf, create_dictionary,get_frequency_vectors,create_matrix_from_vectors
from sklearn.metrics.pairwise import cosine_similarity
from lib.plot import augmente... | |
"""NAMD parser tests.
"""
from os.path import basename
from re import search
import bz2
import pytest
from alchemlyb.parsing.namd import extract_u_nk
from alchemtest.namd import load_tyr2ala
from alchemtest.namd import load_idws
from alchemtest.namd import load_restarted
from alchemtest.namd import load_restarted_rev... | |
import os
import shutil
import tempfile
from uuid import uuid4
import ethereum.keys
from ethereum.slogging import get_logger
from ethereum.utils import decode_hex, remove_0x_head
from devp2p.app import BaseApp
import pytest
from pyethapp.accounts import Account, AccountsService, DEFAULT_COINBASE
# reduce key derivati... | |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import shu... | |
__VERSION__="ete2-2.2rev1056"
# -*- coding: utf-8 -*-
# #START_LICENSE###########################################################
#
#
# This file is part of the Environment for Tree Exploration program
# (ETE). http://ete.cgenomics.org
#
# ETE is free software: you can redistribute it and/or modify it
# under the t... | |
__all__ = ['extract_ssi', 'extract_ssi_to_file',
'extract_eta', 'extract_eta_to_file',
'extract_Q_channel', 'extract_Q_down',
'extract_overland_volume', 'extract_overland_volume_to_file']
from datetime import timedelta
from configparser import SafeConfigParser
import h5py
import numpy... | |
import abc
import os.path
import shutil
from subprocess import CalledProcessError, check_call, check_output
from pkgpanda.exceptions import ValidationError
from pkgpanda.util import download_atomic, sha1
# Ref must be a git sha-1. We then pass it through get_sha1 to make
# sure it is a sha-1 for the commit, not the ... | |
#!/usr/bin/env python3
import base64
import collections
import concurrent.futures
import functools
import gi
import glob
import html.entities
import os
import os.path
import re
import subprocess
import sys
import threading
import unidecode
import urllib.error
import urllib.parse
import urllib.request
from gi.reposito... | |
# -*- coding: ISO-8859-1 -*-
# Copyright (c) 2006-2013, Alexis Royer, http://alexis.royer.free.fr/CLI
#
# 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... | |
"""
Copyright 2015 Basho Technologies, Inc.
Copyright 2010 Rusty Klophaus <rusty@basho.com>
Copyright 2010 Justin Sheehy <justin@basho.com>
Copyright 2009 Jay Baird <jay@mochimedia.com>
This file is provided to you under the Apache License,
Version 2.0 (the "License"); you may not use this file
except in compliance wi... | |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
#!/usr/bin/env python
'''
Little example on how to use the Network class to create a model and perform
a basic classification of the MNIST dataset
'''
#from NumPyNet.layers.input_layer import Input_layer
from NumPyNet.layers.connected_layer import Connected_layer
fro... | |
# Copyright (c) 2015 William Lees
# 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, distribut... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import HTMLParser
import smtplib
from frappe import msgprint, throw, _
from frappe.email.smtp import SMTPServer, get_outgoing_email_account
from frappe.email.email_b... | |
"""
:copyright: (c) 2014 Building Energy Inc
:license: see LICENSE for more details.
"""
# system imports
import json
import datetime
# django imports
from django.contrib.auth.decorators import login_required
from django.core.cache import cache
# vendor imports
from annoying.decorators import ajax_request
from dateut... | |
"""
Table of command codes is in Section 4.1, page 58.
"""
import re
from decimal import Decimal
def parse_command(s):
if s[0] == '%':
# Extended commands, identify by first 3 chars
code = s[1:3]
cls = extended_commands[code]
return cls.from_string(s)
else:
# For normal... | |
#!/usr/bin/env python
# graphviz -- Python interface to the GraphViz graphing utility.
#
# Copyright 2002 by Kevin Quick <quick@null.net>. All rights reserved.
import string
# # ### ### # ### ### # # ### ### # # ###
# # # # # # # # # # # # ... | |
"""
A minimalist REST API for Salt
==============================
This ``rest_wsgi`` module provides a no-frills REST interface for sending
commands to the Salt master. There are no dependencies.
Extra care must be taken when deploying this module into production. Please
read this documentation in entirety.
All auth... | |
##
# The MIT License (MIT)
#
# Copyright (c) 2015 Stefan Wendler
#
# 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,... | |
#!/usr/bin/env python
#########################################################################################
# Extract raw intracranial volume in cubic millimeters.
# Method: bias field correction (N4) followed by SIENAx or RBM
# RBM (reverse MNI brain masking) is adapted from Keihaninejad (2010)
#
# ---------------... | |
import os
import mock
import redis
from scrapy import Request, Spider
from unittest import TestCase
from . import connection
from .dupefilter import RFPDupeFilter
from .queue import SpiderQueue, SpiderPriorityQueue, SpiderStack
from .scheduler import Scheduler
# allow test settings from environment
REDIS_HOST = os... | |
# 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 2014 Nervana Systems 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.o... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import psycopg2
import sys
from xlrd import open_workbook
con = None
program_list =[]
measure_list = []
##This is a bit of code that will parse an excel file and read records to a postgreSQL db. For this example the data consists
##of clinical quality measures and the govern... | |
"""Collects and reports container and host metrics.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import errno
import io
import logging
import os
import time
import six
from treadmill import cgroups
from tread... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import functools
import redis
from multiprocessing.dummy import Pool as ThreadPool
from redis.client import Lock
from redis.sentinel import Sentinel
from .commands import SHARD_METHODS
from ._compat import basestring, iteritems
from .hashring import HashRing
fro... | |
import functools
import multiprocessing
import os
import signal
import time
import types
import psutil
from simpleflow import logger
from .named_mixin import NamedMixin, with_state
def reset_signal_handlers(func):
"""
Decorator that resets signal handlers from the decorated function. Useful
for workers... | |
import datetime
import dateutil.parser
from pixiv_pixie.utils import LazyProperty
from .constants import IllustType, IllustAgeLimit
def _lazy(attr_name):
def get_func(self):
self.update()
return getattr(self, attr_name)
return LazyProperty(get_func, property_name=attr_name)
class PixivIll... | |
# 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 list of conditions and the f... | |
#TIME COMPLEXITY :
"""
FOR WORD PREDICTION : O(1)
FOR WORD PREDICTION WITH 'R'TH RANK: O(R)
"""
#import the modules necessary
from nltk.util import ngrams
from collections import defaultdict
from collections import OrderedDict
import string
import time
import gc
start_time = time.time()
#returns : void
#arg: ... | |
from __future__ import absolute_import, unicode_literals
from future.builtins import int, open, str
import os
import mimetypes
from json import dumps
from django.template.response import TemplateResponse
try:
from urllib.parse import urljoin, urlparse
except ImportError:
from urlparse import urljoin, urlpar... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.