src
stringlengths
721
1.04M
# -*- coding: utf-8 -*- # Copyright (C) 2013 Michael Hogg # This file is part of bonemapy - See LICENSE.txt for information on usage and redistribution import numpy as np from abaqusConstants import C3D4, C3D4H, C3D10, C3D10H, C3D10I, C3D10M, C3D10MH # ~~~~~~~~~~ class elementC3D4(): def __init__(self): ...
# Copyright (C) 2013 Google Inc. # 2017 ycmd contributors # # This file is part of ycmd. # # ycmd is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your op...
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
# Copyright 2021 The TensorFlow Ranking Authors. # # 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 ag...
__copyright__ = """ Copyright (C) 2005, Catalin Marinas <catalin.marinas@gmail.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be...
# param.py - default parameters for the jvplot package # Copyright (C) 2014 Jochen Voss <voss@seehuhn.de> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # ...
#!/usr/bin/python3 # @begin:license # # Copyright (c) 2015-2019, Benjamin Niemann <pink@odahoda.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at y...
# -*- coding: utf-8 -*- from django import forms from django.core import signing from django.core.signing import BadSignature from django.forms.models import ModelForm from django.template import RequestContext from django.utils.translation import ugettext from cms.models import CMSPlugin from .models import Text fro...
from FEMur import Element import sympy as sy import numpy as np import scipy as sc import matplotlib.pyplot as plt class Element1D(Element): 'Defines the Linear Elements with its nodes and shape functions' total_elements = 0 def __init__(self, node_table): Element.__init__(self) # Use methods def...
# -*- coding: utf-8 -*- from __future__ import absolute_import import pytest from sentry.grouping.fingerprinting import FingerprintingRules, InvalidFingerprintingConfig from tests.sentry.grouping import with_fingerprint_input def test_basic_parsing(insta_snapshot): rules = FingerprintingRules.from_config_stri...
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-12-28 04:48 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('wechat', '0009_auto_20161223_1920'), ] operations = [ migrations.RenameModel( ...
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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 witho...
# -*- coding: utf-8 -*- # name # sequence # direction # domain # dna_region import pipeline.constants as C import pipeline.primer_utils as putils class Primer: """Doc string here..""" Name = "Primer" def __init__(self,name,dir,domain,region,seq): self.name = name self.direction = dir ...
import time class ValFix(object): def getMap(self, s_graph, p_graph, _map, matrix, weights): self.__time = time.perf_counter() self.__cost, self.new_map = 0, dict() twins = {x: set(m.loc[lambda m_row: abs(m_row - c) < .0000001].index.tolist()) for x, m, c in ((x, matrix[x]...
import psycopg2 as pg import datetime as dt import threading import sets import socorro.lib.prioritize as socorro_pri import socorro.lib.psycopghelper as socorro_psy import socorro.database.postgresql as socorro_pg import socorro.lib.util as socorro_util """ Schema.py contains several utility functions and the code w...
# -*- coding: utf-8 -*- import os import csv import yaml """ Facades for accessing the configuration data. """ __author__ = 'Bernardo Martínez Garrido' __license__ = 'MIT' __status__ = 'Development' class _FileReader(object): """ Offers methods to read the data files. """ # Singleton control obje...
from copy import copy from random import randint from memory import ( FirstInFirstOutAlgorithm, TheOptimalAlgorithm, LastRecentlyUsedAlgorithm, ApproximalLastRecentlyUsedAlgorithm, RandomAlgorithm ) PAGE_SIZE = 100 FRAMES = 10 NUM_REQUESTS = 1000 def test(page_size, frames_size, num_requests, d...
# Copyright (C) 2016 Allen Li # # 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,...
""" Create item database. """ import logging import os import re import pydarkstar.logutils import pydarkstar.scrubbing.ffxiah import pydarkstar.itemlist import pydarkstar.options import pydarkstar.common class Options(pydarkstar.options.Options): """ Reads options from config file, then from command line. ...
# # @BEGIN LICENSE # # Psi4: an open-source quantum chemistry software package # # Copyright (c) 2007-2016 The Psi4 Developers. # # The copyrights for code used from other parties are included in # the corresponding files. # # This program is free software; you can redistribute it and/or modify # it under the terms of ...
# Copyright (C) 2010-2014 CEA/DEN, EDF R&D # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library ...
# By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, # we can see that the 6th prime is 13. # What is the 10001st prime number? # To-Do: Consider implementing the primality test implemented in GnuPG. # It works in three steps: # - The standard sieve algorithm using the primes up to 4999 # ...
import gzip import itertools from asml.network.registry import RegistryClient from asml.network.stream import StreamClient from asml.autogen.services.ttypes import ComponentType from asml.parser.factory import ParserFactory class FileStream: def __init__(self, module_properties): self._path = module_properties['...
# 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...
# uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: MultiCall.py """ MultiCall - a class which inherits its methods from a Tkinter widget (Text, for example), but enables multiple calls of functions pe...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
# Copyright (c) 2007-2008 The PyAMF Project. # See LICENSE for details. """ Gateway for the Django framework. This gateway allows you to expose functions in Django to AMF clients and servers. @see: U{Django homepage (external)<http://djangoproject.com>} @author: U{Arnar Birgisson<mailto:arnarbi@gmail.com>} @since:...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
#!/usr/bin/python #--------------------------------------------------------------------------------------------------- # Add a new dataset production request into the Bambu database. # # v1.0 Sep 19, 2014 #---------------------------------...
# vi: ts=4 expandtab # # Copyright (C) 2016 Canonical Ltd. # # Author: Ryan Harper <ryan.harper@canonical.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3, as # published by the Free Software Foundation. # # ...
from libs.graph.DLinkedList import Queue, DoubledLinkedList as List from libs.graph.PriorityQueue import PriorityQueueBinary as PriorityQueue from libs.graph.Tree import * #it is better to use a DoubledLinkedList to operate with a great efficiency on #the lists those will be used in the graph representation class Node...
from tenable_io.api.base import BaseApi from tenable_io.api.models import PluginDetails, PluginFamilyDetails, PluginFamilyList class PluginsApi(BaseApi): def families(self, include_all=None): """Return list of plugin families. :param include_all: Whether or not to include all plugins. Defaults t...
from django.db import models # Blog app models. class Post(models.Model): published = models.BooleanField(default=False) published_date = models.DateTimeField(null=True, blank=True) slug = models.SlugField(max_length=80) title = models.CharField(max_length=80, default='Post Title') subtitle = mode...
from __future__ import print_function import json import urlparse from utils import ProgressBar, Color, Symbol from pprint import pprint from settings import Settings from influxdbclient import InfluxdbClient import requests class Query: DEFAULT_FUNC = "mean" def __init__(self, measurement, field): ...
"""Class to represent the COUSUB (COUnty SUBdivision) level of the Census, used in the naming convention for Election Districts in some counties. """ from tqdm import tqdm from couchdb.mapping import Document, TextField, IntegerField from Database import Database, QueryType class Cousub(Document): """COUnty SU...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Tagline' db.create_table(u'pleiapp_tagline', ( (u'id', self.gf('django.db.models...
# Copyright (c) 2019 PaddlePaddle 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 app...
from setuptools import setup import sys if sys.version < "2.7": raise Exception("Couched needs Python 2.7 or above") LONG_DESCRIPTION = open('README.txt').read() CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Opera...
# -*- coding:utf-8 -*- import ast from sqlalchemy.sql import text def getCommuneFromInsee(connection, insee): sql = """ SELECT l.commune_maj, l.insee, st_asgeojson(st_transform(l.the_geom, 4326)) as commune_geojson FROM layers.l_communes l WHERE l.insee ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright (C) 20...
import os, pickle, numpy as np from collections import Counter from math import log from warnings import warn from __config__.filepath import AUX_DIR, FREQ_FILE, VOCAB_FILE from utils import product # Load vocabulary with open(os.path.join(AUX_DIR, VOCAB_FILE), 'rb') as f: pred_name = pickle.load(f) with open(...
import os import re import traceback import logging import platform from distutils.version import StrictVersion from PySide import QtCore from PySide import QtGui from P4 import P4, P4Exception, Progress, OutputHandler import Utils import AppUtils import GlobalVars import Callbacks reload(Utils) reload(AppUtils) re...
#!/usr/bin/python -u # Copyright or Copr. INRIA/Scilab - Sylvestre LEDRU # # Sylvestre LEDRU - <sylvestre.ledru@inria.fr> <sylvestre@ledru.info> # # This software is a computer program whose purpose is to generate C++ wrapper # for Java objects/methods. # # This software is governed by the CeCILL license under French ...
from django.shortcuts import render from rest_framework import generics from rest_framework.response import Response from rest_framework import views from geomat.feedback.serializers import FeedBackSerializer from django.core.mail import send_mail from rest_framework import status from drf_yasg.utils import swagger_aut...
""" Setup file """ import os import sys from setuptools import find_packages, setup HERE = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(HERE, "README.rst")) as f: README = f.read() with open(os.path.join(HERE, "CHANGES.rst")) as f: CHANGES = f.read() REQUIREMENTS_TEST = open(os.path.jo...
# 题目描述 # 输入一棵二叉树,判断该二叉树是否是平衡二叉树。 # -*- coding:utf-8 -*- # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def IsBalanced_Solution(self, pRoot): # write code here if pRoot == None: return True return a...
# Copyright (c) 2016, PerformLine, 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 copyright # notice, this list of conditio...
__author__ = 'ndieks' import os from setuptools import setup import setuptools with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( ...
# Copyright 2020 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# # gui.py - Graphical front end for anaconda # # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 # Red Hat, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software F...
from ..global_state import bugzilla_client import logging import urllib from requests import HTTPError log = logging.getLogger(__name__) class Bug(object): def __init__(self, id_, loadInfo=True): self.id_ = id_ self.data = {} if loadInfo: self.refresh() def refresh(self): ...
#!/usr/bin/env python # -*- coding: utf-8; py-indent-offset:4 -*- ############################################################################### # # Copyright (C) 2015 Daniel Rodriguez # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pub...
import argparse from osnap import default_python_version, get_logger, init_logger_from_args, __application_name__ import osnap.osnapy_win import osnap.osnapy_mac import osnap.util LOGGER = get_logger(__application_name__) def make_osnapy( python_version, application_name = None, clea...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Oct 26 21:05:37 2017 @author: sitibanc """ import pandas as pd import numpy as np import matplotlib.pyplot as plt # ============================================================================= # Read CSV # =============================================...
''' this file demo how to manage instances ''' import logging, unittest logger=logging.getLogger('pytest') class A(object): conn='shared connection here' def foo(self,x): logger.debug('instance method call conn:' + self.conn) print "executing foo(%s,%s)"%(self,x) @classmethod def...
# -*- coding: ISO-8859-1 -*- from MidiOutStream import MidiOutStream class MidiToText(MidiOutStream): """ This class renders a midi file as text. It is mostly used for debugging """ ############################# # channel events def channel_message(self, message_type, channel, data...
from __future__ import print_function, division, absolute_import from .. import types, utils, errors import operator from .templates import (AttributeTemplate, ConcreteTemplate, AbstractTemplate, infer_global, infer, infer_getattr, signature, bound_function, make_callabl...
# -*- coding: utf-8 -*- # Copyright (c) 2010, 2014 Lorenz Quack # This code is released under the MIT License: # 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 ...
# -*- coding: utf-8 -*- """List the nested group structure around the selected group or element.""" from pyrevit import revit, DB from pyrevit import script output = script.get_output() selection = revit.get_selection() class GroupNode: def __init__(self, group_element, par=None): self.group = group_el...
#!/usr/bin/python # File created on 27 Jan 2012. from __future__ import division __author__ = "Kishori M Konwar" __copyright__ = "Copyright 2013, MetaPathways" __credits__ = ["r"] __version__ = "1.0" __maintainer__ = "Kishori M Konwar" __status__ = "Release" try: import sys, os, re, math, gzip from glob imp...
from pony.orm import * from datetime import datetime from model.group import Group from model.contact import Contact from pymysql.converters import decoders from pymysql.converters import encoders, decoders, convert_mysql_timestamp conv = encoders conv.update(decoders) conv[datetime] = convert_mysql_timestamp clas...
# This file is part of MyPaint. # Copyright (C) 2007 by Martin Renold <martinxyz@gmx.ch> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) ...
#!/usr/bin/python # This script is used with an LED and a momentary button, perhaps the same, # like https://www.sparkfun.com/products/10440 # The LED should be wired to GPIO pin 23 and the button to pin 24. # The idea is that it is run at startup (for example, from rc.local) # It turns the LED on to indicate that it'...
# Copyright (C) 2010, Stefano Rivera <stefanor@debian.org> # Copyright (C) 2017-2018, Benjamin Drung <bdrung@debian.org> # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice app...
# -*- coding: utf-8 -*- # # nltools documentation build configuration file, created by # sphinx-quickstart on Thu Jun 4 07:22:28 2015. # # 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 file. # # A...
#!/usr/bin/env python """Semantic Protobufs are serialization agnostic, rich data types.""" import copy import cStringIO import json import logging import struct from google.protobuf import text_format from grr.lib import rdfvalue from grr.lib import registry from grr.lib import type_info from grr.lib import utils ...
#!/bin/env python # Automatically translated python version of # OpenSceneGraph example program "osgdirectinput" # !!! This program will need manual tuning before it will work. !!! import sys from osgpypp import osgDB from osgpypp import osgGA from osgpypp import osgViewer # Translated from file 'DirectInputRegis...
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
from datetime import timedelta from decimal import Decimal from io import BytesIO import pytest from django.utils.timezone import now from PyPDF2 import PdfFileReader from pretix.base.models import ( Event, Item, ItemVariation, Order, OrderPosition, Organizer, ) from pretix.plugins.ticketoutputpdf.ticketoutput im...
"""lsfHelper.py shouldn't need a batch system and so the unit tests here should aim to run on any system.""" from toil.batchSystems.lsfHelper import parse_mem_and_cmd_from_output from toil.test import ToilTest class LSFHelperTest(ToilTest): def test_parse_mem_and_cmd_from_output(self): # https://github.co...
from datetime import datetime import django from django.core.management import call_command import factory from StringIO import StringIO import sys from tinyblog.models import Post, EmailSubscriber class PostFactory(factory.Factory): FACTORY_FOR = Post title = factory.Sequence(lambda n: 'Post %s' % n) sl...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals # Python from six.moves import zip, range, map # NOQA # UTool import utool as ut import vtool as vt #import vtool.image as vtimage import numpy as np from ibeis.algo.preproc import preproc_probchip from os.path i...
# -*- coding: utf-8 -*- __author__= "Luis C. Pérez Tato (LCPT)" __copyright__= "Copyright 2016,LCPT" __license__= "GPL" __version__= "3.0" __email__= "l.pereztato@gmail.com" import math from materials.sections import internal_forces from miscUtils import LogMessages as lmsg def exportInternalForces(nmbComb, elems, f...
# -*- coding: utf-8 -*- # script.module.python.koding.aio # Python Koding AIO (c) by whufclee (info@totalrevolution.tv) # Python Koding AIO is licensed under a # Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. # You should have received a copy of the license along with this # wor...
import pytest from quicksort import quicksort def test_quicksort_simple(): input = [1, 3, 2] assert quicksort(input) == [1, 2, 3] def test_quicksort(): input = [54, 26, 93, 17, 71, 31, 44, 55, 20] assert quicksort(input) == [17, 20, 26, 31, 44, 54, 55, 71, 93] def test_quicksort_duplicate(): ...
from __future__ import absolute_import, print_function import subprocess import os import time from lwp.exceptions import ContainerDoesntExists, ContainerAlreadyExists, ContainerAlreadyRunning, ContainerNotRunning,\ DirectoryDoesntExists, NFSDirectoryNotMounted # LXC Python Library # Original author: Elie Delo...
from django.contrib.auth.models import User, Group from django.test import TestCase from community.models import Community from community.utils import create_groups from membership.models import JoinRequest from users.models import SystersUser class SystersUserTestCase(TestCase): def setUp(self): User.ob...
#!/usr/bin/env python3 import os import sys import subprocess import argparse parser = argparse.ArgumentParser(description="Helper script to bring up production env") parser.add_argument( "--start", dest="start", action="store_true", help="start production environment" ) parser.add_argument( "--kill", dest=...
#!/usr/bin/env python3 # Copyright 2020, Bloomberg Finance L.P. # # 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...
# rFactor Remote LCD # Copyright (C) 2014 Ingo Ruhnke <grumbel@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later versi...
#!/usr/bin/env kivy import kivy import uuid kivy.require('1.8.0') from kivy.app import App from kivy.properties import NumericProperty, ReferenceListProperty,ObjectProperty, StringProperty from kivy.uix.button import Button from kivy.uix.label import Label from kivy.uix.boxlayout import BoxLayout from kivy.uix.scre...
# Django settings for testsite project. import os PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__)) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ...
from collections import OrderedDict from typing import Dict from contextshell.action import Action, ActionArgsPack, ActionExecutor from contextshell.path import NodePath class FakeTree: def __init__(self): self.node_map : Dict[NodePath, FakeTree] = dict() def get(self, path): return self.nod...
### # Copyright (c) 2005, Jeremiah Fincher # Copyright (c) 2009-2010, James McCoy # 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 copyr...
#!/usr/bin/env python3 # Copyright (c) 2014-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 logic for skipping signature validation on old blocks. Test logic for skipping signature validati...
from __future__ import division from builtins import object from past.utils import old_div import numpy as np from sporco.admm import tvl2 import sporco.metric as sm class TestSet01(object): def setup_method(self, method): np.random.seed(12345) self.D = np.random.randn(16, 15) self.Dc =...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Lingua::EN::Syllable::syllable() estimates the number of syllables in the word passed to it. Note that it isn't entirely accurate... it fails (by one syllable) for about 10-15% of my /usr/dict/words. The only way to get a 100% accurate count is to do a dictionary look...
# Copyright 2019 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
import click import csv from manyquery.connection import Connection, MultiConnection @click.command() @click.option('--host', '-h', default=['ict.croptrak.com'], multiple=True, help='Hostname. Repeatable.') @click.option('--user', '-u', help='MySQL username') @click.option('--password', '-p', prompt=...
# Copyright 2012 Managed I.T. # # Author: Kiall Mac Innes <kiall@managedit.ie> # # 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 r...
# -*- coding:utf-8 -*- import threading import pytest from bajoo.filesync import task_consumer from bajoo.promise import Promise class TestTaskConsumer(object): def _make_external_promise(self): """Helper used to make stub Promise. Returns: Promise, resolve, reject: the promise and...
# -*- coding: utf-8 -*- """ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in...
import json import os import sys from .color_printer import ColorPrinter from .checker import Checker from .exc import LocalSettingsError, SettingsFileNotFoundError from .loader import Loader from .types import LocalSetting, SecretSetting from .util import NO_DEFAULT, get_file_name from .__main__ import make_local_set...
# -*- coding: utf-8 -*- import zmq import os import time from threading import Thread from zhelpers import socket_set_hwm, zpipe from zsync_server import CHUNK_SIZE, PIPELINE, ports, ip dst_path = 'sync_files_dst' def client_thread(ctx, port): dealer = ctx.socket(zmq.DEALER) socket_set_hwm(dealer, PIPELINE) ...
from trello import TrelloClient import json # api_key='your-key' - 05571f7ecf0d9177c020b9ab3495aaac # api_secret='your-secret' - 03a65f30fb4946c03cba7998327f7e10025493f7e036408d6efbcdbd63fc66f5 # token='your-oauth-token-key' - 1316a12594687b611d0c631896b9b421436bd955d0d376162521c5ed267155d8 # token_secret='your-oauth-...
import sys import unittest from django import __version__ from django.core.management import call_command from django.test import SimpleTestCase, mock from django.test.utils import captured_stdin, captured_stdout, patch_logger class ShellCommandTestCase(SimpleTestCase): def test_command_option(self): wi...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Project.aside' db.add_column(u'projects_project', 'aside', self.gf('ma...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
import dateutil import events from sim_interface import TraceReader import json import pickle import gzip class JsonTraceReader(TraceReader): def __init__(self, filename): self.trace_filename = filename self.trace_logs = None self.trace_pos = 0 self.start_time = None self....
import json import sys import os from collections import OrderedDict def ordered(obj): if isinstance(obj, dict): return sorted((k, ordered(v)) for k, v in obj.items()) if isinstance(obj, list): return sorted(ordered(x) for x in obj) else: return obj if len(sys.argv) < 2: print(...