text
stringlengths
12
6.59M
import HTMLParser import html2text import re import socket import time import urllib import os import glob import astropy.io.fits as pyfits from threeML.io.file_utils import sanitize_filename from threeML.config.config import threeML_config from threeML.io.download_from_ftp import download_files_from_directory_ftp fr...
'''This module contains the main() function, which is the entry point for the command line interface.''' __version__ = '2.3.1' def main(): '''The entry point for Setuptools.''' import sys from radon.cli import program, log_error if not sys.argv[1:]: sys.argv.append('-h') try: pro...
# Copyright 2014 DreamHost, LLC # # Author: DreamHost, 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 applicabl...
import asyncio import html import re import discord import peewee from discord import Embed from alexis.base.command import Command from alexis.base.database import BaseModel from alexis.base.utils import pat_channel, pat_subreddit class RedditFollow(Command): def __init__(self, bot): super().__init__(b...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ This script is for downloading and maintaining a local copy of all of the XML files of PLOS articles. By default it doesn't rely on access to the PLOS's internal network (but can use it if available). Diagram of relevant systems here: https://confluence.plos.org/confl...
""" Django-specific extensions for use with aloe_django_. .. _aloe_django: https://github.com/koterpillar/aloe_django """ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import # pylint:disable=redefined-builtin,unused-wildc...
#!/usr/bin/env python # Test alpha variation at which cannot detect a planet # Create a combined spectra with a planet at an alpha value. # try and detect it by varying RV and alpha. # At some stage the alpha will not vary when it becomes to small # This will be the alpha detection limit. # Maybe this is a wavelength...
import subprocess, time, os, sys from django.contrib.staticfiles.testing import StaticLiveServerTestCase from django.test import TestCase from django.conf import settings from django.contrib.auth.models import User from django.core.management.base import OutputWrapper from django.core.management.color import color_st...
########################################################################### # (C) Vrije Universiteit, Amsterdam (the Netherlands) # # # # This file is part of AmCAT - The Amsterdam Content Analysis Toolkit # # ...
from functools import reduce from datetime import datetime import operator import re from django_select2.views import AutoResponseView from django.http import JsonResponse from django.contrib.auth.models import Group from django.conf.urls import url from django.db.models import Q, Count from fiscal.models import Memb...
from capstone.x86_const import * import struct from constructs import * from base_analyzer import BaseAnalyzer class X86_Analyzer(BaseAnalyzer): def _create_disassembler(self): self._disassembler = Cs(CS_ARCH_X86, CS_MODE_32) def ins_uses_address_register(self, instruction): for op in instruc...
import re from ctypes import (Structure, POINTER, pointer, c_int, c_double) import numpy from railgun.cfuncs import cfdec_parse, choice_combinations, CJOINSTR from railgun.cdata import cddec_parse """ SimObject, its metaclass (MetaSimObject), and helper functions Notations of "types" used here: CDT: C Data Type ...
from sklearn import metrics import numpy as np from pandas import DataFrame, Series from utils import pprint_scores from collections import defaultdict import pylab as pl class Reporter(object): defaults = dict( verbose=False ) def __init__(self, **kwargs): self.config = de...
## # Copyright (C) 2016 Jessica Tallon & Matt Molyneaux # # This file is part of Inboxen. # # Inboxen 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 #...
#!/usr/bin/python """ achievements_analytics.py Created by Mahdi Yusuf on 2011-03-06. """ from github2.client import Github import sys, re from django.utils import simplejson from achievements.models import Achievement, ProloggerUser from datetime import datetime #Helper functions def string_found(string1, string2...
# Copyright 2018 DeepMind Technologies Limited. 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 ...
from django import forms from django.contrib.auth.forms import UserCreationForm from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import render_to_response from django.template import RequestContext from django.contrib.auth.decorators import login_required from django.conf import settings...
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ python %prog study.file population.file gene-association.file This program returns P-values for functional enrichment in a cluster of study genes using Fisher's exact test, and corrected for multiple testing (including Bonferroni, Holm, Sidak, and false discovery rate...
''' Copyright 2014 The Science and Technology Facilities Council 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...
from flask import Flask from flask import session from flask import Response from flask import request from flask import redirect, url_for from flask import render_template from api.core import app, db from api.models.user import User from api.models.page import Page import urllib import json import datetime @app.ro...
import datetime from typing import Optional import json from copy import deepcopy import openpyxl from dateutil.relativedelta import relativedelta from django.contrib.auth.decorators import login_required from api.monitorings import structure_sheet from laboratory.decorators import group_required from django.http imp...
from rest_framework import serializers as ser from rest_framework import exceptions from modularodm.exceptions import ValidationValueError from framework.auth.core import Auth from framework.exceptions import PermissionsError from website.models import Node, User, Comment from website.exceptions import NodeStateError...
from rest_framework import serializers as ser from modularodm.exceptions import ValidationValueError from api.base.exceptions import InvalidModelValueError, JSONAPIException, Conflict from api.base.serializers import AllowMissing, JSONAPIRelationshipSerializer, HideIfDisabled from website.models import User from api...
''' Generates factors of a particular number by iterating through the num upto sqrt(num) . Efficient approach using prime factor generation. The function reduce if new to you, just computes result of the supplied function f (in this case list.__add__) on the first two elements of the supplied list, ...
"""Runs probability-matched means (PMM). Specifically, this script uses PMM to composite one of the following: - set of saliency maps - set of class-activation maps (CAMs) When compositing saliency maps or CAMs, this script also composites the accompanying predictor fields (input to the convnet that generated the sa...
import pytest from gitlabform.gitlabform import GitLabForm from gitlabform.gitlabform.test import create_group, create_users, remove_users_from_group, get_gitlab, GROUP_NAME USER_BASE_NAME = 'group_member_user' # user1, user2, ... @pytest.fixture(scope="function") def gitlab(request): gl = get_gitlab() c...
"""GStudio implementations of repository sessions.""" # pylint: disable=too-many-public-methods,too-few-public-methods # Number of methods are defined in specification # pylint: disable=too-many-ancestors # Inheritance defined in specification from bson import ObjectId from .. import utilities from . import o...
import requests, json, secrets, time, urllib startTime = time.time() # function to find key in nested dicts: see http://stackoverflow.com/questions/9807634/find-all-occurences-of-a-key-in-nested-python-dictionaries-and-lists def gen_dict_extract(key, var): if hasattr(var,'iteritems'): for k, v in var.iter...
from sqlalchemy import Column, Integer, String, Float, ForeignKey, Table, MetaData from sqlalchemy import create_engine, insert from sqlalchemy.orm import relationship, sessionmaker, backref import json metadata = MetaData() champion = Table('Champion', metadata, Column('id', Integer, primary_key=T...
# -*- coding: utf-8 -*- # Copyright(C) 2011 Romain Bignon, Laurent Bachelier # # 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, version 3 of the License. # # This program is distributed in the ...
# Copyright (C) 2014 Linaro Ltd. # # 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 distribute...
from urllib import quote_plus from datetime import datetime, date from types import MethodType import dateutil.parser import requests import json class atlas_request_error(Exception): pass class atlas_server_error(Exception): pass class atlas_request: ATLAS_API_KEY = None ATLAS_API_BASE_URL = 'h...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import codecs import json import time import datetime import re from django import forms from django.contrib.auth import authenticate, login, logout from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required fr...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Urwid utility functions # Copyright (C) 2004-2011 Ian Ward # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import codecs import json import time import datetime import re import logging from datetime import date import pytz import django from django import forms from django.contrib.auth import authenticate, login, logout from django.contrib.auth.models imp...
#! /usr/bin/env python from __future__ import print_function from operator import itemgetter import argparse import os import re import sys import traceback try: import audiotools except ImportError: audiotools = None from mutagen.flac import FLAC from mutagen.mp4 import MP4 from mutagen.mp3 import MP3 if sys...
#!/usr/bin/env python # -*- coding: utf-8 -*- """auth.py: basic web front-end to auth/de-auth ipaddrs using iptables. author: anton@belodedenko.me """ from subprocess import Popen, PIPE from collections import defaultdict import datetime, traceback, sys from settings import (MAX_AUTH_IP_COUNT, SQLITE_DB, DEBUG, VERS...
#!/usr/bin/env python # Copyright 2011 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...
import time from collections import namedtuple from distutils.version import LooseVersion from cassandra import AuthenticationFailed, InvalidRequest, Unauthorized from cassandra.cluster import NoHostAvailable from cassandra.protocol import SyntaxException from dtest import CASSANDRA_VERSION_FROM_BUILD, Tester, debug ...
#!/usr/bin/env python __author__ = 'Justin Bollinger' import RPi.GPIO as GPIO import smtplib from email.mime.text import MIMEText import json from astral import Astral import datetime import time import pytz import sys def door_change(): print "Door Changed" GPIO.output(door_relay_pin, GPIO.HIGH) time.sle...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2014 James Zhang # Copyright (c) 2015 Rasmus Sorensen # # The MIT 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 Softwa...
import time import sys from selenium import webdriver import configparser def getDetails(): Config = configparser.ConfigParser() Config.read("acc.ini") #single section Account and options Username, Password try: uname = Config.get("Account", "Username") pword = C...
# Copyright (c) 2017 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. """ This script (intended to be invoked by autoninja or autoninja.bat) detects whether a build is using goma. If so it runs with a large -j value, and ot...
# -*- coding: utf-8 -*- """ Autopilots for the DriveIt Gym environment. @author: Jean-Claude Manoli """ import numpy as np from belief import BeliefTracking from PositionTracking import PositionTracking, TruePosition epsilon = 0.05 class Autopilot(object): def __init__(self, car, other_cars=None, tracker_type=Po...
from django.conf import settings from django.utils.translation import gettext_lazy as _ # disable plugin when set to False settings.AXES_ENABLED = getattr(settings, "AXES_ENABLED", True) # see if the user has overridden the failure limit settings.AXES_FAILURE_LIMIT = getattr(settings, "AXES_FAILURE_LIMIT", 3) # see...
######## # Copyright (c) 2015 GigaSpaces Technologies Ltd. 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 json from jsonschema import ValidationError, validate schema = { "type": "object", "required": ["@type"], "properties": { "@type": {"type": "string"}, } } microformat = { 'employee': { "type": "object", "required": ["url", "name"], "properties": { ...
import datetime from django.core.management.base import BaseCommand from django.db.models import Q from openpyxl import load_workbook import clients.models as clients class Command(BaseCommand): def add_arguments(self, parser): """ :param path - файл с пациентами """ parser.add_a...
# -*- coding: utf-8 -*- import unittest from uuid import uuid4 from app import db from app.models import User, Item from app.main.helpers import delete_item_image from helper import SeleniumTestCase import page from locators import NavBarLocators import time import os class ItemTestCase(SeleniumTestCase): @classme...
############################################################################## # Copyright (c) 2013-2018, 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 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Sz(CMakePackage): """Error-bounded Lossy Compressor for HPC Data""" homepage = "https...
# Copyright (c) 2015, The MITRE Corporation. All rights reserved. #BY USING THE VIRSUTOTAL MAEC PACKER MODULE SCRIPT, YOU SIGNIFY YOUR ACCEPTANCE #OF THE TERMS AND CONDITIONS OF USE. IF YOU DO NOT AGREE TO THESE TERMS, DO #NOT USE THE VIRSUTOTAL MAEC PACKER MODULE. #For more information, please refer to the LICENSE....
import os import sys import time import logging import socket from IPython.config.loader import Config from IPython.parallel.apps.launcher import LocalControllerLauncher,\ LocalEngineLauncher, \ SSHEngineLauncher ...
import sys, os sys.path = [os.path.abspath(os.path.dirname(os.path.dirname(__file__)))] + sys.path import vmcatcher.vmcatcher_subscribe.retrieveFacard import logging import smimeX509validation import unittest import vmcatcher.outputfacard from vmcatcher.vmcatcher_subscribe.fatcontroler import db_controler import nos...
from __future__ import unicode_literals from datetime import datetime from optparse import make_option from time import mktime from django.contrib.auth.models import User from django.core.management.base import BaseCommand from django.utils.timezone import get_default_timezone, make_aware from feedparser import parse...
#!/usr/bin/env python import math import numpy as np import rospy from tf import transformations as tra # python ec_grasps.py --angle 69.0 --inflation .29 --speed 0.04 --force 3. --wallforce -11.0 --positionx 0.0 --grasp wall_grasp wall_chewinggum # python ec_grasps.py --anglesliding -10.0 --inflation 0.02 --speed 0....
import re from django import forms from django.contrib import admin from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm, UserChangeForm from django.contrib.auth.admin import UserAdmin from django.utils.translation import ugettext as _ from user.models import Profile unico...
#! /usr/bin/env python # Copyright (c) 2006 The Regents of The University of Michigan # Copyright (c) 2007,2011 The Hewlett-Packard Development Company # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are #...
import urllib import random import hmac from hashlib import sha1 import datetime import web import helpers, forms from . settings import db, render import config def get_hexdigest(key, s): return hmac.new(key, s, sha1).hexdigest() def encrypt_password(password): key = str(random.random())[2:] return '@'....
import logging import msgpack import asyncio from typing import Dict, Optional, Any from aiokafka import AIOKafkaProducer, AIOKafkaConsumer from asyncio.selector_events import BaseSelectorEventLoop as EventLoop from app.jobs import Job from . import Worker, ActiveJob log = logging.getLogger(__name__) class QueueCl...
from lxml import etree from . import basereader def get_root_el(fn): rootgen = etree.iterparse(fn, events=('start',)) return next(rootgen)[1] def get_namespace(fn): root = get_root_el(fn) ns = {} for prefix in root.nsmap: separator = ':' if prefix is None: separator =...
import itertools import json def parse_to_json(csv, outFile): df = [] parse(csv, df) with open(outFile, "w+") as out: out.write(json.dumps(df, indent=4)) return df def parse(fn, df): with open(fn) as f: content = f.readlines() parser(content, df) def parser(content, data): ...
import cherrypy from basefilter import BaseFilter def default_login_screen(from_page, login = '', error_msg = ''): return """ <html><body> Message: %s <form method="post" action="do_login"> Login: <input type="text" name="login" value="%s" size="10"/><br/> Password: <in...
""" Authenticator original from the JupyterHub repository https://github.com/jupyter/nbgrader/blob/master/nbgrader/auth/hubauth.py """ import json import requests from requests.exceptions import ReadTimeout from tornado.web import HTTPError from tornado.web import RequestHandler from . import util # Backfills fo...
import svgwrite import path_utilities as pu import noise, mouth, nose, eye import random, math class Head: def __init__(self, n, r, cx, cy): self.n = n self.r = r self.cx = cx self.cy = cy self.shape_id = random.choice([0,1,2]) self.hair = random.random() > 0.5 self.mouth = random.random(...
import pytest from api.tests.endpoint_base import EndpointBase @pytest.mark.django_db class TestEndpoints(EndpointBase): def test_activities_endpoint(self, client, activity): response = client.get('/api/v3/activities/') assert response.status_code == 200 def test_activity_detail_endpoint(sel...
# encoding: utf-8 from AppKit import * from Foundation import * import time, math, sys, os, string, re, traceback from sets import Set __all__ = ["Glyphs", "GetFile", "GSMOVE", "GSLINE", "GSCURVE", "GSOFFCURVE", "GSSHARP", "GSSMOOTH", "TAG", "TOPGHOST", "STEM", "BOTTOMGHOST", "TTANCHOR", "TTSTEM", "TTALIGN", "TTI...
#!/usr/bin/env python # -*- coding: utf-8 -*- import wikipedia, re, string import math RE_LINKS = re.compile('(\[\[[Uu]ser *: *(.+?) *(?:\| *(.*?) *)?\]\])') RE_USER = re.compile('\[\[[Uu]ser ?: ?(.+?) ?[\|\]]') RE_LISTED = re.compile('\s*[\*]\s*(\[.+?\]+|\S+)[^\n]*') RE_LISTEDLINK = re.compile('\s*[\*]\s*(\[.+?\]+)...
from __future__ import absolute_import import logging import ujson import datetime import socket from . import base LOG = logging.getLogger(__name__) class LogstashOutput(base.BaseFT): def __init__(self, name, chassis, config): super(LogstashOutput, self).__init__(name, chassis, config) self._...
# encoding: utf-8 from AppKit import * from Foundation import * import time, math, sys, os, string, re, traceback from sets import Set __all__ = ["Glyphs", "GetFile", "GSMOVE", "GSLINE", "GSCURVE", "GSOFFCURVE", "GSSHARP", "GSSMOOTH", "TAG", "TOPGHOST", "STEM", "BOTTOMGHOST", "TTANCHOR", "TTSTEM", "TTALIGN", "TTI...
#!/usr/bin/python # Copyright 2016 Mosen/Tim Sutton # # 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 __future__ import ( absolute_import, division, print_function, unicode_literals) from builtins import (ascii, bytes, chr, dict, filter, hex, input, # noqa int, map, next, oct, open, pow, range, round, str, super, zip) from collections import namedtuple import l...
#!/usr/bin/env python # # VMAccess extension # # Copyright 2014 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.0 # # Un...
from django.test import TestCase from django.test.client import Client from django.core.exceptions import ObjectDoesNotExist, ValidationError from django.db import IntegrityError from teams.views import MakeTeamView from teams.models import Team from users.models import User class MakeTeamPageTest(TestCase): def ...
import spark import motion from bot import process_command from config import config from flask import Flask from flask import request from flask import jsonify from threading import Thread import time import sys app = Flask(__name__) def on_motion_detected(): print("motion detected!") def run_motion_detection(...
from __future__ import ( absolute_import, division, print_function, unicode_literals) from builtins import (ascii, bytes, chr, dict, filter, hex, input, # noqa int, map, next, oct, open, pow, range, round, str, super, zip) from collections import namedtuple from enu...
import unittest from tests.test_utils import with_roscore, mock_pub, check_topic, with_launch_file, launch_node, await import numpy as np from collections import namedtuple from sensor_msgs.msg import Joy from msg import CarPose from msg import CarState @with_roscore class TestCarState(unittest.TestCase): @with_...
#!/usr/bin/env python import os import re import sys import clang.cindex import cppmodel as model import django_apps from django.template import Context, Template import django import HTMLParser import annotations html_parser = HTMLParser.HTMLParser() if not django.conf.settings.configured : django.conf.settings....
from ctypes import c_void_p import math import numpy as np from OpenGL.GL import * from OpenGL.GLU import * from PIL import Image from PyEngine3D.Common import logger, log_level, COMMAND from PyEngine3D.Common.Constants import * from PyEngine3D.Utilities import * from PyEngine3D.OpenGLContext import InstanceBuffer,...
import unittest from testquery import checkquery from testquery import GrappalangRunner from generate_test_relations import generate_default from generate_test_relations import need_generate from raco.language.grappalang import GrappaAlgebra import raco.language.grappalang as grappalang from platform_tests import Myria...
# Copyright (C) 2014 Rémi Bèges # For conditions of distribution and use, see copyright notice in the LICENSE file import tkinter as Tk import tkinter.ttk as ttk from pubsub import pub """ Logger GUI Frame """ #TODO : Graph should ask logger for selected var class Logger_Frame(Tk.Frame): def __init__(self,paren...
import os import glob import sys root_py_folder = "klampt" if sys.version_info[0] == 2: #python2 version has drifted from current Python3 version... maintain separate packages list for compatibility root_py_folder = "python2_version/klampt" subpackages = ['apps','io','math','model','model/create','plan','p...
{ 'name': 'Website', 'category': 'CMS', 'version': '1.0', 'description': """ OpenERP Website CMS =================== """, 'author': 'OpenERP SA', 'depends': ['web'], 'installable': True, 'data': [ 'views/views.xml', 'views/res_config.xml', 'website_data.x...
 from URLDictionary import * from satori.core.models import * # Module for database queries def UserById(uid): return User.objects.get(id=uid) def ContestById(cid): return Contest.objects.get(id=cid) def CurrentUser(): if not ('user' in Session.request.session.keys()): return None else: u = Session.reques...
import json import subprocess from optparse import make_option import yaml from django.conf import settings from django.core.management.base import BaseCommand from django.utils import timezone from salmon.apps.monitor import models, utils class Command(BaseCommand): help = "Run Salt monitor checks" option_...
""" Limited dependent variable and qualitative variables. Includes binary outcomes, count data, (ordered) ordinal data and limited dependent variables. General References -------------------- A.C. Cameron and P.K. Trivedi. `Regression Analysis of Count Data`. Cambridge, 1998 G.S. Madalla. `Limited-Dependent a...
""" Author: Marusa Zerjal, 2019 - 07 - 15 Take Sco-Cen components fitted to 6D data and make overlaps (using covariance matrix) with stars missing radial velocities in order to find more Sco-Cen candidates. MZ: It fails in python2 (cannot import emcee). """ import numpy as np import sys sys.path.insert(0, '..') fro...
from __future__ import division, print_function, absolute_import import pytest import numpy as np from numpy.testing import assert_array_almost_equal from scipy.spatial.transform import Rotation def test_generic_quat_matrix(): x = np.array([[3, 4, 0, 0], [5, 12, 0, 0]]) r = Rotation.from_quaternion(x) e...
from __future__ import division, print_function, absolute_import import pytest import numpy as np from numpy.testing import assert_equal, assert_array_almost_equal from numpy.testing import assert_allclose from scipy.spatial.transform import Rotation from scipy.stats import special_ortho_group def test_generic_quat...
import scrapy from scrapy.command import ScrapyCommand from scrapy.fetcher import fetch from scrapy.spider import spiders from scrapy.xpath import XmlXPathSelector, HtmlXPathSelector from scrapy.utils.misc import load_class from scrapy.extension import extensions from scrapy.conf import settings def get_url(url): ...
from django.test import Client from django.core.urlresolvers import reverse from django.contrib.auth import get_user_model import datetime from core.tests.base import BaseTestCase from profiles.utils import set_expiration_date class ProfileViewTestCase(BaseTestCase): def setUp(self): super(ProfileViewTe...
#!/usr/bin/env python """ Feed wall.py your JSON and get a wall of tweets as HTML. If you want to get the wall in chronological order, a handy trick is: % tail -r tweets.jsonl | ./wall.py > wall.html """ import os import re import sys import json import requests import fileinput AVATAR_DIR = "img" def downlo...
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
from django.shortcuts import render_to_response from django.template import RequestContext from utkik.decorators import http_methods from utkik.utils import uncamel class ContextData(object): """ A container for attributes to store on the template context. All the attributes are later collected as a dict...
from django.contrib.auth.models import Group, User from django.db import models from django.utils.encoding import smart_unicode from ipynbsrv.common.utils import ClassLoader from ipynbsrv.contract.backends import ContainerBackend, SuspendableContainerBackend class Backend(models.Model): """ Model used to sto...
# Copyright 2012-2015, Andrey Kislyuk and argcomplete contributors. # Licensed under the Apache License. See https://github.com/kislyuk/argcomplete for more info. from __future__ import absolute_import, division, print_function, unicode_literals import os, sys, argparse, contextlib, subprocess, re from . import my_s...
from __future__ import absolute_import from __future__ import unicode_literals # -*- coding: utf-8 -*- from os import path as os_path import os import sys ################################# # General # ################################# BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) SECRET...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import print_function from irc3.compat import PY3 from irc3.compat import string_types from irc3.compat import asyncio from irc3 import utils from collections import defaultdict import functools import venusian import fnmatch import logging...
# Ariane CLI Python 3 # Ariane Core Mapping API # # Copyright (C) 2015 echinopsii # # 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) ...