src stringlengths 721 1.04M |
|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import sys
def noop_gettext(s):
return s
permission = True
cms_toolbar_edit_on = 'edit'
port = 8000
for arg in sys.argv:
if arg == '--CMS_PERMISSION=False':
permission = False
if arg == '--CMS_TOOLBA... |
# coding=utf-8
from __future__ import absolute_import, division, print_function
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
fr... |
# MIT License
# Copyright (c) 2016 Morgan McDermott & John Carlyle
# 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, cop... |
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
# -*- coding: utf-8 -*-
"""Super server class"""
from abc import ABCMeta, abstractmethod
from werkzeug.wrappers import Response
class CommServer(metaclass=ABCMeta):
@abstractmethod
def __init__(self, server_resources, configuration):
"""Configures the resource for exit
Args:
ser... |
from __future__ import print_function, absolute_import, division
import sys
import click
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
import ec2hosts
def main():
try:
cli(obj={})
except Exception as e:
import traceback
click.echo(traceback.format_exc(), err=True)
... |
import unittest
from katas.kyu_7.regexp_fun_1_when_i_miss_few_days_of_gym import gym_slang
class GymSlangTestCase(unittest.TestCase):
def test_equal_1(self):
self.assertEqual(gym_slang("When I miss few days of gym"),
"When I miss few days of gym")
def test_equal_2(self):
... |
import pymel.all as pm
import traceback
from collections import namedtuple as NamedTuple
class Duck(object):
pass
class MmmmQuickMenus( object ):
## __init__ runs as soon as we start the cube maker
## we almost always put a reference to self in
##
def __init__(self):
self.setupNamedTuple... |
from helga.plugins import command
from functions import bounty_lookup, crucible_lookup, daily_lookup
from functions import heroic_lookup, nightfall_lookup, xur_lookup
from scraper import VENDOR_NAMES
guard_help = "Returns a guardian's destinytracker.com page"
@command('guardian', aliases=('g',), help=guard_help)
def ... |
# coding=utf-8
from pytest import raises
from rses.src.objects import stock
import rses_errors
def test_ingredient_type_create(ingredient_type_no_create):
ingredient_type = stock.IngredientType(name=ingredient_type_no_create)
assert ingredient_type.id
assert ingredient_type.name == ingredient_type_no_cre... |
import datetime
import django.dispatch
phase_change = django.dispatch.Signal(providing_args=['from_phase', 'to_phase', 'changed_at'])
def card_order(sender, instance, **kwargs):
if instance.order:
return
from django.db.models import Max
max_order = instance.phase.cards.aggregate(
... |
def pytest_addoption(parser):
parser.addoption("--blazeweb_package", action="store",
help="blazeweb-package: app module to run for tests")
parser.addoption("--blazeweb_profile", action="store", default="Test",
help="blazeweb-profile: app settings profile to use (default... |
import scrapy
import re
from locations.items import GeojsonPointItem
import json
class CVSSpider(scrapy.Spider):
name = "pizzaranch"
allowed_domains = ["pizzaranch.com"]
download_delay = 0.5
start_urls = (
'https://pizzaranch.com/locations',
)
def parse_times(self, times):
if ti... |
#
# Copyright (C) 2014 Red Hat, Inc.
#
# 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 i... |
#!/usr/bin/python
#
# Functions to manipulate data from/to Zabbix Trapper.
# https://github.com/mtulio/kb/blob/master/scripts/zabbix/trapper-zbx_nginx/zabbix_lib.py
#
import re, struct, time, socket, sys, datetime, os.path
try:
import json
except:
import simplejson as json
#################################
#... |
# Copyright (C) 2016 Deloitte Argentina.
# This file is part of CodexGigas - https://github.com/codexgigassys/
# See the file 'LICENSE' for copying permission.
import pefile
import math
import os
import sys
import shutil
import time
from test import test
class PEHeaderReader():
# def __init__(self,file):
# ... |
# -*- coding: utf-8 -*-
from flask import render_template, session, redirect, url_for
from app import app
from app.models.Forms import PublicProfile
from app.models.Checks import login_required
from app.models.SQL_DB import User, Item_Profile
@app.route('/supplier/settings/public_profile', methods=['GET', 'POST'])
@... |
# Copyright 2010 OpenStack Foundation
# Copyright 2012 University Of Minho
#
# 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.... |
# coding=utf-8
"""Dublin Core Metadata Initiative, see http://dublincore.org/documents/dcmi-terms/"""
from epubaker.metas.attrs import Attrs, AltScript, Dir, FileAs, Id, Role, Lang
from epubaker.xl import Element, URI_XML
def always_true(*args, **kwargs):
pass
l = [
'abstract', 'accessRights', 'accrualMeth... |
# -*- coding: utf-8 -*-
# (C) 2013-2018,2020 Muthiah Annamalai
#
# This file is part of 'open-tamil' package tests
#
# setup the paths
import unittest
from opentamiltests import *
from tamil.utf8 import get_letters
from transliterate import azhagi, jaffna, combinational, UOM, ISO, itrans, algorithm
class ReverseTran... |
import ctypes as C
import numpy as np
# SDL 1.2 keycodes - damn them to hell!
SDLK_UP = 1073741906
SDLK_DOWN = 1073741905
SDLK_RIGHT = 1073741903
SDLK_LEFT = 1073741904
SDLK_RETURN = 13
SDLK_LCTRL = 224
SDLK_LSHIFT = 225
SDLK_X = 27
SDLK_C = 6
SDLK_Z = 29
SDLK_W = 26
SDLK_A = 4
SDLK_S = 22
SDLK_D = 7
# key to button ... |
""" core implementation of testing process: init, session, runtest loop. """
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import contextlib
import fnmatch
import functools
import os
import pkgutil
import sys
import warnings
import attr
import py
import s... |
from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash, views
from pymongo import MongoClient
from pymongo.cursor import Cursor as MongoCursor
from ConfigParser import SafeConfigParser
from datetime import datetime, timedelta
from Crypto.Hash import SHA256
import os
import os.pa... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 28 09:55:21 2016
@author: chrismcginlay
"""
grid = [
list("SYNTAXQWERT"),
list("GHFPOSTKDSK"),
list("LKJHCVNBVYR"),
list("CCCBIWUISKT"),
list("LKTSOPSHDER"),
list("XZPOSTSEIGU"),
]
for row in grid:
row.insert(0,"*")
row.append("*")
width ... |
__author__ = 'Nicole'
import json
import random
import time
GREEN = 'green'
CONSERVATIVE = 'conservative'
LIBERAL = 'liberal'
LIBERTARIAN = 'libertarian'
MAX_CACHED_POINTS = 400
STATES = [GREEN, CONSERVATIVE, LIBERAL, LIBERTARIAN]
class MyStates:
def __init__(self):
self.currentStates = [CurrentStateOf... |
# -*- coding: utf-8 -*-
from model.contact import Contact
from model.group import Group
import random
def test_del_contact_in_group(app, db, orm):
list =[]
app.contact.check_available_min_requirement(app, db)
group_list = db.get_group_list()
for this_group in group_list:
contacts_in_group = orm... |
from MuseParse.classes.ObjectHierarchy.ItemClasses import Note
from MuseParse.classes.ObjectHierarchy.TreeClasses.PartNode import PartNode
from MuseParse.tests.testLilyMethods.lily import Lily
class testPartMeasureWithNote(Lily):
def setUp(self):
self.item = PartNode()
self.item.addEmptyMeasure(1... |
from .types import TypesManager
def encode(obj):
""" Encodes an item preparing it to be json serializable
Encode relies on defined custom types to provide encoding, which in turn
are responsible of using the 'encode' function parameter passed to them
to recursively encoded contained items.
... |
# -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
#!/usr/bin/env python
# Copyright (C) 2015 Swift Navigation Inc.
# Contact: Ian Horn <ian@swiftnav.com>
# Bhaskar Mookerji <mookerji@swiftnav.com>
#
# This source is subject to the license found in the file 'LICENSE' which must
# be be distributed together with this source. All other rights reserved.
#
# THIS ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
##===-----------------------------------------------------------------------------*- Python -*-===##
## _
## | |
## __| | __ ___ ___ ___
## / _` |/ _` \ \ /\ / / '_ |
## ... |
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2011 Frédéric Bertolus.
#
# This file is part of Perroquet.
#
# Perroquet is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... |
import codecs
import os
import re
import typing as tp
from satella.exceptions import ConfigurationValidationError
from .base import Descriptor, ConfigDictValue
from .registry import register_custom_descriptor
@staticmethod
def _make_boolean(v: tp.Any) -> bool:
if isinstance(v, str):
if v.upper() == 'TRUE... |
from nbodykit.base.catalog import CatalogSource
from pmesh.domain import GridND
from nbodykit.utils import split_size_3d
import numpy
class SubVolumesCatalog(CatalogSource):
""" A catalog that distributes the particles spatially into subvolumes per
MPI rank.
Attributes
----------
d... |
#!/usr/bin/env python
# Converted from RDS template located at:
# https://github.com/cloudtools/troposphere/blob/master/examples/RDS_with_DBParameterGroup.py
import os
import troposphere
from troposphere import Base64, Join, Parameter, Output, Ref, Template, Tags
from troposphere.rds import DBInstance, DBParameterGrou... |
from __future__ import print_function
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http, useragents
from streamlink.plugin.api import validate
from streamlink.stream import HLSStream
class RaiPlay(Plugin):
url_re = re.compile(r"https?://(?:www\.)?raiplay\.it/dirette/(\w+)/?")
... |
## @package gmapcatcher.tilesRepo.tilesRepoRMaps
# This module provides sqlite3 tile repository functions in the format
# used by the RMaps android app.
#
# Usage:
#
# - constructor requires MapServ instance, because method
# 'get_tile_from_coord' is provided in the MapServ
#
import os
import gtk
import sys
import t... |
from ..utils import *
##
# Minions
# Flamewaker
class BRM_002:
events = OWN_SPELL_PLAY.after(Hit(RANDOM_ENEMY_MINION, 1) * 2)
# Twilight Whelp
class BRM_004:
play = HOLDING_DRAGON & Buff(SELF, "BRM_004e")
# Imp Gang Boss
class BRM_006:
events = SELF_DAMAGE.on(Summon(CONTROLLER, "BRM_006t"))
# Dark Iron Skul... |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2013-2018 Danilo Bargen
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,... |
class Html:
def __init__(self):
# Nothing to do
return
def td(self, x):
return "<td>" + str(x) + "</td>"
def tdc(self, x, color):
return "<td bgcolor='" + color + "'>" + str(x) + "</td>"
def tdh(self, x):
return "<td bgcolor='#AAEEAA'>" + str(x) + "</td>"
def tr(self, ... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2014-2017 GEM Foundation
#
# OpenQuake 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 Licen... |
import bs4
import requests
import csv
import re
import operator
def get_page(url):
"""
Returns a BeautifulSoup object from an URL request
:param url: URL
:return: BeautifulSoup object
"""
r = requests.get(url)
data = r.text
return bs4.BeautifulSoup(data, "lxml")
def main():
"""
... |
# encoding: utf-8
import datetime
import south.db
from south.db import dbs
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db = dbs['stats']
db.dry_run = south.db.db.dry_run
# Adding field 'NodeTypeUsage.... |
from __future__ import print_function
from __future__ import absolute_import
from .securityhandlerhelper import securityhandlerhelper
import re as re
dateTimeFormat = '%Y-%m-%d %H:%M'
import arcrest
from . import featureservicetools as featureservicetools
from arcrest.hostedservice import AdminFeatureService
impor... |
# Copyright 2015 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... |
from sympy.core import sympify, Lambda, Dummy, Integer, Rational, oo, Float, pi
from sympy.functions import sqrt, exp, erf
from sympy.printing import sstr
import random
class Sample(tuple):
"""
Sample([x1, x2, x3, ...]) represents a collection of samples.
Sample parameters like mean, variance and stddev c... |
#
# 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
# ... |
from __future__ import unicode_literals
import copy
from modelcluster.forms import ClusterForm, ClusterFormMetaclass
from django.db import models
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from django.utils.six import text_type
from django import forms
from djan... |
#! /usr/bin/env python
# This example shows how to solve a first simple PDE:
# - load the mesh,
# - perform initial refinements
# - create a H1 space over the mesh
# - define weak formulation
# - initialize matrix solver
# - assemble and solve the matrix system
# - visualize the solution
#
# PDE: Poisson... |
#!/usr/bin/env python
# This file is part of DiSTAF
# Copyright (C) 2015-2016 Red Hat, Inc. <http://www.redhat.com>
#
# 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 th... |
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2017, 2021 Rocky Bernstein <rocky@gnu.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your... |
# This file is part of QuTiP: Quantum Toolbox in Python.
#
# Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
... |
class Person: # Portable: 2.X or 3.X
def __init__(self, name): # On [Person()]
self._name = name # Triggers __setattr__!
def __getattribute__(self, attr): # On [obj.any]
print('get: ' + attr)
if attr == 'name'... |
import time
import fractions
from functools import reduce
from logging import getLogger
logger = getLogger(__name__)
class Scheduler:
def __init__(self, jobs):
"""
Create a new Scheduler.
>>> s = Scheduler([Job(1, max, 100, 200)])
>>> for jobs in s:
... time.sleep(s.t... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Request',
fields=[
('id', models.AutoField(verb... |
from bs4 import BeautifulSoup
import re
import os
import multiprocessing
def read_and_tokenize (file_name):
xml_file_handle = open(file_name, 'rb')
xml_file_contents = xml_file_handle.read()
xml_file_handle.close()
xml_file_text = ''
full_text_all = BeautifulSoup(xml_file_contents).find_all(class_="full_text")
... |
#!/usr/bin/python
#
# Copyright (c) SAS Institute 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... |
"""
PySCeS - Python Simulator for Cellular Systems (http://pysces.sourceforge.net)
Copyright (C) 2004-2019 B.G. Olivier, J.M. Rohwer, J.-H.S Hofmeyr all rights reserved,
Brett G. Olivier (bgoli@users.sourceforge.net)
Triple-J Group for Molecular Cell Physiology
Stellenbosch University, South Africa.
Permission to us... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pyresample, Resampling of remote sensing image data in python
#
# Copyright (C) 2010-2016
#
# Authors:
# Esben S. Nielsen
# Thomas Lavergne
# Adam Dybbroe
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Les... |
# pylint: disable=E1101,E1103
# pylint: disable=W0703,W0622,W0613,W0201
from functools import partial
import itertools
import numpy as np
from pandas._libs import algos as _algos, reshape as _reshape
from pandas._libs.sparse import IntIndex
from pandas.compat import PY2, range, text_type, u, zip
from pandas.core.dty... |
"""
Django settings for djangoconnectiondashboard project.
Generated by 'django-admin startproject' using Django 1.8.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/... |
import sublime
import sublime_plugin
import re
# Takes the sublime.View and a sublime.Region object
# Return the array of strings, each element represents on line of the selection
def get_lines(view, selection_region):
multiline_text = view.substr(selection_region)
lines = re.split(r'(.*\n)', multiline_text, re.DO... |
# -*- coding: utf-8 -*-
from common import normalize_xml_name, get_natural_sort_key
XMLID_MAXSIZE = 128
class XmlIdManager(object):
"""Manages creation and lookup of xml_id in OOOP database or XML files"""
def __init__(self, ooop_instance, file_xml_ids):
self.ooop = ooop_instance
self._xml... |
from collections import namedtuple
import logging
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User, Group
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.utils.timezone impo... |
#!/usr/bin/env python
from pmagpy import pmag
from pmagpy import pmagplotlib
from matplotlib import pyplot as plt
import sys
import os
import numpy as np
import matplotlib
if matplotlib.get_backend() != "TKAgg":
matplotlib.use("TKAgg")
from pmagpy import ipmag
def main():
"""
NAME
histplot.py
... |
#!/usr/bin/env python
"""
Export a BaseType from getting objects using a bad header_sort
"""
# import the basic python packages we need
import os
import sys
import tempfile
import pprint
import traceback
# disable python from generating a .pyc file
sys.dont_write_bytecode = True
# change me to the path of pytan if th... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Joël Grand-guillaume (Camptocamp)
# Copyright 2010 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... |
from redleader.resources import Resource
import redleader.exceptions as exceptions
class SQSQueueResource(Resource):
"""
Resource modeling an S3 Bucket
"""
def __init__(self,
context,
queue_name,
dead_letter_queue=None,
dead_letter_que... |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2021 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 required by applicable law ... |
from abc import ABCMeta, abstractmethod
from collections import OrderedDict
from collections.abc import Iterable, MutableSequence
from copy import deepcopy
import numpy as np
from openmc.checkvalue import check_type
class Region(metaclass=ABCMeta):
"""Region of space that can be assigned to a cell.
Region ... |
import numpy as np
import skimage.io
from scipy.ndimage import zoom
from skimage.transform import resize
try:
# Python3 will most likely not be able to load protobuf
from caffe.proto import caffe_pb2
except:
import sys
if sys.version_info >= (3, 0):
print("Failed to include caffe_pb2, things mi... |
from PyQt5 import QtWidgets
from view.aes_window import Ui_AESWindow
from view.ui_thread import UIThread
from view.base import Base
from utils.aes_handler import AESHandler
class AES(QtWidgets.QMainWindow, Ui_AESWindow, Base):
def __init__(self, parent=None):
QtWidgets.QMainWindow.__init__(self, parent)
... |
import sys
import re
import os
import string
import subprocess
#BASE_DIR = '/home/aritter/twitter_nlp'
#BASE_DIR = os.environ['HOME'] + '/twitter_nlp'
#BASE_DIR = '/homes/gws/aritter/twitter_nlp'
BASE_DIR = 'twitter_nlp.jar'
if os.environ.has_key('TWITTER_NLP'):
BASE_DIR = os.environ['TWITTER_NLP']
#sys.path.app... |
"""
InaSAFE Disaster risk assessment tool developed by AusAid -
**Impact calculator test suite.**
Contact : ole.moller.nielsen@gmail.com
.. note:: 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 Found... |
"""
Django settings for vvs_crawler project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...... |
import os.path as op
import numpy as np
from numpy.testing import assert_allclose, assert_array_equal
import pytest
from itertools import compress
from mne import io, pick_types, pick_channels, read_events, Epochs
from mne.channels.interpolation import _make_interpolation_matrix
from mne.datasets import testing
from ... |
import yaml
import os
from flask import Flask, render_template, jsonify, request
from amplifier import Amplifier, SOURCES
app = Flask(__name__)
with open(os.path.join(os.path.dirname(__file__),"config.yaml")) as f:
config = yaml.load(f)
amplifier_obj = Amplifier(serial_port=config["serial_port"], logger=app.logger)
... |
"""
A script to build a set files of materialised views of the data presented
in municipality profiles on the Municipal Money website.
Municipality-specific profile data is stored in municipality-specific files
since producing them takes a lot of time with many queries against the API.
By storing municipality-specific... |
from copy import copy
from lxml import etree
from cnxepub.html_parsers import HTML_DOCUMENT_NAMESPACES
from nebu.models.document import Document
REFERENCE_MARKER = '#!--testing--'
M46882_METADATA = {
'authors': [{'id': 'OpenStaxCollege',
'name': 'OpenStaxCollege',
'type': 'cnx-... |
import webapp2
import base64
from webapp2_extras import auth
from webapp2_extras import sessions
from webapp2_extras.auth import InvalidAuthIdError
from webapp2_extras.auth import InvalidPasswordError
#Decorator to easily append routes to an app
class route(object):
def __init__(self,app=webapp2.get_app(),*args,**kwa... |
# Copyright 2016 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... |
from django.test import TestCase, override_settings
from django.core.exceptions import ImproperlyConfigured
from babik_shadow_accounts import get_shadow_account_model
from babik_shadow_accounts.models import ShadowAccount
from tests.testapp.models import CustomShadowAccount
class GetShadowAccountModelTestCase(TestCas... |
import re
import sh
from soap.datatype import type_cast
from soap.expression import is_variable
from soap.program import ProgramFlow, PragmaInputFlow, PragmaOutputFlow
from soap.parser.common import _lift_child, _lift_dontcare, CommonVisitor
from soap.parser.expression import DeclarationVisitor, ExpressionVisitor
fro... |
"""Calculates temporal degree centrality"""
import numpy as np
from ..utils import process_input
def temporal_degree_centrality(tnet, axis=0, calc='overtime', communities=None,
decay=0, ignorediagonal=True):
r"""
Temporal degree of network.
The sum of all connections each ... |
##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2016 Daniel Schulte <trilader@schroedingers-bit.net>
##
## 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 vers... |
import operator
class unit:
_zero = (0,) * 7
_negativeOne = (-1, ) * 7
_labels = ('m', 'kg', 's', 'A', 'K', 'mol', 'cd')
def __init__(self, value, derivation):
self.value = value
self.derivation = derivation
return
def __add__(self, other):
if not self.derivati... |
#!/usr/bin/python3
#
# 09/21/2016
# MaximumPathSum.py
# Maximum path sum I
# Maximum path sum II
#
# Scott Wiedemann
#
import sys
class MaximumPathSum:
_triangleData = []
def __init__(self, InputFile):
for line in InputFile:
self._triangleData.append([int(v) for v in line.split()])
return
def sumMaxPath(s... |
#!/usr/bin/env python
# encoding: utf-8
import os
from efl.evas import EVAS_HINT_EXPAND
from efl import elementary
from efl.elementary.window import StandardWindow
from efl.elementary.box import Box
from efl.elementary.hoversel import Hoversel, ELM_ICON_STANDARD, ELM_ICON_FILE
from efl.elementary.icon import Icon
EX... |
# -*- coding: utf-8 -*-
directorios = \
r'''
D:/Series
'''.split('\n')
'''
Traducción para algunos géneros
'''
gen = {
'Crime': u'Crimen',
'Action': u'Acción',
'Drama': u'Drama',
'Comedy': u'Comedia',
'Adventure': u'Aventuras',
'Thriller': u'Thriller'
}
... |
#!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... |
import json
import unittest
import sys
import os
import re
from mlmorph import Generator, Analyser
CURR_DIR = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
class Struct:
def __init__(self, entries):
self.__dict__.update(**entries)
class AnalyserGeneratorTests(unittest.TestCase):
gene... |
import numpy as np
from edc_constants.constants import (
ALIVE as edc_ALIVE, DEAD as edc_DEAD, YES as edc_YES, NO as edc_NO,
POS as edc_POS, NEG as edc_NEG, IND as edc_IND, UNK as edc_UNK,
NOT_APPLICABLE as edc_NOT_APPLICABLE,
MALE as edc_MALE, FEMALE as edc_FEMALE)
SUBJECT_IDENTIFIER = 'subject_ident... |
# This file is part of wger Workout Manager.
#
# wger Workout Manager 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.
#
# wger W... |
# Authors: Daniel Strohmeier <daniel.strohmeier@tu-ilmenau.de>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
from math import sqrt
import numpy as np
from scipy import linalg
from ..utils import check_random_state, logger, verbose
def power_iteration_kron(A, C, ... |
import prairielearn as pl
import lxml.html
from html import escape
import numpy as np
import math
import chevron
import random
def prepare(element_html, data):
element = lxml.html.fragment_fromstring(element_html)
required_attribs = ['answers-name']
optional_attribs = ['weight', 'label', 'comparison', 'rt... |
# -*- coding: utf-8 -*-
from ctypes.util import find_library
from dateutil.parser import parse
import datetime
import discord
import sqlite3
import asyncio
import time
import re
# version
__version__ = '2.0.0'
# Discord.pyの読み込み
client = discord.Client()
# 鍵の読み込み
KEY = None
with open('KEY.txt', 'r') as f:
KEY... |
#!/usr/bin/env python
# generate-gitignore.py
# GusE 2014.04.17 V0.1
"""
Generate gitignore files intelligently based off of the directory contents
"""
__version__ = "1.0"
import getopt
import sys
import os
import subprocess
import traceback
import logging
import logging.handlers
import tempfile
import argparse
__app... |
#!/usr/bin/python2
#
# Copyright (c) 2015 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.
"""Generate or update an existing config (.options file) for libfuzzer test.
Invoked by GN from fuzzer_test.gni.
"""
import ConfigP... |
# Copyright 2014-2018 The PySCF Developers. 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 appl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.