text stringlengths 12 6.59M |
|---|
#!/usr/bin/env python
''' Consumer and Normalizer for the eScholarship Repo
at the University of California
'''
from lxml import etree
from xml.etree import ElementTree
from datetime import date, timedelta
import requests
from scrapi_tools import lint
from scrapi_tools.document import RawDocument, NormalizedDocument... |
# TmServer - TissueMAPS server application.
# Copyright (C) 2016 Markus D. Herrmann, University of Zurich and Robin Hafen
#
# 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... |
# -*- coding: utf-8 -*-
import xml.etree.ElementTree as ET
import argparse
import glob
from pprint import pprint
import sys, os
from collections import OrderedDict
import copy
import datetime, time
import cPickle as pickle
import subprocess, shlex
FUNCTIONAL_CATEGORY = 'Functional' # how to display those categories
ER... |
import pkg_resources
from tod import model
ALEXA_SKILL_ID = ""
with open(pkg_resources.resource_filename("resources", "alexa_skill_id.txt"), 'r') as alexa_skill_id_file:
ALEXA_SKILL_ID = alexa_skill_id_file.read().strip()
TOD_MODEL = model.Model()
TOD_MODEL.populate_from_json(pkg_resources.resource_filename("reso... |
from unittest import skipUnless, TestCase, skip
from scripts.service.ws_re.register.author import Authors
from scripts.service.ws_re.register.registers import Registers
from tools import INTEGRATION_TEST
_MAX_SIZE_WIKI_PAGE = 2_098_175
class TestAuthors(TestCase):
@classmethod
def setUpClass(cls) -> None:
... |
from .slackrequest import SlackRequest
from requests.packages.urllib3.util.url import parse_url
from .channel import Channel
from .user import User
from .util import SearchList, SearchDict
from ssl import SSLError
from websocket import create_connection
import json
class Server(object):
'''
The Server object... |
from .slackrequest import SlackRequest
from requests.packages.urllib3.util.url import parse_url
from .channel import Channel
from .user import User
from .util import SearchList, SearchDict
from ssl import SSLError
from websocket import create_connection
import json
class Server(object):
'''
The Server object... |
from __future__ import absolute_import, unicode_literals
from .base import *
import os
DEBUG = False
try:
from .local import *
except ImportError:
pass
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'fpf',
'USER': os.environ['DJANGO_DB_USER... |
# -*- coding: utf-8 -*-
import ConfigParser
import sys
import subprocess
import os
from os.path import join as joinPath
class Station:
def __init__(self, name, url, playlist):
self.name = name
self.url = url
self.playlist = playlist
def __str__(self):
return self.name
class ... |
# -*- coding: utf-8 -*-
# © <YEAR(S)> <AUTHOR(S)>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import account_payment
|
'''Tests for distance-based objectives, layers, etc.'''
import pytest
import numpy
import numpy.linalg
from numpy.testing import assert_allclose
#from ...neural._classes.difference import word_movers_similarity
@pytest.fixture
def N1():
return 5
@pytest.fixture
def N2():
return 3
@pytest.fixture
def ndim():
... |
# License: EPL
import os
import sys
import traceback
try:
xrange
except:
xrange = range
#===============================================================================
# Things that are dependent on having the pydevd debugger
#===============================================================================
de... |
# License: EPL
import os
import sys
import traceback
from _pydev_imps._pydev_saved_modules import threading
try:
xrange
except:
xrange = range
#===============================================================================
# Things that are dependent on having the pydevd debugger
#==========================... |
"""
support for presenting detailed information in failing assertions.
"""
import py
import imp
import marshal
import struct
import sys
import pytest
from _pytest.monkeypatch import monkeypatch
from _pytest.assertion import reinterpret, util
try:
from _pytest.assertion.rewrite import rewrite_asserts
except ImportE... |
__all__ = ('FeedFilter')
from delim_filter import DelimFilter
import argparse
import re
import csv
import socket
import sqlite3
import sys
from bulkwhois.cymru import BulkWhoisCymru
from async_dns import AsyncResolver
import publicsuffix.publicsuffix as publicsuffix
import httplib2
#import XMLFilter from xml_filter
c... |
import thumbor_botornado.s3_loader as S3Loader
import tornado.concurrent.return_future
import thumbor.loaders.http_loader as HttpLoader
import re
HTTP_RE = re.compile(r'\Ahttps?:', re.IGNORECASE)
@return_future
def load(context, url, callback):
if HTTP_RE.match(url):
HttpLoader.load(context, url, callback... |
from django.contrib.auth import get_user_model
from drf_haystack.serializers import HaystackSerializer
from rest_framework import serializers
from . models import (
Action,
Behavior,
BehaviorProgress,
Category,
Goal,
GoalProgress,
PackageEnrollment,
Trigger,
UserAction,
UserGoal... |
from django import forms
from django.contrib.auth import get_user_model
from .models import UserProfile
class UserProfileForm(forms.ModelForm):
class Meta:
model = UserProfile
fields = ("timezone", 'maximum_daily_notifications')
class UserForm(forms.ModelForm):
class Meta:
model = ... |
#!/usr/bin/python
# Copyright (c) 2013 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Recipes for PNaCl target libs."""
import fnmatch
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__),... |
import yaml
from os.path import expanduser
import os
import json
import jsonschema
import copy
class Config(object):
"""
Class in charge to configuration management
"""
def __init__(self, log, config_path = expanduser('~') + '/.jav/'):
self.log = log
self.__config_path = self.prep... |
#!/usr/bin/env python
## category General
## desc Calculates simple stats for a BAM file
"""
Calculates simple stats for a BAM file
"""
import os
import sys
from ngsutils.bam import read_calc_mismatches, bam_iter, bam_open
from ngsutils.gtf import GTF
from ngsutils.support.regions import RegionTagger
from ngsutils.sup... |
import iptc
import wget
import shutil
from os import path, unlink
from yum import YumBase
# NGUtil Libraries
from .common import _NGUtilCommon
from .template import _NGUtilTemplates
class _NGUtilApp(_NGUtilCommon):
"""
Class object for handling setting up the NGINX application.
"""
# Additional r... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the QueryCache functionality of johnny."""
from __future__ import print_function
from threading import Thread
try:
from queue import Queue
except ImportError: # Python < 3.0
from Queue import Queue
import django
from django.conf import settings
from... |
###
# Copyright (c) 2005-2009, Jeremiah Fincher
# Copyright (c) 2009-2010, James McCoy
# 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 ... |
# -*- coding: utf-8 -*-
# Copyright (c) 2021 shmilee
'''
Residual zonal flow Cores.
'''
import numpy as np
from ..cores.converter import Converter, clog
from ..cores.digger import Digger, dlog
from .. import tools
from .data1d import _Data1dDigger
_all_Converters = ['Data1dDensityConverter']
_all_Diggers = ['Data1d... |
#!/usr/bin/env python
#
# Please follow
# http://projects.scipy.org/numpy/wiki/CodingStyleGuidelines
#
# Author: Pearu Peterson
# Created: July 2009
# pylint: disable=C,R
"""
See http://pylibnidaqmx.googlecode.com/
"""
from __future__ import print_function, division, unicode_literals, absolute_import
import os
im... |
from django.db import models
from django.db.models import Q
class ForumManager(models.Manager):
def for_groups(self, groups):
if groups:
public = Q(groups__isnull=True)
user_groups = Q(groups__in=groups)
return self.filter(public|user_groups).distinct()
return se... |
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
import socket
import random
import string
import time
import contextlib
import os
from nimp.utilities.build import *
from nimp.utilities.deployment import *
from nimp.utilities.file_mapper import *
from nimp.utili... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import re
import pwd
import sys
sys.dont_write_bytecode = True
from copy import deepcopy
from ruamel import yaml
from pathlib import Path
from fnmatch import fnmatch
from contextlib import contextmanager
from argparse import ArgumentParser, Action
from leather... |
import time
import threading
import shared
import Queue
from struct import unpack, pack
import hashlib
import bitmessagemain
# Every connection to a peer has a sendDataThread (and also a
# receiveDataThread).
class sendDataThread(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
... |
from django import template
register = template.Library()
@register.inclusion_tag('gallery/inclusion_tags/gallery_list.html')
def gallery_listing(object_list):
return {'object_list': object_list}
@register.inclusion_tag('gallery/inclusion_tags/gallery_detail.html')
def gallery_detail(obj):
return {'object': ... |
import operator
import numpy as np
import sys
if sys.argv[0] != "gen_py.py":
from api_autogen import *
import cgt
from . import core, utils
# Every non-underscored function in this file should have a docstring, and it should enforce that the input data is valid
# ==================================================... |
import copy
import boto3
import requests
import hashlib
import uuid
import collections
import json
import contextlib
import datetime
import itertools
import logging
import os
import pager
import pool.thread
import pprint
import random
import re
import shell
import shell.conf
import subprocess
import sys
import time
imp... |
#!/usr/bin/env python
# Copyright 2013 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Archives a set of files or directories to an Isolate Server."""
__version__ = '0.9.0'
import collections
import errno
i... |
# -*- coding: utf-8 -*-
# ocitysmap, city map and street index generator from OpenStreetMap data
# Copyright (C) 2010 David Decotigny
# Copyright (C) 2010 Frédéric Lehobey
# Copyright (C) 2010 Pierre Mauduit
# Copyright (C) 2010 David Mentré
# Copyright (C) 2010 Maxime Petazzoni
# Copyright (C) 2010 Thomas Petaz... |
""" NIPAP XML-RPC
=============
This module contains the actual functions presented over the XML-RPC API. All
functions are quite thin and mostly wrap around the functionality provided by
the backend module.
"""
import time
from functools import wraps
from flask import Flask
from flask import request, ... |
###############################################################################
# PowerSphericalPotential.py: General class for potentials derived from
# densities with two power-laws
#
# amp
# rho(r)= ---------
# ... |
import time
import logging
from core.region_connection import RDSConnection, EC2Connection
from servers.celery_backend.deploy import SG_NAME
DB_NAME = "nimbostratus"
SUCCESS_MESSAGE = '''\
Allowed instances will be able to connect via:
- Host: %s
- Port: %s
'''
def spawn_rds():
logging.info('Spawning a... |
import os.path
with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'VERSION.txt')) as version_file:
VERSION = version_file.read().strip()
# -*- coding: utf-8 -*-
"""
:mod:`odmltables` provides classes for manipulation and conversion of odML files.
Classes:
.. autoclass:: odmltables.odml_table.Odm... |
""" An abstract base class for console-type widgets.
"""
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
# Standard library imports
from os.path import commonprefix
import re
import sys
from textwrap... |
import cStringIO
import traceback
import framework.util as util
from framework.s3uploader import S3Uploader
from framework.log import log
from framework.controller import Controller
from framework.config import Config
from PIL import Image, ImageOps
class FileServer(object):
"""
A generic FileServer.
... |
#!/usr/bin/env python
#
# mailer.py: send email describing a commit
#
# $HeadURL$
# $LastChangedDate$
# $LastChangedBy$
# $LastChangedRevision$
#
# USAGE: mailer.py commit REPOS REVISION [CONFIG-FILE]
# mailer.py propchange REPOS REVISION AUTHOR REVPROPNAME [CONFIG-FILE]
# mailer.py propchange2 REPO... |
import os, sys, re
from subprocess import *
from optparse import OptionParser
#######################################
#######################################
### Class ExcelWriter
#######################################
#######################################
class ExcelWriter:
''' This class writes Excel data from ... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# metadata
from __future__ import unicode_literals
import frappe, os
from frappe.model.meta import Meta
from frappe.modules import scrub, get_module_path, load_doctype_module
from frappe.utils import get_html_format
fr... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# util __init__.py
from __future__ import unicode_literals, print_function
from werkzeug.test import Client
import os, re, sys, json, hashlib, requests, traceback
from .html_utils import sanitize_html
import frappe
fro... |
import time
import os
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("nwapp=" + os.path.dirname(os.path.abspath(__file__)))
driver = webdriver.Chrome(executable_path=os.environ['CHROMEDRIVER'], chrome_options=chrome_options)
... |
#!/usr/bin/env python
# (C) 2006 British Broadcasting Corporation and Kamaelia Contributors(1)
# All Rights Reserved.
#
# You may only modify and redistribute this under the terms of any of the
# following licenses(2): Mozilla Public License, V1.1, GNU General
# Public License, V2.0, GNU Lesser General Public Lice... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import cstr
import mimetypes, json
from werkzeug.wrappers import Response
from werkzeug.routing import Map, Rule, NotFound
fr... |
""" Module to generate individual FRB files """
from pkg_resources import resource_filename
import numpy as np
from astropy import units
from astropy.coordinates import SkyCoord
from frb import frb
def frb_121102():
"""
FRB 121102
All of the data currently comes from Tendulkar et al. 2017
... |
# -*- 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... |
# -*- coding: utf-8 -*-
from candidates import Candidate
# TODO: Put dynamical spectra with it's metada to class (a-la ``frames.Frame``)?
# Then we initialize ``Searcher`` instance with instance of this class. If so
# then Sanya should implement creation instances of this new dynamical spectra
# class with his code
#... |
"""Plotting methods for model evaluation.
This module can be used to evaluate any kind of weather model (machine learning,
NWP, heuristics, human forecasting, etc.). This module is completely agnostic
of where the forecasts come from.
--- REFERENCES ---
Hsu, W., and A. Murphy, 1986: "The attributes diagram: A geome... |
import os
from typing import Optional
import semver
from gitflow import _, version
from gitflow.common import Result
from gitflow.const import VersioningScheme
from gitflow.version import VersionConfig
def filter_sequence_number(version_config, prev_version, global_seq):
if version_config.versioning_scheme == V... |
#!/usr/bin/env python
# -*- mode: python; sh-basic-offset: 4; indent-tabs-mode: nil; coding: utf-8 -*-
# vim: tabstop=4 softtabstop=4 expandtab shiftwidth=4 fileencoding=utf-8
#
# Base script helper
# Copyright 2011, Jorge A Gallegos <kad@blegh.net>
import argparse
import ConfigParser
import glob
try:
import simpl... |
"""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 agreed to in ... |
#!/usr/bin/env python
"""Sequential tests (num_threads == 0) for RazerS 3.
See run_tests.py for the actual tests. We only call the code from there.
"""
import logging
import os.path
import sys
# Automagically add util/py_lib to PYTHONPATH environment variable.
path = os.path.abspath(os.path.join(os.path.dirname(__f... |
#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code... |
# -*- coding: utf-8 -*-
"""
Contains functions for generating an SPH glass in a periodic box. To generate
a glass, see glassBox.
This package requires diskpy, ChaNGa, and pynbody.
Created on Wed Mar 16 17:37:10 2016
@author: ibackus
"""
import shutil
import os
import numpy as np
import pynbody
SimArray = pynbody.a... |
# Natural Language Toolkit: Corpus Access
#
# Copyright (C) 2001 University of Pennsylvania
# Author: Edward Loper <edloper@ldc.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
#
# $Id$
#
# Goals for this module:
#
# 1. we want corpus access to be easy. In particular, we don't want
#... |
#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2009, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code... |
# -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Copyright 2015-2018 BigML
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
from benchmark.fortune_html_parser import FortuneHTMLParser
from setup.linux import setup_util
import importlib
import os
import subprocess
import time
import re
import pprint
import sys
import traceback
import json
import logging
import csv
import shlex
import math
from threading import Thread
from threading import E... |
#!/usr/bin/env python2.7
from gazebo_msgs.msg import ModelStates, ModelState
import tf2_ros
import rospy
from sensor_msgs.msg import CameraInfo
from tf2_geometry_msgs import PoseStamped
import numpy as np
from humanoid_league_msgs.msg import BallRelative, GoalRelative
from copy import deepcopy
rospy.init_node("fake_v... |
# -*- coding: utf-8 -*-
# Natural Language Toolkit: Interface to the CoreNLP REST API.
#
# Copyright (C) 2001-2016 NLTK Project
# Author: Dmitrijs Milajevs <dimazest@gmail.com>
#
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import unicode_literals
import os
import re
import jso... |
# -*- coding: utf-8 -*-
# Natural Language Toolkit: Tokenizer Utilities
#
# Copyright (C) 2001-2017 NLTK Project
# Author: Steven Bird <stevenbird1@gmail.com>
# URL: <http://nltk.sourceforge.net>
# For license information, see LICENSE.TXT
from re import finditer
from xml.sax.saxutils import escape
def string_span_tok... |
__author__ = 'lvapeab'
import logging
logging.basicConfig(level=logging.INFO, format='[%(asctime)s] %(message)s', datefmt='%d/%m/%Y %H:%M:%S')
logger = logging.getLogger(__name__)
def check_params(params):
"""
Checks some typical parameters and warns if something wrong was specified.
:param params: Model... |
#!/usr/bin/python
import re
import sys
import vertcon
def log(message, *args, **kwargs):
print >>sys.stderr, message.format(*args, **kwargs)
def err(*args, **kwargs):
log(*args, **kwargs)
sys.exit()
class FormatError(Exception):
def __init__(self, message, *formatArgs):
self.message = message.format(*formatArg... |
"""
Author: Justin Cappos
Modified by Brent Couvrette to make use of circular logging.
Module: Node Manager main program. It initializes the other modules and
doesn't do much else.
Start date: September 3rd, 2008
This is the node manager for Seattle. It ensures that sandboxes are correctly
assigned t... |
#!/usr/bin/python
import re
import sys
peakArray = []
sectionArray = []
class Peak(object):
def __init__(self):
self.id = ''
self.name = ''
self.latitude = ''
self.longitude = ''
self.zoom = ''
self.elevation = ''
self.prominence = ''
self.prominenceLink = None
self.grade = ''
self.ccLatitude = '... |
#!/usr/bin/env python
# Copyright (C) 2011-2013 OpenStack Foundation
#
# 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 ... |
## $Id$
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006 CERN.
##
## CDS Invenio 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 ... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Static Rendering
================
libsr
-----
This is the part of sr that distinguishes directories into projects
"""
import os
import sys
import codecs
import shelve
from ConfigParser import SafeConfigParser
from email import message_from_string
from md5 import md5
... |
#
# Copyright 2015 Telefonica Investigacion y Desarrollo, S.A.U
#
# 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 unde... |
"""
Onsager calculator module
Class to create an Onsager "calculator", which brings two functionalities:
1. determines *what* input is needed to compute the Onsager (mobility, or L) tensors
2. constructs the function that calculates those tensors, given the input values.
This class is designed to be combined with cod... |
import logging; _L = logging.getLogger('openaddr.ci.collect')
from ..compat import standard_library
from argparse import ArgumentParser
from os import close, remove, utime, environ
from zipfile import ZipFile, ZIP_DEFLATED
from os.path import relpath, splitext, exists
from urllib.parse import urlparse
from tempfile i... |
from os import environ
from os.path import splitext, relpath
from requests import get
from uritemplate import expand
auth = environ['GITHUB_TOKEN'], 'x-oauth-basic'
start_url = 'https://api.github.com/repos/openaddresses/openaddresses'
print('Starting at {start_url}'.format(**locals()))
got = get(start_url, auth=auth)... |
"""
Aggregate data for openassessment.
"""
from collections import defaultdict, namedtuple, OrderedDict
from io import StringIO
from urllib.parse import urljoin
from zipfile import ZipFile
from itertools import chain
import csv
import json
import os
import logging
import requests
from django.conf import settings
from... |
# coding=utf-8
__author__ = "AstroPrint Product Team <product@astroprint.com>"
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2017 3DaGoGo, Inc - Released under terms of the AGPLv3 License"
import logging
import os
import yaml
import importlib
imp... |
# -*- coding: utf-8 -*-
# Copyright (C) 2004-2016 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
#
# Authors: Aric Hagberg <hagberg@lanl.gov>
# Loïc Séguin-C. <loicseguin@gmail.com>
# Da... |
import os.path
import sys
import click
import importlib
from .utils import default_state_options, load_module
@click.command(name='load.run', help="Load cached data files into the database")
@default_state_options
@click.argument('filenames', nargs=-1)
@click.option('--place', help="the name of a place to load")
def... |
# Copyright 2013 Mirantis 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 ... |
# Copyright (c) 2013 Ian C. Good
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distrib... |
import json
import os
import environ
from django.conf.global_settings import LANGUAGES as GLOBAL_LANGUAGES
from django.core.exceptions import ImproperlyConfigured
CONFIG_FILE_NAME = "config_dev.env"
root = environ.Path(__file__) - 2 # two levels back in hierarchy
env = environ.Env(
DEBUG=(bool, False),
LAN... |
from collections import OrderedDict
from collections.abc import Mapping, MutableMapping
from io import StringIO
from math import log10
from numbers import Integral, Real
import os
import tempfile
from warnings import warn
import numpy as np
import h5py
from . import HDF5_VERSION, HDF5_VERSION_MAJOR
from .ace import L... |
import os.path
import time
import weakref
import gtk
import gtksourceview2
from ..util import save_file, idle, get_project_root, single_ref
from ..signals import SignalManager, Signal, connect_all, connect_external
class Editor(SignalManager):
add_spot_request = Signal()
before_close = Signal()
before_... |
# helperji, context stvari
from django.shortcuts import render, get_object_or_404, redirect
from django.http import Http404, HttpResponse
from django.contrib import messages
from django.core import serializers
from django.utils import simplejson
from workflows.urls import *
from workflows.helpers import *
import workfl... |
import re
import string
import datetime
import tldextract
import logging
from lxml import html
from operator import add
from sparkUtils import SparkDo
from pyspark.sql.functions import udf
from pyspark.sql import Row, SQLContext
from pyspark import SparkContext, SparkConf
from pyspark.sql.types import StringType, Ti... |
"""
Project: Farnsworth
Authors: Karandeep Singh Nagra and Nader Morshed
"""
from django import forms
from django.conf import settings
from django.db.models import Q
from django.forms.models import BaseModelFormSet, modelformset_factory
from base.models import UserProfile
from managers.models import Manager
from wo... |
from django import forms
from base.models import UserProfile
from managers.models import Manager
from workshift.models import Semester, WorkshiftPool, WorkshiftType, \
TimeBlock, WorkshiftRating, PoolHours, WorkshiftProfile, \
RegularWorkshift, ShiftLogEntry, InstanceInfo, WorkshiftInstance
class SemesterForm(form... |
"""
Project: Farnsworth
Authors: Karandeep Singh Nagra and Nader Morshed
"""
from __future__ import division, absolute_import
from datetime import date, timedelta
from django.utils.timezone import now
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import log... |
from .models import Span
from itertools import chain
from utils import tokens_to_ngrams
def get_text_splits(c):
"""
Given a k-arity Candidate defined over k Spans, return the chunked parent context (e.g. Sentence)
split around the k constituent Spans.
NOTE: Currently assumes that these Spans are in t... |
import sys
import re
from lxml import etree
from os import mkdir
from os.path import join
from datetime import datetime
def setup():
'''Set up for parsing and conversion.'''
mkdir("_posts")
def parse():
'''Parse the XML file in argv[1] and for each post call write_post.'''
tree = etree.parse(open... |
"""
Dynamically generated set of TestCases based on set of yaml files decribing
some integration tests. These files are shared among all official Elasticsearch
clients.
"""
import re
from os import walk, environ
from os.path import exists, join, dirname, pardir
import yaml
from elasticsearch import TransportError
from... |
#!/usr/bin/env python
# coding: utf-8
# Copyright (c) 2011, Yusuke Ohshima
# 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 copyrigh... |
# -*- coding: utf-8 -*-
#
# core.py
#
# Copyright 2016 Johan Lundberg <lundberg@nordu.net>
#
# This started as an extension to the Neo4j REST client made by Versae, continued
# as an extension for the official Neo4j python bindings when they were released
# (Neo4j 1.5, python-embedded).
#
# After the relea... |
# Make sure to set configuration, needs to be before any galpy imports
from nose.tools import assert_raises
from galpy.util import config
config.__config__.set('astropy','astropy-units','True')
import numpy
from astropy import units, constants
def test_orbit_setup_radec_basic():
from galpy.orbit import Orbit
o... |
import re
from random import randint
from hashlib import sha1
import html
TAB_SIZE = 4
SALT = bytes(randint(0, 1000000))
def hash_text(s, label):
return label + '-' + sha1(SALT + s.encode("utf-8")).hexdigest() + '-' + label
def convert(text):
text, variables = store_vars(text)
text = handle_whitespace(tex... |
# Copyright 2019 Raytheon BBN Technologies
#
# 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
import numpy as np
from scipy.optimize import cur... |
"""
This class is the workhorse of CARTOframes by providing all functionality related to data access to CARTO, map creation, and Data Observatory functionality.
"""
from __future__ import absolute_import
import json
import os
import random
import sys
import time
import collections
import binascii as ba
from warnings im... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime
from odoo.tests import common, Form
from odoo.exceptions import UserError
from odoo.tools import mute_logger
class TestSaleMrpFlow(common.SavepointCase):
@classmethod
def setUpCl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.