src stringlengths 721 1.04M |
|---|
import random
import pytest
from cctbx import sgtbx
from dials.algorithms.symmetry.cosym._generate_test_data import generate_intensities
from dials.array_family import flex
from dxtbx.model import Beam, Crystal, Experiment, Scan
from dxtbx.model.experiment_list import ExperimentList
from dxtbx.serialize import load
fr... |
# Lint as: python3
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
#!/usr/bin/env python
from tkFileDialog import *
from Tkinter import *
from tkSimpleDialog import Dialog
import tkMessageBox
from plotAscii import *
from imageUtil import *
from view2d import *
from mdaAscii import *
import Pmw
import os, string
import AppShell
global Scan
global SH # SHARED
class setupPrinter(... |
from pylibelf import *
from pylibelf.types import *
from pylibelf.iterators import *
from pylibelf.constants import *
from pylibelf.util import *
from pylibelf.util.syms import *
from pylibelf.macros import *
from bisect import bisect_left
import pylibelf.util
import pylibelf
import types
import os
def _inrange(x, a,b... |
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 23 19:05:35 2017
@author: SuperKogito
"""
# Define imports
import tkinter as tk
class ExitPage(tk.Frame):
""" Exit page class """
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent)
self.controller = controller
self.con... |
#!/usr/bin/python
import lldb
import fblldbbase as fb
def lldbcommands():
return [
PrintDebugInformation(),
PrintUnifications(),
PrintTypes(),
PrintMachineTypes(),
PrintRewriteCalls(),
RecorderDump()
]
class PrintDebugInformation(fb.FBCommand):
def name(self):
return 'xl'
def de... |
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404, render_to_response
from django.utils.functional import memoize
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import TemplateView, ListView as BaseListView
from bootstrap.views import (ListView,... |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... |
from oslo.config import cfg
from SoftLayer import API_PUBLIC_ENDPOINT
FILE_OPTIONS = {
None: [
cfg.ListOpt('enabled_services', default=['identity',
'compute',
'image',
... |
#!/usr/bin/python3
""" service_main.py:
"""
# Import Required Libraries (Standard, Third Party, Local) ********************
import asyncio
import datetime
import logging
if __name__ == "__main__":
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)... |
import json
import time
import unittest
from datetime import datetime, timedelta
from mock import Mock, patch
from six.moves.urllib.parse import parse_qs, urlparse
from xero.api import Xero
from xero.auth import (
OAuth2Credentials,
PartnerCredentials,
PrivateCredentials,
PublicCredentials,
)
from xero... |
# Amara, universalsubtitles.org
#
# Copyright (C) 2013 Participatory Culture Foundation
#
# 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 Free Software Foundation, either version 3 of the
# License, or (at your op... |
from unittest import TestCase
from urllib.parse import urlparse
import warnings
from scrapy.http import Response, Request
from scrapy.spiders import Spider
from scrapy.spidermiddlewares.offsite import OffsiteMiddleware, URLWarning
from scrapy.utils.test import get_crawler
class TestOffsiteMiddleware(TestCase):
... |
from rest_framework import generics, permissions
from django.contrib.auth.models import User
# from T.tings.models.models_users import TUserProfile
from T.tings.serializers.serializers_users import TUserSerializer
class TUserPermission(permissions.BasePermission):
"""
Custom permission to only allow owners of... |
# Copyright 2012 NEC 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 ag... |
"""
High-level libvirt test utility functions.
This module is meant to reduce code size by performing common test procedures.
Generally, code here should look like test code.
More specifically:
- Functions in this module should raise exceptions if things go wrong
- Functions in this module typically use funct... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the operating system path specification implementation."""
import platform
import unittest
from dfvfs.path import os_path_spec
from tests.path import test_lib
class OSPathSpecTest(test_lib.PathSpecTestCase):
"""Tests for the operating system path specificati... |
'''
Created on 22/09/2017
@author: Frank Delporte
'''
import thread
import Tkinter as tk
import tkFont
import time
from ButtonHandler import *
from KeyReader import *
from PongGui import *
from SlideShow import *
from ConsoleMenu import *
from Legend import *
try:
import keyboard # pip install keyboard
... |
import datetime
from socket import *
from sportorg.utils.time import time_to_hhmmss
"""
Format of WDB data package
- length is 1772 bytes
1) 36b text block at the beginning
2 4132500 0 0 3974600\n
bib - finish_time - disqual_status - 0 - start_time
2) binary part
bytes 128-131 - card number
by... |
#! /usr/bin/env python3
import sys
import re
def uso():
"""Imprime instruções de uso do programa."""
uso = """
Este programa gera a ordem correta de inclusão em um banco de dados.
Passe o nome dos arquivos na linha de comando. Caso queira imprimir
ocorrências de referência circular ou inexistente ... |
# 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 ... |
# defivelo-intranet -- Outil métier pour la gestion du Défi Vélo
# Copyright (C) 2016 Didier Raboud <me+defivelo@odyx.org>
#
# 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 Free Software Foundation, either version... |
# -*- coding: utf-8 -*-
from gettext import gettext as _
LEVEL1 = [
1,
_('Divisions'),
['lineasDepto'],
[],
[
(_('Adilabad'), 1, _('Adilabad'), _("It's in the north")),
(_('Nizamabad'), 1, _('Nizamabad'), _("It's in the northwest")),
(_('Karimnagar'), 1, _('Karimnagar'), _(... |
from contextlib import contextmanager
from io import StringIO
import tempfile
import logging
import time
import os
log = logging.getLogger("harpoon.helpers")
@contextmanager
def a_temp_file():
"""Yield the name of a temporary file and ensure it's removed after use"""
filename = None
try:
tmpfile ... |
import os
import errno
import subprocess
def mkdir_p(path):
'''Recursively make all directories in a path'''
try:
os.makedirs(path)
except OSError as exc:
if exc.errno == errno.EEXIST:
pass
else: raise
def dict_sorted(d):
'''Returns dict sorted by key as a list of t... |
import sys
from termcolor import colored
class Messages():
LOGFILE = "git-events.log"
#Status and operations
RUNNING = 'Successfully started gitevents'
WAS_RUNNING = 'Gitevents is already running'
NOT_RUNNING = 'Git-events is not running'
STOPPED = 'Successfully stopped gitevents'
#Error... |
from eclcli.common import command
from eclcli.common import utils
from ..networkclient.common import utils as to_obj
class ListCommonFunction(command.Lister):
def get_parser(self, prog_name):
parser = super(ListCommonFunction, self).get_parser(prog_name)
parser.add_argument(
'--descrip... |
# vote.py
# Handles server-side logic for voting
# by Chad Wyszynski (chad.wyszynski@csu.fullerton.edu)
import webapp2
from google.appengine.api import users
import datastore
import json
import logging
class RequestHandler(webapp2.RequestHandler):
# valid vote types
vote_types = {"up": 1, "down": -1}
# H... |
#!/usr/bin/env python
#
# Problem: Ticket Swapping
# Language: Python
# Author: KirarinSnow
# Usage: python thisfile.py <input.in >output.out
for case in range(int(raw_input())):
n, m = map(int, raw_input().split())
s = [map(int, raw_input().split()) for i in range(m)]
z = 0
do = {}
de = {}
... |
# -*- coding: utf8 -*-
# Copyright (C) 2013 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
"""
This file is a wrapper for autopep8 library.
"""
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../linting'))
import threading
f... |
import requests
from bloodon.accounts.social.providers.oauth2.views import (OAuth2Adapter,
OAuth2LoginView,
OAuth2CallbackView)
from .provider import GoogleProvider
class GoogleOAuth2Adapter(OAuth... |
# -*- encoding: utf-8 -*-
#
# Copyright (c) 2013 Paul Tagliamonte <paultag@debian.org>
# Copyright (c) 2013 Julien Danjou <julien@danjou.info>
# Copyright (c) 2013 Nicolas Dandrimont <nicolas.dandrimont@crans.org>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and as... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import base64
import itertools
import functools
from datetime import datetime
import traceback
from PyQt5.QtCore import QByteArray, QTimer
from PyQt5.QtNetwork import (
QNetworkAccessManager,
QNetworkProxyQuery,
QNetworkRequest,
QNetworkRe... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/joncrall/code/hotspotter/hsgui/_frontend/EditPrefSkel.ui'
#
# Created: Mon Feb 10 13:40:41 2014
# by: PyQt4 UI code generator 4.9.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
... |
#!/usr/bin/python
import pyaudio
import wave
import urllib2
import thread
import time
import requests
CHUNK = 1024
FORMAT = pyaudio.paInt16 #paInt8
CHANNELS = 2
RATE = 44100 #sample rate
filename = "output.wav"
website = 'http://ec2-54-71-180-108.us-west-2.compute.amazonaws.com/hearboi/device/record/status'
status =... |
#
# This sets up how models are displayed
# in the web admin interface.
#
from django import forms
from django.conf import settings
from django.contrib import admin
from src.objects.models import ObjAttribute, ObjectDB, ObjectNick, Alias
from src.utils.utils import mod_import
class ObjAttributeInline(adm... |
# Anibots (anigraf robots) physical/visual sim
#
# Copyright (c) 2007-2012 Samuel H. Kenyon. <sam@synapticnulship.com>
# http://synapticnulship.com
# This is open source, made available under the MIT License (see the
# accompanying file LICENSE).
#
# This python script connects my anibots C++ program (with the help of... |
# Authors:
# Rob Crittenden <rcritten@redhat.com>
#
# Copyright (C) 2010 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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... |
# Copyright 2004-2006 Joe Wreschnig, Michael Urman, Iñigo Serna
# 2012 Christoph Reiter
# 2013 Nick Boultbee
#
# 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 ... |
#!multiconf
from multiconf.envs import EnvFactory
from multiconf import ConfigRoot, ConfigItem, ConfigBuilder
from multiconf.decorators import nested_repeatables, repeat, required, named_as
@nested_repeatables('cloud_servers, jenkins, apache')
@required('git')
class Project(ConfigRoot):
def __init__(self, selecte... |
from setuptools import setup, find_packages
VERSION = (1, 0, 0)
# Dynamically calculate the version based on VERSION tuple
if len(VERSION)>2 and VERSION[2] is not None:
str_version = "%d.%d_%s" % VERSION[:3]
else:
str_version = "%d.%d" % VERSION[:2]
version= str_version
setup(
name='django-options',
... |
# This file is part of cappuccino.
#
# cappuccino is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cappuccino is distributed i... |
'''
wallstweet, February 9th, 2014
Data mining twitter with style.
Copyright 2014 Riley Dawson, Kent Rasmussen, Chadwyck Goulet
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.apa... |
# -*- coding: utf-8 -*-
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from datetime import datetime, timedelta
from mock import patch
from accounts.models import Account
class TestIndexView(TestCase):
def setUp(self):
self.url ... |
from datetime import date, timedelta
from django.conf import settings
from django.core.management.base import BaseCommand
from kitsune.kpi.management import utils
from kitsune.kpi.models import L10N_METRIC_CODE, Metric, MetricKind
from kitsune.sumo import googleanalytics
class Command(BaseCommand):
help = "Calc... |
"""
Spin-restricted Hartree-Fock for atom
"""
import numpy as np
import scipy.linalg as slg
from frankenstein import molecule, scf
from frankenstein.tools.mol_utils import get_norb_l
from frankenstein.tools.scf_utils import get_fock, get_fock_ao_direct, \
get_scf_energy
from frankenstein.data.atom_data import ge... |
# -*- coding: utf-8 -*-
import os
import zipfile
from django import forms
from django.conf import settings
from django.core.cache import cache
from django.core.urlresolvers import reverse
from mock import Mock, patch
from nose.tools import eq_
import amo.tests
from files.utils import SafeUnzip
from mkt.files.helpers... |
from __future__ import print_function
import yaml
import os
from apt_package_mirror.mirror import Mirror
import sys
import argparse
def main():
# When files are created make them with a 022 umask
os.umask(022)
# Add commandline options and help text for them
parser = argparse.ArgumentParser()
par... |
#!/usr/bin/env python
#-------------------------------------------------------------------------------
# FILE: gentankdiy.py
# PURPOSE: gentankdiy.py add enhanced external tank data to genmon
#
# AUTHOR: jgyates
# DATE: 06-18-2019
#
# MODIFICATIONS:
#--------------------------------------------------------------... |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import unittest
import os
import numpy as np
from pymatgen.core import PeriodicSite
from pymatgen.io.vasp import Vasprun, Poscar, Outcar
from pymatgen.analysis.defects.core import Vacancy, Interstitial, Def... |
"""Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... |
# -*- coding: utf-8 -*-
"""
g_octave.description_tree
~~~~~~~~~~~~~~~~~~~~~~~~~
This module implements a Python object with the content of a directory
tree with DESCRIPTION files. The object contains *g_octave.Description*
objects for each DESCRIPTION file.
:copyright: (c) 2009-2010 by Rafael... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.db.models.deletion
import django.utils.timezone
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("auth", "0006_require_contenttypes_0002")]
replaces = [("userprofile", "0001_initial... |
#!/usr/bin/python
import threading
import time
import logging
logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s %(levelname)s |%(name)s| %(message)s',
filename='/tmp/mygoclient.log',
filemode='a',
)
logger = logging.getLogger(__name__)
class InputThread(threading.Thread):
'''
Basi... |
# coding=gbk
import re
import string,urlparse
import os.path as osp
nums = string.digits
# Çå³ýhtml´úÂëÀïµÄ¶àÓà¿Õ¸ñ
def clearBlank(html):
if not html or html == None : return ;
html = re.sub('\r|\n|\t','',html)
html = html.replace(' ','').replace(' ','').replace('\'','"')
return html
def... |
from __future__ import print_function
import matplotlib.pyplot as plt
import numpy as np
import os
import sys
import time
import tarfile
from IPython.display import display, Image
from scipy import ndimage
from sklearn.linear_model import LogisticRegression
from six.moves.urllib.request import urlretrieve
from six.move... |
import logging
import logging.config
import sys
from flask import Flask,render_template
from werkzeug.contrib.fixers import ProxyFix
from datetime import datetime
from apis import api, db
import os
log = logging.getLogger('werkzeug')
log.setLevel(logging.ERROR)
DATE_FORMAT="%Y-%m-%d %H:%M:%S"
FORMAT = '%(asctime)s - %... |
import sys
import os
from PySide import QtCore, QtGui
from P4 import P4, P4Exception
# http://stackoverflow.com/questions/32229314/pyqt-how-can-i-set-row-heights-of-qtreeview
class TreeItem(object):
def __init__(self, data, parent=None):
self.parentItem = parent
self.data = data
self.ch... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
ModelerGraphicItem.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
********************... |
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# 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
... |
'''Utility functions and classes used internally by Skype4Py.
'''
import sys
import weakref
import threading
from new import instancemethod
def chop(s, n=1, d=None):
'''Chops initial words from a string and returns a list of them and the rest of the string.
@param s: String to chop from.
@type s: str or... |
"""Variable transforms. Used for mapping to infinite intervals etc."""
from __future__ import print_function
from numpy import Inf
from numpy import hypot, sqrt, sign
from numpy import array, asfarray, empty_like, isscalar, all, equal
class VarTransform(object):
"""Base class for variable transforms."""
de... |
from github import Github
g = Github("cobrabot", "dd31ac21736aeeaeac764ce1192c17e370679a25")
cobratoolbox = g.get_user("opencobra").get_repo("cobratoolbox")
contributors = {}
for contributor in cobratoolbox.get_stats_contributors():
a = 0
d = 0
c = 0
for week in contributor.weeks:
a += week.... |
# Copyright 2016 Hewlett Packard Enterprise Development, LP.
#
# 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 req... |
# $Id$
##
## This file is part of pyFormex 0.8.9 (Fri Nov 9 10:49:51 CET 2012)
## pyFormex is a tool for generating, manipulating and transforming 3D
## geometrical models by sequences of mathematical operations.
## Home page: http://pyformex.org
## Project page: http://savannah.nongnu.org/projects/pyformex/
##... |
"""
Database Acess Layer
"""
import datetime
import itertools
import operator
from django.db.models import Q
from django.db import transaction
from django.core.exceptions import ObjectDoesNotExist
from openlets.core import models
def get_balance(persona, personb, currency):
"""Load a balance between two persons.
... |
# encoding: utf-8
# module PyQt4.QtCore
# from /usr/lib/python3/dist-packages/PyQt4/QtCore.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import sip as __sip
class QSemaphore(): # skipped bases: <class 'sip.simplewrapper'>
""" QSemaphore(int n=0) """
def acquire(self, int_n=1): # rea... |
"""distutils.ccompiler
Contains CCompiler, an abstract base class that defines the interface
for the Distutils compiler abstraction model."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id$"
import sys, os, re
from types import *
from copy import copy
from distutils.errors import *
fro... |
<%
# Instance On/Off logic
# This code handles the turning a machine on/off depending on user input.
# It should be run after all normal create/update/delete logic.
-%>
class InstancePower(object):
def __init__(self, module, current_status):
self.module = module
self.current_status = current_status
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2013 Zuza Software Foundation
#
# This file is part of Pootle.
#
# Pootle 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 Lic... |
# Copyright 2013 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 License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
'''
Wifi Facade.
=============
The :class:`Wifi` is to provide access to the wifi of your mobile/ desktop
devices.
It currently supports `connecting`, `disconnecting`, `scanning`, `getting
available wifi network list` and `getting network information`.
Simple examples
---------------
To enable/ turn on wifi scannin... |
#!/usr/bin/env python
"""
Functions for creating temporary datasets
Used in test_views
"""
import os
import time
import argparse
from collections import defaultdict
import numpy as np
import PIL.Image
IMAGE_SIZE = 10
IMAGE_COUNT = 10 # per category
def create_classification_imageset(folder, image_size=None, imag... |
#!/usr/bin/python
# Author: Thomas Dimson [tdimson@gmail.com]
# Date: January 2011
# For distribution details, see LICENSE
"""Queue server for npsgd modelling tasks.
The queue server is the data backend for NPSGD. It listens to both workers and
the web interface. The web interface populates it with requests while t... |
# -*- coding: utf-8 -*-
#
## This file is part of INSPIRE.
## Copyright (C) 2012, 2013 CERN.
##
## INSPIRE 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 opti... |
#!/usr/bin/python2
"""
bootalert
Sends email with hostname and IP address
Brian Parsons <brian@pmex.com>
"""
import ConfigParser
import datetime
import re
import smtplib
import socket
import sys
import urllib2
# Get Hostname
hostname = socket.gethostname()
# Get current IP
try:
ipsite = urllib2.urlopen('http... |
import symath
from symath.graph.algorithms import *
import symath.graph.generation as graphgen
import unittest
class TestDirectedGraph(unittest.TestCase):
def setUp(self):
self.x, self.y, self.z, self.w, self.e1, self.e2 = symath.symbols('x y z w e1 e2')
self.g = symath.graph.directed.DirectedGra... |
# Copyright 2017 The Forseti Security 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 ap... |
# -*- coding: utf-8 -*-
#
#
# Copyright 2017 Rosen Vladimirov
#
# 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 Free Software Foundation, either version 3 of the
# License, or (at your option) any l... |
# -*- coding: utf-8 -*-
import asyncio
import ccxt
import ccxt.async_support as ccxta # noqa: E402
import time
import os
import sys
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root + '/python')
def sync_client(exchange):
client = getattr(ccxt, exchange)()... |
"""
@todo Clean up the LimitTreeMaker python file to not depend on these extra variables in cuts.py
"""
import os
from .. import Load, DirFromEnv
newLimitTreeMaker = Load('LimitTreeMaker')
def SetupFromEnv(ltm):
"""A function that sets up the LimitTreeMaker after sourcing a config file
@param ltm The Limit... |
#
# Copyright 2016 The BigDL Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
#!/usr/bin/env python
# encoding: utf-8
"""
cli.py
Created by Thomas Mangin on 2014-12-22.
Copyright (c) 2009-2015 Exa Networks. All rights reserved.
"""
import sys
from exabgp.dep.cmd2 import cmd
from exabgp.version import version
class Completed (cmd.Cmd):
# use_rawinput = False
# prompt = ''
# doc_header =... |
"""
Django settings for web project.
Generated by 'django-admin startproject' using Django 1.10.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
# Bu... |
from datetime import timedelta
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
from django.db.models import Count
from django.utils import timezone
class Command(BaseCommand):
help = """Prune old, inactive user accounts.
Conditions for removing an user account... |
from __future__ import print_function
from setuptools import setup, find_packages
from acky import __version__
import sys
if sys.version_info <= (2, 7):
error = "ERROR: acky requires Python 2.7 or later"
print(error, file=sys.stderr)
sys.exit(1)
with open('README.rst') as f:
long_description = f.read(... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-09-12 19:47
from __future__ import unicode_literals
from django.conf import settings
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = T... |
#!/usr/bin/env python
'''
DigitalOcean external inventory script
======================================
Generates Ansible inventory of DigitalOcean Droplets.
In addition to the --list and --host options used by Ansible, there are options
for generating JSON of other DigitalOcean data. This is useful when creating
d... |
"""mapa URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based... |
# -*- coding: utf-8 -*-
# Copyright 2019 Green Valley Belgium NV
#
# 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... |
from FileName import FileName
from MetaInfo import MetaInfo
from ProtectFlags import ProtectFlags
from TimeStamp import TimeStamp
from FSError import *
from FSString import FSString
import amitools.util.ByteSize as ByteSize
class ADFSNode:
def __init__(self, volume, parent):
self.volume = volume
self.blkdev ... |
import os
import sys
import logging
__all__ = ['logger']
try:
from colorama import init, Fore, Style
init(autoreset=False)
colors = {
'good' : Fore.GREEN,
'bad' : Fore.RED,
'vgood' : Fore.GREEN + Style.BRIGHT,
'vbad' : Fore.RED + Style.BRIGHT,
'std' : '... |
from typing import Dict, Optional
import networkx
from randovania.game_description.area import Area
from randovania.game_description.game_patches import GamePatches
from randovania.game_description.node import Node, DockNode, TeleporterNode, PickupNode, ResourceNode
from randovania.game_description.resources.pickup_i... |
# Copyright (C) 2010-2013 Claudio Guarnieri.
# Copyright (C) 2014-2016 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
import select
import socket
import threading
try:
import pycares
HAVE_CARES = True
except:
HA... |
import sys
import argh
import asyncio
import warnings
from Bio import SeqIO
import pandas as pd
from tictax import tictax
def configure_warnings(show_warnings):
'''Show or suppress warnings, mainly for TreeSwift Tree.mrca() operations'''
if show_warnings:
warnings.filterwarnings('always')
else:
... |
import string
import os.path
import copy
import requests
import mimetypes
from file import settings
from django.http import HttpResponseRedirect, HttpResponse
from decorators import HttpOptionsDecorator, VoolksAPIAuthRequired
from django.views.decorators.csrf import csrf_exempt
def get_api_credentials(request):
'... |
# Don't import unicode_literals because of a bug in py2 setuptools
# where package_data is expected to be str and not unicode.
from __future__ import absolute_import, division, print_function
# Ensure setuptools is available
import sys
try:
from ez_setup import use_setuptools
use_setuptools()
except ImportErr... |
from JumpScale import j
import socket
import time
# import urllib.request, urllib.parse, urllib.error
try:
import urllib.request
import urllib.parse
import urllib.error
except:
import urllib.parse as urllib
class GraphiteClient:
def __init__(self):
self.__jslocation__ = "j.clients.grap... |
#!/usr/bin/python
## Math
import numpy as np
## Display
import pygame
import time
import math
## Ros
import rospy
from tf import transformations as tf_trans
## Ros Msgs
from std_msgs.msg import Header, Float64, Int64
from ieee2015_end_effector_servos.msg import Num
from geometry_msgs.msg import Point, PointStamped, Pos... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.