src
stringlengths
721
1.04M
# -*- coding: utf-8 -*- """ Created on Fri Dec 23 14:46:14 2011 @author: moritz """ # This file implements the SLIP model from scipy.integrate.vode import dvode, zvode from scipy.integrate import odeint, ode from pylab import (zeros, sin, cos, sqrt, array, linspace, arange, ones_like, hstack, vsta...
#!/usr/bin/env python # # Copyright (c) 2001 - 2016 The SCons Foundation # # 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 us...
"""Basis for different optimization algorithms. Optimizer provides interface for creating the update rules for gradient based optimization. It includes SGD, NAG, RMSProp, etc. Copyright 2015 Markus Oberweger, ICG, Graz University of Technology <oberweger@icg.tugraz.at> This file is part of DeepPrior. DeepPrior is f...
#!/usr/bin/env python # 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 option) any later version. # # This program is distributed in the hop...
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 Lice...
# Copyright 2012 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
import mock import pytest import time from datetime import datetime from flask import url_for from mock import Mock, patch from app.main.models import User, Suit from app.main.views import authenticated_within max_age = 50 mock_time_more_than_max_age = Mock() mock_time_more_than_max_age.return_value = ( time.mk...
""" Load GEOJSON text files from a given directory to individua vector.GeoJsonLayer models """ import os from django.core.management.base import BaseCommand, CommandError from ...models import GeoJsonLayer WGS84_SRID = 4326 def load_geojson_layer(geojson_filepath): with open(geojson_filepath, "rt", encoding="u...
import json from unittest import TestCase from corehq.elastic import ESError, SIZE_LIMIT from .es_query import HQESQuery, ESQuerySet from . import facets from . import filters from . import forms, users class ElasticTestMixin(object): def checkQuery(self, query, json_output): msg = "Expected Query:\n{}\n...
""" Contains data structures designed for manipulating panel (3-dimensional) data """ # pylint: disable=E1103,W0231,W0212,W0621 from __future__ import division import warnings import numpy as np import pandas.compat as compat from pandas.compat import OrderedDict, map, range, u, zip from pandas.compat.numpy import f...
#! /usr/bin/python3 import sys import os import threading import decimal import time import json import re import requests import collections import logging from logging import handlers as logging_handlers D = decimal.Decimal import apsw import flask from flask.ext.httpauth import HTTPBasicAuth from tornado.wsgi impo...
from __future__ import division from past.utils import old_div from proteus import Domain from proteus import Context ct=Context.Options([ # General parameters # ("T",0.1,"Final time"), ("nDTout",1,"Number of time steps to archive"), ("refinement",0,"Level of refinement"), ("unstructured",False,"Us...
#!/usr/bin/env python from __future__ import print_function from __future__ import division import rpy2.robjects as robjects from rpy2.robjects import pandas2ri import pandas as pd import numpy as np from mipframework import Algorithm, AlgorithmResult, TabularDataResource class ThreeC(Algorithm): def __init__...
def makeCallIndividualPeaksScript(datasetPrefix, ofprefixListFileName, pooledTAFileName, pooledTAFileCore, peakOutputDir, fraglenListFileName, blacklistFileName, codePath, scriptFileName): # ASSUMES THAT THE FRAGMENT LENGTHS ARE IN THE SAME ORDER AS THE ofPrefix's ofprefixListFile = open(ofprefixListFileName) fra...
#!/usr/bin/python3 # This file is part of Munin. # Munin 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, or # (at your option) any later version. # Munin is distributed in t...
import concurrent.futures import indicoio import json import os import socket import urllib.request from os.path import join, exists from PIL import Image, ImageDraw class Grabber(object): def __enter__(self): try: with open(self._captured_data_path, 'r') as f: self.captured_da...
# write documentation in LaTeX format import sys import os import os.path import re import datetime, time import decimal # template details THIS_DIR = os.path.dirname(os.path.abspath(__file__)) TEMPLATE_DIR = os.path.abspath(THIS_DIR + '/templates') HEADER = os.path.join(TEMPLATE_DIR, 'header.tex') FOOTER = os.path.jo...
import pytest import dask.array as da import numpy as np import numpy.testing as npt from dask.array.utils import assert_eq import sklearn.metrics as sm import dask_ml.metrics as dm def test_pairwise_distances(X_blobs): centers = X_blobs[::100].compute() result = dm.pairwise_distances(X_blobs, centers) e...
#!/usr/bin/env python ## Copyright (c) 2015, Eric R. Schendel. ## 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, th...
import sys from ged4py.parser import GedcomReader from ged4py.date import DateValueVisitor class DateFormatter(DateValueVisitor): """Visitor class that produces string representation of dates. """ def visitSimple(self, date): return f"{date.date}" def visitPeriod(self, date): return f...
import logging import tornado import tornado.template import os from tornado.options import define, options # Make filepaths relative to settings. path = lambda root,*a: os.path.join(root, *a) ROOT = os.path.dirname(os.path.abspath(__file__)) define("port", default=8888, help="run on the given port", type=int) define...
## INFO ######################################################################## ## ## ## Python and Cython Syntax Highlighters ## ## ===================================== ...
#!/usr/bin/env python # coding: iso-8859-15 import sys import pgdb import pg from copy import deepcopy from optparse import OptionParser import getpass from database import getDBname, getDBhost, getDBport, getDBuser INTRO = """ Conversion between ETRS89 and ITRS2000 coordinates based on Memo : Specifications for refe...
import requests from .common import fetch_html from bs4 import BeautifulSoup from torrent import Torrent class One337x(object): """Crawler for https://1337x.to""" def __init__(self): super(One337x, self).__init__() self.domain = 'https://1337x.to' def fetch_torrents(self, search_term): ...
#!/usr/bin/env python3 import sys sys.path.append('..') # fix import directory from app import app from app.models import User from PIL import Image from app.utils import rand_str ctx = app.test_request_context() ctx.push() users = User.query.all() for u in users: if u._avatar: with Image.open('../uploa...
# # mjmud - The neverending MUD project # # Copyright (c) 2014, Matt Jordan # # See https://github.com/matt-jordan/mjmud for more information about the # project. Please do not contact the maintainers of the project for information # or assistance. The project uses Github for these purposes. # # This program is free so...
#!/usr/bin/env python ## \file shape_optimization.py # \brief Python script for performing the shape optimization. # \author T. Economon, T. Lukaczyk, F. Palacios # \version 6.2.0 "Falcon" # # The current SU2 release has been coordinated by the # SU2 International Developers Society <www.su2devsociety.org> # with ...
# -*- 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): # Adding field 'Violation.silent' db.add_column('dynamic_validation_violation', 'silent', ...
# Speak.activity # A simple front end to the espeak text-to-speech engine on the XO laptop # http://wiki.laptop.org/go/Speak # # Copyright (C) 2008 Joshua Minor # This file is part of Speak.activity # # Parts of Speak.activity are based on code from Measure.activity # Copyright (C) 2007 Arjun Sarwal - arjun@laptop.or...
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
# Copyright 2009-present MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you # may not use this file except in compliance with the License. You # may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
#!/usr/bin/env python2.7 # token.py: a digital token implemented on top of pybc.coin # #------------------------------------------------------------------------------ from __future__ import absolute_import import logging #------------------------------------------------------------------------------ from . import j...
# -*- coding: utf-8 -*- """ Sahana Eden Supply Model @copyright: 2009-2016 (c) Sahana Software Foundation @license: MIT 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 withou...
#!/usr/bin/env python # *- coding: utf-8 -*- # vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 textwidth=79: """ Installer of Dr. Disco [License: GNU General Public License v3 (GPLv3)] This file is part of Dr. Disco. FuMa is free software: you can redistribute it and/or modify it under the terms of the G...
""" """ import unittest import json import datetime from freezegun import freeze_time from flask import Flask from flask.ext.restful import fields, marshal from flask.ext.restful.fields import MarshallingException from acmapi.fields import Date from acmapi.fields import root_fields from acmapi.fields import event...
#!/usr/bin/python2.5 # Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
#!/usr/bin/env python import pygame, os, sys, subprocess, time import RPi.GPIO as GPIO from pygame.locals import * from subprocess import * if "TFT" in os.environ and os.environ["TFT"] == "0": # No TFT screen SCREEN=0 pass elif "TFT" in os.environ and os.environ["TFT"] == "2": # TFT screen with mouse ...
import pybem2d.core.bases as pcb import pybem2d.core.segments as pcs import pybem2d.core.quadrules as pcq import pybem2d.core.kernels as pck import pybem2d.core.mesh as pcm import pybem2d.core.assembly as pca import pybem2d.core.evaluation as pce import pybem2d.core.visualization as pcv import numpy as np k=10 nelem...
#!/usr/bin/env python """Divisi2: Commonsense Reasoning over Semantic Networks Divisi2 is a library for reasoning by analogy and association over semantic networks, including common sense knowledge. Divisi uses a sparse higher-order SVD and can help find related concepts, features, and relation types in any knowledge...
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
from builtins import range import numpy as np from gpkit import Model, Variable, SignomialsEnabled, SignomialEquality, \ VarKey, units, Vectorize, settings from gpkitmodels.SP.SimPleAC.SimPleAC_mission import Mission, SimPleAC from gpkitmodels.SP.atmosphere.atmosphere import Atmosphere # SimPleAC with multimission...
# -*- coding: utf-8 -*- ############################################################################### # # StructuredQuery # Retrieves a list-based feed containing data in your Google spreadsheet that meets a specified criteria. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the ...
# BSD 3-Clause License # # Copyright (c) 2019, Elasticsearch BV # 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, t...
# Copyright (c) 2016 Red Hat, 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 require...
#!/usr/bin/env python # -*- encoding: utf-8 -*- # # Verifies required libraries and tools exist and are valid versions. # Is so creates scripts/compile/env_exec.sh containing environment used # by bazel when building. # # When changing this script, verify that it still works by running locally # on a mac. Then verify t...
from django import forms class LocationWidget(forms.widgets.Widget): """Forms widget to represent a location. Uses Google Maps API to represent a location on a map with a marker. """ def __init__(self, *args, **kwargs): super(LocationWidget, self).__init__(*args, **kwargs) def ren...
from nose.tools import * from testfixtures import LogCapture from bigbang import repo_loader import bigbang.archive as archive import bigbang.mailman as mailman import bigbang.parse as parse import bigbang.process as process import bigbang.utils as utils import mailbox import os import networkx as nx import pandas as p...
# Create your views here. from datetime import datetime from django.utils.translation import ugettext_lazy as _ from django.shortcuts import render_to_response from django.core.exceptions import ObjectDoesNotExist from django.http import HttpResponseRedirect from django.template import RequestContext from django.contri...
from __future__ import absolute_import, division, print_function, unicode_literals from io import open import os import unittest import mdtraj import numpy as np import AdaptivePELE.atomset.atomset as atomset from AdaptivePELE.atomset import RMSDCalculator from AdaptivePELE.atomset import SymmetryContactMapEvaluator as...
import logging import datetime import os from scrapy.crawler import CrawlerProcess from scrapy.settings import Settings from scrapy.utils.log import configure_logging import spiders def run(): # Logging settings configure_logging(install_root_handler=False) logging.basicConfig( datefmt='%Y-%m-%d ...
import math from decimal import Decimal from pxp.exception import FunctionError from pxp.function import FunctionArg, FunctionList, InjectedFunction from pxp.stdlib.types import number_t, boolean_t def math_abs(resolver, value): """Returns the absolute value of value.""" val = resolver.resolve(value) return va...
# coding: utf-8 import os import shutil import tempfile from burglar import daily from burglar import zhuanlan from burglar import weixin from burglar import Burglar def test_daily(): rv = daily.parse(False) count = len(rv['entries']) rv = daily.parse() assert count == len(rv['entries']) def test_...
import random from CellModeller.Regulation.ModuleRegulator import ModuleRegulator from CellModeller.Biophysics.BacterialModels.CLBacterium import CLBacterium from CellModeller.GUI import Renderers import numpy import math max_cells = 400000 #cell_colors = {0:[0.0, 1.0, 0.0], # 1:[0.0, 0.0, 1.0], # ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('cms', '0016_auto_20160608_1535'), ] operations = [ migrations.CreateModel( name='form', fields=[ ...
import time import numpy as np import tensorflow as tf import awesome_gans.image_utils as iu import awesome_gans.magan.magan_model as magan from awesome_gans.datasets import CelebADataSet as DataSet from awesome_gans.datasets import DataIterator results = {'output': './gen_img/', 'model': './model/MAGAN-model.ckpt'}...
"""pysite URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-bas...
# -*- coding: utf-8 -*- # Copyright 2011 Takeshi KOMIYA # # 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...
#!/usr/bin/env python # pmx Copyright Notice # ============================ # # The pmx source code is copyrighted, but you can freely use and # copy it as long as you don't change or remove any of the copyright # notices. # # ---------------------------------------------------------------------- # pmx is Copyright (C...
# # The contents of this file are subject to the Apache 2.0 license you may not # use this file except in compliance with the License. # # Software distributed under the License is distributed on an "AS IS" basis, # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License # for the specific language gov...
from wfuzz.externals.moduleman.plugin import moduleman_plugin from wfuzz.plugin_api.payloadtools import ShodanIter from wfuzz.plugin_api.base import BasePayload from wfuzz.fuzzobjects import FuzzWordType @moduleman_plugin class shodanp(BasePayload): name = "shodanp" author = ("Xavi Mendez (@xmendez)",) ve...
import os import logging import pandas as pd import glob import re import datetime as dt from collections import Counter logger = logging.getLogger('hr.chatbot.stats') trace_pattern = re.compile( r'../(?P<fname>.*), (?P<tloc>\(.*\)), (?P<pname>.*), (?P<ploc>\(.*\))') def collect_history_data(history_dir, days): ...
# # Copyright 2012-2014 John Whitlock # # 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...
# -*- coding: utf-8 -*- #----------------------------------------------------------------------------- # OpenModes - An eigenmode solver for open electromagnetic resonantors # Copyright (C) 2013 David Powell # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Gen...
# Copyright (C) 2020 OpenMotics BV # # 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 option) any later version. # # This program is distribu...
''' Created on Apr 7, 2016 @author: Alex Ip, Geoscience Australia ''' import sys import netCDF4 import subprocess import re from geophys2netcdf import ERS2NetCDF def main(): assert len( sys.argv) == 5, 'Usage: %s <root_dir> <file_template> <old_attribute_name> <new_attribute_name>' % sys.argv[0] root...
# The MIT License (MIT) # Escalate Copyright (c) [2014] [Chris Smith] # 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, c...
import numpy as np n = 3 filename = '/tmp/kbykbykfloat.raw' with open(filename, 'rb') as f: data = np.fromfile(f, dtype=np.float32) array = np.reshape(data, [n, n, n]) # this array is the "by slice" transpose of the R result ... # now try to read a RcppCNPy object m = np.load("/tmp/randmat.npy") m = np.reshape( n...
#!/usr/bin/env python # # File: voacapgui # # Copyright (c) 2009 J.Watson # # 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, or (at your option) any later versi...
from scrapy.spider import Spider from scrapy import signals from scrapy.selector import Selector import logging import csv from careerpagescrapers.items import Startup, StartupJob from scrapy.log import ScrapyFileLogObserver from scrapy.xlib.pydispatch import dispatcher from scrapy import log logfile = open('testlog.l...
# # Copyright (C) 2009-2016 Nexedi SA # # 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, or (at your option) any later version. # # This program is distributed...
from netmiko.ssh_connection import SSHConnection from netmiko.netmiko_globals import MAX_BUFFER import time class HPComwareSSH(SSHConnection): def session_preparation(self): ''' Prepare the session after the connection has been established ''' self.disable_paging(command=...
import tak.ptn import sqlite3 import os.path import collections import traceback SIZE = 5 GAMES_DIR = os.path.join(os.path.dirname(__file__), "../../games") DB = sqlite3.connect(os.path.join(GAMES_DIR, "games.db")) cur = DB.cursor() cur.execute('select day, id from games where size = ?', (SIZE,)) corpus = collectio...
# -*- coding: utf-8 -*- # This module contains all the Object classes used by the MIT Core Concept # Catalog (MC3) Handcar based implementation of the OSID Id Service. from ...abstract_osid.id import objects as abc_id_objects from ..osid import objects as osid_objects from .. import settings from ..primitives import ...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
# coding=utf-8 """Provider code for Generic Provider.""" from __future__ import unicode_literals import logging import operator import re from builtins import map from builtins import object from builtins import str from datetime import datetime, timedelta from os.path import join from dateutil import parser, tz f...
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- """ Equalize images to the histogram of a reference image Based on https://www.pyimagesearch.com/2021/02/08/histogram-matching-with-opencv-scikit-image-and-python/ """ import argparse import os import sys from skimage import exposure import cv2 # command line para...
# (C) British Crown Copyright 2010 - 2014, Met Office # # This file is part of Iris. # # Iris 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 3 of the License, or # (at your option) any l...
# Copyright 2020 The TensorFlow 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
""" This is a supervisord event listener. """ import sys import argparse import logging import traceback def main(): parser = argparse.ArgumentParser( prog="dart-agent", formatter_class=argparse.RawTextHelpFormatter, description=__doc__, ) parser.add_argument("--write-configuratio...
#!/usr/bin/env python # # Copyright (C) 2008 The Android Open Source Project # # 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 req...
""" Imaging productivity stats Jason Best - jbest@brit.org Generates a productivity report based on the creation timestamps of image files. Details of the imaging session are extracted from the folder name containing the images. Assumed folder name format is: YYYY-MM-DD_ImagerID_OtherInfo Usage: python productivity.p...
#! /usr/bin/env python import netCDF4 as nc import sys import math import numpy as np def from_reduced(N,M): #"N elements from south to north and N elements around equator " if gaussian: hmax = 2*math.pi/N hmin = hmax/2 nlon = N cells_lon = [] cells_lat = [] for i in range(M/2): lat1 = 180.0...
# Copyright (c) 2014 Rackspace, 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 wr...
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals from six.moves import input import sys import os sys.path.append(os.path.join(os.path.dirname(__file__), "..")) import insync def main(): i = insync.client(os.path.expanduser('~/lib/insync.db')) i.login() i...
""" By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23. 3 -> 7 4 -> 2 4 6 8 5 9 3 That is, 3 + 7 + 4 + 9 = 23. Find the maximum total from top to bottom of the triangle below: 75 95 64 17 47 82 18 35 87 10 20 04 82 47 65 19 01 23 75...
""" Functions for aeronautics in this module - physical quantities always in SI units - lat,lon,course and heading in degrees International Standard Atmosphere :: p,rho,T = atmos(H) # atmos as function of geopotential altitude H [m] a = vsound(H) # speed of sound [m/s] as function of H[m] p = ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models def create_provider_configuration(apps, schema_editor): Provider = apps.get_model("core", "Provider") ProviderConfiguration = apps.get_model("core", "ProviderConfiguration") providers = Provider.object...
#!/usr/bin/env python # coding: utf-8 # # Software License Agreement (GPLv2 License) # # Copyright (c) 2011 Thecorpora, S.L. # # 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...
""" Badge Awarding backend for Badgr-Server. """ from __future__ import absolute_import import hashlib import logging import mimetypes import requests import six from django.conf import settings from django.core.exceptions import ImproperlyConfigured from eventtracking import tracker from lazy import lazy from reques...
""" Decorator support for clocked. """ import inspect import new from clocked.profiler_provider import ProfilerProvider def _create_function_wrapper(obj, name): def wrapper(*args, **kwargs): profiler = ProfilerProvider.get_current_profiler() if profiler is None: return obj(*args, **k...
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. class RequestHeaders(object): '''A custom dictionary impementation for headers which ignores the case of requests, since different HTTP libraries seem t...
import collections import json from django import VERSION from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from controlcenter import app_settings, widgets from controlcenter.templatetags.controlcenter_tags import ( _method_prop, attrlabel, attrvalue, ...
# Copyright 2015 Open vStorage NV # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
""" ARCHES - a program developed to inventory and manage immovable cultural heritage. Copyright (C) 2013 J. Paul Getty Trust and World Monuments Fund 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 Founda...
from __future__ import absolute_import from datetime import datetime import time import uuid import json from tzlocal import get_localzone class RemindersService(object): def __init__(self, service_root, session, params): self.session = session self.params = params self._service_root = se...
import pykintone.structure as ps from pykintone.application_settings.base_administration_api import BaseAdministrationAPI import pykintone.application_settings.setting_result as sr class GeneralSettingsAPI(BaseAdministrationAPI): API_ROOT = "https://{0}.cybozu.com/k/v1{1}/app/settings.json" def __init__(self...
""" Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved. This program and the accompanying materials are made available under the terms of the 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 ...
"""Product Trader Pattern This class implements a simple version of the Product Trader Pattern: A SimpleProductTrader manages a registry mapping specifications to classes. Strings are used as Specification. For each Product, a SimpleProductTrader is created. Subclasses of Product register with this SimpleProd...
# -*- coding: utf-8 -*- # Copyright 2017 OpenSynergy Indonesia # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp import models, fields, api class ReturPajakMasukan(models.Model): _name = "l10n_id.retur_pajak_masukan" _description = "Retur Pajak Masukan" _inherit = [...
############################################################################## # # SOM: Stochastic Optimization Method for Analytic Continuation # # Copyright (C) 2016-2020 Igor Krivenko <igor.s.krivenko@gmail.com> # # SOM is free software: you can redistribute it and/or modify it under the # terms of the GNU General P...