text
stringlengths
2
999k
import json, base64, requests from jinja2 import Environment, FileSystemLoader from pathlib import Path import webbrowser import tweepy import sys class Twitter: def __init__(self, auth, Bearer_Token=None): self.auth = auth self.Bearer_Token = Bearer_Token if self.auth is None: ...
""" Provide the functionality to group entities. For more details about this component, please refer to the documentation at https://home-assistant.io/components/group/ """ import asyncio import logging import voluptuous as vol from homeassistant import core as ha from homeassistant.const import ( ATTR_ENTITY_ID...
# Copyright 2013, Big Switch Networks, 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 applic...
from zipline.pipeline import Pipeline from zipline.api import attach_pipeline, pipeline_output from zipline.pipeline.data.equity_pricing import USEquityPricing from zipline.pipeline.data import morningstar from zipline.pipeline.factors import SimpleMovingAverage, AverageDollarVolume from zipline.pipeline.filters.mornin...
FPS = 10 SCREEN_SIZE = (1200, 800) CARDFIELD_COORDS = [(230, 120), (700, 520)] BANK_COORDS = [(970, 160), (70, 350)] BACKGROUND = (140, 122, 230) WHITE = (255, 255, 255) GREY = (128, 128, 128) GREEN = (0, 128, 0) YELLOW = (180, 180, 0) BLACK = (0, 0, 0) COLORS = { "1": [(53, 59, 72), (47, 54, 64),], "2": [(245...
from time import sleep import pytest from ...utils import assert_finished, assert_send, receive_json class TestPeripheralSPI: def test_start(self, obniz): obniz.spi0.start( {"clk": 0, "frequency": 1000000, "miso": 2, "mode": "master", "mosi": 1} ) assert_send(obniz, [{"io0":...
# -*- coding: utf-8 -*- ''' Auther: cytopia License: MIT Transformer for kubernetes-incubator/metrics-server from json into Prometheus readable format. ''' import os import json import re import time import requests import subprocess from flask import Flask from flask import Response ''' Globals that specify at wh...
from flask import Flask, request from hbase_manager import HBaseRecord import json from flask_cors import CORS app = Flask(__name__) CORS(app) @app.route('/') @app.route('/test') @app.route('/hello') def hello(): return 'Hello World!' @app.route('/get_places', methods=['GET', 'POST']) def get_places(): if ...
import aio_pika
# ------------------------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. # -------------------------------------------------------------------...
from django.contrib import admin from .models import Board,TodoList @admin.register(Board) class BoardAdmin(admin.ModelAdmin): search_fields = ['title'] list_display = ('title',) @admin.register(TodoList) class TodoAdmin(admin.ModelAdmin): search_fields = ['title','created'] list_display = ('title',...
#################################################### ## 0. Useful stuff about Python #################################################### # Pyhton Enhancement Proposals, or PEPs, are useful conventions which guide # the user in writing readable and pretty code, as well as many other # details about Python. PEP-8 is the...
from django.urls import path from DBCalls.views import CollectionView, ExhibitView, ModuleView, QuestionView urlpatterns = [ path('Questions/<str:qID>', QuestionView.as_view(), name='questionview'), path('Questions/', QuestionView.as_view(), name='questionview'), path('Modules/<str:mID>', ModuleView.as_vie...
from ..utils import Object class CancelUploadFile(Object): """ Stops the uploading of a file. Supported only for files uploaded by using uploadFile. For other files the behavior is undefined Attributes: ID (:obj:`str`): ``CancelUploadFile`` Args: file_id (:obj:`int`): ...
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Cblas(Package): """The BLAS (Basic Linear Algebra Subprograms) are routines that pr...
import requests from allauth.socialaccount.helpers import render_authentication_error from allauth.socialaccount.models import SocialLogin, SocialAccount from allauth.socialaccount.providers.base import ProviderException from allauth.socialaccount.providers.google.views import GoogleOAuth2Adapter from allauth.socialac...
import socket # Networking support import time # Current time from library import id_generate host = None port = None log_th = None conf_th = None header_th = None command_w_th = None data_w_th = None class HTTPServer: def __init__(self): global host, port, log_th, conf_th, header_th, command_w_th, da...
# pylint: disable=unused-argument,unused-variable,expression-not-assigned import os from datetime import datetime import pytest from expecter import expect import xlrd from dwellingplace.models._utils import parse_xlsx_into_dicts, get_value DATA = os.path.join(os.path.dirname(__file__), "data") def test_load(): ...
from tests import ScraperTest from recipe_scrapers.cdkitchen import CdKitchen class TestCdKitchen(ScraperTest): scraper_class = CdKitchen def test_host(self): self.assertEqual("cdkitchen.com", self.harvester_class.host()) def test_canonical_url(self): self.assertEqual( ...
from typing import Any, List from boa3.builtin import public @public def Main() -> List[Any]: a: List[Any] = [1, 2, 3] a.append('4') return a
import discord from gamestonk_terminal.economy import wsj_model import discordbot.config_discordbot as cfg from discordbot.run_discordbot import logger async def currencies_command(ctx): """Currencies overview [Wall St. Journal]""" try: # Retrieve data df_data = wsj_model.global_currencies(...
# 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 # d...
import numpy as np import torch from torch.autograd import Variable import os import glob import h5py import configs import backbone from data.datamgr import SimpleDataManager from methods.baselinetrain import BaselineTrain from methods.baselinefinetune import BaselineFinetune from methods.protonet import ProtoNet fro...
#!/usr/bin/env python # # Use the raw transactions API to spend bitcoins received on particular addresses, # and send any change back to that same address. # # Example usage: # spendfrom.py # Lists available funds # spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00 # # Assumes it will talk to a bitcoind or Bit...
import sys from .data import REPLACEMENTS, COMBININGMARKS, SUBSUPERSCRIPTS if __name__ == "__main__": outname = 'ts_src/data.ts' if len(sys.argv) == 2: outname = sys.argv[1] with open(outname, 'w') as f: f.write('// autogenerated with python -m unicodeit.export_data\n\n') f.writ...
# -*- coding: utf-8 -*- u"""pytest for `pykern.pkplatform` :copyright: Copyright (c) 2015 Bivio Software, Inc. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ from __future__ import absolute_import, division, print_function import pytest def test_conformance1(): """Verify the p...
import math import numpy as np import sncosmo from baselayer.app.env import load_env from skyportal.models import DBSession, Token from skyportal.tests import api _, cfg = load_env() PHOT_DETECTION_THRESHOLD = cfg["misc.photometry_detection_threshold_nsigma"] def test_token_user_post_get_photometry_data( uploa...
# Definition for singly-linked list. class ListNode: def __init__(self, x): self.val = x self.next = None class Solution: def rotateRight(self, head: ListNode, k: int) -> ListNode: if not (head and head.next and k) : return head fast = head cnt = 1 whi...
# coding=utf-8 # Copyright 2018 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.backend.p...
import sys #For CLI input from decimal import Decimal, getcontext """I wanted to avoid importing this module but, the floats were messing up like >>> 1-0.8 0.19999999999999996 So, I used it. Round function could helped. But using that produce -0.000, which seemed unaesthetic to me.""" getcontext().prec= 3 #Useless, si...
import re from typing import NamedTuple from adventofcode2020.utils.abstract import FileReaderSolution class PassPol(NamedTuple): at_least: int at_most: int letter: str password: str class Day02: @staticmethod def split(input_password) -> PassPol: """ Input `7-9 r: rrrkrrrrr...
# Escreva um programa que leia um valor em metros e o exiba convertido em milímetros n1=int(input('Coloque o(s) valor(es): ')) print ('O valor em metros: ', n1) print ('O valore em centimetros: ', n1 * 100) print ('O valor em milimetros: ', n1*1000)
# Copyright 1999-2021 Alibaba Group Holding Ltd. # # 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...
import pandas as pd from sklearn.preprocessing import LabelEncoder def categorical_features(data, features): features['vehicleType'] = data['vehicleType'] features['vehicleOption'] = data['vehicleOption'] features['vehicleTypeOption'] = [a + '_' + b for a, b in zip(data['vehicleType'].values, ...
from direct.distributed.DistributedObjectAI import DistributedObjectAI from direct.directnotify import DirectNotifyGlobal class DistributedLockAI(DistributedObjectAI): notify = DirectNotifyGlobal.directNotify.newCategory('DistributedLockAI') def __init__(self, air): DistributedObjectAI.__init__(self, ...
""" PASSENGERS """ numPassengers = 7667 passenger_arriving = ( (2, 0, 1, 3, 1, 1, 2, 1, 0, 1, 0, 0, 0, 3, 1, 3, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0), # 0 (2, 2, 4, 2, 0, 1, 0, 1, 2, 0, 0, 1, 0, 4, 6, 1, 2, 3, 0, 1, 1, 1, 0, 0, 0, 0), # 1 (2, 2, 3, 3, 0, 2, 0, 1, 1, 0, 1, 0, 0, 2, 1, 4, 2, 2, 0, 3, 1, 1, 0, 0, 1, 0), #...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the Spotlight Volume configuration plist plugin.""" from __future__ import unicode_literals import unittest from plaso.parsers.plist_plugins import spotlight_volume from tests.parsers.plist_plugins import test_lib class SpotlightVolumePluginTest(test_lib...
"""Error handling for the tilesets CLI""" class TilesetsError(Exception): """Base Tilesets error Deriving errors from this base isolates module development problems from Python usage problems. """ exit_code = 1 def __init__(self, message): """Error constructor Parameters ...
import pytest from webdriver.transport import Response from tests.support.asserts import assert_error, assert_same_element, assert_success def find_elements(session, shadow_id, using, value): return session.transport.send( "POST", "session/{session_id}/shadow/{shadow_id}/elements".format( se...
import sys import subprocess import yaml if len(sys.argv) != 4: print('usage: delegate.py [val1_stake] [val2_stake] [val3_stake]') exit(0) # Load config confFile = open('./conf.yml') conf = yaml.safe_load(confFile) def delegate_cmd(valNumber, amount): cmd = ["spnd", "tx", "staking", "delegate"] cmd.a...
''' Description: email: 359066432@qq.com Author: lhj software: vscode Date: 2021-09-19 17:28:48 platform: windows 10 LastEditors: lhj LastEditTime: 2021-09-20 20:01:05 ''' from dataclasses import dataclass @dataclass class UserBriefInfo(object): user_id:str user_name:str @classmethod def from_user(c...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import paste import subprocess from multiprocessing import Process from pathlib import Path import tkinter.messagebox as messagebox from shutil import copy from appdirs import user_config_dir import logging as log from globe import Globe as globe from util impo...
# Copyright 2017 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 __future__ import print_function from __future__ import absolute_import from __future__ import division from compas.utilities import flatten import compas_rhino from compas_rv2.rhino import get_scene from compas_rv2.rhino import rv2_undo from compas_rv2.rhino import rv2_error # from compas_rv2.rhino import Modif...
from terminalbeat import BaseTest import os class Test(BaseTest): def test_base(self): """ Basic test with exiting Terminalbeat normally """ self.render_config_template( path=os.path.abspath(self.working_dir) + "/log/*" ) terminalbeat_proc = self.star...
from __future__ import unicode_literals from decimal import Decimal from django.conf import settings from django.core.validators import MaxValueValidator, MinValueValidator from django.db import models from django.db.models import Sum from django.utils.encoding import python_2_unicode_compatible from django.utils.tim...
for j in range(y_bus_size - 1, -1, -1): f=[] f += [0] * j h=f.copy() f += [1] for i in range(j + 1, y_bus_size): f += [0] for k in range(j, i): # print(j,i,k) # 临时变量temp,存储l f 的乘积 f[i] -= facter_table[k, i] * f[k] # print(f) for i in range(...
import _plotly_utils.basevalidators class TickprefixValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="tickprefix", parent_name="scattergl.marker.colorbar", **kwargs ): super(TickprefixValidator, self).__init__( plotly_...
# -*- coding: UTF-8 -*- # # Copyright 2019-2022 Flávio Gonçalves Garcia # # 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 b...
from bokeh.charts import Histogram, output_file, show from bokeh.sampledata.autompg import autompg as df p = Histogram(df, 'hp', title="HP Distribution") output_file("histogram.html",) show(p)
from pytezos import PyTezosClient class Token(object): def __init__(self, client: PyTezosClient): self.client = client def set_admin(self, contract_id, new_admin): print(f"Setting fa2 admin on {contract_id} to {new_admin}") call = self.set_admin_call(contract_id, new_admin) r...
''' Parse the FST of the current disk and list the files Example: MountIso c:/isos/ac.gcm (mount existing GCM) % DvdListFiles ''' def do_command(dolwin, args): # Check if any DVD is mounted (real GCM image or DolphinSDK virtual disk) mounted = False res = dolwin.ExecuteWi...
# The objective of this program is to multiply two input numbers def multiply(*args): a = args res = 1 for ele in a: res *= ele return res a1=int(input()) a2=int(input()) print(multiply(a1,a2))
from pyramid_layout.layout import layout_config @layout_config(template='h:templates/base.pt') class BaseLayout(object): csp = None inline_webfont = True requirements = (('app', None),) def __init__(self, context, request): self.context = context self.request = request self.fo...
#!/usr/bin/env python # coding=utf-8 # Created by max on 17-5-4. import os import sys import numpy as np import pandas as pd import matplotlib.pyplot as plt from fbprophet import Prophet from pandas import Series, DataFrame DATA_FILE = "dataset/data0.csv" def main(args): data = pd.read_csv(DATA_FILE, parse_d...
def mergeSort(arr): n= len(arr) if n > 1: mid = int(n/2) left = arr[0:mid] right = arr[mid:n] mergeSort(left) mergeSort(right) Merge(left, right, arr) def Merge(left, right, arr): i = 0 j = 0 k = 0 while i < len(left) and j < len(right): if...
# -*- coding: utf-8 -*- """ Translate docutils node important formatting. each important start will processed with visit() and finished with depart() """ from docutils.nodes import Node from sphinxpapyrus.docxbuilder.translator import DocxTranslator node_name = "important" def visit(visitor: DocxTranslator, node: N...
# Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the relevant file with open(path.join(here, 'README.markdown'), encoding='utf-8')...
from django import template from django.contrib.auth.models import Group register = template.Library() @register.filter(name='has_group') def has_group(user, group_name): try: group = Group.objects.get(name=group_name) except: return False # group doesn't exist, so for sure the user isn't par...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from frappe import _ def get_data(): return [ { "module_name": "Demo App", "color": "grey", "icon": "octicon octicon-file-directory", "type": "module", "label": _("Demo App") } ]
from django import forms from django.urls import reverse from django.utils.translation import pgettext_lazy, ugettext_lazy as _ from i18nfield.forms import I18nFormField, I18nTextarea, I18nTextInput from pretix.base.email import get_available_placeholders from pretix.base.forms import PlaceholderValidator from pretix....
from parserT28.models.instructions.Expression.type_enum import DATA_TYPE from parserT28.controllers.three_address_code import ThreeAddressCode from parserT28.controllers.error_controller import ErrorController from parserT28.models.instructions.Expression.expression import Expression, Identifiers, PrimitiveData from pa...
# -*- coding: utf-8 -*- import os import sys sys.path.insert(0, os.path.abspath('..')) # -- General configuration ------------------------------------------------ # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extens...
import genanki import glob from pathlib import Path import random def generateAnki(): random.seed(42) title = 'Deutschland - Stadt, Land, Fluss' aDeck = genanki.Deck( 2059400110, title) # location to name aModel = genanki.Model( 1607392319, title, fields=[...
# coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
import datetime import json from twilio.base import values def iso8601_date(d): """ Return a string representation of a date that the Twilio API understands Format is YYYY-MM-DD. Returns None if d is not a string, datetime, or date """ if d == values.unset: return d elif isinstance(d,...
import unittest from sqlglot import transpile from sqlglot.errors import ErrorLevel, UnsupportedError class TestDialects(unittest.TestCase): def test_mysql(self): sql = transpile('SELECT CAST(`a`.`b` AS INT) FROM foo', read='mysql', write='mysql')[0] self.assertEqual(sql, 'SELECT CAST(`a`.`b` AS I...
from pathlib import Path import sys import os def add_application_path(): app_path = Path(__file__).resolve().parents[1] sys.path.append(str(app_path)) os.chdir(str(app_path))
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
""" importing public methods """ from .plex_auth import connect_to_plex from .plex_movies import return_movies from .plex_tv import return_tv from .plex_users import get_emails from .plex_users import unsub_emails from .plex_email import send_mail
""" @brief test log(time=2s) """ import unittest import warnings from pyquickhelper.loghelper import fLOG class TestLONGScriptInstall(unittest.TestCase): def test_pypi(self): fLOG( __file__, self._testMethodName, OutputPrint=__name__ == "__main__") import...
from django.shortcuts import render from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import exceptions from common.serializers import UserSerializer from core.models import User,Product,Link,OrderItem,Order from common.authentication import JWTAuthentication from...
from pyglet.libs.darwin.objc_runtime import * # This class is a wrapper around NSCursor which prevents us from # sending too many hide or unhide messages in a row. Apparently # NSCursor treats them like retain/release messages, which can be # problematic when we are e.g. switching between window & fullscreen. class S...
# read version from installed package from importlib.metadata import version __version__ = version("pycounts_polluxtroy3758") from pycounts_polluxtroy3758.plotting import plot_words # noqa: F401 from pycounts_polluxtroy3758.pycounts import count_words # noqa: F401
#!/usr/bin/env python # # Copyright 2018 Confluent 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...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # Usage: # # $ python -m fixit.cli.run_rules --help # $ python -m fixit.cli.run_rules # $ python -m fixit.cli.run_rules --rules AvoidOrI...
from gym.envs.registration import registry, register, make, spec # Algorithmic # ---------------------------------------- register( id='Copy-v0', entry_point='gym.envs.algorithmic:CopyEnv', max_episode_steps=200, reward_threshold=25.0, ) register( id='RepeatCopy-v0', entry_point='gym.envs.alg...
from .multimodal_exploratory_search_pipeline import MultimodalSearchRecipe from .artm_baseline_pipeline import BaselineRecipe from .exploratory_search_pipeline import SearchRecipe from .artm_baseline_pipeline import ARTM_baseline_template as ARTM_baseline from .exploratory_search_pipeline import exploratory_search_temp...
#!/usr/bin/env python """Tests for grr.parsers.windows_persistence.""" from grr.lib import flags from grr.lib import rdfvalue from grr.lib import test_lib from grr.lib.rdfvalues import client as rdf_client from grr.lib.rdfvalues import paths as rdf_paths from grr.lib.rdfvalues import protodict as rdf_protodict from gr...
""" Copyright 2015-2018 IBM 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 di...
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Seqan(CMakePackage): """SeqAn is an open source C++ library of efficient algorithms and d...
# Copyright The PyTorch Lightning team. # # 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...
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # All Rights Reserved # # 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...
#!/usr/bin/env python3 import requests import multiprocessing import time session = None def set_global_session(): global session if not session: session = requests.Session() def download_site(url): with session.get(url) as response: name = multiprocessing.current_process().name ...
# Copyright 2016 Capital One Services, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
class Solution: def longestCommonPrefix(self, strs): min_len = len(min(strs, key = len)) for q in range(len(strs)): strs[q] = list(strs[q]) lst = [] final = '' for _ in range(min_len): lst = [q.pop(0) for q in strs] if all(q ==...
""" Pylibui test suite. """ from pylibui.controls import Slider from tests.utils import WindowTestCase class SliderTest(WindowTestCase): def setUp(self): super().setUp() self.slider = Slider(0, 100) def test_value_initial_value(self): """Tests the sliders's `value` initial value is...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt import json from typing import TYPE_CHECKING, Dict, List from rq import Queue, Worker import frappe from frappe import _ from frappe.utils import convert_utc_to_user_timezone, format_datetime from frappe.utils.backgro...
# Copyright 2018 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, ...
"""GUI support for the IPython ZeroMQ kernel - GTK toolkit support. """ #----------------------------------------------------------------------------- # Copyright (C) 2010-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING.txt, distribute...
#GUI classes for the application from kivy.app import App from kivy.lang import Builder from kivy.core.window import Window from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition from kivy.uix.popup import Popup from kivy.uix.button import Button from kivy.uix.label import Label from kivy.uix....
import os, sys, inspect # realpath() will make your script run, even if you symlink it :) cmd_folder = os.path.realpath(os.path.abspath(os.path.split(inspect.getfile(inspect.currentframe()))[0])) if cmd_folder not in sys.path: sys.path.insert(0, cmd_folder) # # Use this if you want to include modules from a subfo...
# Copyright (c) 2017 Cable Television Laboratories, Inc. ("CableLabs") # and others. 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://w...
from typing import FrozenSet, Tuple import pysmt.typing as types from pysmt.environment import Environment as PysmtEnv from pysmt.fnode import FNode from utils import symb_to_next from hint import Hint, Location def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode, ...
#!/usr/bin/env python # (c) Crown Owned Copyright, 2016. Dstl. import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lighthouse.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
from extensions import db from models.item_data_type import ItemDataType from models.label import Label from models.task import Task class Project(db.Model): id = db.Column(db.String(80), primary_key=True, nullable=False) # 1(Project)-to-1(organisation) org_id = db.Column(db.String(80), db.ForeignKey('org...
# -*- coding: utf-8 -* import numpy as np from loguru import logger import torch import torch.nn as nn import torch.nn.functional as F from videoanalyst.model.common_opr.common_block import (conv_bn_relu, xcorr_depthwise) from videoanalyst.model.module_base imp...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_str from ..utils import ( ExtractorError, int_or_none, str_to_int, unified_strdate, ) class RedTubeIE(InfoExtractor): _VALID_URL = r'https?://(?:(?:www\.)?redtube\.com/|embed\.redtube\...
from Cython.Build import cythonize import numpy as np from distutils.core import setup setup(ext_modules=cythonize(["bbox.pyx","cython_nms.pyx"],include_path=[np.get_include()] ))
# -*- coding: utf-8 -*- # ***************************************************************************** # NICOS, the Networked Instrument Control System of the MLZ # Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS) # # This program is free software; you can redistribute it and/or modify it under # the t...