src stringlengths 721 1.04M |
|---|
# -*- coding: utf-8 -*-
from utils import *
from cleverbot import Cleverbot
from HTMLParser import HTMLParser
# If someone mentions the bot's username, it replies
commands = [('@' + bot['username'].lower())]
action = 'typing'
hidden = True
def run(msg):
input = msg['text'].replace(bot['first_name'] +... |
#
# In lecture, we took the bipartite Marvel graph,
# where edges went between characters and the comics
# books they appeared in, and created a weighted graph
# with edges between characters where the weight was the
# number of comic books in which they both appeared.
#
# In this assignment, determine the weights betw... |
import itertools
from .exceptions import CannotResolveDependencies
from .helpers import DONT_CARE, FIRST
def topological_sort_registrations(registrations, unconstrained_priority=DONT_CARE):
graph = _build_dependency_graph(registrations, unconstrained_priority=unconstrained_priority)
returned_indices = _topolo... |
"""
====================================================
Comparison of segmentation and superpixel algorithms
====================================================
This example compares three popular low-level image segmentation methods. As
it is difficult to obtain good segmentations, and the definition of "good"
oft... |
# 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... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# This file is part of OpenMalaria.
#
# Copyright (C) 2005-2010 Swiss Tropical Institute and Liverpool School Of Tropical Medicine
#
# OpenMalaria is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#... |
# -*-coding:Utf-8 -*
# Copyright (c) 2014 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# lis... |
import numpy as np
def logistic(x):
return 1. / (1. + np.exp(-x))
def logexp1p(x):
""" Numerically stable log(1+exp(x))"""
y = np.zeros_like(x)
I = x>1
y[I] = np.log1p(np.exp(-x[I]))+x[I]
y[~I] = np.log1p(np.exp(x[~I]))
return y
def proj_newton_logistic(A,b,lam0=None, line_search=True):
... |
#!/usr/bin/env python
"""
A simple Controller GUI to drive robots and pose heads.
Copyright (c) 2008-2011 Michael E. Ferguson. All right reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistribu... |
# -*- coding: utf-8 -*-
""" crypto.cipher.arc4
A Stream Cipher Encryption Algorithm 'Arcfour'
A few lines of code/ideas borrowed from [PING]
[PING] CipherSaber implementation by Ka-Ping Yee <ping@lfw.org>, 5 May 2000.
Some documentation text and test vectors taken from [IDARC4]
[IDARC... |
import hashlib
from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, HttpResponse
from django.http import HttpResponseForbidden
from django.shortcuts import get_object_or_404, render_to_response
from django.template import RequestContext
from django... |
#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
from annotypes import add_call_types
from scanpointgenerator import CompoundGenerator, SquashingExcluder
from malcolm.core import Part, PartRegistrar
from ..hooks import AAxesToMove, AGenerator, UParameterTweakInfos, ValidateHook
from ..infos import ParameterTweakInfo
class UnrollingPart(Part):
"""Unroll the di... |
#! /usr/bin/python
# :set tabstop=4 shiftwidth=4 expandtab
# Downoads Environment Canada data and sends the data to Graphite. Additionally logs the data to a file we can use to import later
import csv
import time
import graphitesend
import urllib2
from datetime import date, timedelta
import datetime
graphitesend.ini... |
# PMR WebServices
# Copyright (C) 2016 Manhoi Hur, Belyaeva, Irina
# This file is part of PMR WebServices API.
#
# PMR API 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
... |
# Copyright (C) 2016 Ross Wightman. 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
# =================================... |
# Copyright (c) 2014 Oscar Campos <oscar.campos@member.fsf.org>
# See LICENSE for details
"""TxORM Expressions Unit Tests
"""
from __future__ import unicode_literals
from datetime import datetime, date, time, timedelta
from twisted.trial import unittest
from txorm import Undef
from txorm.variable import Variable
... |
from typing import Dict, Optional, Text
import ujson
from mock import MagicMock, patch
from zerver.lib.test_classes import WebhookTestCase
from zerver.lib.webhooks.git import COMMITS_LIMIT
from zerver.models import Message
class GithubWebhookTest(WebhookTestCase):
STREAM_NAME = 'github'
URL_TEMPLATE = "/api/... |
import os
import logging
from io import BytesIO
from PIL import Image
class Techs():
def __init__(self, assets):
self.assets = assets
self.starbound_folder = assets.starbound_folder
def is_tech(self, key):
return key.endswith(".tech")
def index_data(self, asset):
key = a... |
import serial
import pygame
from pygame.locals import *
class RCTest(object):
"""
Testing over USB serial for commanding by keyboard
Baudrate: 115200
"""
def __init__(self):
pygame.init()
self.ser = serial.Serial('/dev/tty.usbmodem1421', 115200, timeout=1)
self.send_inst = ... |
# -*- coding: utf-8 -*-
import logging
from rest_framework import status
from rest_framework.pagination import PageNumberPagination
from rest_framework.response import Response
logger = logging.getLogger(__name__)
class LinkHeaderPagination(PageNumberPagination):
page_size = 10
page_size_query_param = 'pag... |
import os
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = ['--verbose']
self.test_suite = True
def run_tests(self):
import... |
#!/usr/bin/env python
import io
import os
import re
from setuptools import setup, find_packages
RE_REQUIREMENT = re.compile(r'^\s*-r\s*(?P<filename>.*)$')
RE_BADGE = re.compile(r'^\[\!\[(?P<text>[^\]]+)\]\[(?P<badge>[^\]]+)\]\]\[(?P<target>[^\]]+)\]$', re.M)
BADGES_TO_KEEP = ['gitter-badge', 'readthedocs-badge']
... |
from nose.tools import *
from pymacaroons import Macaroon, Verifier, MACAROON_V1, MACAROON_V2
from pymacaroons.serializers import JsonSerializer
class TestSerializationCompatibility(object):
def setup(self):
pass
def test_from_go_macaroon_json_v2(self):
# The following macaroon have been gen... |
#!/home/longbin/install/apps/Python-2.5_gcc/bin/python
import sys
import math
import getopt
import string
import fileinput
clrs = ['ff0000', '00ff00', '0000ff']
def printheader(n):
print '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
print ' <graphml xmlns="http://graphml.graphdrawing.org/xmln... |
'''
Copyright (C) 2017-2019 Vanessa Sochat.
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... |
# -*- coding: utf-8 -*-
"""
TODO: DEPRICATE OR REFACTOR INTO SMK
python -c "import doctest, ibeis; print(doctest.testmod(ibeis.algo.hots.word_index))"
python -m doctest -v ibeis/algo/hots/word_index.py
python -m doctest ibeis/algo/hots/word_index.py
"""
from __future__ import absolute_import, division, print_function
... |
# Copyright 2020 The AutoKeras Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
import smtplib
from unittest.mock import call, Mock, MagicMock, patch
from django.contrib.auth.models import User
from django.test import TestCase
from learn.models import Translation, Dictionary
from learn.services import signals
class SignalsTests(TestCase):
def test_shouldSendMailContaining_DictionaryLanguag... |
#!/usr/bin/env python
"""
Count the number of occurrences of a motif in drosophila introns near the splice sites (distance less than 200nt)
The motif is YGCY where at least one Y has to be a T. [TGCC, TGCT, CGCT]
"""
import sys, re
from Bio import SeqIO
def intDB(intron_file):
intdb = dict()
fh = open(intron... |
import shutil
import tempfile
from django.core.exceptions import PermissionDenied
from django.core.files.base import ContentFile
from django_nose.tools import assert_raises, assert_equal, assert_false, assert_true
from guardian.shortcuts import assign_perm
from mock import call, Mock, patch
from captain.base.tests i... |
"""Parsing and writing ``resp`` program instruction file format ("respin")"""
from dataclasses import dataclass, asdict
from fortranformat import FortranRecordWriter as FW
from itertools import zip_longest
import io
import math
import re
import sys
from typing import Dict, List, Optional, TextIO, Tuple, Type, TypeVar,... |
# Date: September 2017
# Author: Kutay B. Sezginel
"""
Initializing job submission files for computing cluster
"""
import os
from thermof.sample import slurm_file, slurm_scratch_file, pbs_file
from . import read_lines, write_lines
def job_submission_file(simdir, parameters, verbose=True):
""" Generate job submiss... |
import json
with open("../gallery/" + 'albums.json', 'r') as fd:
albums = json.loads(json.load(fd))
pics = {}
for album in albums:
album_dir = "../img/" + album['name'].replace(' ', '_')
with open(album_dir + '/album_data.json', 'r') as fd:
album_data = json.loads(json.load(fd))
for img ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on 31.07.2013
@author: LK@UofA
mtpy/uofa/bayesian1d.py
Module for handling the UofA Bayesian 1D inversion/modelling code.
"""
import os
import sys
import os.path as op
import mtpy.utils.filehandling as MTfh
import mtpy.core.edi as EDI
import mtpy.utils.ex... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division, unicode_literals
##
## This file is part of DaBroker, a distributed data access manager.
##
## DaBroker is Copyright © 2014 by Matthias Urlichs <matthias@urlichs.de>,
## it is licensed under the GPLv3. See the file `README.rst` fo... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name="index"),
url(r'^signin/$', views.signin, name='signin'),
url(r'^create_user/(?P<user_id>[0-9]+)/(?P<user_class>\
([a-z])+)$', views.create_new_user, \
name='new_user'),
url(r'^time... |
# Copyright 2014-2016 Morgan Delahaye-Prat. All Rights Reserved.
#
# Licensed under the Simplified BSD License (the "License");
# you may not use this file except in compliance with the License.
"""Request and related classes."""
import json
import asyncio
from aiohttp.web_reqrep import Request as BaseRequest
clas... |
from __future__ import absolute_import
import os
import sys
import urwid
from netlib import odict
from . import common, grideditor, contentview, signals, searchable, tabs
from . import flowdetailview
from .. import utils, controller
from ..protocol.http import HTTPRequest, HTTPResponse, CONTENT_MISSING, decoded
class... |
"""
# Modified from: https://code.google.com/archive/p/pyrtree/ .
# Copyright Google
# Under The 3-Clause BSD License
#
# 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 th... |
# -*- coding: utf-8 -*-
import os
import sys
sys.path.append('.')
import importlib
import traceback
import click
import re
from ._compat import iteritems
from .helper import make_client
class NoAppException(click.UsageError):
"""Raised if an application cannot be found or loaded."""
def locate_app(app_id):
... |
from twitterpandas import TwitterPandas
from examples.keys import TWITTER_OAUTH_SECRET, TWITTER_OAUTH_TOKEN, TWITTER_CONSUMER_SECRET, TWITTER_CONSUMER_KEY
__author__ = 'keyanvakil'
if __name__ == '__main__':
# create a twitter pandas client object
tp = TwitterPandas(
TWITTER_OAUTH_TOKEN,
TWITT... |
"""
Given a singly linked list, determine if it is a palindrome.
Example 1:
Input: 1->2
Output: false
Example 2:
Input: 1->2->2->1
Output: true
Follow up:
Could you do it in O(n) time and O(1) space?
"""
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val ... |
from flask import Flask, request, jsonify
from werkzeug.utils import secure_filename
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.restless import APIManager
import os
app = Flask(__name__)
app.config['DEBUG'] = True
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/schedulord.db'
app.config['UPLOA... |
from common.api.permissions import IsStaffOrTeamCaptain
from common.models import Interest, Language, Position, TeamMember, Region
from teams.api.serializers import EditableFlatTeamSerializer, TeamSerializer, PlayerMembershipSerializer
from teams.models import Team
from rest_framework import permissions, status, viewse... |
from __future__ import print_function
import os
import sys
import traceback
import lxml.etree
from django.core.management.base import BaseCommand
from fs.osfs import OSFS
from path import Path as path
from xmodule.modulestore.xml import XMLModuleStore
def traverse_tree(course):
"""
Load every descriptor in... |
# -*- coding: utf-8 -*-
# Copyright 2016 Mirantis, 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... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-12 02:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('museum_site', '0010_auto_20160826_2152'),
]
operations = [
migrations.Alter... |
from django import template
from django.template.defaultfilters import stringfilter
from competition.models.game_model import Game
import slumber
import datetime
import logging
import requests
logger = logging.getLogger(__name__)
register = template.Library()
@register.filter
@stringfilter
def iso_to_datetime(val... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014-2015, 2019 Pytroll Developers
# Author(s):
# Martin Raspaud <martin.raspaud@smhi.se>
# Abhay Devasthale <abhay.devasthale@smhi.se>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Pub... |
"""
utils.py - Utilities module
ZoeyBot - Python IRC Bot
Copyright 2012-2014 (c) Phixyn
This file is part of ZoeyBot.
ZoeyBot 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
... |
from .. import PanBase
from ..utils import images
from ..utils import current_time
import matplotlib
matplotlib.use('AGG')
import matplotlib.pyplot as plt
from astropy.modeling import models, fitting
import numpy as np
import os
from threading import Event, Thread
class AbstractFocuser(PanBase):
"""
Base... |
####################################################################################################
# neuropythy/test/__init__.py
# Tests for the neuropythy library.
# By Noah C. Benson
import unittest, os, sys, six, warnings, logging, pimms
import numpy as np
import pyrsistent as pyr
import neuropythy as ny
if... |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import os
import sys
import shutil
import platform
from .logging import Logger, log
from .utils import run_output
import click
import yaml
class SystemChecker(object):
"""A super-fancy helper for checking the system configuration
"""
def __init__(self, verbose):
super().__init__()
self.... |
# Copyright 2015 Dimitri Racordon
#
# 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 writi... |
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... |
# -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import hashlib
import hmac
import re
from collections import OrderedDict
from urllib.parse impor... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import itertools
from django.contrib.auth import get_user
from django.core.urlresolvers import reverse, reverse_lazy
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import... |
import random
from django.shortcuts import render, get_object_or_404, redirect
from django.urls import reverse
from .models import Game, Question
# Create your views here.
def index(request):
games = Game.objects.all()
return render(request, "million/index.html", {
"games": games,
})
def game(requ... |
import unittest
import os
import numpy as np
import pytest
import scipy
import deepchem as dc
from deepchem.data import NumpyDataset
from deepchem.models import GraphConvModel, DAGModel, WeaveModel, MPNNModel
from deepchem.molnet import load_bace_classification, load_delaney
from deepchem.feat import ConvMolFeaturizer... |
#!/usr/bin/env python
MZNSOLUTIONBASENAME = "minizinc.out"
import sys
import os
import shutil
import argparse
import random
import subprocess
import tempfile
import time as ttime
import glob
import datetime
runcheck = __import__('mzn-runcheck')
cwd=os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.... |
#!/usr/bin/python
'''
Copyright (c) 2020, dataJAR Ltd. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
... |
import zmq
import traceback
import socket
import time
class CommunicationClass:
def __init__(self, name='director'):
self.context = zmq.Context()
self.poller = zmq.Poller()
self.pub_sock = None
self.sub_socks = {}
self.pub_tag = name
#
self.create_pub_socket(... |
# This file is part of ts_wep.
#
# Developed for the LSST Telescope and Site Systems.
# This product includes software developed by the LSST Project
# (https://www.lsst.org).
# See the COPYRIGHT file at the top-level directory of this distribution
# for details of code ownership.
#
# This program is free software: you ... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Question.skip_condition'
db.add_column(u'survey_question', 'skip_condition',
... |
# -*- coding: utf-8 -*-
# MolMod is a collection of molecular modelling tools for python.
# Copyright (C) 2007 - 2019 Toon Verstraelen <Toon.Verstraelen@UGent.be>, Center
# for Molecular Modeling (CMM), Ghent University, Ghent, Belgium; all rights
# reserved unless otherwise stated.
#
# This file is part of MolMod.
#
#... |
#
# 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... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# --- BEGIN_HEADER ---
#
# webserver - [insert a few words of module description on this line]
# Copyright (C) 2003-2009 The MiG Project lead by Brian Vinter
#
# This file is part of MiG.
#
# MiG is free software: you can redistribute it and/or modify
# it under the terms of... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'WoodFeatures.rays_structure'
db.alter_column(u'botanyc... |
"""Module that simply encapsulate all the random functions that are used in fuzzing,
with only one call of function from random package."""
__author__ = 'Matus Liscinsky'
import random
def random_repeats(repeats):
"""Decorator for random number of repeats of inner function
Note that the return value of the... |
"""
virtio_console test
@copyright: 2010 Red Hat, Inc.
"""
import array, logging, os, random, re, select, shutil, socket, sys, tempfile
import threading, time, traceback
from collections import deque
from threading import Thread
from autotest_lib.client.common_lib import error
from autotest_lib.client.bin import util... |
__author__ = 'kevin'
from datetime import datetime
from subprocess import call, check_output
import sys
import os
import csv
import copy
import tag_lists
class GitTag():
"""Represents a Tag in a git repository"""
def __init__(self, line):
raw_tag, raw_hash, raw_date, raw_timestamp = line.split("|")
... |
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.txt')).read()
CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
requires = []
setup(name='mist.io',
version='0.9.9',
license='AGPLv3',
description... |
""" User resources """
import hashlib
import sqlalchemy
from smserver import exceptions
from smserver import models
from smserver.resources import base
class UserResource(base.BaseResource):
""" User class resource """
MIN_PASSWORD_LENGTH = 8
def create(self, name, password, email=None, rank=1):
... |
# -*- coding: utf-8 -*-
import time
from ethereum import slogging
import gevent
from gevent.event import AsyncResult
from gevent.queue import (
Queue,
)
REMOVE_CALLBACK = object()
log = slogging.get_logger(__name__) # pylint: disable=invalid-name
class Task(gevent.Greenlet):
""" Base class used to created... |
# -*- coding: utf-8 -*-
"""Database module, including the SQLAlchemy database object and DB-related utilities."""
from sqlalchemy.orm import relationship
from .compat import basestring
from .extensions import db
# Alias common SQLAlchemy names
Column = db.Column
relationship = relationship
Model = db.Model
# From Mi... |
from setuptools import setup
from decide import __version__
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="decide-exchange-model",
version=__version__,
packages=[
"decide",
"decide.qt",
"decide.qt.inputwindow",
"decide.model",
"dec... |
# -*- coding: utf-8 -*-
# Code comment plugin
# This file is part of gedit
#
# Copyright (C) 2005-2006 Igalia
# Copyright (C) 2006 Matthew Dugan
# Copyrignt (C) 2007 Steve Frécinaux
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as ... |
#!/usr/bin/env python
"""
Analyze and edit .sketch files (internal in .tilt)
Also supports generating .sketch files from json
@author: Sindre Tosse
"""
import struct
import json
import pdb
import numpy as np
try:
from stl import mesh
STL_SUPPORTED = True
STL_COLOR = (1., 0., 0., 1.)
STL_BRUSH_SIZE = 0.... |
# coding=utf-8
from django.template import TemplateSyntaxError, Template
# ------------------------------ Durchschnittsberechnung für das Ranking ------------------------------ #
def get_average(ergebnis, fb_list, attr):
"""Berechnet das gewichtete Mittel über das Attribut attr für die Fragebogenliste fb_list."... |
__source__ = 'https://leetcode.com/problems/range-module/'
# Time: O(logK) to O(K)
# Space: O(A+R), the space used by ranges.
#
# Description: Leetcode # 715. Range Module
#
# A Range Module is a module that tracks ranges of numbers.
# Your task is to design and implement the following interfaces in an efficient manne... |
import numpy
import matplotlib
matplotlib.use('Agg')
matplotlib.rcParams['font.sans-serif'] = ['SimHei']
matplotlib.rcParams['font.family']='sans-serif'
matplotlib.rcParams['axes.unicode_minus'] = False
import matplotlib.pyplot as plt
import sys
import json
import argparse
# python ***.py -s [srcfile... |
# -*- coding: utf-8 -*-
"""
Generates source data
"""
from __future__ import print_function
import imp
import os
import io
import re
import sys
DATA_DIR = os.environ.get("DATA_DIR")
UNIDECODE_REPOPATH = os.environ.get("UNIDECODE_REPOPATH")
if not DATA_DIR and UNIDECODE_REPOPATH:
DATA_DIR = os.path.join(UNIDECODE... |
#
# This file is part of the PyMeasure package.
#
# Copyright (c) 2013-2021 PyMeasure Developers
#
# 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 limit... |
#!/usr/bin/env python
# Copyright 2010 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... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-05-30 05:35
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('republica', '0001_initial'),
... |
# ===============================================================================
# Copyright 2016 Jake Ross
#
# 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... |
#!/usr/bin/env python
import json
import os
import sys
from ansible.module_utils.basic import *
from subprocess import Popen, PIPE
DOCUMENTATION = '''
---
module: discovery_diff
short_description: Provide difference in hardware configuration
author: "Swapnil Kulkarni, @coolsvap"
'''
def get_node_hardware_data(hw_i... |
# Definition for singly-linked list.
class ListNode(object):
def __init__(self, x):
self.val = x
self.next = None
# 核心点:
# 如果结点i和节点j**之间**存在和为0的连续节点,即 acc(list[i:j]) == 0,那么acc[:i+1] == acc[:j]
# 举例:
# 结点值 1, 2, 3, -5, 4
# 累计和 1, 3, 6, 1, 5
# 连续结点 2, 3, -5 和为0,所以第一个节点和第四个结点的累积和一样,都是1
# 因此只需要用一个字... |
#
# Honeybee: A Plugin for Environmental Analysis (GPL) started by Mostapha Sadeghipour Roudsari
#
# This file is part of Honeybee.
#
# Copyright (c) 2013-2020, Chris Mackey <Chris@MackeyArchitecture.com>
# Honeybee is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Publ... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2011, 2012 CERN.
#
# 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 your option) any... |
## Copyright 2003-2007 Luc Saffre
## This file is part of the Lino project.
## Lino 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... |
# coding=utf-8
# Copyright 2020 The Real-World RL Suite Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
from jsonrpc import ServiceProxy
import sys
import string
import getpass
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:9332")
e... |
# overall python packages
import glob
#import astropy.io.fits as fits
# 2397897 143.540054 0.032711 20.449619 119.370173 9.753314 33.197590 -1.000000 25.191960 40.977921 2 127
# ------ -------- -------- ra dec
import os
import time
import numpy as n
import sys
t0=time.time()
#from astropy.cosmology import ... |
# -*- coding: utf-8 -*-
import os
from robot.libraries.BuiltIn import BuiltIn
from robot.libraries.BuiltIn import RobotNotRunningError
from robot.api import logger
from .keywordgroup import KeywordGroup
class _LoggingKeywords(KeywordGroup):
LOG_LEVEL_DEBUG = ['DEBUG']
LOG_LEVEL_INFO = ['DEBUG', 'I... |
# -*- coding: utf-8 -*-
################################################################################
###
### ReadLAMMPSDump - v0.1.8 - May 03, 2018
###
################################################################################
###
### a package to read LAMMPS Dump files
### (it assumes that the data colu... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 Savoir-faire Linux (<www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the t... |
# -*- coding: utf-8 -*-
#
# File: College.py
#
# Copyright (c) 2007 by []
# Generator: ArchGenXML Version 1.5.2
# http://plone.org/products/archgenxml
#
# GNU General Public License (GPL)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public L... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.