src
stringlengths
721
1.04M
##################################################################################### # # Copyright (c) Microsoft Corporation. All rights reserved. # # This source code is subject to terms and conditions of the Apache License, Version 2.0. A # copy of the license can be found in the License.html file at the root of t...
# Copyright 2011 OpenStack Foundation # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
# setup.py - distutils packaging # # Copyright (C) 2003-2010 Federico Di Gregorio <fog@debian.org> # # psycopg2 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 3 of the License, or # (at...
import datetime import os import time import libtmux from valve.source.a2s import ServerQuerier from subprocess import call class CorruptedTf2ServerInstanceError(Exception): """ Raised when an invalid TF2 server instance is found. """ class SteamCmdNotFoundError(Exception): """ Raised when the ...
#!/usr/bin/env python # ***** BEGIN LICENSE BLOCK ***** # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # ***** END LICENSE BLOCK ***** """desktop_unittest.py The goal o...
# -*- coding: utf-8 -*- # 爬取知乎全站的用户信息 import json from scrapy import Spider, Request from Crawler.Zhihu.zhihuuser.items import UserItem class ZhihuSpider(Spider): #忽略301,302重定向请求 # handle_httpstatus_list = [301, 302] name = "zhihu_user" allowed_domains = ["www.zhihu.com"] user_url = 'https://...
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import requests from requests_oauthlib import OAuth1 from urlparse import parse_qs import json REQUEST_TOKEN_URL = "https://api.twitter.com/oauth/request_token" AUTHORIZE_URL = "https://api.twitter.com/oauth/authorize?oauth_token=" ACCESS_TOKEN_URL = "h...
__copyright__ = "Copyright 2017 Birkbeck, University of London" __author__ = "Martin Paul Eve & Andy Byers" __license__ = "AGPL v3" __maintainer__ = "Birkbeck Centre for Technology and Publishing" from django.conf.urls import url from submission import views urlpatterns = [ url(r'^start/$', views.start, name='su...
"""A fully synthetic read model that allows us to produce single end or paired end reads with arbitrary read and template lengths. It's read model format is as follows { 'model_class': 'illumina', 'model_description': '', 'paired': True/False, 'read_length': 100, 'mean_template_length': 300, 'std_template_...
#!/usr/bin/env python ################################################## ## DEPENDENCIES import sys import os import os.path try: import builtins as builtin except ImportError: import __builtin__ as builtin from os.path import getmtime, exists import time import types from Cheetah.Version import MinCompatib...
""" Example of a bending magnet emitting in x-ray region for a multi-electron emission (by convolution) """ import numpy as np import inspect # Import elements from common Glossary from optics.beam.electron_beam_pencil import ElectronBeamPencil, ElectronBeam from optics.magnetic_structures.bending_magnet import Bendin...
import pygame import math class Planet: def __init__(self, surface, color, position, radius, center): self.radius = radius self.surface = surface self.color = color self.setPosition(position) self.center = center self.setOrbitOffset(0) self.setOrbitPeriod(1) ...
import xbmc, xbmcaddon, xbmcgui, xbmcplugin,os,base64,sys,xbmcvfs import shutil import urllib2,urllib import re import extract import downloader import time import plugintools from addon.common.addon import Addon from addon.common.net import Net import CheckPath import zipfile import ntpath USER_AGENT = 'Mozilla/5.0...
# 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/env python # -*- encoding: utf-8 -*- from roars.rosutils.rosnode import RosNode from roars.vision.cameras import CameraRGB from roars.vision.arucoutils import MarkerDetector from roars.vision.arp import ARP import roars.vision.cvutils as cvutils import cv2 import numpy as np import os import json #⬢⬢⬢⬢⬢➤ N...
# -*- coding: utf-8 -*- """ Copyright (c) 2017 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ import subprocess from io import StringIO from dockerfile_parse import DockerfileParser from atomic_reactor.plugin ...
#!/usr/bin/env python import pysam import sqlite3 import os import sys import collections import re from unidecode import unidecode from bx.bbi.bigwig_file import BigWigFile from gemini.config import read_gemini_config # dictionary of anno_type -> open Tabix file handles annos = {} def get_anno_files( args ): con...
""" RandomLayout.py Generates a random layout by moving all the nodes positions randomly in a 640x480 pixel box. The connections are then optimized for the new layout. Guaranteed to hit an aesthetic layout at infinity, not recognize it, and keep on going for another infinity :p Created Summer 2004, Denis...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe, sys from frappe import _ from frappe.utils import cint, flt, now, cstr, strip_html, getdate, get_datetime, to_timedelta from frappe.model import default_fields from...
import pytest import sys sys.path.append('../..') from phpscan.core import Scan, logger, verify_dependencies from phpscan.satisfier.greedy import GreedySatisfier def init_and_run_simple_scan(script): scan = Scan(script, Scan.INPUT_MODE_SCRIPT) scan.satisfier = GreedySatisfier() scan.start() retur...
#!/usr/bin/env python # -*- coding: utf-8 -*- from urllib2 import Request, urlopen, HTTPError import re from BeautifulSoup import BeautifulSoup import sys reload(sys) sys.setdefaultencoding("utf-8") from sys import stderr import time UA = 'Mozilla/5.0 (compatible; MSIE 5.5; Windows NT)' def _fetch_page(url): ...
# # Chris Lumens <clumens@redhat.com> # # Copyright 2009 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, modify, # copy, or redistribute it subject to the terms and conditions of the GNU # General Public License v.2. This program is distributed in the hope that it # will be usef...
import http import json from flask import helpers class BaseResponse: def __init__(self, headers=None, status=None): self.status = status or http.HTTPStatus.OK self.headers = headers or {} def make_response(self): response = helpers.make_response( self.get_content(), ...
from . import Cell from .patterns import Patterns as BuiltinPatterns import numpy as np class World(object): ''' The game World is a two dimensional grid populated with Cells. >>> w = World() >>> w[0] Cell(location=(0,0),...) >>> w[x,y] Cell(location=(x,y),...) >> w.step() >> ...
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Vincent Michel <vincent.michel@inria.fr> # Gilles Louppe <g.louppe@gmail.com> # # License: BSD 3 clause """Recursive feature elimination for feature ranking""" import warnings import numpy as np from ..utils import check_X_y, safe_sqr fro...
#!/usr/bin/env python """Command-line tool for starting a local Vitess database for testing. USAGE: $ run_local_database --port 12345 \ --topology test_keyspace/-80:test_keyspace_0,test_keyspace/80-:test_keyspace_1 \ --schema_dir /path/to/schema/dir It will run the tool, logging to stderr. On stdout, a sm...
"""Read ChordPro files and output them through a PDFWriter object""" import re import song import uke class ChordProError(Exception): """Error in a ChordPro input.""" pass def _analyze_chordpro_textline(line): """Analyze the text and chords in a line of text. Args: line: The line of text, with chords...
""" Unit tests for degree centrality. """ from nose.tools import * import networkx as nx class TestDegreeCentrality: def __init__(self): self.K = nx.krackhardt_kite_graph() self.P3 = nx.path_graph(3) self.K5 = nx.complete_graph(5) F = nx.Graph() # Florentine families ...
""" A module for converting numbers or color arguments to *RGB* or *RGBA* *RGB* and *RGBA* are sequences of, respectively, 3 or 4 floats in the range 0-1. This module includes functions and classes for color specification conversions, and for mapping numbers to colors in a 1-D array of colors called a colormap. Color...
# 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. #----------------------------------------------------------------------...
""" Ecks plugin to collect disk usage information Copyright 2011 Chris Read (chris.read@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/lice...
""" We need to somehow work with the typing objects. Since the typing objects are pretty bare we need to add all the Jedi customizations to make them work as values. This file deals with all the typing.py cases. """ import itertools from jedi._compatibility import unicode from jedi import debug from jedi.inference.co...
# -*- coding: us-ascii -*- # asynchia - asynchronous networking library # Copyright (C) 2009 Florian Mayer <florian.mayer@bitsrc.org> # This program 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, eit...
import logging import warnings from datetime import datetime, timedelta from django.contrib.auth.backends import ModelBackend from django.core.cache import cache from .exceptions import RateLimitException logger = logging.getLogger('ratelimitbackend') class RateLimitMixin(object): """ A mixin to enable ra...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2015 Matt Martz <matt@sivel.net> # Copyright (C) 2015 Rackspace US, Inc. # # 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...
#!/usr/bin/python2 #replace markup #, ## ,### by \section, \subsection, \subsubsection. #anchor names are preserved and generated from the section name otherwise #The script is not perfect and might miss some specific cases from sys import argv from os import path import string import re anchors={} def generate_anc...
#!/usr/bin/env python ###################################################################################### # module : hepstore.core.docker # author(s): Peter Schichtel # year : 2017 # version : 0.1 ###################################################################################### ########################...
#! /usr/bin/env python3.7 import re import isodate import modules.extensions.regexes as regexes import modules.commands.helpers.time_formatter as time_formatter ON_ACTION = "PRIVMSG" def call(salty_inst, c_msg, balancer, **kwargs): video_ids = re.findall(regexes.YOUTUBE_URL, c_msg["message"]) if not video...
# coding: utf-8 ''' Created on Jul 24, 2014 @author: Noah ''' import bencode import logging import pprint import os.path log = logging.getLogger(__name__) pp = pprint.PrettyPrinter(indent = 1, width = 80) HASHLEN = 20 class Metafile: ''' Decodes the metadata stored in a .torrent metafile and presents a stan...
#!/usr/bin/python """ Program for creating HTML plots """ import os import sys import json import time from readevtlog import * def write_prefix(): f.write(''' <!doctype html> <html> <head> <title>DNA performance report</title> <script src="http://code.jquery.com/jquery-latest.min.js"></script> <script src...
""" The MIT License (MIT) Copyright (c) 2014 - 2015 Jos "Zarthus" Ahrens and contributors 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 rig...
# Copyright (C) 2011-2012 Andy Balaam and The Pepper Developers # Released under the MIT License. See the file COPYING.txt for details. from all_known import all_known from pepinterface import implements_interface from values import PepArray from values import PepBool from vals.numbers import PepInt from values impo...
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' import os, cProfile from tempfile import gettempdir from calibre.db.legacy ...
"""API for reading notebooks of different versions""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import json class NotJSONError(ValueError): pass def parse_json(s, **kwargs): """Parse a JSON string into a dict.""" try: nb_dict = json.load...
from twitter_ads.client import Client from twitter_ads.targeting import AudienceSummary CONSUMER_KEY = 'your consumer key' CONSUMER_SECRET = 'your consumer secret' ACCESS_TOKEN = 'access token' ACCESS_TOKEN_SECRET = 'access token secret' ACCOUNT_ID = 'account id' # initialize the client client = Client(CONSUMER_KEY, ...
#!/usr/bin/env python """Utility functions and classes for GRR API client library.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import time from future.builtins import map from google.protobuf import wrappers_pb2 from google.protobuf import symbol...
#!/usr/bin/python # boto3 python client to download files from S3 and check md5 # AWS_ACCESS_KEY_ID .. The access key for your AWS account. # AWS_SECRET_ACCESS_KEY .. The secret key for your AWS account. # folker@anl.gov import sys, getopt, boto3, hashlib, io import argparse def md5sum(src, length=io.DEFAULT_BUFFER...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2013 Rodolphe Quiédeville <rodolphe@quiedeville.org> # # 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...
from rest_framework.test import APITestCase from accounts.models import User class UserTestCase(APITestCase): """ Unit test case to test user features. """ def setUp(self): """ This method will run before any test. """ self.superuser = User.objects.create_superuser( ...
#!/usr/bin/env python # -*- coding: UTF-8 -*- """Interaction module assets' tests. """ from tinyscript.interact import set_interact_items from utils import * args.interact = True set_interact_items(globals()) class TestInteraction(TestCase): def test_interact_setup(self): g = globals().keys() ...
""" Authentication -------------- User account plugins and authentication. """ from ..content.api.authentication import authenticate_token as authenticate_cms_token from . import model from .interfaces import IClientSkinLayer from AccessControl import ClassSecurityInfo from Acquisition import aq_parent from App.class...
import numpy as np import matplotlib.pyplot as plt GRAY_SCALE_RANGE = 255 import pickle data_filename = 'data_deskewed.pkl' print('Loading data from file \'' + data_filename + '\' ...') with open(data_filename, 'rb') as f: train_labels = pickle.load(f) train_images = pickle.load(f) test_labels = pickle.l...
from database import Database,TableDB,FieldDB import biana.BianaObjects class BianaDatabase(Database): externalEntityID_col = "externalEntityID" external_entity_relation_id_col = "externalEntityRelationID" externalEntityID_col_type = "integer(4) unsigned" externalDatabaseID_col = "externalDatabaseID...
# Copyright 2012, 2013 by the Micromagnum authors. # # This file is part of MicroMagnum. # # MicroMagnum 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) a...
""" Advanced counter. This script is used to get some statistics from a text file. The script parse a file and returns the number of words, line, the most commom letter and the average number of letters per word. The script has a mandatory argument which is the file to parse. It is possible to pass different options t...
import skimage.color import skimage.measure import skimage.transform import skimage.filters import skimage.morphology import numpy as np import io from PIL import Image class GameFrameError(BaseException): pass class GameFrame: def __init__(self, frame_data, frame_variants=None, timestamp=None, **kwargs...
"""celery.backends.amqp""" import socket import time from datetime import timedelta from carrot.messaging import Consumer, Publisher from celery import conf from celery import states from celery.backends.base import BaseDictBackend from celery.exceptions import TimeoutError from celery.messaging import establish_con...
#! /usr/bin/python # -*- coding: utf-8 -*- """The main scene of the cocos-single frontend. This is one of the views in MVC pattern. """ import pyglet from cocos import director, layer, scene, menu from cocos.scenes import transitions from .utils.basic import set_menu_style from .utils.layers import BackgroundLayer,...
""" State Space Representation Author: Chad Fulton License: Simplified-BSD """ import numpy as np from .tools import ( find_best_blas_type, validate_matrix_shape, validate_vector_shape ) from .initialization import Initialization from . import tools class OptionWrapper(object): def __init__(self, mask_attri...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Zend Server API documentation build configuration file, created by # sphinx-quickstart on Mon Dec 24 01:33:37 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in thi...
"""empty message Revision ID: a374e36d0888 Revises: 4a6559da7594 Create Date: 2017-05-21 22:53:53.490856 """ from alembic import op import sqlalchemy as sa from sqlalchemy.orm import Session from models import physical from models import user # revision identifiers, used by Alembic. revision = '4_add_physical_user...
""" Utilities for training the parameters of tensorflow computational graphs. """ import tensorflow as tf import sys import math OPTIMIZERS = {'grad': tf.train.GradientDescentOptimizer, 'adam': tf.train.AdamOptimizer} class EarlyStop: """ A class for determining when to stop a training while loop by a bad co...
from flask import Flask, request from subprocess import Popen, PIPE import json app = Flask(__name__) HelpMessage = """ Usage: POST command to this URL with following payload: {"file": "...", args:[...]} We are using this format to keep it the same with NodeJs spawnSync Example: {"file": "ls", arg...
import sure import tempfile from contents import contents def test_file_with_long_levels(): content = '''/** * Project X * Author: Jean Pimentel * Date: August, 2013 */ /* > Intro */ Toc toc! Penny! Toc toc! Penny! Toc toc! Penny! /* >> The Big Bang Theory << */ The Big Bang Theory is an American sitcom cr...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Configuration file for template documentation.""" import os import sys try: import sphinx_rtd_theme except ImportError: sphinx_rtd_theme = None try: from sphinxcontrib import spelling except ImportError as e: print(e) spelling = None # If extensi...
from clldutils.clilib import PathType from pycldf import Dataset, Database # # Copied from distutils.util - because we don't want to deal with deprecation warnings. # def strtobool(val): # pragma: no cover """Convert a string representation of truth to true (1) or false (0). True values are 'y', 'yes', 't'...
# PyDIP 3.0, Python bindings for DIPlib 3.0 # This file contains functionality to download bioformats # # (c)2020, Wouter Caarls # # 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://...
#!/usr/bin/env python # Modified from python program written by Vance Morris for IoT Foosball table import RPi.GPIO as GPIO import os,json import ibmiotf.application import ibmiotf.device from ibmiotf.codecs import jsonIotfCodec import uuid from time import sleep import signal import sys import logging # setup IoT Fo...
from setuptools import setup, find_packages, Extension # Note to self: To upload a new version to PyPI, run: # pip install wheel twine # python setup.py sdist bdist_wheel # twine upload dist/* module1 = Extension('diff_match_patch', sources = ['interface.cpp'], include_dirs = [...
import os import argparse import logging import blessings import random import contextlib import shutil import datetime import sys from .api import TheTVDBApi from .action.sync import setup as sync_setup, action as sync_action from .action.search import setup as search_setup from .action.add import setup as add_setup ...
#!/usr/bin/env python3 # -*- coding utf-8 -*- __Author__ ='eamon' 'Modules Built-In' from datetime import datetime now = datetime.now() print(now) print(type(now)) dt=datetime(2015,10,5,20,1,20) print(dt) print(dt.timestamp()) t=1444046480.0 print(datetime.fromtimestamp(t)) print(datetime.utcfromtimestamp(t)...
from polybori.nf import * from polybori.PyPolyBoRi import * from polybori.ll import eliminate, ll_encode from time import time from copy import copy from itertools import chain from inspect import getargspec from polybori.statistics import used_vars, used_vars_set from polybori.heuristics import dense_system,gauss_on_...
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
import os import vtk from vtk.util.vtkAlgorithm import VTKPythonAlgorithmBase from vtk.util import numpy_support from vtk.numpy_interface import dataset_adapter as dsa from vtk.numpy_interface import algorithms as alg import logging from timeit import default_timer as timer class SourceStandfordBunny(VTKPythonAlgor...
""" Test suite. - Do not put 'mailer' in INSTALLED_APPS, it disturbs the emails counting. - Make sure these templates are accessible: registration/login.html base.html 404.html To have a fast test session, you can set a minimal configuration as: DATABASES = { 'default': { 'ENGINE': 'django.db....
#!/usr/bin/python2.5 # # Copyright 2008 the Melange 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...
from __future__ import division, print_function, absolute_import, unicode_literals from mog_commons.collection import * from mog_commons import unittest class TestCollection(unittest.TestCase): def test_get_single_item(self): self.assertEqual(get_single_item({'x': 123}), ('x', 123)) def test_get_sin...
import numpy as np from pywrap.testing import cython_extension_from from nose.tools import assert_equal, assert_raises def test_bool_in_bool_out(): with cython_extension_from("boolinboolout.hpp"): from boolinboolout import A a = A() b = False assert_equal(not b, a.neg(b)) def tes...
### Code for running Hadoop clusters on the model endpoints ### then using the cumulative summing script to sum the endpoint and area by tcd threshold. ### Also, sample code for copying results from spot machine to s3 for two endpoints. ### git clone https://github.com/wri/gfw-annual-loss-processing ''' For annual ga...
import os.path INSTALLED_APPS = [ 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django_messages' ] MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'dj...
# Generated by Django 2.2.13 on 2020-09-01 17:50 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('products', '0059_auto_20200830_1804'), ] operations = [ migrations.AlterField( model_name='chapter', name='title', ...
import copy from django.forms import ModelForm, BaseFormSet from django import forms from crispy_forms.layout import Layout, HTML, Fieldset from crispy_forms.helper import FormHelper from models import BandInformation, CellInformation from hs_core.forms import BaseFormHelper, get_crispy_form_fields from djan...
# graph.py # # Copyright 2011 Hugo Teso <hugo.teso@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 2 of the License, or # (at your...
#!/usr/bin/env python ''' Get greengenes taxonomies. Given an otu table with otu ids in the first column, search through the greengenes taxonomy list. Output the taxonomies in order. If the input database is a pickle, just load that dictionary. ''' import sys, argparse, re, cPickle as pickle def table_ids(fn): ...
import unittest from collections import namedtuple from exc import AheadOfMaxOffsetError import tt from build import tt_pb2 as proto SEND = 's' RECV = 'r' ClockCase = namedtuple('ClockCase', ['wall_time', 'event', 'input', 'expected']) class TTTest(unittest.TestCase): def test_less(self...
from __future__ import print_function from numpy.testing import measure from skmonaco import mcquad def run_print(test_list): print() print(" Integrating sum(x**2) -- Uniform Monte Carlo") print(" ============================================") print() print(" ndims | npoints | nprocs | time ") ...
# engine/result.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Define result set constructs including :class:`.ResultProxy` and :class:`.RowProxy...
__author__ = 'Deniz' import time, subprocess, argparse, getopt from sys import argv import sys, os DEFAULT_NUM_SUMMONERS = 250 DEFAULT_LOCATION = os.curdir + "\_out\Random_Summoners_run_"+str(time.time()) def main(): parser = argparse.ArgumentParser(description='Attempt to generate X number' ...
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2008 (ita) "as and gas" import os, sys import Task from TaskGen import extension, taskgen, after, before EXT_ASM = ['.s', '.S', '.asm', '.ASM', '.spp', '.SPP'] as_str = '${AS} ${ASFLAGS} ${_ASINCFLAGS} ${SRC} -o ${TGT}' Task.simple_task_type('asm', as_str, 'PIN...
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import hashlib import logging import os import shutil import tarfile import time import unittest from abc import ABCMeta from contextlib import contextmanager from http.server import BaseH...
# -*- coding: utf-8 -*- """Application models.""" import copy import csv import os import random import re import secrets import string import uuid from collections import namedtuple from datetime import datetime from enum import IntEnum, IntFlag from functools import lru_cache from hashlib import md5 from io import S...
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2017 Sicepat Ekspres Indonesia (<http://www.sicepat.com>). # @author: - Pambudi Satria <pambudi.satria@yahoo.com> # # This program is free software: you can redistribute it and/or modi...
import pandas as pd import numpy as np from sklearn.lda import LDA from sklearn.linear_model import LogisticRegression from sklearn.cross_validation import train_test_split from sklearn.preprocessing import StandardScaler from sklearn.metrics import accuracy_score import matplotlib.pyplot as plt from matplotlib.colors...
''' Created on 25 Mar 2016 @author: bogdan python3 required for operation -- due to Unicode issues v09: returning different insertion costs for graphonological distance ''' import sys, re, os import copy # from p010graphems.levenshtein import levenshtein from collections import defaultdict from collections import Cou...
# Copyright 2013 IBM Corp. # # 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 t...
from flask import session, redirect, request from webViews.view import normalView from webViews.dockletrequest import dockletRequest from webViews.dashboard import * from webViews.checkname import checkname import time, re class addClusterView(normalView): template_path = "addCluster.html" @classmethod de...
# encoding: utf-8 from __future__ import unicode_literals import os import re from .common import InfoExtractor from .youtube import YoutubeIE from ..compat import ( compat_urllib_parse, compat_urlparse, compat_xml_parse_error, ) from ..utils import ( determine_ext, ExtractorError, float_or_n...
import ast from Tensile.Configuration import ReadWriteTransformDict from Tensile.Configuration import Parameter from Tensile.Configuration import CallableParameter from Tensile.Configuration import ExpressionEvaluator from Tensile.Configuration import ProjectConfig def test_ReadWriteTransformDict(): def readXForm(...
#!/usr/bin/env python3 # Copyright (c) 2018 The Dash Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.mininode import * from test_framework.test_framework import BitcoinTestFramework from test_fr...
# -*- coding: utf-8 -*- # # pwntools documentation build configuration file, created by # sphinx-quickstart on Wed May 28 15:00:52 2014. # # 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. # # Al...