src stringlengths 721 1.04M |
|---|
from poretools import *
import sys
## Nov 4, 2014
## TODO for pipeline Id want both the "details" and the "fa" files
## This would require a --saveas option -- and it will save both.
## Might also want it to save the fastas to their own files when --each
#logging
import logging
logger = logging.getLogger('poreminion'... |
# -*- encoding: utf-8 -*-
"""
@authors: Nelson Daniel Ochoa ndaniel8a@gmail.com
Sebastián Ortiz V. neoecos@gmail.com
@license: GNU AFFERO GENERAL PUBLIC LICENSE
SIIM Models are the data definition of SIIM2 Framework
Copyright (C) 2013 Infometrika Ltda.
This program is free software: you can redistribu... |
# Copyright 2015 Conchylicultor. 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 law ... |
import unittest
from p2bf.builder import BFBuild
from p2bf.emitter import Emitter
import StringIO
from util.run_bf import run
class TestIfStatements(unittest.TestCase):
def test_if_true(self):
emit_output = StringIO.StringIO()
run_output = StringIO.StringIO()
emitter = Emitter(stdout=emit_... |
#!/usr/bin/env python
'''Timing interface'''
from bisect import bisect_left, bisect_right
import numpy as np
import pandas as pd
import librosa
class TimeSlice(object):
"""
A slice of time: has a start time, a duration, and a reference to an Audio object.
"""
def __init__(self, time, duration, au... |
"""
Constants for Job Board app
"""
JOB_PARAM_QUERY_KEY = 'query'
JOB_PARAM_COUNTRY_KEY = 'country'
JOB_PARAM_CITY_KEY = 'city'
JOB_PARAM_TRUE_VALUE = '1'
JOB_TYPE_REMOTE_KEY = 'remote'
JOB_TYPE_ONSITE_KEY = 'onsite'
JOB_TYPE_CHOICES = (
(JOB_TYPE_REMOTE_KEY, 'Remote'),
(JOB_TYPE_ONSITE_KEY, 'Onsite'),
)
JO... |
# -*- coding: utf-8 -*-
"""The app module, containing the app factory function."""
from flask import Flask, render_template
from myflaskapp import commands, public, user
from myflaskapp.assets import assets
from myflaskapp.extensions import bcrypt, cache, csrf_protect, db, debug_toolbar, login_manager, migrate
from my... |
import os
import os.path
import tempfile
import shutil
from nose.tools import eq_
from build_pack_utils import utils
from compile_helpers import setup_webdir_if_it_doesnt_exist
from compile_helpers import convert_php_extensions
from compile_helpers import is_web_app
from compile_helpers import find_stand_alone_app_to_r... |
# -*- coding:utf-8 -*-
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.iface import Iface
from ...util import Util
import saklient
# module saklient.cloud.models.model_iface
class Model_Iface(Model):
## インタフェースを検索・作成するための機能を備えたクラス。
## @priv... |
'''
@author Ivehui
@time 2016/06/05
@function: reinforcement agent
'''
import random
import caffe
import parameters as pms
import numpy as np
class DqnAgent(object):
def __init__(self, action_space, model=pms.newModel):
self.action_space = action_space
actionSolver = None
actionSolver = ca... |
__file__ = 'newServiceMerger'
__date__ = '2/17/2016'
__author__ = 'ABREZNIC'
"""
The MIT License (MIT)
Copyright (c) 2016 Texas Department of Transportation
Author: Adam Breznicky
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Sof... |
##########################################################################
#
# Copyright (c) 2013, Image Engine Design 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:
#
# * Red... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Creates a C code lookup table for doing ADC to temperature conversion
# on a microcontroller
# based on: http://hydraraptor.blogspot.com/2007/10/measuring-temperature-easy-way.html
# Modified Thu 10 Feb 2011 02:02:28 PM MST jgilmore for 5D_on_arduino firmware
# temps are no... |
# -*- coding: utf-8 -*-
# 15/6/10
# create by: snower
import logging
import threading
from tornado.ioloop import IOLoop, asyncio
from thrift.protocol.TBinaryProtocol import TBinaryProtocolAcceleratedFactory
from torthrift.transport import TIOStreamTransportFactory
from torthrift.server import TTornadoServer as BaseTTo... |
#!/usr/bin/python
#
# Copyright 2017 Gabriel Cebrian
#
# 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 appl... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib
import json
import os
import re
from flask import Flask
from flask import request
from flask import make_response
from random import randint
# Flask app should start in global layout
app = Flask(__name__)
@app.route('/webhook', methods=['POST'])
def webhook()... |
'''
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
'''
# Building a Standard Dual Linear Program... |
#!/usr/bin/env python
from collections import defaultdict
import pprint
import itertools
import numpy as np
from sklearn.cross_validation import StratifiedKFold
from sklearn import svm
from sklearn.feature_selection import SelectKBest
#outer loop 5-fold CV. X = data, y = label
def oSkfCv(group_label_dict, znorm_dict... |
#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.utils.safestring import mark_safe
import django_tables2 as tables
from django_tables2.columns import LinkColumn, Column, DateTimeColumn, DateColumn
from django_tables2.utils import A
from osnovni.models import MuzejskiPredmet, IstorijaIzmenaPredmeta
from orgsem... |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
### BEGIN LICENSE
# Copyright (C) 2013 <Konstantinos Mastorakis> <mastorak at gmail dot 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
... |
# -*- coding: utf-8 -*-
__author__ = "Ulysse Rubens <urubens@student.ulg.ac.be>"
__version__ = "0.1"
"""
Dictionary utilities encapsuling the Cytomine identifiers.
"""
CYTOMINE_KEYS = {
'demo.cytomine.be': {'public_key': '678d80ce-1d8f-4c33-857e-ae45605dec66',
'private_key': '90651c95-47... |
from flask_restful import reqparse, abort, Resource
from common import api, db
from constants import HttpStatus, EMPTY_JSON
from helpers import handle_bson
COLL_COURSES = 'courses'
course_parser = reqparse.RequestParser()
course_parser.add_argument('id', required=True)
course_parser.add_argument('title')
course_par... |
# Wrapper for loading templates from eggs via pkg_resources.resource_string.
try:
from pkg_resources import resource_string
except ImportError:
resource_string = None
from django.template.base import TemplateDoesNotExist
from django.template.loader import BaseLoader
from django.conf import settings
class Loa... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'spicetools/view/mainwin.ui'
#
# Created: Sun Apr 27 13:13:01 2014
# by: PyQt4 UI code generator 4.9.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf... |
#!/usr/bin/env python
import asyncio
import websockets
import io
import uuid
SERVER_KEY = "xyzzy"
class ServiceProvider:
def init(self, ws, require_uid):
self.requests = {}
self.pub_handlers = {}
self.req_handlers = {}
self.ws = ws
self.public_pub_events = []
self.... |
usr_input = input("Welcome to the Single Voice Sinusoidal Music Compiler:\n"
"The full file path should be specified with the file extension (preferably .csv)\n"
"Music Should in the format of:\n"
"Notes,AN4,BN2,0,CN4...\n"
"Time(S or MS),1000,... |
from operator import *
from pprint import pprint
from toolz import diff
from toolz import filter
from types import FunctionType
def get_val(val):
return val
# ----------------------------------------------------------------------------
def echo(*args):
list(map(lambda i: pprint(i), args))
# -----------------------... |
"""
Clase Punto
coord x
coord y
suma(punto)
resta(punto)
Clase Traza
instancias Punto en una Lista
añadir punto
comparar dos trazas (dos trazas serán iguales si sus puntos son iguales)
"""
import math
import turtle
class Punto:
def __init__(self, x... |
from pledger.account import Account, AccountFactory
from pledger.parser import Parser
from pledger.directive import *
from pledger.ledger_processor import LedgerProcessor
import pytest
class ProcessorStub(object):
def __init__(self):
self.repo = AccountFactory()
self.account = self.repo.root()
... |
"""
Django settings for pelawak project.
Generated by 'django-admin startproject' using Django 1.8.2.
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/settings/
"""
# Build path... |
ROOT_SCOPE_METHOD( MD( 'Plus', 'PLUS_FACTORY_single()' ) )
TEST( """ Or @ ( . [ ( Plus @ y ) ( Plus @ x ) ] flatten () ) consume [ x x y y y x y y ] value value == x """ )
OBJECT( 'PLUS_FACTORY',
methods = [
MS( ARG( CW( '@' ), CG( 'CLAUSE', 'clause' ) ), """
JUMP__return_ANY( CONTEXT, CONTEXT, $CA(PL... |
import os.path
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from math import log10
import yaml
from github_analysis_tool.services.database_service import DatabaseService
class Tfidf:
def __init__(self, secret_config):
# Generate a github_reques... |
from __future__ import print_function
import os
import unittest
import numpy as np
from numpy import allclose
#import pyNastran
#from pyNastran.bdf.bdf import BDF
#root_path = pyNastran.__path__[0]
#test_path = os.path.join(root_path, 'bdf', 'test', 'unit')
from pyNastran.bdf.cards.elements.mass import CONM2
import ... |
#!/usr/bin/env python
# (c) 2007 Canonical Ltd.
# Author: Martin Pitt <martin.pitt@ubuntu.com>
# This script needs python-distutils-extra, an extension to the standard
# distutils which provides i18n, icon support, etc.
# https://launchpad.net/python-distutils-extra
from glob import glob
from distutils.version impor... |
__source__ = 'https://leetcode.com/problems/house-robber-ii/'
# https://github.com/kamyu104/LeetCode/blob/master/Python/house-robber-ii.py
# Time: O(n)
# Space: O(1)
#
# Description: Leetcode # 213. House Robber II
#
# Note: This is an extension of House Robber.
#
# After robbing those houses on that street, the thief... |
from rainmaker.tests import test_helper, factory_helper
from rainmaker.main import Application
from rainmaker.db.main import init_db, HostFile, SyncFile, Sync, \
Host, Resolution, Download
from rainmaker.db import main
fh = factory_helper
def test_db_init():
init_db()
def test_sync_file_version_init():
... |
from django.contrib import admin
# Register your models here.
from .models import *
admin.site.register(Address)
admin.site.register(AutonomousSystem)
admin.site.register(AutonomousSystemAutomatic)
#
#admin.site.register(ClassificationIdentifier)
#admin.site.register(ClassificationType)
admin.site.register(Contact)... |
# Copyright 2018 The TensorFlow Probability 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 o... |
import re
def validate(query):
if (query != None) and (len(query) > 0):
# remove escapes
query = removeEscapes(query)
# check ~ is used properly
if isinstance(checkSquiggle(query), basestring):
return checkSquiggle(query)
# check ! is used properly
if ... |
import matlab.engine
import argparse, os
import torch
from torch.autograd import Variable
import numpy as np
import time, math, glob
import scipy.io as sio
import cv2
parser = argparse.ArgumentParser(description="PyTorch SRResNet Eval")
parser.add_argument("--cuda", action="store_true", help="use cuda?")
pa... |
#!/usr/bin/env python
"""
Simple app for converting between float, double, and IEEE754 binary
representations.
"""
__author__ = "Zachary Sturgeon <zws258@email.vccs.edu>"
import struct
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.checkbox import C... |
# (c) 2015, Alice Ferrazzi <alice.ferrazzi@gmail.com>
#
# This file is part of Eisen
#
# Eisen 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 v... |
from django.db import models
from django.utils import timezone
from django_extensions.db.models import TimeStampedModel
from .managers import PartyQuerySet
class Party(TimeStampedModel):
"""
A UK political party
The canonical source of these parties is The Electoral Commission, with
some exceptions.... |
#!/usr/bin/python3
# Copyright (C) 2017 Christopher Blay <chris.b.blay@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 l... |
#!/usr/bin/env python2
import threading
import time
# HTTP-related
import SimpleHTTPServer
import SocketServer
import os
# websocket-related
from gevent import monkey; monkey.patch_all()
from ws4py.server.geventserver import WebSocketServer
from ws4py.websocket import WebSocket
import random
class HTTPThread(threading... |
import logging
import os
import spotipy
import sys
from beatnik.api_manager.clients import AppleMusicApi, SoundcloudApi
from beatnik.api_manager.link_converter import LinkConverter
from beatnik.api_manager.link_parser import LinkParser
from beatnik.api_manager.search_handler import SearchHandler
from gmusicapi import ... |
class Encapsulamiento:
""" Esta clase tiene 3 atributos y 3 métodos propios.
>>> # El atributo privado es accesible a través de una Propiedad.
>>> x = Encapsulamiento()
>>> x.atributo_publico
este atributo es privado.
>>> x._atributo_semi_privado
este atributo es 'ca... |
#!/usr/bin/env python
"""
Calculate enrichment of regions with states using ChromHMM.
Usage:
calc_enr.py (-r <regions_file> | -R <directory_with_regions_files>) (-s <segmentation_directory> | -S <directory_with_segmentation_directories>) -c <ChromHMM_directory> -o <output_directory>
Options:
-h --help ... |
import numpy
from safe.impact_functions.core import FunctionProvider
from safe.impact_functions.core import get_hazard_layer, get_exposure_layer
from safe.impact_functions.core import get_question
from safe.storage.vector import Vector
from safe.common.utilities import ugettext as _
from safe.common.tables import Table... |
# -*- coding: utf-8 -*-
"""
gdown.modules.filefactory
~~~~~~~~~~~~~~~~~~~
This module contains handlers for filefactory.
"""
import re
from datetime import datetime
from dateutil import parser
from time import sleep
from ..module import browser, acc_info_template
from ..exceptions import ModuleError
def upload(u... |
# -*- coding: utf-8 -*-
"""
[Python 2.7 (Mayavi is not yet compatible with Python 3+)]
Created on Wed Dec 16 22:44:15 2015
@author: Ryan Stauffer
https://github.com/ryanpstauffer/market-vis
[This module referenced http://www.theodor.io/scraping-google-finance-data-using-pandas/]
Market Visualization Prototype
Quotes M... |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2017 IBM Corporation
Licensed under the Apache License, Version 2.0 (the “License”);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agre... |
from bs4 import BeautifulSoup
from .default_recipe_parser import recipe_parser
from .foodnetwork import foodnetwork
from .recipe import Recipe
from .schema_org_recipe_parser import schema_org_recipe_parser, use_schema_org
# messy python 3 support
try:
from urllib.request import urlopen, quote
from urllib.pars... |
# Copyright (c) 2013 Bull.
#
# 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, sof... |
import sys
import unittest
import zstandard as zstd
from . common import (
make_cffi,
)
if sys.version_info[0] >= 3:
int_type = int
else:
int_type = long
def generate_samples():
samples = []
for i in range(128):
samples.append(b'foo' * 64)
samples.append(b'bar' * 64)
sam... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2012 Canonical Ltd.
# Copyright (c) 2013 Antergos
#
# 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, o... |
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# wger W... |
import requests
import json
from lxml import html
from BaseModule import BaseModule
class Square(BaseModule):
def login(self, username, password, useragent):
useragent = BaseModule().define_user_agent(useragent)
headers = {'user-agent': useragent}
session = requests.Session()
logi... |
# Reuben Thorpe (2016), CodeEval [As Quick As A Flash v1.0]
from sys import argv
def swap(seq, x, y):
seq[x], seq[y] = seq[y], seq[x]
def q_sort_pivots(seq, begin, end):
"""
Code Evals implimentation of the quick sort algorithm, returns the
number of pivots enacted during a complete sort.
... |
"""Add email_address.active_at.
Revision ID: c47007758ee6
Revises: b7fa6df99855
Create Date: 2020-08-20 21:47:43.356619
"""
from alembic import op
from sqlalchemy import column, table
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'c47007758ee6'
down_revision = 'b7fa6df99855'
branch_lab... |
#some import
import numpy
import itertools
import random
import math
import os.path
import urllib2
import sys
#global variables
n = None
N = None
Dk = None
Du = None
Dc = None
e = None
r = None
x = None
xa = None
ASW = None
EXC = None
INS = None
pASW = None
pEXC = None
pINS = None
#help func... |
# -*- coding: utf-8 -*-
#
# Copyright Adam Pritchard 2020
# MIT License : https://adampritchard.mit-license.org/
#
"""
Flask routes used by tasks queues and cron jobs
"""
import logging
import flask
from google.cloud import ndb
import config
import gapps
import emailer
import main
tasks = flask.Blueprint('tasks',... |
"""
Donation Toolbar View.
"""
from pyplanet.views.generics.widget import WidgetView
class DonationToolbarWidget(WidgetView):
template_name = 'transactions/donation_toolbar.xml'
widget_x = -109.5
widget_y = 61
z_index = 30
game = None
def __init__(self, app):
"""
Initiate the toolbar view.
:param app:... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015, 2016 CERN.
#
# Invenio 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) any... |
"""
mpbas module. Contains the ModpathBas class. Note that the user can access
the ModpathBas class as `flopy.modflow.ModpathBas`.
Additional information for this MODFLOW/MODPATH package can be found at the `Online
MODFLOW Guide
<http://water.usgs.gov/ogw/modflow/MODFLOW-2005-Guide/index.html?bas6.htm>`_.
""... |
# -*- coding: utf-8 -*-
#########################################################################
## This scaffolding model makes your app work on Google App Engine too
## File is released under public domain and you can use without limitations
#########################################################################
... |
"""
testing offboard positon control with a simple takeoff script
"""
import rospy
from mavros_msgs.msg import State
from geometry_msgs.msg import PoseStamped, Point, Quaternion
import math
import numpy
from gazebo_msgs.srv import SetLinkProperties
from gazebo_msgs.srv import SetLinkPropertiesRequest
from gazebo_msg... |
from django.conf.urls import url
from tastypie.resources import ModelResource, ALL, ALL_WITH_RELATIONS
from tastypie.utils import trailing_slash
from tastypie.authentication import BasicAuthentication, Authentication, SessionAuthentication, MultiAuthentication
from tastypie.authorization import Authorization
from tasty... |
from functools import wraps
from flask import request
from typing import Dict
from community_share.app_exceptions import Unauthorized, Forbidden
from community_share.authorization import get_requesting_user
from community_share.models.user import User
from community_share.models.base import Serializable
def api_pat... |
# -*- coding: utf-8; mode: Python -*-
# ocitysmap, city map and street index generator from OpenStreetMap data
# Copyright (C) 2010 David Decotigny
# Copyright (C) 2010 Frédéric Lehobey
# Copyright (C) 2010 Pierre Mauduit
# Copyright (C) 2010 David Mentré
# Copyright (C) 2010 Maxime Petazzoni
# Copyright (C) 2010... |
from datetime import datetime
from mock import patch
from nose.tools import eq_
from flicks.base.helpers import babel_date, country_name
from flicks.base.tests import TestCase
class TestHelpers(TestCase):
def test_babel_date(self):
date = datetime(2011, 9, 23)
with self.activate('en-US'):
... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------
# Mzero 4
# Copyright 2015 tvalacarta@gmail.com
# http://blog.tvalacarta.info/plugin-xbmc/Mzero/
#
# Distributed under the terms of GNU General Public License v3 (GPLv3)
# http://www.gnu.org/licenses/gpl-3.0.html
# ------------------... |
#!/usr/bin/env python
# encoding: utf-8
from django.shortcuts import render_to_response, get_object_or_404, HttpResponse, get_list_or_404
from locations.models import Location
from reminds.models import Remind, RemindLocation, REMINDS_STATUS, RemindSendResult
from django.http import HttpResponse
from django.contrib.au... |
# encoding: utf-8
# Author: Zhang Huangbin <zhb@iredmail.org>
from os import urandom, getloadavg
import re
import time
import urllib2
import socket
from base64 import b64encode, b64decode
from xml.dom.minidom import parseString as parseXMLString
import random
import subprocess
import web
import settings
from libs impo... |
# Copyright (C) 2009, 2010, 2011 Rickard Lindberg, Roger Lindberg
#
# This file is part of Timeline.
#
# Timeline 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... |
import os
from urllib2 import urlopen
from boto.s3.connection import S3Connection, S3ResponseError
from boto.s3.connection import Location
from archivekit.store.common import Store, StoreObject, MANIFEST
DELIM = os.path.join(' ', ' ').strip()
ALL_USERS = 'http://acs.amazonaws.com/groups/global/AllUsers'
class S3St... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import webbrowser
from bs4 import BeautifulSoup
import chardet
import markdown
class MarkdownPreview(object):
_source = None
_template_path = None
_html_path = None
_css_path = None
def __init__(self, source=None, template=None, ... |
#!/usr/bin/env python
#=========================================================================
# build.py
#=========================================================================
# Builds pydgin.
import multiprocessing
import os
import shutil
import sys
import subprocess
import distutils.spawn
usage = """Usage:
... |
import os
import shutil
from DefconfigParser import DefconfigParser
from BuildRootCommandHandler import BuildRootCommandHandler
from ScriptBuilder import ScriptBuilder
class BuildRootCommandHandler_Prepare(BuildRootCommandHandler):
def __init__(self, next_command_handler):
BuildRootCommandHandler.__init__(... |
#!/usr/bin/env python
"""
Python class wrapper for data fitting.
Includes the following external methods:
getFunctions returns the list of function names (dictionary keys)
FitRegion performs the fitting
Note that FitRegion will plot on top of the current data using MPlots routines
if the current curve and the current ... |
# -*- Mode: Python; tab-width: 4 -*-
# Id: asynchat.py,v 2.26 2000/09/07 22:29:26 rushing Exp
# Author: Sam Rushing <rushing@nightmare.com>
# ======================================================================
# Copyright 1996 by Sam Rushing
#
# All Rights Reserved
#
# Permission... |
__author__ = "Wren J. R. (uberfastman)"
__email__ = "wrenjr@yahoo.com"
import distutils.util as distutils
import getopt
import logging
import os
import re
import sys
import traceback
from configparser import ConfigParser
import pkg_resources
from pkg_resources import DistributionNotFound, VersionConflict
from report... |
"""Provides methods to bootstrap a BluMate instance."""
import logging
import logging.handlers
import os
import shutil
import sys
from collections import defaultdict
from threading import RLock
import voluptuous as vol
import blumate.components as core_components
import blumate.components.group as group
import bluma... |
#!/usr/bin/env python
##
# createadmin.py
# Runs when an admin promotes a user to admin.
# Must verify that request was from admin with correct token.
#
import psycopg2, cgi,cgitb,string,random
from sys import exit
cgitb.enable(display=0,logdir="../log/",format="text")
import config
form=cgi.FieldStorage()
keys=form... |
"""Provides explicit constructions of expander graphs.
"""
import itertools
import networkx as nx
__all__ = ["margulis_gabber_galil_graph", "chordal_cycle_graph", "paley_graph"]
# Other discrete torus expanders can be constructed by using the following edge
# sets. For more information, see Chapter 4, "Expander Gra... |
# -*- coding:utf-8 -*-
# Created by xupingmao on 2017/06/11
# @modified 2020/02/18 00:20:12
"""搜索知识库文件"""
import re
import sys
import six
import xutils
import xauth
import xmanager
import xconfig
import xtables
from xutils import textutil
from xutils import SearchResult, text_contains
NOTE_DAO = xutils.DAO("note")
... |
# -*- coding:utf-8 -*-
from django.contrib import admin
from django.contrib.sites.models import RequestSite
from django.contrib.sites.models import Site
from django.utils.translation import ugettext_lazy as _
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.model... |
#$#HEADER-START
# vim:set expandtab ts=4 sw=4 ai ft=python:
#
# Reactor Configuration Event Engine
#
# Copyright (C) 2016 Brandon Gillespie
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Fre... |
"""
Wrap C++ class methods and constructods.
"""
import warnings
import traceback
from copy import copy
from pybindgen.typehandlers.base import ForwardWrapperBase, ReverseWrapperBase, \
join_ctype_and_name, CodeGenerationError
from pybindgen.typehandlers.base import ReturnValue, Parameter
from pybindgen.typehandl... |
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http
from streamlink.stream import HLSStream
class LiveRussia(Plugin):
url_re = re.compile(r"https?://(?:www.)?live.russia.tv/index/index/channel_id/")
iframe_re = re.compile(r"""<iframe[^>]*src=["']([^'"]+)["'][^>]*>""")
stre... |
# copyright 2016 Siavoosh Payandeh Azad and Behrad Niazmand
import package_file
import copy
def extract_checker_info(name_string):
package_file.list_of_detection_info_sa0[name_string] = []
package_file.list_of_detection_info_sa1[name_string] = []
package_file.list_of_true_misses_sa0[name_string] = []
... |
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
# This file is part of the mantid workbench.... |
import logging
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator, EmptyPage, InvalidPage
from physical.models import DatabaseInfra
from logical.models import Database
from util ... |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
from MultogoBoard import Board
from MultogoPlayer import Player
from random import randint
class GameState(object):
PreGame = 0
InGame = 1
PostGame = 2
class GameHandler(object):
#
def __init__(self, gameId, name, width, height, max_players):
self.gameId = gameId
self.name = name
self.width = width
sel... |
from __future__ import print_function
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
from pattern_text.en import wordnet
from pattern_text.en import NOUN, VERB
# WordNet is a lexical database for the English language.
# It groups English words into sets of synonyms called... |
###################################################################################
# liarutils.py, utility calls for liar
###################################################################################
#
# Copyright 2013 David Hicks (Starnose Ltd)
#
# This file is part of Liar
#
# Liar is free software: you can... |
import enums
import borg, importlib
importlib.import_module('.helpers', 'borg')
importlib.import_module('.archive', 'borg')
import os, stat, queue, gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
def walk():
treepath = Gtk.TreePath.new_first()
dir_stack = []
def pop_dir_item():
nonlocal treep... |
# -*- coding: utf-8 -*-
import pytest
from infinispan import utils
from infinispan.hotrod import TimeUnits
class TestUtils(object):
def test_from_pretty_time(self):
assert utils.from_pretty_time('10s') == (10, TimeUnits.SECONDS)
assert utils.from_pretty_time('10ms') == (10, TimeUnits.MILISECONDS... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.