text stringlengths 475 200k |
|---|
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import datetime
import pytz
import time
from openerp import tools
from openerp.osv import osv
from openerp.report import report_sxw
class pos_details(report_sxw.rml_parse):
def _get_invoice(self, inv_id):
... |
# -*- coding: utf-8 -*-
from gluon import current
def config(settings):
"""
Template settings for Seychelles
- designed to be used in a Cascade with an application template
"""
#T = current.T
# Pre-Populate
settings.base.prepopulate.append("locations/SC")
# Uncomment to rest... |
import hashlib
import collections
import re
from util import hook, text
# variables
colors = collections.OrderedDict([
('red', '\x0304'),
('orange', '\x0307'),
('yellow', '\x0308'),
('green', '\x0309'),
('cyan', '\x0303'),
('ltblue', '\x0310'),
('rylblue', '\x0312'),
('blue', '\x0302... |
# Copyright 2014 The Oppia 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 ... |
# 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... |
# -*- coding: utf-8 -*-
"""
Description:
This is the main driver of the SmartMT gui
Usage:
python start.py
Author: YingzhiGou
Date: 20/06/2017
"""
import inspect
import os
import sys
import webbrowser
import sip
from qtpy import QtCore
from qtpy.QtWidgets import QMainWindow, QWidget, ... |
# coding=utf-8
from bangumi.finder import Finder, PhantomJSFinder, ChromeFinder, FinderException
from bangumi.downloader import Downloader
from common.config import Config
import argparse
def create_finder(url):
browser = Config().get_property("parameters", "browser")
if browser == "phantomjs":
finder... |
"""
Test cases for codeop.py
Nick Mathewson
"""
import unittest
from test.test_support import run_unittest, is_jython
from codeop import compile_command, PyCF_DONT_IMPLY_DEDENT
if is_jython:
import sys
import cStringIO
def unify_callables(d):
for n,v in d.items():
if callable(v)... |
import matplotlib.pyplot as plt
import numpy as np
from igakit.cad_geometry import cad_geometry
from igakit.cad_geometry import line as patch
from pigasus.fit.curfit import curfit
from pigasus.fit.curfit import compute_uk
cos = np.cos
sin = np.sin
sqrt = np.sqrt
pi = np.pi
#------------------------... |
# Copyright 2014 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 ... |
'''
lock.py - this file is part of S3QL (http://s3ql.googlecode.com)
Copyright (C) Nikolaus Rath <[EMAIL]>
This program can be distributed under the terms of the GNU GPLv3.
'''
from __future__ import division, print_function, absolute_import
from .common import setup_logging, CTRL_NAME, QuietError
from .parse_args i... |
#!/usr/bin/python
import subprocess, os
import cgi
import cgitb
import time
import gridmatlab.configuration as config
from gridmatlab.miscfunctions import load_solver_data, update_solver_data
import miginterface as mig
import json
import cPickle
import traceback
import signal
cgitb.enable()
def main(form, output_fo... |
import os
import sys
import tempfile
import commands
import subprocess
# James builds the DMG manually, by copying
# and pasting one block of commands at a time
# from the Launcher's Mac build page on the
# CVL's public wiki:
# https://confluence-vre.its.monash.edu.au/display/CVL/MASSIVE-CVL+Launcher+Mac+OS+X+build+i... |
#!/usr/bin/python3
"""
This file runs operating system functions to compile and build
the executables in the directories and copy them to the corresponding
directories.
Author: Howard Cheung ([EMAIL])
Date: 2017/07/23
License of the source code: MIT license
"""
from distutils.dir_util import c... |
# Copyright 2018 The Oppia 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 ... |
##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2012-2015 Uwe Hermann <[EMAIL]>
## Copyright (C) 2019 Zhiyuan Wan <[EMAIL]>
## Copyright (C) 2019 Kongou Hikari <[EMAIL]>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU Genera... |
# ****************************************************************************
# Copyright 2018 The Apollo 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
#
# ht... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'encoder-widget2.ui'
#
# Created by: PyQt5 UI code generator 5.12.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_DeenEncoderWidget(object):
def setupUi(self, DeenEncoderWi... |
from numpy.distutils.ccompiler import simple_version_match
from numpy.distutils.fcompiler import FCompiler
compilers = ['SunFCompiler']
class SunFCompiler(FCompiler):
compiler_type = 'sun'
description = 'Sun or Forte Fortran 95 Compiler'
# ex:
# f90: Sun WorkShop 6 update 2 Fortran 95 6.2 Patch 11169... |
#!/usr/bin/python
#
# This CGI script gives you the location of your Python interpreter,
# your path to Sendmail, your environment variables and a list of the
# Python modules that are installed on your web server.
#
import glob, os, re, string, sys, traceback
from stat import *
lang2css = {
'0': '''
th ... |
""" Dynamic C++ bindings generator.
"""
import sys, string
### helper to get the version number from root-config
def get_version():
try:
import commands
stat, output = commands.getstatusoutput("root-config --version")
if stat == 0:
return output
except Exception:
pass
# semi-... |
# Automatically update an NVDA add on.
# By Bryan Smart ([EMAIL])
import os
import threading
import urllib
import tempfile
import gui
import wx
from callafter import *
class NVDAAddOnUpdater (object):
def __init__ (self, add_on_name, update_url, current_version):
self._add_on_name = add_on_name
self._update_... |
# -*- coding: utf-8 -*-
'''
Covenant Add-on
Copyright (C) 2017 Covenant
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) a... |
"""
This module defines the attributes of the
PyPI package for the Mbed SDK
"""
from distutils.core import setup
from setuptools import find_packages
from os.path import isfile, join
from tempfile import TemporaryFile
from shutil import copyfileobj
LICENSE = open('LICENSE').read()
DESCRIPTION = """A set of Python scr... |
from L500analysis.data_io.get_cluster_data import GetClusterData
from L500analysis.utils.utils import aexp2redshift
from L500analysis.plotting.tools.figure_formatting import *
from L500analysis.plotting.profiles.tools.profiles_percentile \
import *
from L500analysis.plotting.profiles.tools.select_profiles \
imp... |
import FWCore.ParameterSet.Config as cms
procName='DIGI'
process = cms.Process(procName)
# import of standard configurations
process.load('Configuration.StandardSequences.Services_cff')
process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
process.load('FWCore.MessageService.MessageLogger_cfi')
process.load('Config... |
# Created By: Virgil Dupras
# Created On: 2009-10-23
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-... |
import os
import sqlite3
from flask import Flask, request, session, g, redirect, url_for, abort, \
render_template, flash
# create our little application :)
app = Flask(__name__)
app.config.from_object(__name__)
# Load default config and override config from an environment variable
app.config.update(dict(
DA... |
#
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (C) 2011-2014 Star2Billing S.L.
#
# The Initia... |
"""
This code was generated by Codezu.
Changes to this file may cause incorrect behavior and will be lost if
the code is regenerated.
"""
from mozurestsdk.mozuclient import default as default_client
from mozurestsdk.mozuurl import MozuUrl;
from mozurestsdk.urllocation import UrlLocation
from mozure... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cint, cstr, flt
from frappe import _
from frappe.model.document import Document
from operator import itemgetter... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
"""Simple registration request and response parsing and object representation
This module contains objects representing simple registration requests
and responses that can be used with both OpenID relying parties and
OpenID providers.
1. The relying party creates a request object and adds it to the
C{L{AuthReq... |
#!/usr/bin/env python
#
# Georgia Tech Spring 2014
#
# scheduler.py: script to manage experiments and data by finding
# appropriate clients, copying files into those directories, and
# potentially modifying the scheduling frequency information
#
# Note: you *MUST NOT* start more than 1 instance of this program at
# the... |
from flask_wtf import Form
from wtforms import StringField, PasswordField
from wtforms.validators import DataRequired
from TsetseCheckout.user.models import User
class LoginForm(Form):
username = StringField('Username', validators=[DataRequired()])
password = PasswordField('Password', validators=[DataRequire... |
import itertools
import numpy
import six
import chainer
from chainer import backend
from chainer.backends import cuda
from chainer import configuration
from chainer import function
from chainer.functions.activation import relu
from chainer.functions.activation import tanh
from chainer.functions.array import concat
fr... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from collections import defaultdict
class Migration(DataMigration):
# Flag to indicate if this migration is too risky
# to run online and needs t... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
raster.py
---------------------
Date : February 2013
Copyright : (C) 2013 by Victor Olaya and Alexander Bruy
Email : volayaf at gmail dot com
**********... |
import asyncio
import atexit
import codecs
import io
import os
import subprocess
import sys
# The default event loop on Windows doesn't support subprocesses, so we need to
# use the proactor loop. See:
# https://docs.python.org/3/library/asyncio-eventloops.html#available-event-loops
# Because the event loop is essenti... |
"""Client part of socket communication
"""
import json
import socket
from arithmetic_computing.communication.base_socket import BaseSocket
from arithmetic_computing.communication.communication_error \
import CommunicationError
class ClientSocket(BaseSocket):
"""Class that represents the client in a socket co... |
from .positive_alert_test_case import PositiveAlertTestCase
from .negative_alert_test_case import NegativeAlertTestCase
from .alert_test_suite import AlertTestSuite
class TestAlertDuoFailOpen(AlertTestSuite):
alert_filename = "duo_fail_open"
# This event is the default positive event that will cause the
... |
# reggen.py - registry file generator for Windows shell context menus
#
# Copyright 2009 Yuki KODAMA <[EMAIL]>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2, incorporated herein by reference.
import sys
import os.path
import glob
import re
import cod... |
from django.test import TestCase
import pandas as pd
import numpy as np
from .models import MyModel, Trader, Security, TradeLog, MyModelChoice
from django_pandas.io import read_frame
class IOTest(TestCase):
def setUp(self):
data = {
'col1': np.array([1, 2, 3, 5, 6, 5, 5]),
'col2': ... |
#!/usr/bin/env python2.6
#
# Software License Agreement (GPLv2 License)
#
# Copyright (c) 2012 TheCorpora SL
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License... |
"""
Given a list of integers, made up of (hopefully) a small number of long runs
of consecutive integers, compute a representation of the form
((start1, end1), (start2, end2) ...). Then answer the question "was x present
in the original list?" in time O(log(# runs)).
"""
import bisect
def intranges_from_list... |
# OS
from subprocess import call
import os
import sys
# Djano
from django.core.files import File as FileDj
from django.http import HttpResponse
from django import forms
from django.core.files.temp import NamedTemporaryFile
# Signal processing
import numpy as np
import wave
from scipy.signal import butter, lfilter
# ... |
"""Generates a bash script for installing by hand or light config management integration"""
import json
import os
import os.path
import shutil
import subprocess
import tempfile
import checksumdir
import pkg_resources
import dcos_installer.config_util
import gen.build_deploy.util as util
import gen.template
import ge... |
import numpy as np
from collections import Counter, namedtuple
SEED = 0
np.random.seed = SEED
def loaddataset(name, train_suffix='_TRAIN', test_suffix='_TEST'):
data = np.loadtxt('UCR_TS_Archive_2015/{0}/{0}{1}'.format(name, train_suffix), delimiter=',')
test_data = np.loadtxt('UCR_TS_Archive_2015/{0}/{0}{1}... |
import os
import pytest
import json
import logging
import logging.handlers
import pyethereum.slogging as slogging
class TestHandler(logging.handlers.BufferingHandler):
def __init__(self):
logging.Handler.__init__(self)
self.capacity = 10000
self.buffer = []
@property
def logged(s... |
# -*- 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 'BlogPost.description'
db.alter_column(u'blog_blogpost', 'description', self.gf('django.db... |
# -*- coding: utf-8 -*-
"""
mpsvm.py
Contains the implementation of a max-plus support vector machine that
uses convex optimization to find the best "separating corner" for a set
of (possibly max-linearly seperable) training patterns.
"""
import enum
import dccp
import cvxpy as cvx
import numpy as np
def _vec_exp_af... |
# different layers used in the project
# from tensorflow.python.ops import variable_scope
# from tensorflow.python.ops import math_ops
# from tensorflow.python.ops import array_ops
# from tensorflow.python.ops import nn_ops
import tensorflow as tf
def fully_connected(name, label, var_in, dim_in, dim_out,
... |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
)
from ..utils import (
ExtractorError,
HEADRequest,
str_to_int,
)
class MixcloudIE(InfoExtractor):
_VALID_URL = r'^(?:https?://)?(?:www\.)?mixcloud\.com/([^/]+)/([^/]+... |
from random import randrange
import string
from collections import deque, defaultdict
def remove_punct(text):
return text.translate(string.maketrans("", ""), string.punctuation)
class State(object):
"""
This class represents single state in Markov chain
"""
def __init__(self, state):
# tu... |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for implementations of L{IReactorProcess}.
"""
from __future__ import division, absolute_import, print_function
import io
import os
import signal
import sys
import threading
import twisted
import subprocess
from twisted.trial.unittest... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import datetime as dt
import logging
import re
import requests
from bs4 import BeautifulSoup
from trojmiastopl.utils import get_content_for_url
try:
from __builtin__ import unicode
except ImportError:
unicode = lambda x, *args: x
log = logging.getLogger(__file__)
... |
"""Revised Policy Approve
Implements the changes suggested by Security
Fairy. Detaches the existing policy for the
queried role and attaches the revised policy.
"""
import boto3
import os
import logging
import re
from setup_logger import create_logger
from aws_entity import AWSEntity
from botocore.exceptions import ... |
import os
import pytest
import numpy as np
import nibabel as nb
import pandas as pd
from nltools.simulator import Simulator
from nltools.data import (Brain_Data,
Adjacency,
Groupby)
from nltools.stats import threshold, align
from nltools.mask import create_sphere, roi... |
# -*- coding: utf-8 -*-
from ..patch import xraylib
from ..patch.pint import ureg
from ..utils.hashable import CompHashable
from . import element
import numpy as np
class Interaction(CompHashable):
def __init__(self, name, energy, prob):
self._name = name
self._energy = energy
self._prob... |
"""
Tests for the recently enrolled messaging within the Dashboard.
"""
import datetime
import unittest
import ddt
from django.conf import settings
from django.urls import reverse
from django.utils.timezone import now
from opaque_keys.edx import locator
from pytz import UTC
from common.test.utils import XssTestMixi... |
# -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2017 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by th... |
import warnings
import numpy as np
from pymatgen.analysis.structure_prediction.substitution_probability import \
SubstitutionPredictor
from pymatgen.core.periodic_table import Specie, Element
def get_dopants_from_substitution_probabilities(structure, num_dopants=5,
... |
#!/usr/bin/python
import sys
import serial
from intelhex import IntelHex
import time
import datetime
def add8(a, b):
return (a + b & 0xFF)
page_size = 255
class Hex2BinConv():
def __init__(self, out):
self.hex = IntelHex()
self.out = out
def load(self, filename):
prin... |
###############################################################################
# Copyright 2016 - Climate Research Division
# Environment and Climate Change Canada
#
# This file is part of the "EC-CAS diags" package.
#
# "EC-CAS diags" is free software: you can redistribute it and/or modify
# it under... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
# 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... |
# -*- coding: utf-8 -*-
###
# (C) Copyright (2012-2017) Hewlett Packard Enterprise Development LP
#
# 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 limi... |
#-*-:coding:utf-8-*-
import ply.lex
import ply.yacc
from blindtex.latex2ast import lexer
from blindtex.latex2ast.math_object import MathObject
tokens = lexer.tokens
precedence = (
('right', 'SUP', 'SUB'),
)
# In this parser the end result will be a python list with math_objects as elements.
# Each math obje... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2008 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.
# Jordi Esteve <[EMAIL]>
# $Id$
#
# This program is fr... |
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
from numpy import sin, sum
from .go_benchmark import Benchmark
class Infinity(Benchmark):
r"""
Infinity objective function.
This class defines the Infinity [1]_ global optimization problem. This
is a multimodal... |
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import os
IMG_DIR= "/var/www/iMLAnonResultPlots/"
if "IML_SERVER" in os.environ:
print( "Found IML Server environment entry, saving plots to: " + os.environ["IML_SERVER"] )
PLOT_BASE_URL = "http://" + os.environ["IML_SE... |
# This file is part of PULP.
#
# PULP is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# PULP is distributed in the hope that it will ... |
#
# Copyright (c) 2010-2011, 2015
# Nexa Center for Internet & Society, Politecnico di Torino (DAUIN)
# and Simone Basso <[EMAIL]>.
#
# This file is part of Neubot <http://www.neubot.org/>.
#
# Neubot is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License ... |
# -*- Mode: python; coding: utf-8; tab-width: 8; indent-tabs-mode: t; -*-
#
# Copyright (C) 2009 Jonathan Matthew <[EMAIL]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, o... |
# Copyright (c) 2012-2014, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
"""
Gaussian Processes regression examples
"""
try:
import pylab as pb
except:
pass
import numpy as np
import GPy
def olympic_marathon_men(optimize=True, plot=True):
"""Run a standard Gaus... |
"""
Test the partitions and partitions service
"""
from unittest import TestCase
from mock import Mock
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from stevedore.extension import Extension, ExtensionManager
from xmodule.partitions.partitions import (
Group, UserPartition, UserPartitionError, No... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'UserProfile'
db.create_table('users_userprofile', (
... |
#Variational Monte Carlo program for the Helium atom - parallelized with pypar
#Written by Magnar K. Bugge
from math import sqrt,exp
from numpy import zeros,double,linspace,array
from random import random
import pypar
MCcycles = 10000000 #Number of MC cycles
MCcycles2 = 10000 #Number of MC cycles for determination of... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
"""
Content sync for Djax
"""
from djax.registry import content_registry, build_registry
from djax.gateway import content_client, trigger_client
import uuid
import logging
from django.db.models import Manager
from django.contrib.contenttypes.models import ContentType
from pax.util import slugify
import re
log = loggin... |
# Code from Chapter 3 of Machine Learning: An Algorithmic Perspective (2nd Edition)
# by Stephen Marsland (http://stephenmonika.net)
# You are free to use, change, or redistribute the code in any way you wish for
# non-commercial purposes, but please maintain the name of the original author.
# This code comes with no ... |
# 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
'''YABFD is Yet Another Brute Force Detector.
Copyright (c) 2008, 2009 Hraban Luyat
Search logfiles for hosts that are brute-forcing passwords on a server through
a daemon that allows remote login.
Inspired by Daniel Drown's SBFD: <http://dan.drown.org/sbfd/>.
'''
import collections
import Con... |
#Splitting out maringal effects to see if they can be generalized
from statsmodels.compat.python import lzip, callable, range
import numpy as np
from scipy.stats import norm
from statsmodels.tools.decorators import cache_readonly, resettable_cache
#### margeff helper functions ####
#NOTE: todo marginal effects for gr... |
###############################################################################
# The MIT License (MIT)
#
# Copyright (c) 2021 Baldur Karlsson
#
# 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 Softwar... |
# -*- coding: utf-8 -*-
# Copyright 2020 OpenSynergy Indonesia
# Copyright 2020 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import models, api, fields
class HrAnalyticTimesheet(models.Model):
_name = "hr.analytic.timesheet"
_inherit = "hr.analyti... |
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2014 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 glob,requests,re
from bs4 import BeautifulSoup
hostlist = ['www.abc.net.au', 'www.news.com.au', 'au.news.yahoo.com','www.smh.com.au','www.dailytelegraph.com.au',
'www.theage.com.au', 'www.theguardian.com', 'www.brisbanetimes.com.au', 'www.9news.com.au',
'www.afr.com', 'www.heraldsun.com.a... |
#!/usr/bin/python
import os
import random
import tempfile
import unittest
import lcm
import client
class TestLcmFile(unittest.TestCase):
def setUp(self):
# tempfile.mktemp() is deprecated, so make our own random filename :-/
self.log_filename = os.path.join(tempfile.gettempdir(),
"lcm_... |
"""
___init___.py
"""
__all__ = ["VERSION", "set_locale", "get_locale_language", "get_parsed_language", "install_gettext", "get_summary"]
import platform
import locale
import gettext
import os
import cairo
import gtk
import sys
VERSION = open(os.path.join(os.path.dirname(__file__), "..", "VERSION")).read()
DEFAULT_L... |
#!/usr/bin/python
import os, re, sys
rules = [
(r'[\t ]+(?=[\r\n])', ''), #replace spaces before newlines
(r'@property\s*\(((?:[\w ]+,)*[\w ]+)\)\s*',
lambda m: '@property (%s) ' % (', '.join([s.strip() for s in m.group(1).split(',')]))), #space out property declarations
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from twisted.internet import reactor, protocol
# a client protocol
class InClient(protocol.Protocol):
# {username: connection_id}
users = {}
# {connection_id: nethud.proto.client}
clients = {}
def... |
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights... |
#!/usr/bin/env python
# Copyright 2011 Google Inc. All Rights Reserved.
"""Windows specific utils."""
import ctypes
import exceptions
import logging
import os
import re
import time
import _winreg
import ntsecuritycon
import pywintypes
import win32api
import win32file
import win32security
from google.protobuf import ... |
# Copyright (c) 2019-2020 Manfred Moitzi
# License: MIT License
from typing import TYPE_CHECKING
from ezdxf.lldxf import validator
from ezdxf.lldxf.attributes import (
DXFAttr, DXFAttributes, DefSubclass, XType, RETURN_DEFAULT,
group_code_mapping,
)
from ezdxf.lldxf.const import SUBCLASS_MARKER, DXF2000
from ez... |
class Solution:
def add(self, num1, num2):
num = []
carry = 0
maxLen = max(len(num1), len(num2))
num1.extend(itertools.repeat(0, maxLen - len(num1)))
num2.extend(itertools.repeat(0, maxLen - len(num2)))
for a, b in zip(num1, num2):
sum = a + ... |
#!/usr/bin/python
"""
ipums_data_prep.py
Parse the data and syntax files from the IPUMS project and prepare
them for loading into an RDBMS (tested on PostgreSQL 9.1).
This script uses the spss syntax file and the gzipped raw data file generated
by an IPUMS extract. There are 4 ways to run thi... |
# Simulator for a 'reverse' phone book - keys are ~all phone numbers in the
# world, values are lists of phone books which contain that phone number.
# Approach: Use NetworkX to build a example representative social network.
# Iterate all nodes (i.e. users) in the graph and for each vertex (friend phone
# number in th... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import tinymce.models
import easy_thumbnails.fields
class Migration(migrations.Migration):
dependencies = [
('cms', '0013_urlconfrevision'),
('sites', '0001_initial'),
('djangocms_new... |
# Copyright (c) 2011-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
#
# Un... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.