text
stringlengths
17
737k
# -*- coding: utf-8 -*- """ pygments.lexers.lisp ~~~~~~~~~~~~~~~~~~~~ Lexers for Lispy languages. :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, bygroups, words, default from...
from django.test import TestCase from pxl.models import PXLBoardModel from django.contrib.auth.models import User import factory class UserFactory(factory.django.DjangoModelFactory): """Set up a user.""" class Meta: model = User username = factory.Faker('user_name') password = factory.Faker('p...
# -*- coding: utf-8 -*- """ pygments.lexers.text ~~~~~~~~~~~~~~~~~~~~ Lexers for non-source code file types. :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from bisect import bisect from pygments.lexer import Lexer, LexerC...
# -*- coding: utf-8 -*- # http://google-styleguide.googlecode.com/svn/trunk/pyguide.html from datetime import datetime from sqlalchemy import ForeignKey, func from sqlalchemy.orm import aliased from sqlalchemy.dialects import mysql from sqlalchemy.ext.declarative import AbstractConcreteBase from sqlalchemy.sql.express...
from __future__ import print_function import numpy as np import pylab as plt import time from astrometry.util.ttime import Time, CpuMeas from astrometry.util.resample import resample_with_wcs, OverlapError from astrometry.util.fits import fits_table from astrometry.util.plotutils import dimshow from tractor import T...
from django.test import TestCase from django.contrib.auth.models import User, Group, Permission from usermanage import models class storemanageViewsTestCase(TestCase): def test_not_loged_user_store_index_view(self): resp = self.client.get('/store/', follow = True) self.assertEqual(resp.status_code...
""" Classes and functions for archetypes. """ import os from glob import glob from astropy.io import fits import numpy as np from scipy.interpolate import interp1d import scipy.special from .zscan import calc_zchi2_one from .rebin import trapz_rebin from .utils import transmission_Lyman class Archetype(): """...
from collections import defaultdict from optparse import make_option import logging import sys from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django.contrib.admindocs.views import extract_views_from_urlpatterns from test_utils.crawler.base import Crawler class...
inset('btcChain.py') # btcrelay can relay a transaction to any contract that has a function # name 'processTransaction' with signature si:i extern relayDestination: [processTransaction:si:i] # note: _ancestor[9] # # a Bitcoin block (header) is stored as: # - _blockHeader 80 bytes # - _height is 1 more than the typ...
# encoding: utf8 from __future__ import absolute_import import logging from lxml import etree import six from .lib.attribute_dict import AttrDict from .lib.result import ValidationResult from .utils import uncapitalize from .soap import SOAPError basestring = six.string_types __all__ = ['SOAPDispatcher', 'SoapboxR...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from future.moves.urllib.parse import urlparse from future.utils import string_types from builtins import range import os import traceback import uuid from buildbot import getVersion from buildbot.config impo...
#!/usr/bin/env python #----------------------------------------------------------------------- # # Core video, sound and interpreter loop for Gigatron TTL microcomputer # - 6.25MHz clock # - Rendering 160x120 pixels at 6.25MHz with flexible videoline programming # - Must stay above 31 kHz horizontal sync --> 200 cy...
# coding=utf-8 from __future__ import print_function, unicode_literals import functools import os import platform import re import struct import sys import time import requests from bgmi import __version__ from bgmi.config import IS_PYTHON3, BGMI_PATH, DATA_SOURCE, SUPPORT_WEBSITE requests.packages.urllib3.disable_...
#!/usr/bin/python from boto.route53.connection import Route53Connection from boto.route53.exception import DNSServerError import config import sys import re route53 = Route53Connection(config.aws_access_key_id, config.aws_secret_access_key) def get_new_name(instance_type, env): if instance_type == "hosting": ...
""" Module for working with Python packages. """ import logging import os import sys import pkg_resources from pkglib_util import cmdline from pkglib import CONFIG from config import parse import util import pyenv import errors def get_log(): return logging.getLogger(__name__) # Common options arg must suppo...
import sys import time import threading import firebase import traceback from firebase import firebaseURL from Queue import Queue statementQueue = Queue() firebaseWriters = {} # if this is just None it's hard to deal with scoping issues... # don't want to declare a global so just referencing as array terminalIdentif...
""" Django settings for gettingstarted project, on Heroku. For more info, see: https://github.com/heroku/heroku-django-template For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/sett...
# MIT License # # Copyright (c) 2017-18 Felix Simkovic # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, m...
#!/usr/bin/env python import os import sys import json import glob import logging import inspect import argparse import traceback import importlib import unicodecsv import datetime as dt from billy.core import db from billy.core import settings, base_arg_parser from billy.scrape import ScrapeError, get_scraper, check...
from __future__ import absolute_import, print_function from datetime import datetime from logging import DEBUG, INFO, WARNING, ERROR, CRITICAL import multiprocessing import os import shutil import tempfile import pprint import warnings import re from pkg_resources import parse_version, SetuptoolsVersion, PEP440Warnin...
# -*- coding: utf-8 -*- import mock import time import datetime from nose.tools import * # noqa from framework.auth import Auth from website.util import api_url_for, web_url_for from tests.base import OsfTestCase, assert_is_redirect from tests.factories import AuthUserFactory, ProjectFactory, ExternalAccountFactory ...
import requests import time class UnauthorizedException(Exception): def __init__(self, message, error): Exception.__init__(self, message) self.error = error class NotAuthenticatedException(Exception): pass class NotImplementedException(Exception): pass URL_AUTH = 'https://api.mercadolib...
import argparse from argparse import RawTextHelpFormatter # Colors, Banner and cls from theme import * # Removes arg parse default usage Prefix class HelpFormatter(argparse.HelpFormatter): def add_usage(self, usage, actions, groups, prefix=None): if prefix is None: prefix = '' return su...
""" These are the items that can be added to the staff toolbar. """ from django.contrib.admin.templatetags.admin_urls import admin_urlname from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import reverse, reverse_lazy from django.utils.encoding import force_text from django.utils.saf...
# -*- coding: utf-8 -*- ''' LSR, Logical Shift Right Test This is an Bit Manipulation operation of the 6502 ''' import unittest from pynes.compiler import lexical, syntax, semantic class LsrTest(unittest.TestCase): def test_lsr_acc(self): tokens = lexical('LSR A') self.assertEquals(2, len(toke...
from django.db import models # class AjaxChatBans(models.Model): # userid = models.IntegerField(db_column='userID') # Field name made lowercase. # username = models.CharField(max_length=192, db_column='userName') # Field name made lowercase. # datetime = models.DateTimeField(db_column='dateTime') # Field n...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Extensión de pydatajson para la federación de metadatos de datasets a través de la API de CKAN. """ from __future__ import print_function import logging from ckanapi import RemoteCKAN from ckanapi.errors import NotFound, NotAuthorized from .ckan_utils import map_dataset...
# Superclass for spherical distribution functions, contains # - sphericaldf: superclass of all spherical DFs # - anisotropicsphericaldf: superclass of all anisotropic spherical DFs import numpy import pdb import scipy.interpolate from .df import df, _APY_LOADED from ..potential import flatten as flatten_potential f...
''' Created on Oct 3, 2010 Use this module to start Arelle in web server mode @author: Mark V Systems Limited (c) Copyright 2010 Mark V Systems Limited, All rights reserved. ''' from arelle.webserver.bottle import route, get, post, request, response, run, static_file import os, io, sys, time, threading, uuid from are...
import wx class MainFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self, None, title='Test') # Set App to FullScreen and get focus self.ShowFullScreen(1) # Erase background from designated areas by DC ( for the buttons ) self.Bind(wx.EVT_ERASE_BACKGROUND, self.set_background) # Set Custom Cursor...
""" This module provides functionality for manipulating proteomics data sets. Functionality includes merging data sets and interfacing with attributes in a structured format. """ # Built-ins from __future__ import absolute_import, division from collections import OrderedDict import copy import logging import os impo...
""" Module :mod:`pyesgf.search.results` =================================== Search results are retrieved through the :class:`ResultSet` class. This class hides paging of large result sets behind a client-side cache. Subclasses of :class:`Result` represent results of different SOLr record type. """ from collectio...
"""Settings handling. Provides :class:`DummySettingsManager` and :class:`SettingsManager` (syncs to disk). """ import sys import os from copy import deepcopy import json from collections import defaultdict from .util import dd, wrap_fn class _JSONEncoder (json.JSONEncoder): """Extended json.JSONEncoder with s...
# -*- coding: utf8 -*- import numpy as np import PDielec.Calculator as Calculator from PyQt5.QtWidgets import QWidget, QApplication from PyQt5.QtWidgets import QComboBox, QLabel from PyQt5.QtWidgets import QCheckBox from PyQt5.QtWidgets import QVBoxLayout, QFormLayout fro...
# Copyright (c) 2010-2014 OpenStack Foundation. # # 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 agre...
#!/usr/bin/env python # # Authors: James D. McClain <jmcclain@princeton.edu> # """Module for running k-point ccsd(t)""" import time import tempfile import numpy import numpy as np import h5py from pyscf import lib import pyscf.ao2mo from pyscf.lib import logger import pyscf.cc import pyscf.cc.ccsd from pyscf.pbc impo...
# -*- coding: utf-8 -*- import numpy as np from pandas.compat import zip from pandas.core.dtypes.generic import ABCSeries, ABCIndex from pandas.core.dtypes.missing import isna, notna from pandas.core.dtypes.common import ( is_bool_dtype, is_categorical_dtype, is_object_dtype, is_string_like, is_lis...
from collections import deque import io import os import tarfile from tempfile import NamedTemporaryFile import unittest import gzip import numpy from PIL import Image from six.moves import xrange import zmq from fuel import config # from fuel.server import recv_arrays, send_arrays from fuel.datasets import H5PYDatas...
# -*- coding: utf-8 -*- import math from ast import literal_eval from bisect import bisect_left from collections import defaultdict, deque from heapq import heapify, heappush, nsmallest from itertools import count as icount from typing import Iterable, Tuple, Union, List import numpy as np import pandas as pd from ca...
import pytest import unittest import numpy import cupy from cupy import testing from cupy.cuda import runtime from cupy.cuda.texture import (ChannelFormatDescriptor, CUDAarray, ResourceDescriptor, TextureDescriptor, TextureObject, TextureReference) dev =...
#!/usr/bin/env python # -*- coding: utf-8 -*- import ClassificationModules.ClassificationModule import DatabaseCommunication as DC import ClassificationModules.ActiveLearningSpecific as AL class ClassifierCollection: """A class to deal with multiple Classification Modules""" classificationmodules = [] ...
""" This module contains dsolve() and different helper functions that it uses. dsolve() solves ordinary differential equations. See the docstring on the various functions for their uses. Note that partial differential equations support is in pde.py. Note that ode_hint() functions have docstrings describing their vari...
# ---------------------------------------------------------------------------- # 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...
import os import shlex import sys from six.moves import configparser as ConfigParser # The PLATOON_DEVICES environment variable should be a list of comma-separated # device name entries, e.g. PLATOON_DEVICES=cuda0,cuda2,cuda3 PLATOON_DEVICES = os.getenv("PLATOON_DEVICES", "") # The PLATOON_HOSTS environment variable...
"""Classes and methods for handling AT commands.""" import re import humod.errors as errors from warnings import warn def deprecated(dep_func): """Decorator used to mark functions as deprecated.""" def warn_and_run(*args, **kwargs): """Print warning and run the function.""" warn('%r is depreca...
import copy as python_copy import datetime import hashlib import itertools import math import os import pathlib import tempfile import uuid import warnings from collections import Counter from collections.abc import Iterable from pathlib import Path from typing import Any, Dict, List, Optional, Set, Tuple, Union impor...
# -*- coding: utf-8 -*- """ pygments.lexers.agile ~~~~~~~~~~~~~~~~~~~~~ Lexers for agile languages. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import Lexer, RegexLexer, ExtendedRegexLexer, \ Le...
import os import sys import time import operator import logging import requests import json import re from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler from watchdog.events import FileModifiedEvent class GamificationHandler(FileSystemEventHandler): def __init__(self, paper...
import datetime import hashlib import itertools import math import os import pathlib import tempfile import uuid import warnings from collections import Counter, defaultdict from collections.abc import Iterable from pathlib import Path from typing import Any, Dict, List, Optional, Set, Tuple, Union import gdstk import...
import hashlib import requests import time import urllib from celery.decorators import periodic_task, task from celery.task.schedules import crontab from datetime import datetime, timedelta import dateutil.parser import dateutil.tz from .. import app from .. import db from .. import redis_conn from ..celeryconfig impo...
import os import numpy as np import cv2 import argparse import shutil import pandas as pd import logging from sklearn.model_selection import train_test_split class WashingtonRGBD(object): """ Data Wrapper class for WashingtonRGBD dataset Attributes ----------- root_dir: root directory until t...
# -*- coding: utf-8 -*- """ pygments.lexers.agile ~~~~~~~~~~~~~~~~~~~~~ Lexers for agile languages. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import Lexer, RegexLexer, ExtendedRegexLexer, \ Le...
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ Procedures to validate and update golden path of a genome assembly. This relies heavily on formats.agp, and further includes several algorithms, e.g. overlap detection. """ import os import os.path as op import sys import shutil import logging from optparse import Op...
from datetime import datetime import pytest from django.core.exceptions import FieldDoesNotExist, ValidationError from django.contrib.auth import get_user_model from django.contrib.auth.models import AnonymousUser, Group from django.contrib.sites.models import Site from django.test import TestCase, RequestFactory fr...
#!/usr/bin/env python """ Check lesson files and their contents. """ from __future__ import print_function import sys import os import glob import json import re from optparse import OptionParser from util import Reporter, read_markdown, load_yaml, check_unwanted_files, require, IMAGE_FILE_SUFFIX __version__ = '0.2...
import json import math import re import struct import sys from peewee import * from peewee import sqlite3 try: from playhouse._sqlite_ext import peewee_bm25 as cy_bm25 from playhouse._sqlite_ext import peewee_lucene as cy_lucene from playhouse._sqlite_ext import peewee_murmurhash as cy_murmurhash from...
""" pytest_watch.command ~~~~~~~~~~~~~~~~~~~~ Implements the command-line interface for pytest-watch. All positional arguments after `--` are passed directly to py.test executable. Usage: ptw [options] [<directories>...] [-- <args>...] Options: -h --help Show this help. --version Show version. ...
from tqdm import tqdm import torch from torch.autograd import Variable as Var from utils import map_label_to_target class Trainer(object): def __init__(self, args, model, criterion, optimizer): super(Trainer, self).__init__() self.args = args self.model = model self.crite...
from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import reverse from django import forms from django.test import TestCase from django.utils.unittest import expectedFailure from regressiontests.generic_views.models import Artist, Author from regressiontests.generic_views import view...
#! /usr/bin/env python # Copyright Arvid Norberg 2008. Use, modification and distribution is # subject to the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) import os, sys, time stat = open(sys.argv[1]) line = stat.readline() while not 's...
#!/usr/bin/env python3 # # Copyright 2018 The Bazel 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 ...
# coding=utf-8 from functools import wraps from threading import Thread from twisted.python.threadpool import ThreadPool pool = ThreadPool(name="Decorators") pool.start() def run_async(func): """ A function decorator intended to cause the function to run in another thread (in other words, asynchronousl...
""" Rename our fasta files using locality:country:date:number format Locality is probably (but not always) city, and matches the regexp [a-zA-Z0-9_] (i.e. \w+) Country is the country and also matches the \w regexp data is always an eight digit number e.g. 20171028 for October 28 2017 or 00000000 if we don't have the d...
from directory_tools.command_process import CommandProcess from directory_tools.yaml_config import YamlConfig from yaml import dump from sys import argv from directory_tools.argument_parser import Parser from directory_tools.client import Client class Commands: posix_account = { 'full_name': 'cn', # mus...
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright 2018 Kitware 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 cop...
#!/usr/bin/env python3 import os import sys import fcntl import atexit import signal import getpass import logging import secrets import textwrap import subprocess from pathlib import Path import htcondor import classad # # We could try to import colorama here -- see condor_watch_q -- but that's # only necessary fo...
# -*- coding: utf-8 -*- """ pygments.lexers.other ~~~~~~~~~~~~~~~~~~~~~ Lexers for other languages. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, bygroups, using, \ thi...
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function import mock import logging from django.core.urlresolvers import reverse from exam import fixture from sentry.models import ProjectKey, ProjectOption, TagKey from sentry.testutils import TestCase logger = logging.getLogger(__name__) cl...
# -*- encoding: utf-8 -*- ################################################################################ # # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # ...
#!/usr/bin/env python3 # # Copyright 2018 The Bazel 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 ...
#!/usr/bin/python import sys, csv from math import isnan from researchBook import ResearchBook from pandas import * timeseries = {} def appendPoint(quotebook): values = {} values['timestamp'] = quotebook.lastTimestamp values['top_ask'] = quotebook.topAskPrice values['top_bid'] = quotebook.topBidPrice values['sp...
from __future__ import print_function import ConfigParser import os import httplib import urllib import json from pprint import pprint import logging ECHONEST_SUCCESS = 0 ECHONEST_STATUS = { -1: "Unknown Error", 0: "Success", 1: "Missing/ Invalid API Key", 2: "This API key is not allowed to call this...
# Time: O(n) # Space: O(1) # # Given an integer, convert it to a roman numeral. # # Input is guaranteed to be within the range from 1 to 3999. # class Solution(object): def intToRoman(self, num): """ :type num: int :rtype: str """ numeral_map = {1: "I", 4: "IV", 5: "V", 9:...
# -*- coding: utf-8 -*- from EXOSIMS.Completeness.BrownCompleteness import BrownCompleteness import numpy as np import os import hashlib import scipy.optimize as optimize import scipy.interpolate as interpolate import scipy.integrate as integrate import astropy.units as u try: import cPickle as pickle...
from elftools.elf.elffile import ELFFile from elftools.elf.enums import * from elftools.elf.constants import * from elftools.elf.sections import SymbolTableSection import logging from .base_executable import * from .section import * INJECTION_SIZE = 0x1000 class ELFExecutable(BaseExecutable): def __init__(self, ...
#!/usr/bin/env python3 # # Copyright 2018 The Bazel 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 ...
#!/usr/bin/python """ Copyright 2016 Google 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 by applicable l...
''' tools for working with FSPS stellar population synthesis library (and its python bindings) ''' import numpy as np from scipy import stats, integrate from datetime import datetime import pickle import matplotlib.pyplot as plt from astropy.cosmology import WMAP9 from astropy import units as u, constants as c,...
# -*- coding: utf-8 -*- import os import json import logging from ruamel.yaml import YAML import sys import copy import errno from glob import glob from six import string_types import datetime import shutil from collections import OrderedDict from .util import NormalizedDataAssetName, get_slack_callback, safe_mmkdir ...
import os import configparser import csv import yaml import numpy as np from ruamel.yaml import YAML from energy_demand.read_write import write_data def run( path, sos_model, narrative, weather_name, gva_scenario, population_scenario, timesteps ): # Na...
""" Mongo-based Experiment driver and worker client =============================================== Components involved: - mongo e.g. mongod ... - driver e.g. hyperopt-mongo-search mongo://address bandit_json bandit_algo_json - worker e.g. hyperopt-mongo-worker --loop mongo://address Mongo ===== Mong...
#!/usr/local/bin/python # $Id$ import sys, os, stat, logging, base64, time, imp, gzip import BaseHTTPServer, SocketServer, cgi, cStringIO, urlparse import param, update, filters, util # add the Cheetah template directory to the import path tmpl_dir = os.path.dirname(sys.modules['__main__'].__file__) if tmpl_dir: tmp...
from cffi import FFI import os INCLUDE = ['/usr/include/nanomsg', '/usr/local/include/nanomsg'] def functions(): for dir in INCLUDE: if os.path.exists(dir): break lines = [] for fn in os.listdir(dir): with open(os.path.join(dir, fn)) as f: cont = '' for ln in f: if cont == ',': lines...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2014-2016 Brno University of Technology (author: Karel Vesely) # Licensed under the Apache License, Version 2.0 (the "License") import numpy as np import sys, os, re, gzip, struct ################################################# # Adding kaldi tools to shel...
from django.conf.urls import patterns, url, include from cbh_chembl_ws_extension.base import Login, Logout from chembl_core_db.utils import DirectTemplateView from django.conf import settings from flowjs import urls as flow from django.contrib import admin from tastypie.api import Api from cbh_chembl_ws_extension....
#!/usr/bin/python from bitcoin.main import * from bitcoin.pyspecials import safe_hexlify, safe_unhexlify, from_str_to_bytes, st, by, changebase import string, unicodedata, random, hmac, re, math try: from bitcoin._wordlists import WORDS except ImportError: raise Exception # WORDS = _get_wordlists() #ERROR UNR...
#!/usr/bin/env python3 import click from github3 import GitHub desc = '''# Starred - [Content](#starred) ''' @click.command() @click.option('--username', default='maguowei', help='GitHub username') def starred(username): gh = GitHub() stars = gh.starred_by(username) click.echo(desc) repo_dict = {...
""" This software was developed by the University of Tennessee as part of the Distributed Data Analysis of Neutron Scattering Experiments (DANSE) project funded by the US National Science Foundation. If you use DANSE applications to do scientific research that leads to publication, we ask that you acknowledge ...
#! /usr/bin/env python3 # -*-coding:Utf-8 -* """ Serveur pour les client du labyrinthe """ import socket import sys import threading import os import re import platform from carte import Carte from labyrinthe import Labyrinthe if platform.system() == 'Windows': CLEAR = lambda: os.system('cls') if p...
# -*- coding: utf-8 -*- import os import inspect import cPickle as pickle import numpy as np from os.path import exists from skimage.io import imread from skimage.transform import resize TRAIN_PERCENT = 0.7 VALID_PERCENT = 0.1 TEST_PERCENT = 0.2 CLASS_NAMES = ('Protists', 'Crustaceans', 'PelagicTunicates', 'Artifa...
""" This is the main module for PyBlosxom functionality. PyBlosxom's setup and default handlers are defined here. """ from __future__ import nested_scopes import os, time, re, sys, StringIO import tools from entries.fileentry import FileEntry VERSION = "1.0.0" VERSION_DATE = VERSION + " not yet released" VERSION_SPL...
"""A module to provide a copy of all the default data within the IATI SSOT. This includes Codelists, Schemas and Rulesets at various versions of the Standard. Todo: Handle multiple versions of the Standard rather than limiting to the latest. Implement more than Codelists. """ from copy import deepcopy impor...
import os import time import sys from nxdrive.tests.common import REMOTE_MODIFICATION_TIME_RESOLUTION from nxdrive.tests.common_unit_test import UnitTestCase from nxdrive.client import LocalClient from nxdrive.client import RemoteDocumentClient from nxdrive.engine.engine import Engine from shutil import copyfile from ...
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; eit...
# ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- import copy import hashlib import logging import re from urllib.parse import parse_qs from urllib.parse import urlparse from svtplay_dl.error import ServiceError from svtplay_dl.fetcher.dash import dashparse from svtplay_dl.fetche...
import functools import inspect @functools.lru_cache(maxsize=512) def _get_signature(func): return inspect.signature(func) def get_func_args(func): sig = _get_signature(func) return [ arg_name for arg_name, param in sig.parameters.items() if param.kind == inspect.Parameter.POSITIONAL_OR_...
from .module import Module class Potard(Module): possible_events = {'moved'} def __init__(self, id, alias, robot): Module.__init__(self, 'Potard', id, alias, robot) self._value = 0 @property def position(self): """ Position in degrees. """ return self._value def ...
a03cbde1-2d5f-11e5-b1d5-b88d120fff5e
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) from ..extern import six from ..extern.six.moves import zip as izip from ..extern.six.moves import range as xrange from .sorted_array import Sorted...
#!/usr/bin/python # -*- coding: utf-8 -*- ## Binary Analysis Tool ## Copyright 2009-2012 Armijn Hemel for Tjaldur Software Governance Solutions ## Licensed under Apache 2.0, see LICENSE file for details ''' Program to process a whole directory full of compressed source code archives to create a knowledgebase. Needs a...