src stringlengths 721 1.04M |
|---|
"""
This is the main module for running the BERNAISE code.
More specific info will follow in a later commit.
"""
import dolfin as df
from common.cmd import parse_command_line, help_menu
from common.io import create_initial_folders, load_checkpoint, save_solution, \
load_parameters, load_mesh
__author__ = "Gaute Li... |
import pandas as pd
df = pd.read_csv('data/src/sample_pandas_normal.csv')
print(df)
# name age state point
# 0 Alice 24 NY 64
# 1 Bob 42 CA 92
# 2 Charlie 18 CA 70
# 3 Dave 68 TX 70
# 4 Ellen 24 CA 88
# 5 Frank 30 NY 57
df_i = df.set_ind... |
from django.conf import settings
from django.db import models
from django.db.models import query
from django.utils.translation import ugettext as _
from django.utils.timezone import now, timedelta
from geopy import geocoders
from .feed_readers import get_feed_reader
import logging
logger = logging.getLogger(__name__)... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_face_recognition
----------------------------------
Tests for `face_recognition` module.
"""
import unittest
import os
import numpy as np
from click.testing import CliRunner
from face_recognition import api
from face_recognition import face_recognition_cli
fro... |
# -*- coding: utf-8 -*-
import unittest, json
TABLE_NAME1 = 'Table-1'
TABLE_RT = 45
TABLE_WT = 123
TABLE_NAME = 'Table-HR'
TABLE_RT = 45
TABLE_WT = 123
TABLE_RT2 = 10
TABLE_WT2 = 10
TABLE_HK_NAME = u'hash_key'
TABLE_HK_TYPE = u'N'
TABLE_RK_NAME = u'range_key'
TABLE_RK_TYPE = u'S'
HK_VALUE1 = u'123'
HK_VALUE2 = u'4... |
# -*- coding: utf-8 -*-
# Neuronal - Framework for Neural Networks and Artificial Intelligence
#
# Copyright (C) 2012 dddddd <dddddd@pyphiverses.org>
# Copyright (C) 2012 Notxor <gnotxor@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General P... |
# Alexandre's backup script
# Copyright © 2014 Alexandre A. de Verteuil
#
# 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 option) any ... |
# Copyright 2013 OpenStack Foundation
# Copyright 2013 Rackspace Hosting
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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 co... |
"""Sensor for the Open Sky Network."""
import logging
from datetime import timedelta
import requests
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_NAME,
CONF_LATITUDE,
CONF_LO... |
# Copyright (C) 2015 by Alex Brandt <alunduil@alunduil.com>
#
# muniments is freely distributable under the terms of an MIT-style license.
# See COPYING or http://www.opensource.org/licenses/mit-license.php.
from muniments.scheduler.api import information
from test_muniments.test_fixtures import register_fixture
from... |
"""
MIT License
Copyright (c) 2017 Code Society
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, ... |
from __future__ import unicode_literals
import contextlib
import os
import sys
from pre_commit.envcontext import envcontext
from pre_commit.envcontext import Var
from pre_commit.languages import helpers
from pre_commit.util import clean_path_on_failure
from pre_commit.xargs import xargs
ENVIRONMENT_DIR = 'node_env'... |
from direct.task.Task import Task
from panda3d.core import *
from panda3d.direct import *
from DistributedNPCToonBaseAI import *
from toontown.quest import Quests
class DistributedNPCSpecialQuestGiverAI(DistributedNPCToonBaseAI):
def __init__(self, air, npcId, questCallback = None, hq = 0):
DistributedNPC... |
#! /usr/bin/env python
#
"""Latipics gathers pictures taken at a particular venue using FOursquare and Instagram"""
__author__ = "Carlo Andrea Conte"
__copyright__ = "Copyright 2013, Mahaya, inc."
__email__ = "carloandreaconte@icloud.com"
import json
import urllib
import sys
import argparse
import time
i... |
"""
Representation of an Album object
"""
from .trovebox_object import TroveboxObject
from .photo import Photo
class Album(TroveboxObject):
""" Representation of an Album object """
_type = "album"
def __init__(self, client, json_dict):
self.photos = None
self.cover = None
Trovebox... |
from rest_framework.routers import APIRootView, DefaultRouter
import catalog.rest
import documents.rest
import notifications.rest
import search.rest
import telepathy.rest
import users.rest
import www.rest
class DochubAPI(APIRootView):
"""
This is the API of DocHub.
You are free to use it to crawl DocHub... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# convert_json.py
#
# Copyright 2014 Jared <jarednorman@hotmail.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 o... |
"""
Course Goals Models
"""
from __future__ import absolute_import
from django.contrib.auth.models import User
from django.db import models
from django.utils.translation import ugettext_lazy as _
from model_utils import Choices
from opaque_keys.edx.django.models import CourseKeyField
# Each goal is represented by a g... |
from ...utilities import COLUMN, ROW, index_1d, inverted, is_on_board_2d
from ..direction import Direction, UnknownDirectionError
from ..tessellation_base import TessellationBase, TessellationBaseInheritableDocstrings
class HexobanTessellation(
TessellationBase, metaclass=TessellationBaseInheritableDocstrings
):
... |
# Copyright 2019 The Sonnet 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 applicable l... |
import json
from ipaddress import ip_address
from django.core.exceptions import FieldDoesNotExist, ValidationError
from django.db import transaction
from django.db.models import Q
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from django.views.generic.base im... |
'''Evaluate constant expressions in ir
'''
from __future__ import absolute_import
from __future__ import with_statement
import operator as O
from ..runtime.multimethod import MultiMethod, defmethod, around
from .resolution import compile_time_resolve, UnresolvableError
from .walk import propigate_location
from . imp... |
from django.conf.urls import patterns, include, url
#import autocomplete_light
#autocomplete_light.autodiscover()
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
from movieduk import settings
urlpatterns = patterns('',
#(r'^account/', include... |
from typing import TYPE_CHECKING, Any, Dict, List, Optional
if TYPE_CHECKING:
from django_auth_ldap.config import LDAPSearch
from typing_extensions import TypedDict
from .config import DEVELOPMENT, PRODUCTION, get_secret
if PRODUCTION:
from .prod_settings import EXTERNAL_HOST, ZULIP_ADMINISTRATOR
else:
... |
# -*- coding:utf-8 -*-
from flask import Flask
from flask.ext.bootstrap import Bootstrap
from flask.ext.moment import Moment
from flask.ext.sqlalchemy import SQLAlchemy
from config import config
from elasticsearch import Elasticsearch
db = SQLAlchemy()
bootstrap = Bootstrap()
moment = Moment()
es = None
def creat... |
# Copyright (C) 2015 Simon Biggs
# 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 distributed in... |
#!/usr/bin/env python
'''
pyOpt_gradient
Holds the Python Design Optimization Gradient Calculation Class.
Copyright (c) 2008-2013 by pyOpt Developers
All rights reserved.
Revision: 1.0 $Date: 20/06/2010 21:00$
Developers:
-----------
- Dr. Ruben E. Perez (RP)
- Mr. Peter W. Jansen (PJ)
History
-------
v. 1.0... |
#!coding=utf-8
import settings
from mongodb.model import *
def result_data(data, status, message=''):
result = dict(data=data, status=status, message=message)
return result
def find_all_objects(model):
return model.objects
def find_objects_by_id(model, id):
return model.objects(id=id)
def check... |
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import functools
from dateutil import parser as date_parse
import time
import logging
import json
from azure.core.exceptions import ResourceExistsError, ResourceNotFoun... |
import math
import operator
import random
import pytest
import hail as hl
import hail.expr.aggregators as agg
from hail.utils.java import Env
from hail.utils.misc import new_temp_file
from ..helpers import *
setUpModule = startTestHailContext
tearDownModule = stopTestHailContext
class Tests(unittest.TestCase):
... |
#
# Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# This file is licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# This file is... |
import requests
from rest_framework.reverse import reverse as drf_reverse
from django import forms
from django.conf import settings
from django.urls import NoReverseMatch
from olympia.shelves.models import Shelf
class ShelfForm(forms.ModelForm):
class Meta:
model = Shelf
fields = ('title', 'end... |
import copy
from vsg import parser
from vsg import rule
from vsg import token
from vsg import violation
from vsg.vhdlFile import utils
class separate_multiple_signal_identifiers_into_individual_statements(rule.Rule):
'''
Checks the case for words.
Parameters
----------
name : string
Th... |
# -*- coding: utf-8 -*-
""" Custom Validators
@requires: U{B{I{gluon}} <http://web2py.com>}
@author: Fran Boon <fran[at]aidiq.com>
@author: Dominic König <dominic[at]aidiq.com>
@author: sunneach
@copyright: (c) 2010-2011 Sahana Software Foundation
@license: MIT
Permission is hereby gran... |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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,... |
# particlesim
# Copyright (C) 2017 Mark Niehues, Stefaan Hessmann, Jaap Pedersen,
# Simon Treu, Hanna Wulkow, Thomas Hadler
#
# 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 ... |
import sys, os
import time
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
from torch.optim import lr_scheduler
import torchvision
from torchvision import datasets, models, transforms
from pmodels import RtResnet18... |
import escort_mission
import faction_ships
class wrong_escort (escort_mission.escort_mission):
def __init__ (self,factionname,missiondifficulty,distance_from_base,creds,numsysaway,jumps=(),var_to_set='',dynfg='',dyntype='',alternatesystems=(),alternatefactions=(),alternateflightgroups=(),alternatetypes=(),alternate... |
"""Test Home Assistant yaml loader."""
import io
import os
import unittest
import logging
from unittest.mock import patch
import pytest
from homeassistant.exceptions import HomeAssistantError
from homeassistant.util import yaml
from homeassistant.config import YAML_CONFIG_FILE, load_yaml_config_file
from tests.common... |
##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import models, fields
from odoo.tools import float_round
clas... |
import tensorflow as tf
import tensorflow.contrib.slim as slim
from flowfairy.conf import settings
from util import lrelu, conv2d, maxpool2d, embedding, avgpool2d, GLU, causal_GLU
from functools import partial
import ops
discrete_class = settings.DISCRETE_CLASS
batch_size = settings.BATCH_SIZE
samplerate = sr = settin... |
'''
WikiLinks Extension for Python-Markdown
======================================
Converts [[WikiLinks]] to relative links. Requires Python-Markdown 2.0+
Basic usage:
>>> import markdown
>>> text = "Some text with a [[WikiLink]]."
>>> html = markdown.markdown(text, ['wikilinks'])
>>> print html
... |
#!/usr/bin/env python
# encoding: utf-8
# contains the common actions
import random
from logs import *
class Card(object):
"""Creates the card objects used in game"""
def __init__(self, name, attack, money, cost, name_padding=15, num_padding=2):
self.name = name
self.cost = cost
self.... |
#Basic
'''
import tkinter as tk
class GUI(tk.Frame):
def __init__(self, master=None):
tk.Frame.__init__(self, master)
self.grid()
self.create()
def create(self):
w = tk.Canvas(self,width=600,height=400)
# w.create_image = (image=vp)
w.pack()
ru... |
#!/usr/bin/env python
# encoding: utf-8
"""The main file."""
import matasano.util
import matasano.stats
import matasano.blocks
import matasano.oracle
import matasano.attacker
import matasano.prng
import matasano.mac
import matasano.math
import matasano.public
import matasano.hash
import base64
import binascii
import... |
"""
Classes encapsulating tool parameters
"""
import logging, string, sys
from galaxy import config, datatypes, util, form_builder
import validation
from elementtree.ElementTree import XML, Element
log = logging.getLogger(__name__)
class ToolParameter( object ):
"""
Describes a parameter accepted by a tool.... |
#!/usr/bin/env python
# Use the built in json and sqlite library
import json
import sqlite3
def main():
# Running card counter
card_count = 0
# Load all json data into a collection
card_data = json.load(open('cards.collectible.json'))
# Connect to our database and creat table if it doesn't e... |
# This file is part of Lerot.
#
# Lerot 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 3 of the License, or
# (at your option) any later version.
#
# Lerot is distributed in the hope tha... |
# coding: utf-8
"""
Vericred API
Vericred's API allows you to search for Health Plans that a specific doctor
accepts.
## Getting Started
Visit our [Developer Portal](https://developers.vericred.com) to
create an account.
Once you have created an account, you can create one Application for
Production and an... |
# THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE.
# Copyright (C) NIWA & British Crown (Met Office) & Contributors.
#
# 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 Licen... |
# -----------------------------------------------------------------------------
# Name: graph_tool.py (part of PyGMI)
#
# Author: Patrick Cole
# E-Mail: pcole@geoscience.org.za
#
# Copyright: (c) 2013 Council for Geoscience
# Licence: GPL-3.0
#
# This file is part of PyGMI
#
# PyGMI is free softw... |
# -*- coding: utf-8 -*-
# Author: Zach.Wang
# @Time : 2019-12-25 19:09
factorynums=eval(input())
factoryroute=[]
for _ in range(factorynums-1):
factoryroute.append(eval(input().replace(' ',',')))
print(factoryroute)
factoryroutereachcount={}
#TODO star situtation
def star_condition():
for i in range(factorynums)... |
# Copyright 2012 OpenStack Foundation
# All Rights Reserved
# Copyright (c) 2012 NEC 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/lic... |
import os
import sys
from PyQt5 import QtCore, QtWidgets
import config
import re
import util
import logging
logger = logging.getLogger(__name__)
from model.game import GameState
__author__ = 'Thygrrr'
class GameArguments:
pass
class GameProcess(QtCore.QProcess):
def __init__(self, *args, **kwargs):
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division, unicode_literals
##
## This is part of Pybble, a WMS (Whatever Management System) based on
## Jinja2/Haml, Werkzeug, Flask, and Optimism.
##
## Pybble is Copyright © 2009-2014 by Matthias Urlichs <matthias@urlich... |
# Copyright (C) 2016-2020 OpenIO SAS
#
# 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- mode: python -*-
# This file is part of opensearch.
# Copyright © 2009, Dansk Bibliotekscenter a/s,
# Tempovej 7-11, DK-2750 Ballerup, Denmark. CVR: 15149043
#
# opensearch is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gene... |
#
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.com>
#
# 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... |
import ssl
import os
import threading
from hazelcast.six.moves import BaseHTTPServer
from hazelcast import six
from unittest import TestCase
from hazelcast.core import Address
from hazelcast.errors import HazelcastCertificationError
from hazelcast.discovery import HazelcastCloudDiscovery
from hazelcast.client import H... |
import os
import pytest
from panoptes.pocs.core import POCS
from panoptes.pocs.observatory import Observatory
from panoptes.utils import error
from panoptes.utils.serializers import to_yaml
@pytest.fixture
def observatory():
observatory = Observatory(simulator=['all'])
yield observatory
def test_bad_state... |
# -*- coding: utf-8 -*-
'''
Queries for experiments with ENDSEQ operator
'''
import os
from tool.attributes import get_move_attribute_list, get_place_attribute_list
from tool.experiment import SLI, RAN, ALGORITHM, \
CQL_ALG, QUERY, Q_MOVE, Q_PLACE
from tool.io import get_query_dir, write_to_txt, get_out_file, get... |
import os.path
import logging
class Persistence:
def __init__(self, persistence_file):
self.authorized_chats = list()
self.persistence_file = persistence_file
if persistence_file and os.path.isfile(persistence_file):
logging.info('Loading authorized chats from %s' % persisten... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import imdb
import sys, time
from itertools import chain
def getActor(name, count):
"""
For a given actor, get their film list from IMDb,
seek budget, gross, release date, then double-check
they are *in* the film, THEN print to stdout.
"""
print >>sys.stderr, "(%d... |
# Authors:
# Rob Crittenden <rcritten@redhat.com>
#
# Copyright (C) 2010 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'InMainWindow.ui'
#
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_myMainWindow(object):
def setupUi(self, myMainWindow):
my... |
# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of astroid.
#
# astroid 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
#... |
import numpy as np
import matplotlib.pyplot as plt
import urllib2
#%matplotlib inline
sample_size = 1000
np.random.seed(1)
url = ('https://raw.githubusercontent.com/Upward-Spiral-Science'
'/data/master/syn-density/output.csv')
data = urllib2.urlopen(url)
csv = np.genfromtxt(data, delimiter=",")[1:]
csv_rand ... |
from __future__ import unicode_literals, absolute_import
import re
from collections import defaultdict
from datetime import date, time
from datetime import datetime
from decimal import Decimal
from tri_form.compat import (
ValidationError,
field_defaults_factory,
)
from bs4 import BeautifulSoup
import pytest... |
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import inspect
from django.template.loader import render_to_string
from django.db import connection
import settings
from xformmanager.models import Metadata, FormDefModel, ElementDefModel
from reports.models import Case, SqlReport
from reports.util import get_where... |
import os
from unittest.mock import MagicMock
from unittest.mock import patch
from cauldron import environ
from cauldron.test import support
MY_DIRECTORY = environ.paths.clean(os.path.dirname(__file__))
@patch('cauldron.cli.commands.cd.os.chdir')
def test_cd(os_chdir: MagicMock):
"""Should change to the specifi... |
import urllib
from django.urls import get_resolver
from django.urls import NoReverseMatch
def resolve_url(request, path=None):
"""Helper function that reports information on the request's url.
Taken from http://code.google.com/p/greatlemers-django-tools \
/source/browse/trunk/gdt_nav/models.... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import waldur_core.logging.loggers
import django.utils.timezone
import waldur_core.core.fields
import waldur_core.core.validators
class Migration(migrations.Migration):
depen... |
import json
from idpanel.training.features import reduce_prevector_datapoints_to_features
from idpanel.blacklist import labels_to_ignore
if __name__ == "__main__":
data_points = []
with open("prevectors.json", "r") as f:
for line in f:
line = line.strip()
if len(line) == 0:
... |
# -*- coding: utf-8 -*-
# Copyright © 2012-2016 Roberto Alsina and others.
# 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 t... |
# -*- coding: utf-8 -*-
# @Author: Manuel Rodriguez <valle>
# @Date: 10-May-2017
# @Email: valle.mrv@gmail.com
# @Last modified by: valle
# @Last modified time: 12-Feb-2018
# @License: Apache license vesion 2.0
from kivy.uix.boxlayout import BoxLayout
from kivy.storage.jsonstore import JsonStore
from kivy.propert... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import datetime
from datetime import datetime, timedelta, time
from odoo import fields
from odoo.tests.common import TransactionCase
import pytz
class TestCalendar(TransactionCase):
def setUp(self):
super... |
from flask_restful import fields, marshal_with
from flask_restful.reqparse import RequestParser
from cebulany.auth import token_required
from cebulany.queries.payment_summary import PaymentSummaryQuery
from cebulany.resources.model import ModelListResource
resource_fields = {
'payments': fields.List(fields.Neste... |
#
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2018 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This file is part of Psi4.
#
# Psi4 is free software; you can redistribute it and/or modify
#... |
import socket
import struct
import threading
from . import packets
class Client(object):
"""A class that handles the connection to a Terraria Server"""
def __init__(self, HOST, PORT, player, world, event_manager):
super(Client, self).__init__()
self.ADDR = (HOST, PORT)
self.player =... |
# Copyright (C) 2004-2016 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
#
# Author: Aric Hagberg (hagberg@lanl.gov)
"""
**********
Matplotlib
**********
Draw networks with matplotlib.
See Also
--------
m... |
from titanembeds.database import db
class Guilds(db.Model):
__tablename__ = "guilds"
guild_id = db.Column(db.BigInteger, nullable=False, primary_key=True) # Discord guild id
unauth_users = db.Column(db.Boolean(), nullable=False, default=1) # If allowed unauth users
visitor_view = db.Col... |
#!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... |
import unittest
from mock import MagicMock, call
from scanpointgenerator import CompoundGenerator, LineGenerator
from malcolm.core import PartRegistrar
from malcolm.modules.scanning.parts import ExposureDeadtimePart
def make_generator(duration):
line1 = LineGenerator("y", "mm", 0, 2, 3)
line2 = LineGenerato... |
# 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 __future__ import print_function
import argparse
import json
import random
import requests
from fablab_schedule import config
class ScheduleService:
base_route = "?rest_route=/open-access/v1"
endpoints = {
"status": "/",
"schedule": "/machine-schedule",
}
def __init__(self, b... |
import appuifw, e32, time, graphics, base64, location, urllib
app_lock = e32.Ao_lock()
def quit():
app_lock.signal()
appuifw.app.exit_key_handler = quit
appuifw.app.screen = 'full'
# Splash Image
def handle_redraw(rect):
canvas.blit(img)
img = graphics.Image.open("E:\\Data\\python\\splash.jpg")
canvas = app... |
from mu_repo.action_diff import ParsePorcelain
from mu_repo.execute_parallel_command import ParallelCmd, ExecuteInParallel
#===================================================================================================
# ComputeReposWithChanges
#====================================================================... |
#!/usr/bin/env python2.6
# coding: utf-8
#
# Software License Agreement (GPLv2 License)
#
# Copyright (c) 2012 TheCorpora SL
#
# 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 ... |
# (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import time
from collections import defaultdict
import win32pdh
from six import iteritems, text_type
from six.moves import winreg
DATA_TYPE_INT = win32pdh.PDH_FMT_LONG
DATA_TYPE_DOUBLE = win32pdh.PDH_FMT... |
"""
Botor
=====
A thin wrapper around boto3
:copyright: (c) 2016 by Netflix, see AUTHORS for more
:license: Apache, see LICENSE for more details.
"""
import sys
import os.path
from setuptools import setup, find_packages
ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__)))
# When executing the setup.py,... |
# -*- coding:utf-8 -*-
#!/usr/bin/env python
__all__ = ['weChatController']
import cookielib
import urllib2
import urllib
import urlparse
import json
import poster
import hashlib
import time
import random
import sys
import os
import traceback
from cStringIO import StringIO
import tornado
import tornado.escape
from b... |
#
# Tables describing slots in the CPython type object
# and associated know-how.
#
import Naming
import PyrexTypes
import StringEncoding
invisible = ['__cinit__', '__dealloc__', '__richcmp__',
'__nonzero__', '__bool__']
class Signature(object):
# Method slot signature descriptor.
#
# ... |
from django.utils.text import Truncator
from django.utils.translation import ugettext_lazy as _
# noinspection PyProtectedMember
from vms.models.base import _DummyModel, _UserTasksModel
from vms.models import Dc
class AbstractMonitoringServer(_DummyModel, _UserTasksModel):
"""
Abstract model for representing... |
#+
#
# This file is part of h5py, a low-level Python interface to the HDF5 library.
#
# Copyright (C) 2008 Andrew Collette
# http://h5py.alfven.org
# License: BSD (See LICENSE.txt for full license)
#
# $Date$
#
#-
import unittest
import numpy
from h5py import *
HDFNAME = 'attributes.hdf5'
TYPES = {h5p.FILE_CRE... |
from numpy.testing import assert_almost_equal
import inspect
import pytest
import torch
from allennlp.common import Params
from allennlp.common.checks import ConfigurationError
from allennlp.modules import FeedForward
from allennlp.nn import InitializerApplicator, Initializer, Activation
from allennlp.common.testing i... |
# Copyright 2017,2018,2019,2020,2021 Sony 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
#
# Unless required by applicable law... |
#! /usr/bin/env python2
# -*- coding: utf-8 -*-
import os
import sys
import random
import socket
import subprocess
import signal
import hashlib
import subprocess
from functions import lt
from langs import langs
from loaders import load_config, save_config
ROOT_PATH=os.path.dirname(__file__)
ICON_PATH=os.path.join(R... |
'''
A. Richards
'''
import os,re,sys,time
sys.path.append(os.path.join(".","MyWidgets"))
#from PIL import Image
from ImageTk import PhotoImage
import Tkinter as tk
import tkMessageBox
from tkFileDialog import askopenfilename
import numpy as np
from FileControls import *
from BuildingBlocks import *
from DataProcessing... |
#!/usr/bin/python
#
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... |
import calendar
import datetime
import functools
import json
import os
import time
import cherrypy
import pyodbc
def connect(thread_index):
cherrypy.thread_data.db = pyodbc.connect(os.environ['DATABASE'])
current_dir = os.path.dirname(os.path.abspath(__file__))
cherrypy.thread_data.placeholder_image = op... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.