content
stringlengths
5
1.05M
# Copyright 2014 Hewlett-Packard Development Company, L.P. # Copyright 2020-2021 Hewlett Packard Enterprise Development LP # # 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....
# Generated by Django 3.1 on 2020-09-23 05:14 from django.db import migrations, models import django.db.models.deletion import draftjs_sanitizer import saleor.core.db.fields class Migration(migrations.Migration): initial = True dependencies = [ ('ushop', '0001_initial'), ] ...
import os APP_NAME = os.path.basename(os.path.dirname(__file__)) __version_info__ = (1, 0, 0) __version__ = ".".join(map(str, __version_info__)) default_app_config = 'csv_manager.apps.CsvManagerConfig'
from db import session_scope class DataBaseAccess: def data_select(self, models, inner_join_list=[], outer_join_list=[], filter_list=None): self.filter_list = filter_list with session_scope() as session: # ํ•„์š”ํ•œ ๋ชจ๋ธ๋“ค๋กœ select๋ฌธ์„ ์ƒ์„ฑํ•œ๋‹ค. self.query = session.query(*models) ...
# -*- coding: utf-8 -*- description = 'Collimation hexapod setup' group = 'lowlevel' tango_base = 'tango://phys.biodiff.frm2:10000/biodiff/hexapod/' devices = dict( collimator_x = device('nicos.devices.entangle.Motor', description = 'collimator hexapod X axis', tangodevice = tango_base + 'x', ...
import pytest from hamcrest import assert_that, contains_inanyorder from tests.testing_utils import param_wrapper, run_flake8, run_pylint params = [ # code, flake8 rules, pylint rules param_wrapper('max = 4', {'A001'}, {'W0622'}, id='top_level'), param_wrapper(( 'def bla():', ' filter =...
from datetime import date, datetime, timedelta import traceback from colorama import init, Fore, Style from ..utils.misc import group_list init(autoreset=True) def human(obj): if isinstance(obj, timedelta): secs = obj.total_seconds() mins = secs / 60.0 hours = mins / 60.0 if ho...
from typing import List class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next def __eq__(self, other): if not isinstance(other, ListNode): return False return self.val == other.val and self.next == other.next def __repr__(self):...
#!/usr/bin/env python3 import argparse from astropy.coordinates import SkyCoord,EarthLocation,AltAz from astropy.time import Time import astropy.units as u from math import cos import numpy as np from matplotlib import use use('Agg') import matplotlib.pyplot as plt from matplotlib import patches from mwa_pb.mwa_tile ...
from django.conf import settings from django.conf.urls import url, patterns from models import Document urlpatterns = patterns('mmm.views', url(r'^member/(?P<mid>\d+)/$', 'member_docs', name='member-mmms'), url(r'^committee/(?P<cid>\d+)/$', 'committee_docs', name='committee-mmms...
import gym import envs.fetch as fetch_env import envs.hand as hand_env from .utils import goal_distance, goal_distance_obs Robotics_envs_id = [ 'FetchPushDyn-v1', 'FetchReach-v1', 'FetchPush-v1', 'FetchSlide-v1', 'FetchPickAndPlace-v1', 'FetchPushNew-v1', 'FetchCurling-v1', 'FetchPushObstacle-v1', 'FetchPickO...
# -*- coding: utf-8 -*- from __future__ import print_function, absolute_import from numba import njit, cfunc, cgutils from numba.six import exec_ from numba.utils import PY2 from .support import TestCase, unittest unicode_name1 = u""" def unicode_name1(เฒ _เฒฐเณƒ, เฒ เจŠเฒ ): return (เฒ _เฒฐเณƒ) + (เฒ เจŠเฒ ) """ unicode_name2 = u"""...
import TUI.TUIModel def init(sr): """Open the DIS Expose window so the user can see what's going on.""" tuiModel = TUI.TUIModel.getModel() tuiModel.tlSet.makeVisible("None.DIS Expose") def run(sr): """Sample script to take a series of DIS calibration images and demonstrate looping through data in ...
def insert_crawl_seed(uri, crawlid): insert_seed(uri) try: cursor.execute("INSERT INTO CrawlSeeds (seedURI, crawlId) VALUES ('{uri}', {crawlId})".format(uri=uri, crawlId=crawlid)) except sqlite3.Error as er: print(er, end='\n\t...') if str(er) == 'UNIQUE constraint failed: CrawlSeeds...
#!/usr/bin/python # -*- coding: utf-8 -*- ################################################################################ # Copyright or ยฉ or Copr. Anthony Mathelier and Alessandra Carbone (02-05-2010) # anthony.mathelier@gmail.com, alessandra.carbone@lip6.fr # # This software is a computer program whose purpose is...
# Copyright 2021 Richard Maynard (richard.maynard@gmail.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-2.0 # # Unless required by applicab...
import matplotlib.pyplot as plt from collections import deque import numpy as np import torch import shutil import os from CustomSummaryWriter import CustomSummaryWriter from params import Params from model import ActorCriticWrapper class Logger_Team(): """Simple Logger class to store stats for printing & Tensorbo...
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/spanner_v1/proto/spanner.proto import sys _b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) from google.protobuf import descriptor as _descriptor from google.protobuf import message...
from sqlalchemy import MetaData, Table, Column, Integer, String, Text _COLUMNS = { 'id': Column('id', Integer, primary_key=True), 'name': Column('name', String(100)), 'algorithm': Column('algorithm', String(100)), 'value': Column('value', Integer), 'category': Column('category', String(100)), '...
from pyhcl.passes import check_form, check_types, check_widths, check_flows, infer_types, infer_widths from pyhcl.ir.low_ir import * class CheckAndInfer: @staticmethod def run(c: Circuit): c = check_form.CheckHighForm(c).run() c = infer_types.InferTypes().run(c) c = infer_widths.InferWid...
# For n disks, total 2^n โ€“ 1 moves are required. def towersOfHanoi(n,from_stack,to_stack,aux_stack): if n == 1: print("Moved disc {} from {} to {}".format(n,from_stack, to_stack)) else: towersOfHanoi(n-1, from_stack, aux_stack, to_stack) print("Moved disc {} from {} to {}".format(n,from...
# Put your name and student ID here before submitting! # Name (ID) import random # uncomment one of the two lines below, depending on which library you want to use # import tensorflow # import torch class NNAgent: def __init__(self, id): self.id = id # initialise your neural network h...
from __future__ import division from mmcv.parallel import MMDataParallel from ..core import AttrPredictor, AttrCalculator, CateCalculator from ..datasets import build_dataloader from .env import get_root_logger import numpy as np import pandas as pd def test_predictor(model, dataset, ...
"""Full training script""" import logging from azureml.core import Dataset#, ScriptRunConfig, Environment from azureml.core.compute import ComputeTarget from azureml.core.experiment import Experiment from azureml.automl.core.forecasting_parameters import ForecastingParameters from azureml.train.automl import AutoMLConf...
from maza.core.exploit import * from maza.core.http.http_client import HTTPClient class Exploit(HTTPClient): __info__ = { "name": "3Com OfficeConnect RCE", "description": "Module exploits 3Com OfficeConnect remote command execution " "vulnerability which allows executing com...
from match import match from reddit import reddit from freeRotation import freeRotation from email_me import email_me from twitch import twitch from slack import slack import time class index: def __init__(self): self.match = match() self.reddit = reddit() self.email_me = email_me() self.twitch = twitch() s...
#! /usr/bin/env python import rospy import actionlib from actionlib_msgs.msg import GoalStatusArray, GoalStatus from move_base_msgs.msg import MoveBaseAction from door_pass.door_utils import DoorUtils class DoorPass(object): def __init__(self): max_trans_vel=rospy.get_param("~max_trans_vel", 0.15) ...
s = raw_input() if s.count("AB") > 0 and s.count("BA") > 0 and s.count("AB")+s.count("BA")-s.count("ABA")-s.count("BAB") >= 2: print "YES" else: print "NO"
# Copyright (c) 2016-present, Facebook, Inc. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # pyre-strict import logging from typing import Callable, Iterable, List from .constructor_generator import gather_all_constructors_in_hierarchy ...
class Node: def __init__(self, key, data, parent=None, left=None, right=None): self.key = key self.data = data self.parent = parent self.left = left self.right = right class SplayTree: def __init__(self): self.root = None def zig(self, p): x = p.le...
# noqa: F408, F401 import pytest from opennem.settings.schema import OpennemSettings def test_opennem_imports() -> None: try: import opennem hasattr(opennem, "core") except Exception: pytest.fail("Could not import main module") def test_opennem_version() -> None: import opennem...
__author__ = "alvaro barbeira" import logging import pandas import numpy from . import SummaryInputation from ..data_management import TextFileTools from ..file_formats import Parquet from ..file_formats.gwas import Utilities as GWASUtilities from ..individual_data.Utilities import StudyBasedContext from ..miscellane...
# """ # Special cases tests for ceil. # # These tests are generated from the special cases listed in the spec. # # NOTE: This file is generated automatically by the generate_stubs.py script. Do # not modify it directly. # """ # # from ..array_helpers import NaN, assert_exactly_equal, exactly_equal, infinity, isintegral...
#!/usr/bin/env python # Filename: get_intersection """ introduction: get intersection polygons authors: Huang Lingcao email:huanglingcao@gmail.com add time: 1 March, 2019 """ import os,sys from optparse import OptionParser HOME = os.path.expanduser('~') # path of DeeplabforRS codes_dir2 = HOME + '/codes/PycharmProj...
import torch import torch.nn as nn from torch.autograd import Variable from torch.nn import Embedding, LSTM class LSTMClassifier(nn.Module): def __init__(self, output_size, hidden_size, layers_num, bidirectional, vocab_size, dropout, embedding_length, weights): super(LSTMClassifier, self)...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('harvest', '0009_auto_20160219_1402'), ] operations = [ migrations.AlterField( m...
import glob import numpy as np from os.path import basename, isdir, isfile from PIL import Image from osm import OSMinterface class PatchFinder: def __init__(self, osm_dir, image=None): self.image = image if isdir(osm_dir): if osm_dir[-1] == "/": self.osm_dir = osm_dir ...
""" Predicting Equity Index Returns using Machine Learning Methods - Data Preparation File """ #%% #-------------------------------------------------- #* Load Data import pickle import pandas as pd import os from pandas.tseries.offsets import MonthEnd # To Determine the End of the Corresponding Month dir = os.getcwd()...
# Copyright 2020, Schuberg Philis B.V # # 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 ...
from .clustergram import Clustergram
import json from typing import Dict, List, Optional, Set, Union import justobjects as jo @jo.data(typed=True) class Troll: weight: Union[int, float] sex: str = "male" @jo.data(typed=True) class Droll: style: Optional[int] = 12 trolls: Optional[Set[Troll]] = set() @jo.data(typed=True) class Sphinx...
from person import Person from enrolled import Enroll class Student(Person): #student inherits from person def __init__(self, first, last, dob, phone, address, international=False): super().__init__(self, first, last, dob, phone, address) self.international = international self.enrolled = ...
# Generated by Django 2.2.16 on 2022-01-20 05:58 from django.db import migrations, models import uuid class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Deployment', fields=[ ('uuid',...
''' Explore the statistics of dataset and Preprocess the dataset ''' import time import sys import numpy as np import pandas as pd from sklearn.cross_validation import train_test_split, KFold import multiprocessing ################################################################################################### # ...
class F1: def show(self): print(" messege from class F1") class F2(F1): def disp(self): print("Messege from F2") k = F1() k.show() p = F2() p.show() p.disp()
import logging from flask import redirect from flask import url_for from structlog import wrap_logger from console import __version__ from console import app from console import settings logger = wrap_logger(logging.getLogger(__name__)) @app.route('/') def localhost_to_submit(): return redirect(url_for('submit...
import os import smtplib #instead of providing email adress and password in python program #We are passing these credential using sytem environment variables for security purpose EMAIL_ADDRESS = '' #it will get value of system environment variables named "EMAIL_USER" EMAIL_PASSWORD = '' #it will get value of ...
class Solution: def maxProfit(self, prices: List[int]) -> int: n = len(prices) if n <=1: return 0 min_buy = prices[0] dp_left, dp_right = [0]*n, [0]*n for i in range(1,n): min_buy = min(min_buy, prices[i]) dp_left[i] = max(dp_left[i-1], prices[i] - min...
nome = str(input('Digite seu nome completo: ')).strip() print('Analisando seu nome...') print('Seu nome em maiscรบlas รฉ ', nome.upper()) print('Seu nome em minรบsculas รฉ ', nome.lower()) print('Seu nome tem ao todo {} letras'.format(len(nome.replace(' ', '')))) dividido = nome.split() print('Seu primeiro nome รฉ {} ...
from Models.Pair import Pair from selenium import webdriver from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions a...
r""" Given a binary search tree, rearrange the tree in in-order so that the leftmost node in the tree is now the root of the tree, and every node has no left child and only 1 right child. Example 1: Input: [5,3,6,2,4,null,8,1,null,null,null,7,9] 5 / \ 3 6 / \ \ 2 4 8 ...
from swag_client.migrations.versions import v2 def run_migration(data, version_start, version_end): """Runs migration against a data set.""" items = [] if version_start == 1 and version_end == 2: for item in data['accounts']: items.append(v2.upgrade(item)) if version_start == 2 an...
from django.db import models import datetime as dt from cloudinary.models import CloudinaryField from django.contrib.auth.models import User from django.urls import reverse from django.db.models.signals import post_save # Create your models here. class FlashCards(models.Model): title = models.CharField(max_leng...
# Load in our dependencies from unittest import TestCase import httpretty import requests import httpretty_fixtures # Set up multiple fixture managers class FakeServer(httpretty_fixtures.FixtureManager): @httpretty_fixtures.get('http://localhost:9000/') def hello(self, request, uri, res_headers): re...
from setuptools import setup, find_packages setup( name = "ci-metric-push", version = "0.1", packages = find_packages(), scripts = ['pushci'], install_requires = [ 'librato-metrics==0.4.11', 'docopt==0.6.2', 'PyYAML==3.11', 'coloredlogs==0.5', ], author = "...
# Generated by Django 2.0.2 on 2020-08-17 02:47 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('services', '0001_initial'), ] operations = [ migrations.AlterModelOptions( name='services', options={'ordering': ['-...
def normalize_RTL(src: str): """ check if a string contains any non-english letters, and if so, return it appended by itself backwards This is so it would be easy to read hebrew titles """ if not src.isascii(): return src + ' (' + src[::-1] + ')' return src _safe_chars = frozenset(" ._...
#!/usr/bin/env python3 from setuptools import setup with open('README.md') as readme_file: readme = readme_file.read() setup(name='stringcontext', version='1.0.0', description='Get the context around an index location in a string', long_description=readme, long_description_content_type='te...
#!/usr/bin/env python3 import sys import os PROJECT_TITLE = "PoliRural: Contributions" BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) def rel(*x): return os.path.join(BASE_DIR, *x) # Ensure loggind directory. LOG_DIR_NAME = 'log' LOG_DIR = rel(LOG_DIR_NAME) if not os.path.exists(LOG_D...
""" Application settings """ from .config.db import db from .config.flask import Config from .router import *
from boa.blockchain.vm.Neo.Runtime import Notify from pkg.models.storage import Storage class Counter(): KEY = 'counter' def get(self) -> int: Notify('Counter.get triggered.') storage = Storage() result = storage.get(self.KEY) if (result == None): return 0 ...
from pyDS.stack import Stack import unittest class TestStack(unittest.TestCase): def setUp(self): self.stack = Stack() def test_empty_stack(self): self.assertTrue(self.stack.isEmpty()) def test_stack_push(self): self.stack.push(2) self.assertEqual(self.stack._items, [2])...
from django.conf.urls import url from . import views from django.conf import settings from django.conf.urls.static import static urlpatterns = [ url(r'^$', views.index, name='home'), url(r'^user/(?P<username>\w+)', views.profile, name='profile'), url(r'^upload/$', views.upload_image, name='upload_image'), ...
import os import logging import json from zinc.models import ZincIndex, ZincManifest, ZincFlavorSpec from zinc.catalog import ZincCatalogPathHelper from zinc.defaults import defaults from zinc.catalog import ZincCatalog from zinc.storages import StorageBackend from zinc.client import connect, create_bundle_version i...
import os import re import csv def convert_directory_to_csv(directory, polarity, out_file_path): data = {} data["sentence"] = [] data["sentiment"] = [] with open(out_file_path, "a") as csvfile: writer = csv.writer(csvfile) for file_path in os.listdir(directory): with open(...
from django import forms from .models import ShopOrder class ShopOrderForm(forms.ModelForm): class Meta: model = ShopOrder fields = ('full_name', 'email_address', 'phone_number', 'address_line1', 'address_line2', 'town_or_city', 'county_or_region', 'postcode', '...
import django from django.core.management import call_command from django.test import TestCase from mock import patch class MigrationTests(TestCase): def test_no_migrations_created(self): with patch('sys.exit') as exit_mocked: if django.VERSION < (1, 10): # django < 1.10 uses ...
from unittest import mock from assertpy import assert_that from django.conf import settings from snapshottest.django import TestCase from opening_hours.enums import ResourceType from opening_hours.resources import ( Resource, send_resource_to_hauki, update_hauki_resource, ) class SendResourceToHaukiTest...
#!/bin/python3 def surfaceArea(A): # The function is expected to return an INTEGER. # The function accepts 2D_INTEGER_ARRAY A as parameter. area = 0 height = len(A) width = len(A[0]) # Step 1. Top and bottom area += sum(2 for row in A for n in row if n > 0) # Step 2. For each level, ...
# Copyright (c) 2012-2018 SoftBank Robotics. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the COPYING file. """ Extract a binary toolchain package """ # FIXME: deal with the cyclic-import in a dedicated issue # pylint: disable=cyclic-import import os from ...
# -*- coding: utf-8 -*- from sopel import module from sopel.module import commands import random import re @commands("ping") def normal_ping(bot, trigger): bot.say("Pong!") @commands("pong") def normal_pong(bot, trigger): bot.say("Ping!") @commands("linel") def normal_linel(bot, trigger): bot.say("Es...
from django.urls import path from .views import home, blog, post, search app_name = "blog" urlpatterns = [ path("", home, name="home"), path("blog/", blog, name="blog"), path("post/<int:id>/", post, name="post"), path("search/", search, name="search") ]
pge_events = [ '2017-06-16', '2017-06-19', '2017-06-20', '2017-06-22', '2017-06-23', '2017-07-07', '2017-07-27', '2017-07-31', '2017-08-01', '2017-08-02', '2017-08-28', '2017-08-29', '2017-08-31', '2017-09-01', '2017-09-02', '2017-06-19', '2017-06-20', '2017-07-06', '2017-07-07', '2017-07-27', '2017...
"""This module is responsible for conversion of the videos to frame by frame format.""" import logging from pathlib import Path from typing import Any, Dict, List, Union import imageio import numpy as np import pandas as pd import tqdm # This hotfix is added since imageio checks compability by file extension name ins...
# Copyright 2021 Katteli Inc. # TestFlows.com Open-Source Software Testing Framework (http://testflows.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/lice...
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc from google.ads.google_ads.v6.proto.resources import account_budget_proposal_pb2 as google_dot_ads_dot_googleads_dot_v6_dot_resources_dot_account__budget__propos...
from tornado.test.httpclient_test import HTTPClientCommonTestCase try: import pycurl except ImportError: pycurl = None if pycurl is not None: from tornado.curl_httpclient import CurlAsyncHTTPClient class CurlHTTPClientCommonTestCase(HTTPClientCommonTestCase): def get_http_client(self): return...
import contextlib import os from fontTools import ttLib from google.apputils import app from util import google_fonts as fonts def _LoadGlyf(font, char, name, problems): """Loads a glyf and expands (populates fields) it. Args: font: A TTFont. char: int id of char, e.g. ord('C'). name: name to use...
import json from unittest.mock import patch import pytest import tornado from jupyterlab_git.handlers import NAMESPACE from .testutils import assert_http_error, maybe_future @patch("jupyterlab_git.git.execute") async def test_git_add_remote_success_no_name(mock_execute, jp_fetch, jp_root_dir): # Given loca...
"""empty message Revision ID: 9aab99cbf5c8 Revises: 97be1663d11c Create Date: 2020-10-07 23:59:37.393430 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "9aab99cbf5c8" down_revision = "97be1663d11c" branch_labels = None depends_on = None def upgrade(): # ...
import boto3 import os import json def get_key_from_ddb(key): ddb = boto3.client('dynamodb') response = ddb.get_item( TableName = 'alert-log', Key = { 'message-id': { 'S': key } } ) return response def put_item_on_ddb(key, ...
from datetime import datetime from typing import Any, Callable, Dict, List, Optional import numpy as np import pandas as pd import pyarrow as pa from pandas.api.types import is_object_dtype from slide.exceptions import SlideInvalidOperation from slide.utils import SlideUtils from triad.utils.assertion import assert_or...
# -*- coding:utf-8 -*- # author๏ผšAnson # @Time : 2020/9/21 14:40 # @File : settings.py from __future__ import unicode_literals from kafka import KafkaConsumer from conf.settings import SERVER_IP, TOPIC, AUTO_OFFSET_RESET, CONSUMER_GROUP, API_VERSION class KafkaConsumerModule(object): def __init__(self, boo...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making ่“้ฒธๆ™บไบ‘PaaSๅนณๅฐ็คพๅŒบ็‰ˆ (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in co...
# --------------------------------------------------------------------- # Linux.Debian.get_capabilities # --------------------------------------------------------------------- # Copyright (C) 2007-2018 The NOC Project # See LICENSE for details # --------------------------------------------------------------------- # N...
import sys import code from godot import exposed, export from godot import * from .plugin import BASE_RES FONT = ResourceLoader.load(f"{BASE_RES}/hack_regular.tres") @exposed(tool=True) class PythonREPL(VBoxContainer): def _enter_tree(self): self.history = [] self.selected_history = 0 s...
from django.db import models from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, PermissionsMixin # User Manager class UserManager(BaseUserManager): def create_user(self, username, email, password=None, **kwargs): """Create and return a `User` with an email, phone number, username a...
from corehq.apps.groups.models import Group from corehq.apps.reports.daterange import get_simple_dateranges from dimagi.ext.couchdbkit import * from dimagi.utils.decorators.memoized import memoized DAILY = "daily" WEEKLY = "weekly" MONTHLY = "monthly" DEFAULT_HOUR = 8 DEFAULT_WEEK_DAY = 1 DEFAULT_MONTH_DAY = 1 SCHE...
from django.contrib.auth.models import User from django.core.validators import MinValueValidator from django.db import models from django.db.models import Sum from contest.models import Contest class Language(models.Model): id = models.AutoField(primary_key=True) name = models.CharField(max_length=20) ju...
import argparse import os from . import transition_analysis_utils as tau from . import vtk_output_utils as vtk_out def main(): parser = argparse.ArgumentParser() parser.add_argument("input_dir", type=str, help="The directory containing the input cube files for t...
#!/usr/bin/env python import os import bed import sys import argparse parser = argparse.ArgumentParser(description='slice bed based on the score order') parser.add_argument('-i', required= True, help='<Required> input') parser.add_argument('-n', required= False, default=4, type=int, help='total n pieces (default: 4)')...
#!/usr/bin/env python # coding: utf-8 import pandas as pd import json import re import random import argparse import os def main() -> None: """Entrypoint of Program Run as Module""" ... def read_args(): parser = argparse.ArgumentParser() parser.add_argument( "node_col_name_1", type=str, help="column...
"""Tests for trap tube environments.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import unittest from absl.testing import absltest from absl.testing import parameterized from gym_tool_use import trap_tube_env uu = trap_tube_en...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2020 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 requi...
import logging import sys _formatter = logging.Formatter(fmt="[%(asctime)s] [%(process)d] [%(levelname)s] [%(pathname)s:%(lineno)d]: %(message)s") _ch = logging.StreamHandler(sys.stdout) _ch.setLevel(logging.DEBUG) _ch.setFormatter(_formatter) # _fh = logging.FileHandler("mylog.log", "w") # _fh.setLevel(logging.DEBUG...
__author__ = 'mangalbhaskar' __version__ = '1.0' """ Generic Annotation Dataset Parser ------------------------------------------------------------ Copyright (c) 2020 mangalbhaskar Licensed under [see LICENSE for details] Written by mangalbhaskar ------------------------------------------------------------ """ import ...
#!/usr/bin/env python import sys from rtfparse import version from rtfparse import entry def rtfparse(): sys.exit(entry.cli_start(version.version)) if __name__ == "__main__": rtfparse()
#!/usr/local/bin/python3 from whiptail import Whiptail import requests import json endpoint = "http://YOURIP/api/" hass = { "Authorization": "Bearer YOURTOKEN", "Content-Type": "application/json" } devices = { 'NAME1': ['DEVICEID','light',3], 'NAME2': ['DEVICEID','light',3], 'NAME3': ['DE...
# -*- coding: utf-8 -*- # @Author: ไฝ•็ฟ # @Create Date: 2019-01-16 15:49:20 # @Last Modified by: ไฝ•็ฟ # @Last Modified time: 2019-01-16 15:53:13 class Solution: def twoSum(self, numbers, target): """ :type numbers: List[int] :type target: int :rtype: List[int] ...
from django.conf import settings from django.db import models import pyotp class UserPSK(models.Model): """Strores custom secret key per user""" user = models.OneToOneField(settings.AUTH_USER_MODEL, related_name='psk', on_delete=models.CASCADE) secret_key = models.CharField(max_length=16, default=pyotp.r...