text
stringlengths
2
999k
# Copyright 2021 Sony Semiconductors Israel, 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 b...
#! /usr/bin/env python # encoding: utf-8 # XCode 3/XCode 4/XCode 6/Xcode 7 generator for Waf # Based on work by Nicolas Mercier 2011 # Extended by Simon Warg 2015, https://github.com/mimon # XCode project file format based on http://www.monobjc.net/xcode-project-file-format.html """ Usage: See also demos/xcode6/ fold...
# # 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...
''' Client Side code ''' from socket import AF_INET, socket, SOCK_STREAM from threading import Thread import Tkinter as tkinter def receive(): """Handles receiving of messages.""" while True: try: msg = client_socket.recv(BUFSIZ).decode("utf8") msg_list.insert(tkinter.END, msg...
#!/usr/bin/env python # Copyright 2021 Broadcom. All Rights Reserved. ########################################################################################## # # 09_show_users.py - retrieve and show all users for the target Jira instance # ###########################################################################...
""" Do not put secrets in this file. This file is public. For staging environment (Using Dokku) """ import os from server.settings._base import Config as BaseConfig, initialize_config from server.settings._prodbase import Config as ProdBaseConfig @initialize_config class Config(ProdBaseConfig, BaseConfig): EN...
# generated from catkin/cmake/template/pkg.context.pc.in CATKIN_PACKAGE_PREFIX = "" PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/f1tenth2/f110_ws/devel/include".split(';') if "/home/f1tenth2/f110_ws/devel/include" != "" else [] PROJECT_CATKIN_DEPENDS = "std_msgs;message_runtime".replace(';', ' ') PKG_CONFIG_LIBRARIES_WITH_...
import pytest from thefrick.rules.apt_get_search import get_new_command, match from thefrick.types import Command def test_match(): assert match(Command('apt-get search foo', '')) @pytest.mark.parametrize('command', [ Command('apt-cache search foo', ''), Command('aptitude search foo', ''), Command('...
from typing import Optional, List from fastapi import APIRouter from app.schemas.UserActivityResponse import UserActivityResponse from app.utils.request_validators import valid_limit, valid_offset router = APIRouter() @router.get("") async def get_user_activities(limit: Optional[int] = 4, offset: Optional[int] = 0...
import lvgl as lv def row_gap_anim(obj, v): obj.set_style_pad_row(v, 0) def column_gap_anim(obj, v): obj.set_style_pad_column(v, 0) # # Demonstrate column and row gap # # 60x60 cells col_dsc = [60, 60, 60, lv.GRID_TEMPLATE.LAST] row_dsc = [40, 40, 40, lv.GRID_TEMPLATE.LAST] # Create a container with grid c...
# 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 # distributed under t...
from Tkinter import * from Cantera import * from SpeciesInfo import SpeciesInfo #from KineticsFrame import KineticsFrame _CUTOFF = 1.e-15 _ATOL = 1.e-15 _RTOL = 1.e-7 class CompFrame(Frame): def __init__(self,master): Frame.__init__(self,master) self.config(relief=FLAT, bd=4) self.top = self.mas...
# Copyright (c) OpenMMLab. All rights reserved. import argparse import copy import os import os.path as osp import time import warnings import mmcv import torch import torch.distributed as dist from mmcv.cnn.utils import revert_sync_batchnorm from mmcv.runner import get_dist_info, init_dist from mmcv.utils import Conf...
from whatthefood.train import Minimizer class SGD(Minimizer): def __init__(self, model, loss, lr=0.1, regularization=None): super(SGD, self).__init__(model, loss, regularization) self.lr = lr def _run(self, grads, lr_decay=1., *args, **kwargs): for v, g in zip(self.vars, grads): ...
# Solution def part1(data): stack = [] meta_sum = 0 gen = input_gen(data) for x in gen: if x != 0 or len(stack) % 2 == 1: stack.append(x) continue m = next(gen) while m > 0 or len(stack) > 0: for _ in range(m): meta_sum += next(...
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
#----------------------------------------------------------------------------- # Title : PyRogue base module - Device Class #----------------------------------------------------------------------------- # This file is part of the rogue software platform. It is subject to # the license terms in the LICENSE.txt file...
from django.shortcuts import render from rest_framework.exceptions import NotFound , PermissionDenied from rest_framework import mixins, generics , status , viewsets from rest_framework.response import Response from rest_framework.views import APIView from .models import Notification , NotificationUser from .serialize...
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
from typing import Union from pathlib import Path import cv2 import numpy as np from PIL import Image from _griffig import BoxData, Gripper, Pointcloud, Renderer, RobotPose from .action.checker import Checker from .action.converter import Converter from .infer.inference import Inference from .infer.selection import M...
from django.conf import settings from django.conf.urls import url from django.contrib.auth.views import (LogoutView, PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView) from waffle.decorators import waffle_switch from .views.api_profile i...
#!/usr/bin/env python '''Script to extract average distances from AMETHST output and produce simple table, outputs to std out''' import sys, os from scipy import stats import numpy as np from optparse import OptionParser import re if __name__ == '__main__': usage = "usage: %prog -i <input sequence file>" pars...
from flask import Blueprint, request, url_for, render_template, redirect, flash from flask_security import current_user, login_required from sqlalchemy.sql.expression import func import hashlib from classes.shared import db from classes import settings from classes import RecordedVideo from classes import subscription...
import FWCore.ParameterSet.Config as cms phase2_squarePixels = cms.Modifier()
# This code is part of Qiskit. # # (C) Copyright IBM 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
from urllib.parse import urlencode from django.conf import settings from django.contrib.auth.models import AnonymousUser from django.db.models import F from ...cart.utils import ( get_cart_from_request, get_or_create_cart_from_request) from ...core.utils import get_paginator_items from ...core.utils.filters impor...
import json from django.http import HttpResponse from django.utils.encoding import smart_str NOT_FOUND_RESPONSE = "NotFound" def jsonify_request(response): """ Turn any response in a 200 response to let jQuery code handle it nicely. Response contains a json object with the following attributes: ...
class ScenarioError(Exception): exit_code = 20 class ScenarioTxError(ScenarioError): exit_code = 21 class TokenRegistrationError(ScenarioTxError): exit_code = 22 class TokenNetworkDiscoveryTimeout(TokenRegistrationError): """If we waited a set time for the token network to be discovered, but it wa...
"""Created on June 18th 2018 @author: franco_i """ from numpy import exp def _comp_point_coordinate(self): """Compute the point coordinates needed to plot the Slot. Parameters ---------- self : SlotW24 A SlotW24 object Returns ------- point_list: list A list of 4 PointS...
#!/usr/bin/env python import sys, rospy from pimouse_ros.msg import LightSensorValues def get_freq(): f = rospy.get_param('lightsensors_freq', 10) try: if f<= 0.0: raise Exception() except: rospy.logerr("value error: lightsensors_freq") sys.exit(1) return f if __name__ == '__main__': devfile = '/dev/rtl...
print "Hello, world" print "Who are you?" print "I'm Bomin" print "Why are you here?" print "HAHA." print True print False print 16 print 16.89999999999 print "Bomin Keum" print ("Keum", "Bomin", "16", "Korean") print "NOT AN ERROR"
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from . import _utilities...
from copy import deepcopy def floyd_warshall(g): """Return a new graph that is the transitive closure of g.""" closure = deepcopy(g) # imported from copy module verts = list(closure.vertices()) # make indexable list n = len(verts) for k in range(n): for i in range(n): ...
# Software License Agreement (BSD License) # # Copyright (c) 2010, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above...
from __future__ import division import os import numpy as np from fileReader import readImage from fileReader import readTextFile optimalFolder = "Optimal_Segmentation_Files" # you may have to specify the complete path studentFolder = "Student_Segmentation_Files" # you may have to specify the complete path colorValueS...
# -*- coding: utf-8 -*- """ Declare this directory a package so that 'python setup.py test' finds the unittests here. """
#!/usr/bin/env python3 # Copyright (c) 2014-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test fee estimation code.""" from test_framework.test_framework import enzoTestFramework from test_fra...
#!/usr/bin/env python3 """Converts a statically-linked HAT package into a Dynamically-linked HAT package HAT packages come in two varieties: statically-linked and dynamically-linked. A statically-linked HAT package contains a binary file with the extension '.o', '.obj', '.a', or `.lib`. A dynamically-linked HAT packag...
""" Copyright (C) 2018-2020 Intel 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 or agreed to i...
import os import sys import pytest from montreal_forced_aligner.command_line.mfa import parser from montreal_forced_aligner.command_line.train_lm import run_train_lm def test_train_lm(basic_corpus_dir, temp_dir, generated_dir, basic_train_lm_config_path): if sys.platform == "win32": pytest.skip("LM trai...
"""FUSE driver for Arvados Keep Architecture: There is one `Operations` object per mount point. It is the entry point for all read and write requests from the llfuse module. The operations object owns an `Inodes` object. The inodes object stores the mapping from numeric inode (used throughout the file system API t...
#!/usr/bin/env python from __future__ import with_statement import sys import os import argparse def read_params(args): parser = argparse.ArgumentParser(description='Convert LEfSe output to ' 'Circlader input') parser.add_argument( 'inp_f', metavar='INPUT_FILE', nargs='?', ...
import argparse, sys from apscale import a_create_project, b_pe_merging, c_primer_trimming, d_quality_filtering, e_dereplication_pooling, f_otu_clustering, g_denoising, h_lulu_filtering ## main function for the command line interface def main(): ## initialize the parse and display default behavior if called withou...
import speech_recognition as sr r = sr.Recognizer() sample = sr.AudioFile('02_voice_test.wav') with sample as source: audio = r.record(source) print(type(audio)) print(r.recognize_google(audio))
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
# Suitcase subpackages should follow strict naming and interface conventions. # The public API must include Serializer and should include export if it is # intended to be user-facing. They should accept the parameters sketched here, # but may also accpet additional required or optional keyword arguments, as # needed. i...
from .imgurdownloader import ImgurDownloader # NOQA # defining __version__ variable is pointless __author__ = 'Alex Gisby <alex@solution10.com>' __all__ = []
from django.apps import AppConfig class Gcal2ClickupConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'gcal2clickup'
from abc import ABC, abstractmethod from sentimentalmarket.trading_data import TradingData from sentimentalmarket.notification import notify class IStrategy(ABC): @abstractmethod def when_to_buy(self, trading_data: TradingData, user_config) -> [bool, str]: pass @abstractmethod def whe...
import math n1= float(input('Digite um numero: ')) print ('O numero real {} tem sua aporção inteira igual a {}'.format(n1,math.floor(n1)))
# -*- coding: utf-8 -*- import threading import pexpect from pexpect import TIMEOUT class Player(object): KEY_SPACE = ' ' KEY_UP = '\x1b[A' KEY_DOWN = '\x1b[B' KEY_RIGHT = '\x1b[C' KEY_LEFT = '\x1b[D' def __init__(self, library): self._library = library self.track = None ...
from typing import List import xlrd from xlrd.sheet import Sheet def get_column_values(sheet: Sheet, column_name: str) -> List: column_index = _find_column_index(sheet, column_name) if column_index == -1: raise Exception(f"Sheet does not contain column {column_name}") values = [] for i in ...
#!/usr/bin/env python """ An alternative, more direct implementation of event handling using cffi calls to SDL functions. The current code is incomplete, but can be extended easily by following the official SDL documentation. This module be run directly like any other event get example, but is meant ...
# Copyright (c) 2021 Open Risk (https://www.openriskmanagement.com) # # 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, co...
#!usr/bin/env python3.7 #-*-coding:utf-8-*- import discord class DatabaseException(Exception): pass class NoChannelFoundException(DatabaseException): def __init__(self,channel: discord.TextChannel): super() self.channel = channel class NoEntryFoundException(DatabaseException): def __init...
import matplotlib.pyplot as pl import numpy as np import torch import torch.nn as nn from torch.autograd import Variable import pyro import pyro.distributions as dist from pyro.contrib.autoguide import AutoDelta from pyro import poutine from pyro.infer import SVI from pyro.infer import TraceEnum_ELBO, config_enumerate ...
from mtrandom import MTRandom import random def check(seed): r = MTRandom(seed) s = random.Random(seed) assert r.getstate() == s.getstate()[1] for i in range(313): assert r.random() == s.random() for i in range(1, 64): assert r.getrandbits(i) == s.getrandbits(i) pri...
#!/usr/bin/python import xml.sax as sax import xml.sax.handler as handler from optparse import OptionParser import sys import pprint import re import codecs import os import MySQLdb import traceback from my_radio_module import normalize from artist import ParaHandler class Album: def __init__(self, artist=...
class Solution: def removeSubfolders(self, folder: List[str]) -> List[str]: """String. """ folder.sort() res = [folder[0]] f = folder[0] for i in range(1, len(folder)): if folder[i][:len(f)] != f or folder[i][len(f)] != '/': res.append(folder[i])...
__author__ = 'patras' from domain_springDoor import * from timer import DURATION from state import state, rv DURATION.TIME = { 'unlatch1': 5, 'unlatch2': 5, 'holdDoor': 2, 'passDoor': 3, 'releaseDoor': 2, 'closeDoors': 3, 'move': 7, 'take': 2, 'put': 2, } DURATION.COUNTER = { ...
#!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os import sys def main(): os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'profileapi.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: raise Imp...
class Man: def __init__(self, name): self.name = name print("Initialized!") def hello(self): print("Hello " + self.name + "!") def goodbye(self): print("Good-bye " + self.name + "!") m = Man("David") m.hello() m.goodbye()
# Generated by Django 3.2.7 on 2021-10-14 22:10 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('user_requests', 'add_size_rules'), ] operations = [ migrations.AlterField( model_name='usersizerule', name='id', ...
#!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os import sys def main(): os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'flipkart.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: raise Impor...
# 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 SblimSfcc(AutotoolsPackage): """Small Footprint CIM Client Library""" homepage = "htt...
# coding=utf-8 from config import * import json import pandas as pd import numpy as np import multiprocessing as mp from functools import partial from graph_tool.all import * from ccig import * from sentence_score import * from sentence_pair_score import * from bm25 import * LANGUAGE = "Chinese" W2V_VOCAB = load_W2V_...
"""Utilities functions for query """ import json import os, sys try: from urllib.error import HTTPError from urllib.parse import quote, urlencode from urllib.request import urlopen except ImportError: from urllib import urlencode from urllib2 import quote, urlopen, HTTPError def _parse_prop(search, proplist): ...
import sys import json class Reject(Exception): pass def update(repository_path, ref_name, old_value, new_value): data = json.dumps({ "repository_path": repository_path, "ref_name": ref_name, "old_value": old_value, "new_value": new_value...
# Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
from phanterpwa.helpers import ( CONCATENATE ) text = CONCATENATE( "A new password was requested on {{app_name}}:", "\n\n", "{{password}}", "\n\n", "If you have not made this request, you do not have to do anything.", )
import numpy as np import os from tqdm import tqdm class ReadData: """ A MODULO helper class for input data. ReadData allows to load the data directly before using MODULO, and hence assemblying the data matrix D from data, if needed. """ def __init__(self): pass @classmethod d...
from __future__ import annotations from .types import * from typing import Optional from zipfile import ZipFile import sys deviceManager: DeviceManager = None systemManager: SystemManager = None mediaManager: MediaManager = None zip: ZipFile = None remote: Any = None _print = print def print(*values: object, sep: Op...
import cv2 import sys from pathlib import Path sys.path.append(str(Path("..").absolute().parent)) from misc.functions import functions x = 0 y = 0 w = 0 h = 0 count = 0 cascade_classifier = cv2.CascadeClassifier("cascade.xml") frame = cv2.imread("images/ref-pic.jpeg") h_f, w_f, c_f = frame.shape h_f = int(h_f -...
import smtplib import ssl from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart sender_email = '' # enter the Gmail id of sender reciever_email = '' # enter reciever's email id password = input('Enter passsword: ') message = MIMEMultipart('alternative') message['Subject'] = 'Multipart T...
# Copyright 2020 The Cirq Developers # # 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 ...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
# Copyright 2016 Andreas Florath (andreas@florath.net) # # 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...
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: app_health_config.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 as _message from google.pr...
import os import open3d as o3d import numpy as np if __name__ == '__main__': data_path = os.path.abspath("../data/bunny_normalized.ply") cloud_ply = o3d.io.read_point_cloud(data_path) # Read the point cloud print(cloud_ply) print(np.asarray(cloud_ply.points)) o3d.visualization.draw_geometries([clou...
from re import I, T, match import numpy as np from numpy import ma # from torch._C import float32 from modelmanager import ModelManager import numpy as np import torch import pickle from queue import Queue from tqdm import tqdm import PVRCNN.utils.common_utils import PVRCNN.ops.roiaware_pool3d.roiaware_pool3d_utils imp...
# Generated by Django 2.2.2 on 2020-05-16 22:22 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('results', '0002_auto_20200516_2220'), ] operations = [ migrations.RenameField( model_name='grad...
class Solution(object): def myAtoi(self, str): i = 0 num = 0 flag = 0 while i < len(str) and (str[i] < '0' or str[i] > '9'): if str[i] == '-': flag = 1 i += 1 break elif str[i] == '+': i += 1 ...
"""mysite URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Sep 09 12:11:30 2021 @author: Bernardo Carvalho """ import sys import numpy as np import MySQLdb if len(sys.argv) > 1: filename = str(sys.argv[1]) else: filename = 'dados/BIODBR_20220315-163306.csv' if len(sys.argv) > 2: desc = str(sys.arg...
import io import json import aiohttp import discord import yaml from discord.ext import commands from z3rsramr import parse_sram import pyz3r from alttprbot.alttprgen.mystery import (generate_random_game, generate_test_game) from alttprbot.alttprgen.preset import g...
from django.db import models from django.core.urlresolvers import reverse class Deal(models.Model): id = models.AutoField(primary_key=True) qtd = models.CharField(max_length=3) deal_item = models.ForeignKey('Item', on_delete=models.CASCADE) COMPRA = 'Compra' VENDA = 'Venda' DEAL_TYPE_CHOICES = ...
import os import configparser from boto3.session import Session from fastapi.responses import FileResponse from fastapi import APIRouter,File, UploadFile,Request,Depends from pydantic import BaseModel import json from sqlalchemy import and_ from pydantic.types import FilePath from sqlalchemy.sql.elements import Null f...
''' A Bioinformatics pipeline based on Ruffus. Author: Bernie Pope (bjpope@unimelb.edu.au). Copyright: 2015 See ../README.md for details about how to use the program. Repository: https://github.com/bjpop/complexo_pipeline ''' from __future__ import print_function from ruffus import * import ruffus.cmdline as cmdli...
from __future__ import annotations from ..typecheck import * from ..import core from ..import ui from ..dap import types as dap from .data_breakpoints import DataBreakpoints, DataBreakpoint from .function_breakpoints import FunctionBreakpoints, FunctionBreakpoint from .source_breakpoints import SourceBreakpoints, Sou...
""" Utilities for packing values into bitstrings. Small extension of the struct module. """ from builtins import range, bytes import struct import numpy as np from . import funcargparse struct_descriptors={("i",1):"b",("i",2):"h",("i",4):"i",("i",8):"q", ("u",1):"B",("u",2):"H",("u",4):"I",("u",8):...
#! /usr/local/bin/python # NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is # intentionally NOT "/usr/bin/env python". On many systems # (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI # scripts, and /usr/local/bin is the default directory where Python is # installed, so /usr/bin/env w...
try: import vim import subprocess current_dir = vim.eval("expand('<sfile>:p:h')") subprocess.Popen(["C:\Program Files (x86)\GitExtensions\GitExtensions.exe", "commit", current_dir]) print ("Opening GitExtensions commit window in " + current_dir) except ImportError: print ("Shell not installed...
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test block processing. This reimplements tests from the bitcoinj/FullBlockTestGenerator used by the pu...
# Time: O(n + c^2) # Space: O(c) # The best theory solution (DP, O(n + c^2)) could be seen here: # https://leetcode.com/discuss/64344/theory-matters-from-backtracking-128ms-to-dp-0m class Solution(object): def canWin(self, s): g, g_final = [0], 0 for p in itertools.imap(len, re.split('-+', s)): ...
import logging.config import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ # SEC...
# -*- coding: utf-8 -*- # # python_exameple documentation build configuration file, created by # sphinx-quickstart on Fri Feb 26 00:29:33 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated fil...
import os from flask import Flask, jsonify # The Application Factory def create_app(test_config=None): """Create and configure the Flask webapp""" # Configurations, registrations, and other setup the application needs # implemented inside this function, then the application will be returned. app = Fl...
import json import utils path = '/Users/gustavoarango/Documents/projects/ARGdb/db/' metadata = json.load(open(path+'metadata_with_multilabels.json')) clusters = json.load(open(path+'CLUSTERS.csv.json')) alignments = json.load(open(path+'alignment.tsv.json')) iden = 90 DB={} for cluster in clusters: cluster_st...
# coding: utf-8 import shutil from mock import patch from filebrowser.settings import VERSIONS from tests import FilebrowserTestCase as TestCase from filebrowser.namers import OptionsNamer class BaseNamerTests(TestCase): NAMER_CLASS = OptionsNamer def setUp(self): super(BaseNamerTests, self).setU...
""" Django settings for lammas project. Generated by 'django-admin startproject' using Django 3.0.8. For more information on this file, see https://docs.djangoproject.com/en/3.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.0/ref/settings/ """ import os imp...