CombinedText stringlengths 4 3.42M |
|---|
import os
import time
import zmq
import bquery
import bcolz
import traceback
import tempfile
import zipfile
import shutil
import boto
import redis
import binascii
import logging
import random
import bqueryd
import socket
from bqueryd.messages import msg_factory, WorkerRegisterMessage, ErrorMessage, BusyMessage, StopMes... |
# -*- coding: utf-8 -*-
from kivy.lang import Builder
from kivy.uix.widget import Widget
from kivy.properties import NumericProperty, ListProperty, BooleanProperty
from kivy.animation import Animation
from kivymd.theming import ThemableBehavior
Builder.load_string('''
<MDSpinner>:
canvas.before:
PushMatri... |
from __future__ import absolute_import, unicode_literals
import copy
import logging
import time
from functools import update_wrapper
from django.db.models.fields import Field
from django.utils.translation import ugettext_lazy as _
from concurrency import forms
from concurrency.api import get_revision_of_object
from ... |
"""Dashboard app views"""
import os
import time
import json
from django.contrib.messages import add_message, ERROR, WARNING
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import Http404, HttpResponseRedirect
from logbook import Logger
from kitchen.backends.... |
# Copyright 2019 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 agreed to in wr... |
"""
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
distri... |
# (The MIT License)
#
# Copyright (c) 2016 Kura
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the 'Software'), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, p... |
# coding=utf-8
#
# Copyright 2014-2017 F5 Networks Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
from os import listdir
from os.path import isfile
from sqlalchemy import join
__author__ = 'kiro'
trend_base = "/home/kiro/ntnu/master/code/twitter/trend-data/"
def filename_separation(folder):
"""
Run trend file compilation with all wanted files in the folder.
@param folder: the folder containing twe... |
# _ __
# | |/ /___ ___ _ __ ___ _ _ ®
# | ' </ -_) -_) '_ \/ -_) '_|
# |_|\_\___\___| .__/\___|_|
# |_|
#
# Keeper Commander
# Contact: ops@keepersecurity.com
#
import os
import random
import string
def randomSample(sampleLength=0, sampleString=''):
sample = ''
for i in range(... |
# coding: utf-8
import hashlib
import json
import uuid
from datetime import datetime, timedelta as td
from croniter import croniter
from django.conf import settings
from django.db import models
from django.urls import reverse
from django.utils import timezone
from hc.accounts.models import Project
from hc.api import ... |
'''
The ssh client wrapper system contains the routines that are used to alter
how executions are run in the salt-ssh system, this allows for state routines
to be easily rewritten to execute in a way that makes them do the same tasks
as ZeroMQ salt, but via ssh.
'''
# Import salt libs
import salt.utils
import salt.clie... |
# -*- coding: utf-8 -*-
import json
import urlparse
from django.http import QueryDict
from jingo.helpers import datetime as datetime_filter
from nose import SkipTest
from nose.tools import eq_
from pyquery import PyQuery as pq
from test_utils import RequestFactory
from tower import strip_whitespace
import amo
import... |
# This file is part of EbookLib.
# Copyright (c) 2013 Aleksandar Erkalovic <aerkalov@gmail.com>
#
# EbookLib 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 you... |
import unittest
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer.testing import condition
class TestHuffmanTree(unittest.TestCase):
def test_empty(self):
with self.assertRaises(ValueError):
functions.create_hu... |
"""
Downloads and parses the variables table from the documentation
author: chris @ sihrc
"""
#Python Modules
import urllib2, unicodedata
from bs4 import BeautifulSoup as Soup
#Local Modules
import config
from wrappers import debug
@debug
def download(datafile):
"""
From get_features.py\n
Downloads the d... |
'''
Created on 14.06.2011
@author: michi
'''
import datetime
from PyQt4.QtCore import QAbstractTableModel, QModelIndex, Qt, QVariant, QString
from sqlalchemy.orm import object_mapper, ColumnProperty, RelationshipProperty
from sqlalchemy.util import NamedTuple
from ems import qt4
from ems.thirdparty.odict import Orde... |
#!/usr/bin/env python
# Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All c... |
from sympy.core import Basic
import random
class Partition(Basic):
"""
This class represents an abstract partition.
A partition is a set of disjoint sets whose
union equals a given set.
"""
def next(self):
"""
Generates the next partition.
Examples:
"""
... |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
#!/usr/bin/python
from logging import warn
import pytz
import pymysql
import os
config = ''
def connectToDb():
try:
os.environ['bamboo_IFS_MYSQL_USER_NAME']
print("Using server mysql config")
config = {
'user': os.environ['bamboo_IFS_MYSQL_USER_NAME'],
'passwd': os.... |
#!/usr/bin/env python3
# Adapted from a found script.
# Downloads all images on a given web page.
# To merely see/print the image URLs, see the `list_image_Urls.py` script.
import requests
import os
from tqdm import tqdm
from bs4 import BeautifulSoup as bs
from urllib.parse import urljoin, urlparse
def is_valid(url... |
import urlparse
from cwpoliticl.extensions.base_parser import BaseParser
from cwpoliticl.items import Politicl, CacheItem, WebsiteTypes
class DnaIndiaParser(BaseParser):
def __init__(self):
super(DnaIndiaParser, self).__init__()
def parse_paginate(self, url, hxs, cache_db, history_db):
selec... |
"""Define a connection to the SimpliSafe websocket."""
from __future__ import annotations
import asyncio
from dataclasses import InitVar, dataclass, field
from datetime import datetime, timedelta
from typing import TYPE_CHECKING, Any, Callable, Dict, Final, cast
from aiohttp import ClientWebSocketResponse, WSMsgType
... |
"""
Search (Chapters 3-4)
The way to use this code is to subclass Problem to create a class of problems,
then create problem instances and solve them with calls to the various search
functions.
"""
import sys
from collections import deque
from utils import *
class Problem:
"""The abstract class for a formal pr... |
import random
import asyncio
from functools import partial
from aioredis.errors import ProtocolError
from aioredis.commands import (
create_redis,
Redis,
create_redis_pool
)
from aioredis.util import decode, encode_str, cached_property
from aioredis.log import logger
from aioredis.errors import ReplyError,... |
#tests: lint, mypy
import tensorflow as tf
import numpy as np
from neuralmonkey.nn.ortho_gru_cell import OrthoGRUCell
from neuralmonkey.vocabulary import START_TOKEN
from neuralmonkey.logging import log
from neuralmonkey.decoders.output_projection import no_deep_output
from neuralmonkey.nn.projection import linear
c... |
import numpy
import math
from scipy import stats
from nab.detectors.base import AnomalyDetector
class GoodnessOfFitDetector(AnomalyDetector):
""" This detector is an implementation of online anomaly detection using
Relative Entropy statistic with multiple hypothesis as described in
Figure 1 of Wang, Chengwei... |
#!/usr/bin/env python
# http://stackoverflow.com/a/14050282
def check_antipackage():
from sys import version_info
sys_version = version_info[:2]
found = True
if sys_version < (3, 0):
# 'python 2'
from pkgutil import find_loader
found = find_loader('antipackage') is not None
... |
from flask import render_template, flash, redirect, jsonify, request
from app import app
import subprocess
import config
@app.route('/', methods=['GET','POST'])
@app.route('/index', methods=['GET','POST'])
def index():
return render_template('index.html')
@app.route('/about', methods=['GET'])
def about():
ret... |
import pickle
from Player import *
class TTTBoard:
def __init__(self):
""" Initializes the data members."""
self.SIZE = 3
self.board = [' ']*(self.SIZE*self.SIZE)
self.players = [None, None]
def __str__(self):
""" Returns a string representation of the board where
... |
from __future__ import print_function, division, absolute_import
import random
import math
import copy
import numbers
import multiprocessing
import threading
import traceback
import sys
import os
import time
import json
import types
import numpy as np
import cv2
import imageio
import scipy.spatial.distance
import six... |
import ConfigParser
class Config(dict):
__getattr__ = dict.__getitem__
__setattr__ = dict.__setitem__
def read_config(filename):
"""
This looks for [kleenex] in ``filename`` such as the following:
[kleenex]
db = sqlite:///coverage.db
parent = origin/master
discover = true
report =... |
"""Find spark home, and initialize by adding pyspark to sys.path.
If SPARK_HOME is defined, it will be used to put pyspark on sys.path.
Otherwise, common locations for spark (currently only Homebrew's default) will be searched.
"""
from glob import glob
import os
import sys
__version__ = '1.2.0.dev'
def find():
... |
#######################################################################
#
# Note: This file is a generated file--do not edit it directly!
# Instead make changes to the appropriate content in the database or
# write up a bug here:
#
# https://bugzilla.mozilla.org/enter_bug.cgi?product=support.mozilla.org
#
# with th... |
# 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/.
from optparse import make_option
from django.utils.six.moves import input
from django.conf import settings
from django... |
from __future__ import absolute_import, division, print_function
import logging
from dynd import nd
from pandas import DataFrame
from .expr.table import *
from .api import *
from .data.csv import *
from .data.json import *
from .compute.python import *
from .data.pandas import *
from .data.meta import *
from .compute... |
#!/usr/bin/env python
from __future__ import print_function
from pprint import pprint
from functools import reduce
import operator
import subprocess
import re
from copy import deepcopy
from kerncraft.intervals import Intervals
from kerncraft.prefixedunit import PrefixedUnit
# Datatype sizes in bytes
datatype_size = ... |
# -*- coding: utf-8 -*-
#
# Copyright 2014 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
# -*- coding: utf-8 -*-
"""
Created on Aug 2016
Script to save HCP data into bids format. folowing script creates directory struc
ture and renames all files as per BIDS standard.
@author: Suyash B
"""
import os, glob, shutil
import re, json, numpy
import nibabel as ni
def touch(fname):
if os.path.exists(fname):... |
from glob import glob
import os
from django.conf import settings
from django.contrib.auth.models import User
from django.core.files import File
from django.core.files.images import ImageFile
from nose.tools import eq_
from questions.models import Question
from sumo.tests import TestCase
from upload.models import Ima... |
#!/usr/bin/env python
#
# OmsAgentForLinux Extension
#
# Copyright 2015 Microsoft Corporation
#
# 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.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 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 Licens... |
import sqlalchemy
from osmaxx.converters.gis_converter.bootstrap.bootstrap import BootStrapper
from tests.inside_worker_test.conftest import slow, cleanup_osmaxx_schemas
from tests.inside_worker_test.declarative_schema import osm_models
@slow
def test_osmaxx_data_model_processing_puts_amenity_grave_yard_with_religio... |
from errors import *
import json
import requests
import re
class BaseCriteria(object):
def __init__(self, resource):
self.resource = resource
def __iter__(self):
return self.all()
def all(self):
resp = self.request()
return [self.resource.get_from(o) for o in ... |
import os
import sys
from urllib2 import build_opener, HTTPCookieProcessor, Request
from urllib import urlencode
from subprocess import Popen, PIPE, STDOUT
import re
import urllib2
import tempfile
import subprocess
opener = build_opener(HTTPCookieProcessor)
def urlopen2(url, data=None, auth=True, user_agent='github-c... |
# -*- coding: utf-8 -*-
#
import math
import numpy
import orthopy
from .gauss_legendre import GaussLegendre
from ..tools import scheme_from_rc
class GaussKronrod(object):
"""
Gauss-Kronrod quadrature; see
<https://en.wikipedia.org/wiki/Gauss%E2%80%93Kronrod_quadrature_formula>.
Besides points and ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2013 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#... |
[MERGE] OPW 572488: report sxw/odt: fix inconsistent duplicate content/meta/style files within generated sxw/odt
forward-port of v6.0 server revid: xal@openerp.com-20130102152925-h81qv2fx300oakzv
bzr revid: xal@openerp.com-20130102155718-g07b2mv7gk7d0c7g
|
from cumulusci.robotframework.pageobjects import ListingPage
from cumulusci.robotframework.pageobjects import DetailPage
from cumulusci.robotframework.pageobjects import pageobject
from cumulusci.robotframework.utils import capture_screenshot_on_error
from BaseObjects import BaseNPSPPage
from NPSP import npsp_lex_locat... |
from django.core.management.base import BaseCommand
from django.conf import settings
from django.contrib.auth.models import User
from django.db import transaction
from sys import stderr
from cyder.core.ctnr.models import Ctnr, CtnrUser
from cyder.core.system.models import System, SystemKeyValue
from cyder.cydns.domain... |
from mimetypes import guess_type
from django.http import HttpResponse
from django.utils.encoding import smart_str
from django.utils.translation import ugettext as _
from django.contrib.auth.decorators import login_required
from jmbo.generic.views import GenericObjectList
from category.models import Category
from do... |
# noinspection PyUnresolvedReferences
from globalvars import GlobalVars
from findspam import FindSpam
# noinspection PyUnresolvedReferences
from datetime import datetime
from utcdate import UtcDate
from apigetpost import api_get_post
from datahandling import *
from metasmoke import Metasmoke
from parsing import *
from ... |
# -*- coding: utf-8 -*-
"""Wrapper to run RS4PI from the command line.
:copyright: Copyright (c) 2017 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
from dicompylercore import dicomparser, dvhcalc
from ... |
import getopt
import sys
import pickle
from nltk.stem.porter import PorterStemmer
from nltk.tokenize import word_tokenize
from collections import Counter
import math
import string
import operator
import heapq
from pprint import pprint
dictionary = {}
postings_file = None
postings_sizes = []
starting_byte_offset = 0
al... |
# calibratormodel.py
#
# David J. Lampert (djlampert@gmail.com)
#
# contains the CalibratorModel class, a child of the HSPFModel class to use
# for running simulations during a hydrology calibration that minimizes
# memory requirements
from pyhspf.core import HSPFModel, WDMUtil
class CalibratorModel(HSPFModel):
... |
#!/usr/bin/env python3
import os
import sys
import getopt
import ntpath
import xmltodict # Need to be installed
from PIL import Image # Need to install "pillow"
from PIL.ExifTags import TAGS, GPSTAGS
_usage = 'gpx_report -g track.gpx\ngpx_report -p photo_folder'
opt_force = False
opt_dir = ''
opt_gpx = ''
def erre... |
"""
This file contains the database schema in SQLAlchemy format.
"""
from sqlalchemy import event
from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy.engine import Engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship as sqlalchemy_relationship
Ba... |
import datetime
import logging
import hashlib
import hmac
import json
import traceback
from app.models import SocialNetworkApp, SocialNetworkAppUser, Initiative
from app.sync import save_sn_post, publish_idea_cp, save_sn_comment, publish_comment_cp, save_sn_vote, \
delete_post, delete_comment, del... |
# Perfect Tic Tac Toe AI, it will never lose.
# Created and programmed by Jordan Oberstein.
import random
X = "X"
O = "O"
empty = " "
S = [" ", " ", " ", " ", " ", " ", " ", " ", " "]
turn = 0
def Board(): # prints board
print "\n ",S[0],"|",S[1],"|",S[2]
print " ","---------"
print " ",S[3],"|",S[4],"|",S[5]
p... |
# coding=utf-8
# Filename: k40.py
# pylint: disable=locally-disabled
"""
A collection of k40 related functions and modules.
"""
from __future__ import division, absolute_import, print_function
import os
from itertools import combinations
from collections import defaultdict
from functools import partial
from datetime ... |
#!/usr/bin/env python
"""
Cuckoo search.
Usage:
cs.py [options]
Options:
-h, --help Show this message and exit.
-n N Number of generations in CS. [default: 20]
--print-level LEVEL
Print verbose level. [default: 1]
"""
from __future__ import print_function
import os,sys
from docopt impor... |
# -*- coding: utf-8 -*-
#
# 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... |
# Copyright (c) 2013 Rackspace
# 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... |
# -*- coding: utf8 -*-
''' classes for database access '''
import math
from injector import Module, provides, inject, singleton
import datetime
import pytz
import shapely.wkb
import shapely.geometry
import pandas as pd
try:
import psycopg2
import psycopg2.extras
import psycopg2.extensions
except ImportE... |
#!/usr/bin/env python3
"""
Use URL to EUPS candidate tag file to git tag repos with official version
"""
# Technical Debt
# --------------
# - completely hide eups-specifics from this file
# - skips non-github repos - can add repos.yaml knowhow to address this
# - worth doing the smart thing for externals? (yes for Si... |
'''
A REST API for Salt
===================
:depends: - CherryPy Python module
:configuration: All authentication is done through Salt's :ref:`external auth
<acl-eauth>` system. Be sure that it is enabled and the user you are
authenticating as has permissions for all the functions you will be
running.
... |
"""
Form designer link plugin.
This plugin displays a form at the page, that was created with form_designer.
To customize the output, configure the ``django-form-designer`` application via the settings file.
For example, use:
* ``FORM_DESIGNER_DEFAULT_FORM_TEMPLATE`` or ``FORM_TEMPLATES`` to control the form output ... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on 2014-05-16
@author: Eugene Dvoretsky
Immunopy GUI primitives.
"""
import sys
import time
import numpy as np
from PySide import QtCore
from PySide import QtGui
from PySide import QtOpenGL
from OpenGL.GL import *
from OpenGL import ERROR_ON_COPY
import ipt... |
__author__ = 'Georgios Rizos (georgerizos@iti.gr)'
import numpy as np
import scipy.sparse as sparse
import ctypes as c
import multiprocessing as mp
def get_label_based_random_walk_matrix(adjacency_matrix, labelled_nodes, label_absorption_probability):
"""
Returns the label-absorbing random walk transition pr... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, ESS LLP and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
import json
from frappe.utils import getdate, add_days
from frappe import _
import datetime
from frap... |
import sqlalchemy
from osmaxx.converters.gis_converter.bootstrap.bootstrap import BootStrapper
from tests.inside_worker_test.conftest import slow, cleanup_osmaxx_schemas
from tests.inside_worker_test.declarative_schema import osm_models
@slow
def test_osmaxx_data_model_processing_puts_amenity_grave_yard_with_religio... |
import sys
import copy
import psutil
from PyQt5.QtWidgets import QWidget, QTabWidget
from PyQt5.QtWidgets import QVBoxLayout
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWidgets import QFileDialog
from PyQt5.QtCore ... |
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... |
import logging
from django.conf import settings
from django.urls import reverse
from astrobin.models import Image
from astrobin.stories import add_story
from astrobin_apps_notifications.services import NotificationsService
from astrobin_apps_notifications.utils import push_notification, build_notification_url
from as... |
update PSNR calculation border
|
# Copyright (c) 2014 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.
import sys
import os
from tvcm import project as project_module
class TraceViewerProject(project_module.Project):
trace_viewer_path = os.path.abspat... |
import difflib
import re
import unicodecsv as csv
from ..edit import Edit
from pyutils import print_progress
from .tokenize import default_tokenize_func
MULTIPLE_PUNCT_REGEX = re.compile(r'([.!?]){2,}')
MULTIPLE_SPACE_REGEX = re.compile(r'([ ]){2,}')
GARBAGE_REGEX = re.compile(r'[^\w\s]')
def _get_line_num(edit_fi... |
# -*- coding: utf-8 -*-
import csv
import sys
import re
from django.contrib.gis.geos import Point
from django.core.exceptions import ObjectDoesNotExist
from django.db.utils import IntegrityError
from dplace_app.models import *
MISSING_CODES = []
LOAD_BY_ROW=('iso', 'env_vals',
'langs', 'iso_lat_long',
... |
""" this here's the code responsible for executing 'bru install' commands, e.g.
'bru install package.json' or 'bru install protobug googlemock@1.7.0'.
"""
import os
import re
import glob
import shutil
import filecmp
import platform
import collections
import brulib.jsonc
import brulib.make
import brulib.module_down... |
# coding=utf-8
# noinspection PyUnresolvedReferences
from chatcommunicate import add_room, block_room, CmdException, command, get_report_data, is_privileged, message, \
tell_rooms
# noinspection PyUnresolvedReferences
from globalvars import GlobalVars
from findspam import FindSpam
# noinspection PyUnresolvedReferen... |
"""
Sile object for reading/writing FDF files
"""
from __future__ import print_function, division
from os.path import dirname, sep
import numpy as np
# Import sile objects
from .sile import SileSIESTA
from ..sile import *
from sisl.io._help import *
# Import the geometry object
from sisl import Geometry, Atom, Supe... |
#!/usr/bin/env python
class XMLTranslator:
# Get display indentation for a certain depth
def get_indent(self, depth):
line = ""
for i in range(0, depth):
line += "\t"
return line
# Get variable id (name)
def get_varid(self, node):
return node[0].get("value")
# Get variables
def get... |
import re
from datetime import datetime
import pytz
from radar.constants import HUMAN_DATE_FORMAT
from radar.safe_strftime import safe_strftime
from radar.utils import is_date, date_to_datetime, datetime_to_date, is_datetime
from radar.validation.core import SkipField, ValidationError, pass_context, pass_call
USERN... |
# -*- coding: utf-8 -*-
"""
@file
@brief Default values for the Sphinx configuration.
"""
import sys
import os
import datetime
import re
import warnings
from .style_css_template import style_figure_notebook
from sphinx.builders.html import Stylesheet
if sys.version_info[0] == 2:
from codecs import open
File... |
from functools import wraps
from app import app
from flask import send_from_directory,session,g,Flask,render_template, redirect, request, url_for, flash
import config
from flask_login import current_user
from models import db, login_data, post_data
@app.route("/")
def home():
username=None
if 'username' in ses... |
#!/usr/bin/python
# Fixer.io is a free JSON API for current .
# It relies on daily feeds published by the European Central Bank.
import requests
from datetime import datetime
BASE_URL = 'http://api.fixer.io/'
CURRENCY_CHOICE = ["EUR", "AUD", "BGN", "BRL", "CAD", "CHF", "CNY", "CZK",
"DKK", "GBP", ... |
# Filename: test_math.py
# pylint: disable=locally-disabled,C0111,R0904,C0103
import numpy as np
from numpy.testing import (assert_almost_equal, assert_allclose)
import pytest
from km3pipe.testing import TestCase
from km3pipe.math import (
angle_between, dist, pld3, com, zenith, azimuth, Polygon, IrregularPrism,
... |
# Copyright 2014 eBay Software 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 ... |
import os.path
import logging
import hashlib
import math
import time
import requests
from threading import Thread, Lock
from requests_toolbelt.multipart.encoder import MultipartEncoder, MultipartEncoderMonitor
from . import center, progress, util
class InvalidLoginException(Exception):
pass
class RequestFailed... |
import numpy as np
from algorithms.svd import SVD
from utils.data_io import get_user_movie_time_rating
import utils.c_interface
import sys
class SVDEuclidean(SVD):
def initialize_users_and_movies(self):
self.max_user = self.calculate_max_user()
self.max_movie = self.calculate_max_movie()
s... |
import bloop.util
import enum
_DIFF = enum.Enum('DIFF', ['SET', 'DEL', 'NOOP'])
_MISSING = bloop.util.Sentinel('MISSING')
_TRACKING_ATTR_NAME = '__tracking__'
def _tracking_dict(obj):
'''
Returns the dict used to track changes for a given object.
If the obj does not have a tracking dict, sets one up and ... |
"""A plugin to react to new pokes from Facebook.
It hijacks an authentication-cookie which the user has to enter manually.
Nomnomnom, Cookies!
"""
###############################################################################
#
# TODO: [ ]
#
###########################################################################... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from django.utils.translation import ugettext_lazy as _
from userprofiles.forms import RegistrationForm
from cosinnus.forms.profile import UserProfileForm
from cosinnus.forms.widgets import DateL10nPicker
from cosinnus.models imp... |
# Copyright (C) 2009 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import _, api, fields, models
from odoo.exceptions import UserError
class StockInvoiceOnshipping(models.TransientModel):
_inherit = 'stock.invoice.onshipping'
fiscal_operation_journal = fi... |
#!/usr/bin/python
# -*- coding: utf-8 -*-#
# Copyright (c) 2008-2016, Xavier Basty
#
# 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 r... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, ESS LLP and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
import json
from frappe.utils import getdate, add_days
from frappe import _
import datetime
from frap... |
# -*- coding: utf-8 -*-
"""
Tests for the Openstack Cloud Provider
"""
from __future__ import absolute_import, print_function, unicode_literals
import logging
import os
import shutil
from time import sleep
from salt.config import cloud_config, cloud_providers_config
from salt.ext.six.moves import range
from salt.uti... |
"""
Copyright [2009-2015] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... |
# Copyright (C) 2015 Midokura SARL.
# 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 requir... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.