code
stringlengths
1
199k
""" the flask extension """ import warnings from functools import wraps import logging from flask import request, current_app, g, Blueprint from werkzeug.http import http_date from limits.errors import ConfigurationError from limits.storage import storage_from_string, MemoryStorage from limits.strategies import STRATEG...
import os import matplotlib.pyplot as plt import numpy as np from plotting_styles import onecolumn_figure, default_figure from paths import paper1_figures_path ''' Make a UV plot of the 1000th HI channel. ''' uvw = np.load("/mnt/MyRAID/M33/VLA/14B-088/HI/" "14B-088_HI_LSRK.ms.contsub_channel_1000.uvw.npy"...
''' Created on 2014-5-15 @author: XIAO Zhen ''' '''哈哈''' import Tkinter as tk import time import random class Application(tk.Frame): def __init__(self, master=None): tk.Frame.__init__(self, master) self.winfo_toplevel().rowconfigure(0,minsize = 1) self.winfo_toplevel().columnconfigure(0,mins...
class Solution(object): def levelOrderBottom(self, root): list = [] self.helper(list, root, 0) return list[::-1] def helper(self, list, root, level): if root == None: return if level >= len(list): list.append([]) list[level].append(root.val...
import pytest import cv2 from plantcv.plantcv import auto_crop @pytest.mark.parametrize('padx,pady,expected', [[20, 20, (98, 56, 4)], [(400, 400), (400, 400), (58, 16, 4)]]) def test_auto_crop(padx, pady, expected, test_data): """Test for PlantCV.""" # Read in test data img = cv2.imread(test_data.small_rgb_...
"""Support for Netgear LTE notifications.""" import logging import attr import eternalegypt from homeassistant.components.notify import ATTR_TARGET, BaseNotificationService from . import CONF_NOTIFY, CONF_RECIPIENT, DATA_KEY _LOGGER = logging.getLogger(__name__) async def async_get_service(hass, config, discovery_info=...
""" UNIT 2: Logic Puzzle You will write code to solve the following logic puzzle: 1. The person who arrived on Wednesday bought the laptop. 2. The programmer is not Wilkes. 3. Of the programmer and the person who bought the droid, one is Wilkes and the other is Hamming. 4. The writer is not Minsky. 5. Neither Knuth ...
import unittest class TestVersions(unittest.TestCase): def test_python(self): import platform self.assertEqual(platform.python_version(), "2.7.10rc1") def test_numpy(self): import numpy self.assertEqual(numpy.version.version, "1.9.2") if __name__ == '__main__': unittest.main()
import theano import theano.tensor as T import numpy as np import matplotlib.pyplot as plt from lasagne.layers import InputLayer, DenseLayer, ReshapeLayer import lasagne.layers import lasagne.nonlinearities import lasagne.updates import lasagne.objectives import lasagne.init from ntm.layers import NTMLayer from ntm.mem...
import os import ycm_core flags = [ '-x', 'c++', '-I../../utils/', ] compilation_database_folder = '' if os.path.exists( compilation_database_folder ): database = ycm_core.CompilationDatabase( compilation_database_folder ) else: database = None SOURCE_EXTENSIONS = [ '.C', '.cpp', '.cxx', '.cc', '.c', '....
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('consent', '0013_auto_20170217_1606'), ] operations = [ migrations.AlterField( model_name='educationdetail', name='college_passout...
import os, sys import json import copy import numpy as np import random from multiprocessing import Pool import ipdb utils_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),'nlp scripts') source_vh_dir = '/home/ronotex/Downloads/vector_hash/ingenierias_mineria' treemap_name = 'carreras_mantto_mina' adj_nam...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "vgid.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
""" The sax module contains a collection of classes that provide a (D)ocument (O)bject (M)odel representation of an XML document. The goal is to provide an easy, intuative interface for managing XML documents. Although, the term, DOM, is used above, this model is B{far} better. XML namespaces in suds are represented u...
"""The www.cartoonmad.com analyzer. [Entry examples] - http://www.cartoonmad.com/comic/5640.html - https://www.cartoonmad.com/comic/5640.html """ import re from urllib.parse import parse_qsl from cmdlr.analyzer import BaseAnalyzer from cmdlr.autil import fetch class Analyzer(BaseAnalyzer): """The www.cartoo...
from __future__ import print_function import sys, time import requests, urllib import demjson, shelve import os.path class Archiver: def __init__(self): """ A class for archiving URLS into the wayback machine """ self._machine = "http://archive.org/wayback/available?ur...
import argparse import pyexcel as pe import configparser import os import sys import sqlite3 import my_connection_grp_desg as connection from insert import sanction_grp as insert_sanc DB_URL = None global conn conn = None sheet = None desg_ls=None unit_ls=None sect_ls=None def load_tables(): # conn.row_factory = sqlit...
""" This script replaces underscores with spaces (%20) Project: https://github.com/LagrangianPoint/Apache-Rewrite-Maps-Python/ http://httpd.apache.org/docs/current/rewrite/rewritemap.html http://fragmentsofcode.wordpress.com/2009/02/04/python-script-for-apache-rewritemap/ http://codeblow.com/questions/apache2-rewritema...
""" kintone上のデータを、バックアップを取ってから一括アップデートするスクリプト オプション指定なし→ローカルキャッシュを用いてDry Run -r(--real) →最新のデータを取得してバックアップし、更新 -f(--from-backup) →-rで問題が起きたとき用。バックアップを指定して、そのデータを元に更新する。 """ from cache import get_all, get_app import time import argparse from render import pretty def concat_lines(x, y): if isinstance(y, str): y = y.d...
import xml.etree.ElementTree as ET class Definition(object): def __init__(self, definition_root): self._definition_root = definition_root def type_name(self): type_id = self._definition_root.find('Id').find('TypeId') subtype_id = self._definition_root.find('Id').find('SubtypeId') ...
""" The MIT License (MIT) Copyright (c) 2015-2021 Kim Blomqvist 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, me...
from django.http import HttpResponseRedirect, HttpResponse from django.template import RequestContext from django.shortcuts import get_object_or_404, render_to_response from collections import defaultdict from django.contrib.auth.decorators import login_required from django.core.context_processors import csrf from dja...
import logging import boto3 import io from slovar import slovar from prf import fs log = logging.getLogger(__name__) def includeme(config): Settings = slovar(config.registry.settings) S3.setup(Settings) class S3(fs.FS): def __init__(self, ds, create=False): path = ds.ns.split('/') bucket_nam...
import unittest from ai_graph_color import line, problem_generator class TestProblemGenerator(unittest.TestCase): def test_generate_file_path(self): """ Tests create file """ file_names = ['test.json', ''] for file_name in file_names: file_path = problem_generator...
import struct import time from dataclasses import dataclass from typing import Iterator, Literal, Optional, Tuple from OpenSSL import SSL from mitmproxy import certs, connection from mitmproxy.net import tls as net_tls from mitmproxy.proxy import commands, events, layer, tunnel from mitmproxy.proxy import context from ...
""" Illustration of the heat equation Solve the heat equation using finite differences and Forward Euler. Based on: https://commons.wikimedia.org/wiki/File:Heat_eqn.gif """ from __future__ import division, print_function import numpy as np from mayavi import mlab def step_function(N, scale, X, Y, shape="crescent"): ...
''' Created on Mar 8, 2013 @author: Gary ''' import unittest from housemonitor.outputs.zigbee.zigbeecontrol import ZigBeeControl from housemonitor.outputs.zigbee.zigbeeoutputstep import ZigBeeOutputStep from housemonitor.outputs.zigbee.zigbeeoutputthread import ZigBeeOutputThread from housemonitor.lib.hmqueue import HM...
import sys import words import subprocess import argparse import os.path import shutil from pathlib import Path import yaml class Bencher(object): def __init__(self): self._name = 'bencher' self._help = 'Make benchmark direcotry' def mk_arg_parser(self, ap): ap.add_argument('--suffix', ...
from django.http import HttpResponse, HttpResponseRedirect from django.template import RequestContext, loader from django.core.urlresolvers import reverse from django.shortcuts import render, get_object_or_404 from django.utils import timezone from django.views import generic from polls.models import Choice,Poll class ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sponsors', '0012_sponsor_level_smallint'), ] operations = [ migrations.AlterField( model_name='sponsor', name='conference', ...
import asciitable import numpy as np import matplotlib.pyplot as plt import pyfits from scipy import interpolate def remove_duplicates_func(seq): """ This function takes a list and returns the same without duplicate elements.""" seen = set() seen_add = seen.add return [ x for x in seq if x not in se...
""" ===================================== Include On-leveling into Cape Cod ===================================== This example demonstrates how to incorporate on-leveling into the `CapeCod` estimator. The on-level approach emulates the approach taken by Friedland in "Estimating Unpaid Claims Using Basic Techniques" Ch...
from __future__ import absolute_import, division, print_function from builtins import * # @UnusedWildImport from mcculw import ul from mcculw.ul import ULError from mcculw.enums import (BoardInfo, InfoType, ErrorCode, EventType, ExpansionInfo) from .ai_info import AiInfo from .ao_info import ...
import inspect import re import sys import traceback from inspect import CO_VARARGS from inspect import CO_VARKEYWORDS from traceback import format_exception_only from types import TracebackType from typing import Generic from typing import Optional from typing import Pattern from typing import Tuple from typing import...
class Node(object): # define constructor def __init__(self, data): self.data = data self.next = None class LinkedList(object): def __init__(self, head=None): self.head = head def add(self, new_node): current_node = self.head if self.head: while current_node.next: current_node = current_node.next ...
def f2(): b, d = Base, Derived try: class MyNewClass(b, d): pass except: e2 def f3(): sequence_of_four = a_global try: a, b, c = sequence_of_four except: e3 def f4(): if cond: local = 1 try: local except: e4 def f5()...
from solution1 import urlSimilarity as f qa = [ ('https://codesignal.com/home/test?param1=42&param3=testing&login=admin', 'https://codesignal.com/home/secret/test?param3=fish&param1=42&password=admin', 19), ('https://codesignal.com/home/test?param1=42&param3=testing&login=admin', 'http://codesign...
"""Main module.""" import os import pygame import signal import logging import argparse from threading import Event from multiprocessing import Value from injector import Injector, singleton from ballercfg import ConfigurationManager from .locals import * # noqa from .events import EventManager, TickEvent from .module...
from __future__ import absolute_import class ConfigNotFound(LookupError): """Raise this exception to signal that a requested config item was not found in the config.""" pass
from rest_framework import permissions class IsOwnerOrReadOnly(permissions.BasePermission): """ Custom permission to only allow owners of an object to edit it. """ def has_object_permissions(self, request, view, obj): # Read permissions are allowed to any request, # so we'll always allow...
import storage from representation import Representation from patch import Patch
""" @author: yuchou @time: 2017/8/7 10:28 """
import io import os import re import operator import sys import base64 import time from IOST_Basic import * from IOST_Config import * import gtk import gtk.glade import gobject class IOST_AboutDialog(): def __init__(self, glade_filename, window_name, object_name ,main_builder=None): "This is ...
"""add follow table Revision ID: f045592adab0 Revises: 56a3d184ac27 Create Date: 2017-10-06 00:38:24.001488 """ from alembic import op import sqlalchemy as sa revision = 'f045592adab0' down_revision = '56a3d184ac27' branch_labels = None depends_on = None def upgrade(): # ### commands auto generated by Alembic - ple...
import datetime import uuid from flask import current_app as app from flask import url_for from database import db from sqlalchemy import Column, DateTime, String, Text from sqlalchemy.dialects.postgresql import UUID class Poster(db.Model): __tablename__ = 'posters' id = Column(UUID(as_uuid=True), primary_key=T...
import sublime, sublime_plugin import webbrowser class OpenWikiOnString(sublime_plugin.TextCommand): def run(self, edit): query = self.view.substr(self.view.sel()[0]) webbrowser.open_new("http://wiki.sa-mp.com/wiki/" + query)
import etcd import logging import os import signal import time import unittest import patroni.config as config from mock import Mock, PropertyMock, patch from patroni.api import RestApiServer from patroni.async_executor import AsyncExecutor from patroni.dcs.etcd import AbstractEtcdClientWithFailover from patroni.except...
""" This is the Windows backend for keyboard events, and is implemented by invoking the Win32 API through the ctypes module. This is error prone and can introduce very unpythonic failure modes, such as segfaults and low level memory leaks. But it is also dependency-free, very performant well documented on Microsoft's w...
"""Documentation Tasks""" from fabric.api import lcd, local, task from .utils import pip, requires PACKAGE = "mio" @task() @requires("make", "sphinx-apidoc") def clean(): """Delete Generated Documentation""" with lcd("docs"): local("make clean") @task(default=True) @requires("make") def build(**options)...
from unittest import TestCase from pydigmips import instructions, loaders class HexaLoaderTestCase(TestCase): def testAdd(self): i = ['1510', # 000 101 010 001 0000 '1C60', '2C60'] # 001 011 000 110 0000 o = [instructions.Add(5, 2, 1), instructions.Add(7, 0, 6), ...
import json from pprint import pprint json_data=open('jsonFormated') data = json.load(json_data) pprint(data) json_data.close()
"""Test RPC misc output.""" import xml.etree.ElementTree as ET from test_framework.test_framework import SyscoinTestFramework from test_framework.util import ( assert_raises_rpc_error, assert_equal, assert_greater_than, assert_greater_than_or_equal, ) from test_framework.authproxy import JSONRPCExceptio...
from io import BytesIO import json import os import urllib.parse import six import sys from ftptool import FTPHost import xlsxwriter def smart_text(s, encoding="utf-8", strings_only=False, errors="strict"): """ Returns a text object representing 's' -- unicode on Python 2 and str on Python 3. Treats bytestr...
from holmium.core import ( Page, Element, Locators, Elements, ElementMap, Section, Sections ) from holmium.core.cucumber import init_steps init_steps() class TestSection(Section): el = Element(Locators.NAME, "el") els = Elements(Locators.NAME, "els") elmap = ElementMap(Locators.NAME, "elmap") class Test...
''' Test docx module ''' import os import lxml from docx import * TEST_FILE = 'ShortTest.docx' IMAGE1_FILE = 'image1.png' def setup_module(): '''Set up test fixtures''' import shutil if IMAGE1_FILE not in os.listdir('.'): shutil.copyfile(os.path.join(os.path.pardir,IMAGE1_FILE), IMAGE1_FILE) tes...
from django.db import migrations, models import image_cropping.fields class Migration(migrations.Migration): dependencies = [ ('markets', '0065_auto_20190426_1255'), ] operations = [ migrations.AlterField( model_name="logo", name="cropping", field=image_cr...
subreddit = 'technology' t_channel = '@r_technology' def send_post(submission, r2t): return r2t.send_simple(submission)
from ..multi_load import test_multi_types as multi from ..single_load import test_multi_types as single from . import common class SingleTestCase(common.SingleBase, single.TestCase): pass class MultiTestCase(common.MultiBase, multi.TestCase): pass
import os import oss2 from oss2.models import (ConditionInlcudeHeader, Condition, Redirect, RedirectMirrorHeaders, MirrorHeadersSet, RoutingRule, BucketWebsite, ...
from .config import INFER_HOST from .main import run_app, runserver, serve_static
from textwrap import dedent import inspect from collections import OrderedDict from clusterjob import JobScript import pytest import logging try: from ConfigParser import Error as ConfigParserError except ImportError: from configparser import Error as ConfigParserError def get_methods(obj): """Get list of m...
from __future__ import division import pcbnew import FootprintWizardBase import PadArray as PA from math import ceil, floor, sqrt def calc_solderpaste_margin(w,h,fill): '''Calculate how far in to pull the paste mask to get a certain fill percentage.''' if fill > 0.99: return 0 a = (h+w)/2.0 b = ...
from game import Agent from game import Actions from game import Directions import random from util import manhattanDistance import util class GhostAgent( Agent ): def __init__( self, index ): self.index = index def getAction( self, state ): dist = self.getDistribution(state) if len(dist...
import errno import json import logging import threading import time import websocket import parlai.chat_service.utils.logging as log_utils SOCKET_TIMEOUT = 6 class ChatServiceMessageSocket: """ ChatServiceMessageSocket is a wrapper around websocket to forward messages from the remote server to the ChatServ...
from os import path from .taskqueue import TaskQueueClient __all__ = ['TaskQueueClient'] with open(path.join(path.dirname(__file__), 'version.txt')) as fp: __version__ = fp.read().strip()
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('finance', '0003_auto_20140929_0130'), ] operations = [ migrations.RemoveField( model_name='extract', name='provider', ), ...
import re from django.core.urlresolvers import reverse def test_view_with_scss_file(client, precompiled): """ Test view that renders *SCSS file* that *imports SCSS file from another Django app*. :param client: ``pytest-django`` fixture: Django test client :param precompiled: custom fixture that asserts ...
from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('studygroups', '0004_studygroupsignup_mobile'), ] operations = [ migrations.AddField( model_name='course', name='image', field=models.CharField(default=' ', m...
from django.core.management.base import BaseCommand from django_brfied.models import UnidadeFederativa, Municipio from ...migrations import UNIDADE_FEDERATIVA_ROWS, MUNICIPIO_ROWS class Command(BaseCommand): help = "Importa as UFs e os Municípios para a base" # requires_system_checks = False # def __init__(...
""" Author: Sam Ginzburg Description: This script reads in a blast2go sequence table output of GO Term mappings, and calculates frequencies of GO Terms at specific GO Levels Example run: python generate_pie_charts.py [blast2go_file.txt] [GO Level] """ import sys from GeneOntologyLibrary import obo_parser from GeneOntol...
from DemoFramework import DemoFramework from LUIVerticalLayout import LUIVerticalLayout from LUIFrame import LUIFrame from LUILabel import LUILabel from LUIButton import LUIButton from LUIObject import LUIObject import random f = DemoFramework() f.prepare_demo("LUIFrame") f.add_constructor_parameter("width", "200") f.a...
""" meza.io ~~~~~~~ Provides methods for reading/writing/processing tabular formatted files Examples: basic usage:: >>> from meza.io import read_csv >>> >>> path = p.join(DATA_DIR, 'test.csv') >>> csv_records = read_csv(path) >>> csv_header = next(csv_records).keys() ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('almoxarifado', '0001_initial'), ] operations = [ migrations.AddField( model_name='equipamento', name='fabricante', fi...
from numpy import * from cmlib import showMatr A = matrix([[1, 2, 0], [0, 2, 2]]) B = matrix([[3, -1], [-1, 3], [1, 0]]) res = (A * B).T showMatr(array(res))
import os from setuptools import setup, find_packages from pip.req import parse_requirements PROJECT_NAME = '<your-project-name>' AUTHOR_NAME = '<your-name>' AUTHOR_EMAIL = '<your-email-address>' PROJECT_URL = '' DESCRIPTION = '<your-project-description>' PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) setup(...
from distutils.core import setup setup( name='stompy', version='0.1', packages=['stompy', 'stompy.grid', 'stompy.io', 'stompy.io.local', 'stompy.model', 'stompy.model.delft', 'stompy.model.fvcom', 'stompy.model.pypart', 'stompy.model.suntans', 'stompy.plot', 'stompy...
""" Copyright (C) 2014 Maruf Maniruzzaman Website: http://cosmosframework.com Author: Maruf Maniruzzaman License :: OSI Approved :: MIT License """
from django.contrib import admin from holidays.models import (Holiday, StaticHoliday, NthXDayHoliday, NthXDayAfterHoliday, CustomHoliday) class HolidayAdmin(admin.ModelAdmin): pass class StaticHolidayAdmin(admin.ModelAdmin): pass class NthXDayHolidayAdmin(admin.ModelAdmin): pass class NthXDayAfterHolida...
""" gof.py gof stands for Graph Optimization Framework The gof submodule of theano implements a framework for manipulating programs described as graphs. The gof module defines basic theano graph concepts: -Apply nodes, which represent the application of an Op to Variables. Together these make up a graph. -The T...
def validate(hand): if hand < 0 or hand > 2: return False return True def print_hand(hand, name='ゲスト'): hands = ['グー', 'チョキ', 'パー'] print(name + 'は' + hands[hand] + 'を出しました') def judge(player, computer): if player == computer: return '引き分け' elif player == 0 and computer == 1: ...
""" Form Widget classes specific to the geoSite admin site. """ import json from django.template.loader import render_to_string from .conf import settings from django.utils import six from django import forms from django.forms import widgets, MultiWidget, Media from django.utils.html import conditional_escape, format_h...
import numpy import matplotlib.pyplot as plt from numpy.random import rand a = rand(100) b = rand(100) plt.scatter(a, b) plt.show()
import sys import vlc import os import re from tempfile import * from gtts import gTTS from remote2text import RGBRemote2Text parser = RGBRemote2Text(verbose=True) while True: ir_out = input() response = parser.process(ir_out) if response: tts = gTTS(text=response, lang='pt') tmp = NamedTemp...
from .apps.page import views as page assert page
simulation = "L500_NR_tracers" dirs = {"sim_root_dir" : "/home/fas/nagai/kln26/group_scratch/L500_NR_tracers", "db_dir" : "..", "halo_catalog_dir" : "HC.500", "profiles_dir" : "profiles", "logs_dir" : "logs" } hc_radius = "500c" halo_list_radii = ["200m", "500c", "200c", "vir"] h_inverse...
import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django_mongodb_engine', 'NAME': 'sheesh', } } ALLOWED_HOSTS = [] TIME_ZONE = 'Am...
import gdsfactory as gf import gdsfactory.simulation.gtidy3d as gt from gdsfactory.config import CONFIG from gdsfactory.simulation.gtidy3d.get_results import get_results if __name__ == "__main__": # test_results_run(None) component = gf.components.straight(length=3) sim = gt.get_simulation(component=compone...
from __future__ import print_function import argparse import time from pygecko.transport import zmqTCP, GeckoCore from pygecko.multiprocessing import GeckoPy from pygecko.test import GeckoSimpleProcess def subscriber(**kwargs): geckopy = GeckoPy(**kwargs) def f(topic, msg): print(">> {}: {}".format(topi...
from shutil import copy from tkinter import * from tkinter import filedialog from tkinter import ttk from .GetStaticData import * from .SetStaticData import * def gen_set(): """ This function is called whenever a save-event is requested. The function retrieves all ui-vars and writes the data in them to the .pri...
import logging import traceback import sys from celery import Celery from .callbacks import STATUS_LOADING_DATA from .config import get_engine, _set_connection_string from .loader import FDPLoader from .callbacks import do_request, STATUS_INITIALIZING, STATUS_FAIL, STATUS_DONE app = Celery('fdp_loader') app.config_from...
from __future__ import unicode_literals import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('marketplace', '0012_auto_20170604_1335'), ] operations = [ migrations.AlterField( model_name='package', ...
import _plotly_utils.basevalidators class ThicknessmodeValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="thicknessmode", parent_name="densitymapbox.colorbar", **kwargs ): super(ThicknessmodeValidator, self).__init__( ...
import sys import pygame import picamera import io import yuv2rgb import os import time from subprocess import Popen class Stream(): def __init__(self): self.mode = 'capture' self.deleted = False self.uploading = False self.no_files = False #Get current photo name index ...
from django.conf import settings from django.contrib.auth.models import User from django.contrib.postgres.search import SearchVector, SearchQuery, SearchRank from django.core.urlresolvers import reverse from django.db import models from github import UnknownObjectException from social.apps.django_app.default.models imp...
from __future__ import print_function from . import (paver,trigrid,orthomaker) from ..spatial import field import sys import numpy as np # from numpy import * from scipy.linalg import norm import matplotlib.pyplot as plt class OptimizeGui(object): def __init__(self,og): self.og = og self.p = og.p ...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "quotoxic.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "quickly.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
import pymysql from flask_restful import Resource from flask import abort ALLOWED_SHOW = ('processlist', 'databases', 'plugins', 'privileges') class Mysql(Resource): def __init__(self): self.connection = pymysql.connect(user='root') self.cursor = self.connection.cursor() def _execute(self, sql):...
from msrest.serialization import Model class ApplicationGatewayWebApplicationFirewallConfiguration(Model): """Application gateway web application firewall configuration. All required parameters must be populated in order to send to Azure. :param enabled: Required. Whether the web application firewall is ena...
from datetime import datetime from parsedatetime import parsedatetime, Constants from scrapy import signals from scrapy.xlib.pydispatch import dispatcher from scrapy.exceptions import NotConfigured, IgnoreRequest from scrapy.utils.misc import load_object class HistoryMiddleware(object): DATE_FORMAT = '%Y%m%d' d...