text stringlengths 12 6.59M |
|---|
#!/usr/bin/env python
import os
import sys
import time
sys.path.append(os.path.join(os.path.dirname(__file__), "../../pox"))
import argparse
from collections import defaultdict
import networkx as nx
from pox.lib.packet.ethernet import ethernet
from pox.openflow.libopenflow_01 import ofp_flow_mod_command_rev_map
from... |
# Copyright 2011-2013 Colin Scott
# Copyright 2012-2013 Sam Whitlock
#
# 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... |
#
# fullbuild creates everything that needs to be created before a
# distribution can be made, and puts it all in the right place.
#
# It expects the projects to be in the places where Jack likes them:
# in directories named like 'build.macppc.shared'. That is fixable,
# however.
#
# NOTE: You should proably make a cop... |
import datetime
import dateutil
from django.shortcuts import render, render_to_response, get_object_or_404
from django.template import RequestContext
from django.template.loader import render_to_string
from django.core.urlresolvers import reverse, reverse_lazy
from django.contrib.auth.models import Permission, Group
f... |
# -*- coding: utf-8 -*-
# python.py - Lint checking for Python - given filename and contents of the code:
# It provides a list of line numbers to outline and offsets to highlight.
#
# This specific module is a derivative of PyFlakes and part of the SublimeLint project.
# It is a fork by André Roberge from the original ... |
#!/usr/bin/env python
"""Machine Learning Server."""
# System
import threading
import sys
import os
from datetime import datetime
import logging
# Third Party
import time
from pqueue import Queue
import numpy as np
import schedule
from bottle import run, request, route
from file_manager import FileManager
# First Pa... |
"""
Utility code for the Django example consumer and server.
"""
from urlparse import urljoin
from django.db import connection
from django.template.context import RequestContext
from django.template import loader
from django import http
from django.core.exceptions import ImproperlyConfigured
from django.core.urlreso... |
# -*- coding: utf-8 -*-
#...............................licence...........................................
#
# (C) Copyright 2008 Telefonica Investigacion y Desarrollo
# S.A.Unipersonal (Telefonica I+D)
#
# This file is part of Morfeo EzWeb Platform.
#
# Morfeo EzWeb Platform is free software: you can ... |
#!/usr/bin/env python
"""
mazeRunner.py
Escape the maze quickly.
Author: geugon
License: Apache License 2.0
See http://www.apache.org/licenses/LICENSE-2.0
"""
import pygame
import json
import random
from ast import literal_eval
ROOT2 = 0.5**0.5
class Settings():
""" Parses and stores ... |
#!/usr/bin/env python3
#
# Copyright (C) 2020-2021 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
# published by the Free Software Foundation.
#
# This program is distributed in the h... |
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public tr... |
import logging
from pprint import pprint
from hashlib import sha1
from grano.service import Loader
from sources.experts.util import engine
from sources.experts.util import exp_group, exp_sub_group, exp_group_type
from sources.experts.util import exp_group_task, exp_group_associated_dg
from sources.experts.util import... |
"""
Code for the coordination of site activities for a RAPD install - the monitoring
of data collection and the "cloud", as well as the running of processes and
logging of all metadata
"""
__license__ = """
This file is part of RAPD
Copyright (C) 2009-2016 Cornell University
All rights reserved.
RAPD is free softwar... |
# -*- coding: utf-8 -*-
import os
import datetime
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
from django.db import models, connection, transaction
from django.utils import simplejson
from django.utils.tran... |
#! /usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import print_function
import os
import supriya
from abjad import stringtools
from supriya.etc.ugens import ugens as ugen_definitions
from supriya.tools import ugentools
def make_class_methods(ugen_definition):
result = [
' ### PUBLIC METH... |
#!/usr/bin/env python3
import os
import re
HEADER_EXTENSIONS = [".h", ".hpp"]
SOURCE_EXTENSIONS = HEADER_EXTENSIONS + [ ".cpp", ".c", ".cxx"]
class SourceInfo:
def __init__(self):
self.name = ""
self.prefix = ""
self.extension = ""
self.path = ""
self.line_count = 0
... |
from os import path, listdir
from datetime import datetime
from mercurial import ui, hg, util
from mercurial.node import short
import git
from models import Repo, Commit
def find_git_repos(basepath, baseurl=''):
"""Returns a list of hg Repos in basepath"""
def _find_repos(_path, name):
if not path.i... |
from discord.ext import commands
import asyncio
import discord
import datetime
class BGT():
def __init__(self, bot):
self.bot = bot
self.bg_task = self.bot.loop.create_task(self.AllianceAnnounceEnd())
# self.bg_task = self.bot.loop.create_task(self.TimeTest())
async def AllianceAnnounc... |
import discord
from discord.ext import commands
import time
import asyncio
import unicodedata
import cogs.emojis as Emojis
import inflect
import upsidedown
import datetime
from collections import Counter
class Fun():
def __init__(self, bot):
self.bot = bot
def texttoemoji(self, text: str = None):
... |
import json
import os
import discord
from discord.ext import commands
import gw2api
class GW2(commands.Cog):
def __init__(self):
self.gw2 = gw2api.GuildWars2Client(api_key=os.environ['GW2API'])
self.velv = os.environ['GW2GUILDID']
with open("data/upgrades.json") as f:
self.upg... |
import datetime
import json
from collections import OrderedDict
from django.contrib.auth.models import User, Permission
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import get_script_prefix, resolve, Resolver404
from djan... |
import aiohttp
import asyncio
import discord
import spice_api as spice
import gc
from bs4 import BeautifulSoup
from discord.ext import commands
from lxml import etree
from urllib.parse import parse_qs
from .utils import config
from .utils.checks import permEmbed, edit
class Mal:
def __init__(self, bot):
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Kraller
An application to allow signups for accounts on a server with a key.
"""
from functools import wraps
import logging
import os
import re
from urllib import urlencode
from flask import Flask, abort, render_template, redirect, request, session, url_for, flash, send_... |
# -*- coding: utf8 -*-
import numpy
import scipy.linalg
from . import utils, linsys
__all__ = ['DeflatedCg', 'DeflatedMinres', 'DeflatedGmres', '_DeflationMixin',
'ObliqueProjection', '_Projection', 'Ritz', 'Arnoldifyer',
'bound_pseudo']
class _Projection(utils.Projection):
def __init__(se... |
import asyncio
import datetime
import discord
import logging
from discord import utils
from discord.ext import commands
from .utils.checks import edit, getChannel, getColor, getRole, getUser, getWithoutInvoke
log = logging.getLogger('LOG')
class Mod:
def __init__(self, bot):
self.bot = bot
# Do cl... |
import sys
import logging
from contextlib import contextmanager
import amqp
from kuyruk import exceptions
from kuyruk.task import Task
from kuyruk.config import Config
from kuyruk.worker import Worker
__version__ = '7.0.1'
__all__ = ['Kuyruk', 'Config', 'Task', 'Worker']
logger = logging.getLogger(__name__)
# Ad... |
from discord.ext import commands
import random as rng
class RNG:
"""Utilities that provide pseudo-RNG."""
def __init__(self, bot):
self.bot = bot
@commands.group(pass_context=True)
async def random(self, ctx):
"""Генератор случайностей."""
if ctx.invoked_subcommand is None:
... |
# -*- coding: utf-8 -*-
"""Kwapi logging."""
import logging
import sys
getLogger = logging.getLogger
def setup(file_name):
"""Setup logging with the given parameters."""
# Create logger
logger = logging.getLogger()
logger.setLevel(logging.INFO)
# Create file handler
file_handler = logging.F... |
#!/bin/env python
import discord
import asyncpg
from datetime import datetime
from discord.ext import commands
class Tag:
def __init__(self, bot):
self.bot = bot
self.pg_con = bot.pg_con
async def get_tag(self, server_id: int, tag_name: str):
""" Returns tag value or None """
qu... |
#!/usr/bin/env python
# USGS Landsat Imagery Util
#
#
# Author: developmentseed
# Contributer: scisco
#
# License: CC0 1.0 Universal
from __future__ import print_function
import sys
import subprocess
import argparse
from dateutil.parser import parse
from gs_helper import GsHelper
from clipper_helper import Clipper
... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
"""
@script : sqlite.py
@created : 2012-11-04 00:29:46.091
@changed : 2012-11-07 22:43:29.916
@creator : mkpy.py --version 0.0.27
@author : Igor A.Vetrov <qprostu@gmail.com>
@about : module with SQLite utilities
"""
from __future__ import print_function
import os, sys
f... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Divides course evaluation results among fui-members."""
__authors__ = ["Ole Herman Schumacher Elgesem"]
__email__ = "olehelg@uio.no"
__copyright__ = "Ole Herman Schumacher Elgesem"
__credits__ = ["Ole Herman Schumacher Elgesem"]
__license__ = "MIT"
# Thi... |
import csnUtility
import csnContext
import csnGenerator
import csnProject
import csnPrebuilt
import RollbackImporter
import glob
import inspect
import string
import os
import subprocess
import sys
from csnListener import ChangeListener
import logging
class RootNotFound(IOError):
pass
class NotARoot(IOError):
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import with_statement, division, absolute_import, print_function
__version__ = '0.3.0'
from swagger_validator.core import SwaggerValidator
|
import six.moves.cPickle as pickle
from nose.tools import assert_raises
from syn.five import STR
from syn.base.b import Base, Attr, init_hook, coerce_hook, setstate_hook
from syn.type.a import Type
from syn.base_utils import assert_equivalent, assert_pickle_idempotent, \
assert_inequivalent, assert_type_equivalent,... |
# -*- coding: utf-8 -*-
# Copyright 2014, 2015 OpenMarket Ltd
#
# 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 applica... |
from __future__ import unicode_literals
import re
import datetime
ERROR_INTERNAL = "We're having technical difficulties. Please try again later."
ERROR_NOT_AN_EVENT = "This thread is not an RSVPBot event!. Type `rsvp init` to make it into an event."
ERROR_NOT_AUTHORIZED_TO_DELETE = "Oops! Y... |
#
# commands for robodaniel
# everything is returned in a tuple or a list, period!
#
def compliment(args, sender, sender_id, attachments, bot):
'[person]: send someone a compliment!'
from data.compliments import compliments
from helpers import give
import random
compliment = random.choice(complime... |
from __future__ import unicode_literals
import re
import datetime
import random
ERROR_INTERNAL = "We're having technical difficulties. Please try again later."
ERROR_NOT_AN_EVENT = "This thread is not an RSVPBot event!. Type `rsvp init` to make it into an event."
ERROR_NOT_AUTHORIZED_TO_DEL... |
#!/usr/bin/env python
from __future__ import print_function, division
from fractions import gcd
import operator, cmath
import math as rmath
import random, itertools, sys
from types import *
from base64 import *
phi = (1+5**.5)/2
def Fib(n):
if n<2:
return n
a,b=1,1
while n>2:
a,b,n=b,a+b,n... |
import sublime
import sublime_plugin
import re
from Method import method as parser
try:
from Statement import statement
from Expression import expression
from LocalVariable import local_variable
except ImportError:
sublime.error_message("Dependency import failed; please read readme for " +
"Method plugin f... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 KenV99
#
# 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... |
""" Copyright 2014 Luis Ruiz Ruiz
Copyright 2014 Ana Isabel Lopera Martinez
Copyright 2014 Miguel Ortega Moreno
Copyright 2014 Juan Francisco Salamanca Carmona
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obt... |
##@file Variance
# Variance
# @brief This file defines helper functions for evaluating and processing differences between song vectors
#
import math
## getVariance
# @brief Apply the functions in compareVec to the values in base, new
# @param base The user profile vector
# @param new a list of features to compare ... |
# -*- coding: utf-8 -*-
#
# sampledoc documentation build configuration file, created by
# sphinx-quickstart on Tue Aug 11 05:04:40 2009.
#
# 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.
#
# ... |
# -*- coding: utf-8 -*-
# @Author: Amar Prakash Pandey
# @Date: 2016-03-20
# @Email: amar.om1994@gmail.com
# @Github username: @amarlearning
# @Last Modified by: Amar Prakash Pandey
# @Last Modified time: 2016-04-16
# MIT License. You can find a copy of the License
# @http://amarlearning.mit-license.org
... |
activate_this = '/var/www/flask_app/venv/bin/activate_this.py'
with open(activate_this) as file_:
exec(file_.read(), dict(__file__=activate_this))
import sys
sys.stdout = sys.stderr
import os
os.environ['PYTHON_EGG_CACHE'] = '~/tmp/python-eggs'
from motif_analyzer import app
|
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import math
import pandas as pd
DATE = '2014-10-13'
XLS_NAME = 'startup.xls'
SHEET_NAME = 'STARTUP_' + ''.join(reversed(DATE.split('-')))
BUSINESS_NAME = 'denominazione'
BUSINESS_PROV = 'pv'
BUSINESS_TYPE = 'nat.giuridica'
REVENUE_CLASS = 'classe di produzione ultimo a... |
#!/usr/bin/env python
# vim: expandtab:tabstop=4:shiftwidth=4
'''
Send Openshift cluster capacity to Zagg
'''
#
# Copyright 2016 Red Hat 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 Li... |
from time import sleep
from fabfile.config import *
from fabfile.utils.fabos import detect_ostype
class OpenStackSetupError(Exception):
pass
def verify_service(service):
for x in xrange(10):
output = run("service %s status" % service)
if 'running' in output.lower():
return
... |
'''
Codes for creating a basic scientific statck on a linux VM.
To see the commands that will be issued, use the flag
print_only=T
'''
from contextlib import contextmanager
from fabric_solo import (apt_get, chmod, chown, cp, exists, lcd,
ln, mkdir, mv, rm, runall, sed, wget)
# Shared constants
REPO_PATH = "... |
#!/bin/env python
#
# Description:
# This is the main of the glideinFactory
#
# Arguments:
# $1 = glidein submit_dir
#
# Author:
# Igor Sfiligoi (Apr 9th 2007 - moved old glideFactory to glideFactoryEntry)
#
import os
import os.path
import sys
STARTUP_DIR=sys.path[0]
import fcntl
import popen2
import traceback... |
# coding=utf-8
from __future__ import unicode_literals
__loader__ = None
import datetime
import json
import os
import re
import time
import unittest
import string
import six
import sys
import logging
try:
from mock import patch
except ImportError:
from unittest.mock import patch
try:
from StringIO impo... |
import numpy as np
from shapely.geometry import Polygon
import sectionproperties.pre.geometry as geometry
import sectionproperties.pre.pre as pre
def super_t_girder_section(
girder_type: int,
girder_subtype: int = 2,
w: float = 2100,
t_w: float = None,
t_f: float = 75,
material: pre.Material =... |
# pylint: disable=C0301
""" Parses `zpool status` output """
import re
from Products.ZenEvents import Event
from Products.ZenRRD.CommandParser import CommandParser
class status(CommandParser):
""" Parses `zpool status` output """
def processResults(self, cmd, result):
"""
Example unhealthy ... |
#!/usr/bin/env python
from falafel.config import SimpleFileSpec, PatternSpec, CommandSpec, format_rpm, First, All
from falafel.config import DockerHostSimpleFileSpec, DockerHostPatternSpec, DockerHostCommandSpec
static_specs = {
"nproc.conf" : PatternSpec(r"etc/security/limits\.d/.*-nproc\.conf"),
... |
import datetime
import requests
from django.conf import settings
from celery import shared_task
from utils.slack import SlackHelper
import json
class FlaggedEditSlackPoster:
def __init__(self, logged_action):
self.sh = SlackHelper()
self.logged_action = logged_action
def _dict_to_kv_forma... |
import warnings
from typing import Optional
import numpy as np
import pandas as pd
import scipy.sparse as sp_sparse
from anndata import AnnData
from .. import logging as logg
from .._settings import settings, Verbosity
from .._utils import sanitize_anndata, check_nonnegative_integers
from .._compat import Literal
fr... |
import arrow
from dateutil import tz
from django.db import models, transaction
from django_extensions.db.fields import AutoSlugField
from wagtail.wagtailadmin.edit_handlers import MultiFieldPanel, FieldRowPanel, FieldPanel, \
ObjectList
from wagtail.wagtailcore.fields import RichTextField
from wagtail.wagtailimages... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 22 00:05:59 2017
@author: asadm2
"""
from __future__ import division, print_function, absolute_import
from glob import glob
from astropy.io import fits
import warnings
from astropy.utils.exceptions import AstropyUserWarning
import pandas as pd
impo... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import bleach
import os
import re
import random
from os.path import join
from tempfile import NamedTemporaryFile
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.sites.models import Site
from... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 onwards University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individuals,
# list... |
# -*- coding: utf-8 -*-
# Copyright 2014-2016 Akretion (Alexis de Lattre
# <alexis.delattre@akretion.com>)
# Copyright 2014 Lorenzo Battistini <lorenzo.battistini@agilebg.com>
# Copyright 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2017 Eficent Business and IT Consulting Services, S.... |
# License: BSD 3 clause
import unittest
import numpy as np
from scipy.sparse import csr_matrix
from tick.linear_model import SimuLogReg, ModelHinge
from tick.base_model.tests.generalized_linear_model import TestGLM
class Test(TestGLM):
def test_ModelHinge(self):
"""...Numerical consistency check of los... |
# -*- coding: utf-8 -*-
'''
Mango tasks models and messages.
'''
# This file is part of mango.
# Distributed under the terms of the last AGPL License.
# The full license is in the file LICENCE, distributed as part of this software.
__author__ = 'Jean Chassoul'
import arrow
import uuid
from schematics import m... |
import matplotlib.pylab as plt
from limix_misc.scalar import isfloat
from limix_misc.dict_ import group_by as lms_group_by
from limix_plot.grid import grid_plot
def _sort_key(k):
if isfloat(k):
return float(k)
return k
class BasePlot(object):
def __init__(self, fig=None):
self.tasks = []
... |
"""
Functions and classes for finding Treants in the filesystem.
"""
import os
import sys
import glob
import time
import scandir
from . import backends
def statefilename(treanttype, uuid):
"""Return state file name given the type of treant and its uuid.
"""
return "{}.{}.{}".format(treanttype, uuid, '... |
from itertools import product
import matplotlib.pyplot as plt
from neupy import algorithms, environment, init
from utils import plot_2d_grid, make_circle, make_elipse, make_square
plt.style.use('ggplot')
environment.reproducible()
if __name__ == '__main__':
GRID_WIDTH = 4
GRID_HEIGHT = 4
datasets = [... |
#!/usr/bin/env python
# Copyright 2017 Stanford University
#
# 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 applicabl... |
import os
PROJECT_ROOT = os.path.dirname(__file__)
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'development.sqlite3', # Or path to database file if... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2009-2010 Guillaume Pellerin <yomguy@parisson.com>
# This file is part of TimeSide.
# TimeSide 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, eith... |
# -*- coding: utf-8 -*-
'''
Mango tools system logic functions.
'''
# This file is part of mango.
# Distributed under the terms of the last AGPL License.
# The full license is in the file LICENCE, distributed as part of this software.
__author__ = 'Team Machine'
import time
import arrow
import ujson as json
i... |
# Copyright (c) 2013, Rethink Robotics
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions an... |
'''
Linearly scale the expression range of one gene to be between 0 and 1.
If a reference dataset is provided, then the scaling of one gene in the
target dataset in done using the minimun and range of that gene in the
reference dataset.
'''
import sys
import argparse
sys.path.insert(0, 'Data_collection_processing/')
f... |
# Lint as: python2, python3
# Copyright 2018 The TensorFlow 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
#
... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# ThinkOpen Solutions Brasil
# Copyright (C) Thinkopen Solutions <http://www.tkobr.com>.
#
# This... |
# -*- coding: utf-8 -*-
'''
Mango system periodic tools.
'''
# This file is part of mango.
# Dist4ributed under the terms of the last AGPL License.
# The full license is in the file LICENCE, distributed as part of this software.
__author__ = 'Jean Chassoul'
import logging
from tornado import httpclient
import ... |
# Copyright 2019 The AdaNet 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
from datetime import datetime
from flask import render_template, session, redirect, url_for, flash
from flask_login import login_user, current_user
from . import main
from .forms import UserForm, FakeUserForm
from .. import db
from ..models import Developer, Integration
@main.route('/', methods=['GET', 'POST'])
def i... |
import os
import shutil
import re
import itertools
import warnings
import configparser
import pkg_resources as pkgrs
import time
import pprint
import numpy as np
import pandas as pd
import brewer2mpl as cb # for colours
import matplotlib.pyplot as plt
import matplotlib as mpl
import uncertainties as unc
import uncerta... |
#!/usr/bin/python
from __future__ import print_function
from bcc import BPF
from ctypes import *
import sys
import socket
import os
import struct
import dnslib
import argparse
def encode_dns(name):
size = 255
if len(name) > 255:
raise Exception("DNS Name too long.")
b = bytearray(size)
i = 0;
elements... |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
try:
from . import crowd_anki_importer
except ValueError:
pass
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
from gevent import monkey
monkey.patch_all()
import json
import logging
import Queue
import select
import socket
import ssl
import time
from threading import Thread
import beanstalkc
import apns
import config
logger = logging.getLogger()
for log_handler in config.LOGGING_... |
#
#
# Copyright (C) 2006, 2007 Google 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; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distri... |
""" Steward extension for monitoring servers """
from __future__ import unicode_literals
import imp
import os
import sys
from datetime import timedelta
import inspect
import logging
import yaml
from pyramid.path import DottedNameResolver
from pyramid.settings import aslist
from .check import Check
from .handlers imp... |
#
#
#
# import my stuff
from common_batch import write_batch
from common_batch import commit_batch
from common_batch import show_jobs
import os, shutil, sys, getopt
# parse input arguments
if len(sys.argv) < 2:
print 'loremipsum_strong.py <epssqr>'
sys.exit()
epssqr = sys.argv[1];
spgqpsolver_eps = "1e-6";
p... |
from SimPEG import Survey, Problem, Utils, np, sp
from scipy.constants import mu_0
from SimPEG.EM.Utils import *
from SimPEG.Utils import Zero
class BaseSrc(Survey.BaseSrc):
"""
Base source class for FDEM Survey
"""
freq = None
integrate = False
_ePrimary = None
_bPrimary = None
_hPrim... |
__version__ = '0.51.0'
from dicomweb_client.api import DICOMwebClient # noqa
|
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... |
# encoding: utf-8
import os
import string
import random
import re
import time
from subprocess import Popen, PIPE
from datetime import datetime
#import logging
import bones.event
from bones.bot import Module
from twisted.internet import reactor
mod_dir = os.path.dirname(__file__)
antiflood_timeout = 2.0
class basic(... |
# Copyright 2016 Red Hat, 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 law ... |
__version__ = 'unknown'
try:
__version__ = __import__('pkg_resources').get_distribution('django_richenum').version
except Exception:
pass
|
# coding: utf-8
from __future__ import unicode_literals
import itertools
import re
from .common import (
InfoExtractor,
SearchInfoExtractor
)
from ..compat import (
compat_HTTPError,
compat_kwargs,
compat_str,
compat_urlparse,
)
from ..utils import (
error_to_compat_str,
ExtractorError... |
""" core implementation of testing process: init, session, runtest loop. """
import enum
import fnmatch
import functools
import importlib
import os
import sys
from typing import Dict
import attr
import py
import _pytest._code
from _pytest import nodes
from _pytest.config import directory_arg
from _pytest.config impor... |
from itertools import repeat
import utils
import pyglet, math, resources as res
from pyglet.window import key
from pyglet.graphics import glMatrixMode, GL_PROJECTION, glLoadIdentity, gluOrtho2D, glClear, GL_COLOR_BUFFER_BIT, GL_MODELVIEW, glTranslatef
import game.graphics
from game.objects import Ship, EnemyShip, Bulle... |
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.files.base import File
from django.core.files.storage import Storage
from django.db import connections
from django.utils.encoding import force_unicode
try:
from gridfs import GridFS, NoFile
except ImportError:... |
## Copyright (c) 2009-2011, Florian Finkernagel. All rights reserved.
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions are
## met:
## * Redistributions of source code must retain the above copyright
## notice, this li... |
from django.template import Library
from django.utils.safestring import mark_safe
from django.utils.functional import memoize
register = Library()
def and_n_others(values, limit):
# type: (List[str], int) -> str
# A helper for the commonly appended "and N other(s)" string, with
# the appropriate pluraliza... |
import types
import xml.etree.cElementTree as ElementTree # for VDJXML parsing
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.Alphabet import generic_dna
from Bio.SeqRecord import SeqRecord
from Bio.SeqFeature import SeqFeature, FeatureLocation
# ===================
# = DATA STRUCTURES =
# ================... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.