text stringlengths 12 6.59M |
|---|
#!/usr/bin/python
# -*- coding: <utf-8> -*-
import requests
# import pandas as pd
# import numpy as np
from FinanceDataset.config import YahooConfig
__author__ = 'JasonGUTU'
__version__ = '0.0.1'
__license__ = 'The MIT License (MIT)'
__copyright__ = 'Copyright (c) 2016 CUHK(SZ) Computer @nd Comity'
class YahooFin... |
"""
Models.
"""
from django.db import models
from django.utils.translation import ugettext_lazy as _
from config_models.models import ConfigurationModel
class XBlockDisableConfig(ConfigurationModel):
"""
Configuration for disabling and deprecating XBlocks.
"""
class Meta(ConfigurationModel.Meta):
... |
# -*- coding: utf-8 -*-
# vim: set ts=4
# Copyright 2013 Rémi Duraffort
# This file is part of RandoAmisSecours.
#
# RandoAmisSecours is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of... |
from cog.models import *
from django.forms import ModelForm, ModelMultipleChoiceField, NullBooleanSelect
from django.db import models
from django.contrib.admin.widgets import FilteredSelectMultiple
from django import forms
from django.forms import ModelForm, Textarea, TextInput, Select
from django.core.exceptions impor... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# OpenFisca -- A versatile microsimulation software
# By: OpenFisca Team <contact@openfisca.fr>
#
# Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team
# https://github.com/openfisca
#
# This file is part of OpenFisca.
#
# OpenFisca is free software; you can redist... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Unittests for management commands.
"""
import os
import shutil
import calaccess_processed
from datetime import date
import time
from django.conf import settings
from django.core.management import call_command
from django.core.management.base import CommandError
from dja... |
# Django settings for comics project.
import os
import django
PROJECT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), '../')
DJANGO_DIR = os.path.dirname(os.path.abspath(django.__file__))
SECRET_KEY = 'This key should really be overriden in comics/settings/local.py'
DATABASES = {
'default': {
... |
import time
import GPy
from matplotlib.pyplot import show
import numpy as np
from data_source import DataSource
from optimizer import Optimizer
from savigp import Configuration
from likelihood import MultivariateGaussian, UnivariateGaussian
from plot import plot_fit
from savigp_diag import SAVIGP_Diag
from savigp_sin... |
# Copyright (c) 2012, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np
import pylab as pb
from ..util.linalg import mdot, jitchol, chol_inv, pdinv
from ..util.plot import gpplot
from .. import kern
from GP import GP
#Still TODO:
# make use of slices properl... |
BOOLEAN_SWITCH_VALUES = {'true': True, 'false': False};
HELP_SWITCHES = ['-h', '-?', '/?', '/h', '--help'];
HELP_SWITCH_NAMES = ['h', '?', '?', 'h', 'help'];
class CommandLineOptions():
def __init__(self, application_name, arguments=[], switches=[],
help_message=None, help_notes=None):
assert applica... |
# The purpose of this script is to create a set of maps from a HAZUS run
# based on user input. The user selects one or more maps to create and
# the script takes maps from a template directory and copies them into
# a new project. For each map, the script generates a PDF and JPEG output.
# Author: Josh Groeneveld
#... |
import numpy as np
from numpy import linalg as LA
from numpy.linalg import norm, inv
import shutil, copy
from sklearn.decomposition import PCA
from scipy import spatial
import matplotlib.path as mplPath
import transforms3d
from scipy.optimize import minimize
import cPickle
import os
from ast import literal_eval as make... |
# -*- coding: utf-8 -*-
"""Classes for handling input/output prompts.
Authors:
* Fernando Perez
* Brian Granger
* Thomas Kluyver
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
# Copyright (C) 2001-2007 Fernando Per... |
#-----------------------------------------------------------------------------
# Copyright (C) 2010 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING.txt, distributed as part of this software.
#------------------------------------------------... |
#-----------------------------------------------------------------------------
# Copyright (C) 2010 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING.txt, distributed as part of this software.
#------------------------------------------------... |
#!/usr/bin/env python
"""A simple interactive kernel that talks to a frontend over 0MQ.
Things to do:
* Implement `set_parent` logic. Right before doing exec, the Kernel should
call set_parent on all the PUB objects with the message about to be executed.
* Implement random port and security key logic.
* Implement c... |
"""A ZMQ-based subclass of InteractiveShell.
This code is meant to ease the refactoring of the base InteractiveShell into
something with a cleaner architecture for 2-process use, without actually
breaking InteractiveShell itself. So we're doing something a bit ugly, where
we subclass and override what we want to fix.... |
# -*- coding: utf-8 -*-
import os
import math
import sys
import re
import tempfile
import textwrap
import arcpy
# import our datatype conversion submodule
from datatype import datatype
dt = datatype.DataType()
# import our local directory so we can import internal modules
local_path = os.path.abspath(os.path.dirnam... |
# coding: utf-8
"""Utilities for installing Javascript extensions for the notebook"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
import os
import shutil
import sys
import tarfile
import zipfile
from os.path import basenam... |
# coding: utf-8
"""Utilities for installing Javascript extensions for the notebook"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
import os
import shutil
import sys
import tarfile
import zipfile
import uuid
from os.path im... |
"""Among other routines, dump XMI UML Statecharts from MealyMachine of TuLiP.
- write the statecharts starting from mealy machines.
SCL; 29 Jul 2014
"""
# DONE
# cStringIO ==>> StringIO
import networkx as nx
# import cStringIO
# TODO find replacement for cStringIO; first try follows
# TODO unnecessary relabel... |
import io
import json
import os
import shutil
import sys
pjoin = os.path.join
from IPython.utils.path import get_ipython_dir
from IPython.utils.py3compat import PY3
from IPython.utils.traitlets import HasTraits, List, Unicode, Dict
if os.name == 'nt':
programdata = os.environ.get('PROGRAMDATA', None)
if prog... |
"""The IPython notebook format
Use this module to read or write notebook files as particular nbformat versions.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from IPython.utils.log import get_logger
from . import v1
from . import v2
from . import v3
from . ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import json
import requests
import logging
from datetime import datetime, timedelta
from django.core.exceptions import AppRegistryNotReady
from django.db.utils import OperationalError, ProgrammingError
logger = logging.getLogger(__name__)
... |
# noqa
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import dj_database_url
from .base import *
from .celery import * # NOQA
from .utils import ABS_PATH
from hdx.hdx_configuration import Configuration
# Project apps
INSTALLED_APPS += (
'jobs',
'tasks',
'api',
'ui',
'u... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2015-2018 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... |
import collections
import itertools
import math
import numbers
import operator
import random
import sys
from permuta import Pattern, Rotatable, Shiftable, Flippable
from permuta.misc import left_floor_and_ceiling
if sys.version_info.major == 2:
range = xrange
class Permutation(tuple, Pattern, Rotatable, Shiftab... |
#!/usr/bin/env python
"""
Tools for assisting in parsing data to input into analysis procedure.
"""
#=============================================================================================
# Imports
#=============================================================================================
from assaytools i... |
"""
classes.py - Base classes for PyLink IRC Services.
This module contains the base classes used by PyLink, including threaded IRC
connections and objects used to represent IRC servers, users, and channels.
Here be dragons.
"""
import threading
import time
import socket
import ssl
import hashlib
from copy import de... |
"""
cclib (http://cclib.sf.net) is (c) 2006, the cclib development team
and licensed under the LGPL (http://www.gnu.org/copyleft/lgpl.html).
"""
__revision__ = "$Revision$"
import logging, sys
import Numeric
import utils
class Logfile(object):
"""Abstract class for logfile objects.
Subclasses:... |
#!/usr/bin/env python3
#
# Copyright (C) 2021 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
# published by the Free Software Foundation.
#
# This program is distributed in the hope t... |
"""
Utility classes and functions related to computing fairness evaluations
:author: Anastassia Loukina (aloukina@ets.org)
:author: Jeremy Biggs (jbiggs@ets.org)
:author: Nitin Madnani (nmadnani@ets.org)
:date: 07/29/2019
:organization: ETS
"""
import pandas as pd
import pickle
import numpy as np
from os.path impo... |
# -*- coding: utf-8 -*-
# The Hazard Library
# Copyright (C) 2012-2014, GEM Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your opt... |
#!/usr/bin/env python
"""
Tools for assisting in parsing data to input into analysis procedure.
"""
#=============================================================================================
# Imports
#=============================================================================================
from assaytools i... |
version_info = (0, 0, 4)
__version__ = '.'.join(map(str, version_info))
|
import argparse
import codecs
import os
import os.path
import sys
import pdoc.web
import pdoc.doc
import pdoc.extract
import pdoc.render
version_suffix = "%d.%d" % (sys.version_info[0], sys.version_info[1])
parser = argparse.ArgumentParser(
description="Automatically generate API docs for Python modules.",
... |
import numpy as np
import os
import glob
import cPickle
class LightCurve():
"""
Once fully initiated, instances of this class have the following important
properties
band (string) 'g','r','i' or 'z'
mjd (array) modified julian dates of observations
flux (array) the observed flux
fluxErr (array) the e... |
#!/usr/bin/env python
'''
Application manager. Responsible for starting the service,
performing db migrations, testing.
'''
import os
basedir = os.path.abspath(os.path.dirname(__file__))
COV = None
if os.environ.get('FLASK_COVERAGE'):
import coverage
COV = coverage.coverage(branch=True,include=basedir + '/app... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py... |
# Django
## Models
from django.db import models
from django.contrib.auth.models import User, UserManager
## Exceptions
from django.db import IntegrityError
## Signals
from django.db.models.signals import post_init
from django.dispatch import receiver
# RSS Parsing
import feedparser
import time
from datetime import dat... |
#!/usr/bin/env python3
"""Mbed TLS configuration file manipulation library and tool
Basic usage, to read the Mbed TLS or Mbed Crypto configuration:
config = ConfigFile()
if 'MBEDTLS_RSA_C' in config: print('RSA is enabled')
"""
## Copyright (C) 2019, ARM Limited, All Rights Reserved
## SPDX-License-Identifie... |
import itertools
import re
from collections import OrderedDict, defaultdict
from functools import partial
from fontTools.misc.fixedTools import otRound
from ufo2ft.constants import INDIC_SCRIPTS, USE_SCRIPTS
from ufo2ft.featureWriters import BaseFeatureWriter, ast
from ufo2ft.util import classifyGlyphs, quantize, uni... |
# Licensed under the MIT License
# https://github.com/craigahobbs/chisel/blob/master/LICENSE
"""
TODO
"""
__version__ = '0.9.88'
from .action import \
Action, \
ActionError, \
action
from .app import \
Application, \
Context
from .doc import \
get_doc_requests
from .model import \
Acti... |
from unittest import skip
from unittest.mock import MagicMock
from django.core import mail
from django.core.management import call_command
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from wizard_builder.forms import PageForm
from .. import test_base
from ...delivery i... |
import sys
import random
import traceback
from socket import error
from gevent.pywsgi import WSGIServer
from gevent.queue import Queue
from geventsocketio.protocol import SocketIOProtocol
from geventsocketio.handler import SocketIOHandler
from geventsocketio.policyserver import FlashPolicyServer
__all__ = ['SocketIO... |
import api
import spur
import pwd
import random
from api.common import InternalException, SevereInternalException
def run():
db = api.common.get_conn()
try:
shell = spur.SshShell(
hostname=api.config.shell_host,
username=api.config.shell_username,
password=api.con... |
import os
import numpy as np
import pandas as pd
from pathlib import Path
from openpnm.utils import logging
logger = logging.getLogger(__name__)
def gaseous_species_in_water(target, chemical_formula,
temperature="throat.temperature"):
r"""
Calculate Henry's law constant for gaseou... |
"""
classes.py - Base classes for PyLink IRC Services.
This module contains the base classes used by PyLink, including threaded IRC
connections and objects used to represent IRC servers, users, and channels.
Here be dragons.
"""
import threading
from random import randint
import time
import socket
import threading
i... |
from . import models, serializers
from rest_framework import mixins, viewsets, generics
from rest_framework import status
from rest_framework.response import Response
import snorky.backend.django.rest_framework as snorky
class TaskViewSet(snorky.ListSubscribeModelMixin,
viewsets.ModelViewSet):
m... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#$HeadURL$
#$LastChangedDate$
#$LastChangedRevision$
# See LICENSE.txt for licensing terms
'''
Copyright (c) 2009 Pat Maupin
Automated testing for rst2pdf
'''
import os
import glob
import hashlib
from copy import copy
from optparse import OptionParser
from execmgr impo... |
import ResolvedStellarPops as rsp
import numpy as np
import itertools
import sys
import os
import logging
logger = logging.getLogger()
class model_grid(object):
def __init__(self,
cmd_input=None,
photsys=None,
filter=None,
object_mass=1e6,
... |
# import the monkeyrunner modules used by this program
import time;
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
from com.android.monkeyrunner.easy import EasyMonkeyDevice, By
# Connects to the current device, returning a MonkeyDevice object
device = MonkeyRunner.waitForConnection()
device.press('KE... |
"""
ChatterBot is a machine learning, conversational dialog engine.
"""
from .chatterbot import ChatBot
__version__ = '1.0.1'
__author__ = 'Gunther Cox'
__email__ = 'gunthercx@gmail.com'
__url__ = 'https://github.com/gunthercox/ChatterBot'
__all__ = (
'ChatBot',
)
|
#!/usr/bin/env python3
import subprocess
import pandas
import os
import time
import json
import re
batchsize = [32]
epoch = 10
perf_counters_multipliers = {'r5302c7': 1,
'r5308c7': 4,
'r5320c7': 8}
def run(params, command):
for key, val in params.items... |
#!/usr/bin/python3
# Email: t3knician@protonmail.com
# Twitter: @HOuadhour
# The QtCore module contains the core non GUI functionality. The QtGui
# contains classes for windowing system integration, event handling, 2D
# graphics, basic imaging, fonts and text. The QtWidgets module contains
# classes that provide a s... |
# Copyright (c) 2010-2012, GEM Foundation.
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenQuake is distri... |
import bson
import copy
import unicodecsv as csv
import datetime
import dateutil
import os
import pymongo
import pytz
from .. import config
from .. import tempdir as tempfile
from .. import util
from ..web import base
from ..web.request import AccessTypeList
EIGHTEEN_YEARS_IN_SEC = 18 * 365.25 * 24 * 60 * 60
BYTES_... |
import sys
import os
import argparse
import time
import numpy as np
from os.path import dirname
from sklearn import svm
from sklearn.externals import joblib
from matplotlib import image as img
from lib.utils.dr_utils import invert_dr, gradient_transform
from lib.attacks.svm_attacks import min_dist_calc
#-------------... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import print_function
import os
import shutil
import pytest
from astroquery.utils.commons import TableList
from astropy.tests.helper import remote_data
from ... import esasky
ESASkyClass = esasky.core.ESASkyClass()
@remote_data
class T... |
"""
classes.py - Base classes for PyLink IRC Services.
This module contains the base classes used by PyLink, including threaded IRC
connections and objects used to represent IRC servers, users, and channels.
Here be dragons.
"""
import threading
import time
import socket
import ssl
import hashlib
import ipaddress
im... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#$HeadURL$
#$LastChangedDate$
#$LastChangedRevision$
# See LICENSE.txt for licensing terms
'''
Copyright (c) 2009 Pat Maupin
Automated testing for rst2pdf
'''
import os
import glob
import hashlib
from copy import copy
from optparse import OptionParser
from execmgr impo... |
import simplejson
from datetime import datetime
import dateutil.parser
from django.utils.http import urlencode
from django.test import TestCase
from django.core.urlresolvers import reverse
from tastypie.resources import Resource
from tastypie import fields
from corehq.apps.groups.models import Group
from corehq.pillo... |
#!/usr/bin/python2
def get_argument_parser():
parser = argparse.ArgumentParser(
description="RCAS provides intuitive reports and publication ready graphics"
" from input peak intervals in BED foramt, generated from clip-seq.")
parser.add_argument("BED",
metavar="BED",
... |
from ..PulsePrimitives import *
from ..Compiler import compile_to_hardware
from ..PulseSequencePlotter import plot_pulse_files
import QGL.PulseShapes
from helpers import create_cal_seqs
def PiRabi(controlQ, targetQ, CRchan, lengths, riseFall=40e-9, amp=1, phase=0, calRepeats=2, showPlot=False):
"""
Variable length C... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Command Line Interface for Opalescence (Clifo)
"""
import argparse
import asyncio
import logging
import logging.config
import os
import unittest
import opalescence
from ..btlib.client import Client
from ..btlib.metainfo import MetaInfoFile
_LoggingConfig = {
"ver... |
##
## Copyright (C) 2013 Nokia, Inc
## Copyright (c) 2013-2014 Quanta Research Cambridge, Inc.
## 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 li... |
"""
`try` - Awesome cli tool to try out python packages.
:copyright: (c) by Timo Furrer
:license: MIT, see LICENSE for details
"""
__VERSION__ = "0.2.3"
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Biligrab-Danmaku2ASS
#
# Author: Beining@ACICFG https://github.com/cnbeining
# Author: StarBrilliant https://github.com/m13253
#
# Biligrab is licensed under MIT licence
# Permission has been granted for the use of Danmaku2ASS in Biligrab
#
# Copyright (c) 2014
#
# Perm... |
#
# ovirt-hosted-engine-ha -- ovirt hosted engine high availability
# Copyright (C) 2015 Red Hat, Inc.
#
# 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
# version 2.1 of the Licens... |
#! /usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Measures your typing speed in words per minute (WPM).
"""
__author__ = "Christian Stigen Larsen"
__copyright__ = "Copyright 2017 Christian Stigen Larsen"
__license__ = "GNU GPL v3 or later"
__version__ = "1.16"
|
from carto.exceptions import CartoException, CartoRateLimitException
from .base_dataset import BaseDataset
from ...utils import is_sql_query
class QueryDataset(BaseDataset):
def __init__(self, data, credentials, schema=None):
super(QueryDataset, self).__init__(credentials)
self._query = data
... |
# (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
from datetime import datetime
import os.path
from os import environ
import re
import socket
import ssl
import time
import warnings
from urlparse import urlparse
# 3rd party
import requests
import tornado... |
# -*- coding: utf-8 -*-
"""
MCLevel interfaces
Sample usage:
import mclevel
# Call mclevel.fromFile to identify and open any of these four file formats:
#
# Classic levels - gzipped serialized java objects. Returns an instance of MCJavalevel
# Indev levels - gzipped NBT data in a single file. Returns an MCIndevLev... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010-2014, GEM Foundation.
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Lice... |
import inspect
import sys
import rpyc
if sys.platform == "cli":
# Some compatibility fixes for IronPython
rpyc.core.brine.IMM_INTS = dict((i, bytes([i + 0x50])) for i in range(-0x30, 0xA0))
def BYTES_LITERAL(text):
return bytes(text)
rpyc.lib.compat.BYTES_LITERAL = BYTES_LITERAL
# TODO:... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# Sharoon Thomas, Raphael Valyi
#
# This program is free software: you can redistr... |
#Pyjsdl - Copyright (C) 2013 James Garnon
#from __future__ import division
from rect import Rect
from pyjamas.Canvas.HTML5Canvas import HTML5Canvas
from pyjamas.Canvas import Color
from __pyjamas__ import JS ###0.15
__docformat__ = 'restructuredtext'
class Surface(HTML5Canvas): ###0.15
"""
**pyjsd... |
"""
This module provides various regression analysis techniques to model the
relationship between the dependent and independent variables.
"""
import os
import numpy as N
from neuroimaging.core.image.image import Image
class LinearModelIterator(object):
def __init__(self, iterator, outputs=[]):
self.ite... |
from django.utils.translation import ugettext as _
from casexml.apps.case.xml import V2
from casexml.apps.phone.restore import RestoreConfig, RestoreParams
from corehq.apps.domain.models import Domain
from dimagi.utils.logging import notify_exception
from .models import DemoUserRestore
def turn_off_demo_mode(commcar... |
"""
The :mod:`tslearn.barycenters` module gathers algorithms for time series barycenter computation.
"""
# Code for soft DTW is by Mathieu Blondel under Simplified BSD license
import numpy
from scipy.interpolate import interp1d
from scipy.optimize import minimize
from tslearn.utils import to_time_series_dataset
from... |
#!/usr/bin/env python
# Copyright 2015-2016 Yelp 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 ... |
"""
===========================
Bayesian calibration routine
based on work of (Patil_et_al, 2010 - #http://www.map.ox.ac.uk/media/PDF/Patil_et_al_2010.pdf) in MCMC in pyMC3
and the works of bayesian calibration of (Kennedy and O'Hagan, 2001)
===========================
J. Fonseca script development 27.10.16
... |
"""
This module contains classes which are used to occasionally persist the status
of checks.
"""
# stdlib
import datetime
import logging
import os
import pickle
import platform
import sys
import tempfile
import traceback
import time
# project
import config
from compat.defaultdict import defaultdict
from util import ... |
# -*- coding: utf-8 -*-
"""
MCLevel interfaces
Sample usage:
import mclevel
# Call mclevel.fromFile to identify and open any of these four file formats:
#
# Classic levels - gzipped serialized java objects. Returns an instance of MCJavalevel
# Indev levels - gzipped NBT data in a single file. Returns an MCIndevLev... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010-2014, GEM Foundation.
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Lice... |
# This file is part of the GOsa project.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import functools
import hashlib
import logging
import cups
import multiprocessing
import os
import temp... |
"""
This code takes in a downloaded class schedule from UCONN's Student Administration System,
and determines which classes are in what content area as defined in the Undergraduate Catalog.
It's easiest to select one term, one campus, and search for undergraduate level courses
only. This script does not list campuses ... |
import subprocess
from ..core import color
from ..core import git
from ..exceptions import GitfuException
def run(*argv: str) -> None:
prevent_wip_commits()
git.run('commit', *argv, capture_output=False)
def prevent_wip_commits():
"""
Prevent committing if the last commit has a `wip` comment in it... |
# -*- coding: utf-8 -*-
from django.db import models
from django.db.models.query import QuerySet
class EditionManager(models.Manager):
def find_edition(self, release, edition, **kwargs):
if release:
kwargs[release.identifier] = release
if edition:
kwargs[edition.parent.iden... |
"""
The :mod:`tslearn.barycenters` module gathers algorithms for time series barycenter computation.
"""
# Code for soft DTW is by Mathieu Blondel under Simplified BSD license
import numpy
from scipy.interpolate import interp1d
from scipy.optimize import minimize
from sklearn.exceptions import ConvergenceWarning
impo... |
#!/usr/bin/env python
# Copyright Insight Software Consortium
#
# 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.txt
#
# Unless required by... |
"""
ArcGIS Toolbox for integrating the CEA with ArcGIS.
ArcGIS starts by creating an instance of Toolbox, which in turn names the tools to include in the interface.
These tools shell out to ``cli.py`` because the ArcGIS python version is old and can't be updated. Therefore
we would decouple the python version used by... |
from checks import Check
try:
import wmi
w = wmi.WMI()
except Exception:
wmi, w = None, None
# Device WMI drive types
class DriveType(object):
UNKNOWN, NOROOT, REMOVEABLE, LOCAL, NETWORK, CD, RAM = (0, 1, 2, 3, 4, 5, 6)
B2MB = float(1048576)
KB2MB = B2KB = float(1024)
def should_ignore_disk(name, bl... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
#
# $Id$
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of asses... |
# -*- coding: utf-8 -*-
"""
MCLevel interfaces
Sample usage:
import mclevel
# Call mclevel.fromFile to identify and open any of these four file formats:
#
# Classic levels - gzipped serialized java objects. Returns an instance of MCJavalevel
# Indev levels - gzipped NBT data in a single file. Returns an MCIndevLev... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2014-2018 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... |
#!/usr/bin/env python
import base64
import io
import json
import re
from datetime import datetime, time, timedelta
from django.conf import settings
from django.contrib import messages
from django.db import transaction
from django.db.models import Q
from django.http import (
Http404,
HttpResponse,
HttpRespo... |
"""This is Gittip's payday algorithm. I would appreciate feedback on it.
The payday algorithm is designed to be crash-resistant and parallelizable, but
it's not eventually consistent in the strict sense (iinm) because consistency
is always apodeictically knowable.
Exchanges (moving money between Gittip and the outsid... |
#!/usr/bin/env python
#
# This file is part of the clcache project.
#
# The contents of this file are subject to the BSD 3-Clause License, the
# full text of which is available in the accompanying LICENSE file at the
# root directory of this project.
#
from ctypes import windll, wintypes
import codecs
from collections ... |
import json,csv
amdtFilePath="Amendements_XIV.json"
def convertForNDFormat(amdtOD):
source = "www.assemblee-nationale.fr%s.asp" % amdtOD['representation.contenu.documentURI'][:-4]
print source
with open(amdtFilePath, 'r') as f:
json_data = json.load(f)
print "Json loaded !"
#List of all the normal... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.