src stringlengths 721 1.04M |
|---|
import warnings
from .._compat import integer_types
from .._compat import string_types
from .._compat import text_type
from .._compat import to_bytes
from .._compat import to_native
from ..datastructures import Headers
from ..http import dump_cookie
from ..http import HTTP_STATUS_CODES
from ..http import remove_entity... |
#!/usr/bin/env python3
from os.path import exists
from subprocess import PIPE
from subprocess import Popen
from _thread import start_new_thread
from pynicotine.pluginsystem import BasePlugin
from pynicotine.pluginsystem import returncode
def enable(frame):
global PLUGIN
PLUGIN = Plugin(frame)
def disable(... |
# -*- coding:utf-8 -*-
# Created by Hans-Thomas on 2011-05-15.
#=============================================================================
# test_feature.py --- Wishes feature vows
#=============================================================================
from __future__ import unicode_literals
import mock
im... |
#!/usr/bin/env python
#
# Copyright 2015 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 requir... |
# encoding: utf-8
from south.v2 import DataMigration
from django.contrib.gis.maps.google.overlays import GPolygon
class Migration(DataMigration):
class NewGPolygon(GPolygon):
def latlng_from_coords(self, coords):
"Generates a JavaScript array of GLatLng objects for the given coordinates."
... |
import os.path
import datetime
import pytz
from django.conf import settings
from django.db.models import F
from datetime import timedelta
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.contrib.auth.models i... |
# -*- coding: utf-8 -*-
'''
Object factories for testing.
'''
from factory import Sequence, PostGenerationMethodCall
from factory.alchemy import SQLAlchemyModelFactory
from random import randint
from dci_notify.user.models import User
from dci_notify.database import db
class BaseFactory(SQLAlchemyModelFactory):
... |
def zoneConcentration(shp_gdf, raw, pntLst, bufr=None):
from downloading_funcs import addr_shape, down_extract_zip
import pandas as pd
import geopandas as gpd
pnt = pntLst[0]
pnt_isCalled = pntLst[1]
for url in pnt:
if url[-3:] == 'zip':
pnt = url
asser... |
"""
Salamander ALM
Copyright (c) 2016 Djuro Drljaca
This Python module 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 Python module ... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 later version.
#
# This program is ... |
# -*- coding: utf8 -*-
from django.db import models
from django.contrib.auth.models import User
class Type(models.Model):
name = models.CharField('название', max_length=255)
class Meta:
verbose_name = 'тип заявки'
verbose_name_plural = 'типы заявок'
def __unicode__(self):
return... |
# Copyright 2021 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... |
__author__ = 'saeedamen'
#
# Copyright 2015 Thalesians Ltd. - http//www.thalesians.com / @thalesians
#
# 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... |
"""Web UI for Seam Erasure."""
from __future__ import print_function
import os
import base64
import io
import time
import numpy
from PIL import Image
from flask import Flask, request, render_template, send_file
from seam_erasure import seam_erasure, obj_reader, util
from seam_erasure import weight_data
app = Flas... |
# coding: utf-8
# In[ ]:
import h2o
import pandas as pd
# initialize the model scoring server
h2o.init(nthreads=1,max_mem_size=1, start_h2o=True, strict_version_check = False)
def approve_loan(Loan_Amount,Term,Interest_Rate,Employment_Years,Home_Ownership,Annual_Income,Verification_Status,Loan_Purpose,State,
... |
#!/usr/bin/env python
"""
Author: Ryan Golhar <ryan.golhar@bms.com>
Date: 06/24/15
This script adds readme.txt, *.fastq.gz to a Galaxy Library
Usage: addFilesToLibrary [-h] [--api-key <API_KEY>] [--api-url <API_URL>] <path of directory to scan> <library_name>
"""
import ConfigParser
import os
import argparse
import s... |
import numpy as np
import matplotlib.pyplot as pylab
from matplotlib.widgets import Slider
#==================================================
# decorators
#==================================================
def io(func):
'''
an io decorator that allows
inpu... |
from helpers import *
from adminchat import *
imout_toggle_list = []
@hook.command("imout")
def on_imout_command(sender, command, label, args):
if not is_player(sender):
msg(sender, "&cThis command can't be run from the console")
return True
if sender.hasPermission("utils.imout"):
name... |
print(10 + 3)
# 13
print(10 - 3)
# 7
print(10 * 3)
# 30
print(10 / 3)
# 3.3333333333333335
print(10 // 3)
# 3
print(10 % 3)
# 1
print(10 ** 3)
# 1000
print(2 ** 0.5)
# 1.4142135623730951
print(10 ** -2)
# 0.01
print(0 ** 0)
# 1
# print(10 / 0)
# ZeroDivisionError: integer division or modulo by zero
# print(1... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import json
import datetime
import math
import re
from collections import defaultdict
from dateutil.relativedelta import relativedelta
from odoo import api, fields, models, _
from odoo.exceptions import AccessError, Us... |
#!/usr/bin/python
############################################################################
# Copyright (C) 2011-2013 SchedMD LLC
# Written by David Bigagli <david@schedmd.com>
#
# This file is part of SLURM, a resource management program.
# For details, see <http://slurm.schedmd.com/>.
# Please also read the inclu... |
import click
import re
import os
import hashlib
import json
import string
import random
import sys
from jinja2 import Template
class AttrDict(dict):
def __init__(self, *args, **kwargs):
super(AttrDict, self).__init__(*args, **kwargs)
self.__dict__ = self
def random_string(size=6, chars=string.as... |
# SecuML
# Copyright (C) 2018 ANSSI
#
# SecuML 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.
#
# SecuML is distributed in the hope t... |
# Copyright 2016 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- mode: python ; coding: utf-8 -*-
#
# Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Publi... |
import logging
import threading
from socket import AF_UNSPEC
from pyroute2.common import basestring
from pyroute2.netlink import nlmsg
from pyroute2.netlink.rtnl.rtmsg import rtmsg
from pyroute2.netlink.rtnl.req import IPRouteRequest
from pyroute2.ipdb.transactional import Transactional
from pyroute2.ipdb.linkedset imp... |
# -*- encoding: utf-8 -*-
#
# 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... |
# -*- coding: utf-8 -*-
"""
CO2 2.0 Plugin
Copyright (C) 2019 Olaf Lüke <olaf@tinkerforge.com>
co2_v2.py: CO2 2.0 Plugin Implementation
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... |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
#
# Copyright (C) 2015-2018 University of Oxford
#
# This file is part of msprime.
#
# msprime 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... |
#!/usr/bin/env python
# Copyright (C) 2009-2010 GSyC/LibreSoft, Universidad Rey Juan Carlos
#
# 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... |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import meep_utils, meep_materials
import numpy as np
from meep_utils import in_sphere, in_xslab, in_yslab, in_zslab
import meep_utils
"""
"""
class SapphireBars(meep_utils.AbstractMeepModel): #{{{
""" Array of sapphire bars along the E-field
"""
def cell_cente... |
"""
Here are defined all book related views as below:
BookList
AuthorList
AddEditBook
AddEditAuthor
"""
from flask import (
render_template,
request,
redirect,
url_for,
views,
)
from flask_login import login_required, current_user
from app.lib.abstract import BookAbstraction, Auth... |
from UnitModel import *
__author__ = 'benjaminsmith'
"""Inherits from UnitModel"""
class ActionModel(UnitModel):
"""Set initial ActionModel."""
def __init__(self,action_name,tendency,value,pos_expectancy,neg_expectancy,pos_val,neg_val,threshold,chaos,persistence):
super(ActionModel,self).__init__(actio... |
import numpy as np
from sklearn.base import RegressorMixin, clone
from sklearn.externals.joblib import Parallel, delayed
from sklearn.utils import Bunch
from sklearn.utils.metaestimators import _BaseComposition
def _parallel_fit_estimator(estimator, X, y, sample_weight=None):
if sample_weight:
estimator.f... |
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "L... |
"""
.. module: historical.s3.poller
:platform: Unix
:copyright: (c) 2017 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
.. author:: Mike Grima <mgrima@netflix.com>
"""
import os
import uuid
import logging
import boto3
from botocore.exceptions import ClientError
from ... |
#!/usr/bin/env python
"""
get_beer.py - Version 0.1 2015-03-11
pick up the beer can and deliver it another
"""
import rospy, sys
import moveit_commander
from geometry_msgs.msg import PoseStamped, Pose
from moveit_commander import MoveGroupCommander, PlanningSceneInterface
from moveit_msgs.msg import Pla... |
from __future__ import absolute_import, unicode_literals
import collections
import itertools
import logging
import pykka
from mopidy import audio, backend, mixer, service
from mopidy.audio import PlaybackState
from mopidy.core.service import ServiceController
from mopidy.core.history import HistoryController
from mo... |
import json
import logging
import os
from collections import OrderedDict
from pokemongo_bot.base_dir import _base_dir
'''
Helper class for updating/retrieving Inventory data
Interesting info and formulas:
https://drive.google.com/file/d/0B0TeYGBPiuzaenhUNE5UWnRCVlU/view
https://www.reddit.com/r/pokemongodev/comments... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008 Andrew Resch <andrewresch@gmail.com>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
from _... |
#!/usr/bin/env python
import unittest
import sys,os
import index
import classifier
path = os.path.abspath(__file__)
sys.path.append(os.path.join(os.path.dirname(path), "../"))
import utils
from settings import settings
corpus = [
dict(question_id=0,tags=["Windows","crash","bluescreen"],body="Help! Windows 8 cr... |
import tweepy, time, sys, yaml, json
class Bot(object):
"""docstring for Bot"""
def __init__(self):
super(Bot, self).__init__()
self.creds = None
self.api = self.load_api()
def load_api(self):
with open('credentials.yaml', 'r') as f:
self.creds = yaml.load(f)
auth = tweepy.OAuthHandler(self.creds[... |
#!/usr/bin/env python3
# -*- coding:UTF-8 -*-
# Copyright (c) 2014 Nicolas Iooss
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights... |
#https://bitbucket.org/mhallin/py-scrypt/src
#pip3.4 install scrypt
#pip3.4 install pycrypto
import struct
from binascii import b2a_base64 as e64
from binascii import a2b_base64 as d64
import scrypt
import Crypto.Random
random = Crypto.Random.new().read
#from passlib.utils import consteq
def consteq(left, right):
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import cv2
import sys
import ava.cv.utl
import random
import numpy as np
def main( argv = None ):
if argv is None:
argv = sys.argv
# test_with_gray()
print('----------... |
# coding: utf-8
from __future__ import unicode_literals, print_function
import pytest
from oar.lib import db
from oar.kao.job import insert_job
from oar.kao.platform import Platform
from oar.kao.kamelot_fifo import main, schedule_fifo_cycle
@pytest.yield_fixture(scope='function', autouse=True)
def minimal_db_initi... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Client blueprint used to handle OAuth callbacks."""
from flask import Blueprint, ... |
from elasticsearch import Elasticsearch,RequestsHttpConnection,NotFoundError
from flask import url_for
import config
import json
class Lead(object):
es = Elasticsearch(config.ES_HOSTS,connection_class=RequestsHttpConnection)
@staticmethod
def create_lead(lead_data):
try:
results = Lead.es.create(index... |
# Copyright 2019 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, ... |
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, m... |
"""record
The record data structure and helper functions.
"""
import collections
import hashlib
# -----------------------------------------------------------------------------
# The main data structure
# -----------------------------------------------------------------------------
record_fields = ['version', 'fr... |
# -*- coding: utf-8 -*-
import json
from datetime import datetime
from django.core.urlresolvers import reverse
from django.db import models
from django.contrib.auth.models import User
from model_utils.managers import InheritanceManager
class PollManager(models.Manager):
def active(self):
return self.filt... |
import json
import requests
GEOCODING_URL = 'http://maps.googleapis.com/maps/api/geocode/json'
ZERO_RESULTS = 'ZERO_RESULTS'
OVER_QUERY_LIMIT = 'OVER_QUERY_LIMIT'
REQUEST_DENIED = 'REQUEST_DENIED'
INVALID_REQUEST = 'INVALID_REQUEST'
ERRORS = (ZERO_RESULTS, OVER_QUERY_LIMIT, REQUEST_DENIED, INVALID_REQUEST)
def get_l... |
from antlr4 import *
from AbstractSyntaxTree import *
from VisitorSymbolTable import *
class VisitorDeclarationProcessor(VisitorSymbolTable):
def __init__(self, symbolTable, errorHandler):
super(VisitorDeclarationProcessor, self).__init__(symbolTable, errorHandler)
self.mainFunctionDefined = False
... |
# -*- coding: utf-8 -*-
# Copyright 2016 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 applicable la... |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Generator for C style prototypes and definitions """
import glob
import os
import re
import sys
from idl_log import ErrOut, I... |
import abc
import datetime
import enum
import typing
import jsii
import jsii.compat
import publication
from jsii.python import classproperty
import aws_cdk.aws_cloudwatch
import aws_cdk.aws_iam
import aws_cdk.core
__jsii_assembly__ = jsii.JSIIAssembly.load("@aws-cdk/aws-logs", "1.15.0", __name__, "aws-logs@1.15.0.js... |
#!/usr/bin/python
import urllib2
import sys
def getTopology(mol_id):
l = urllib2.urlopen("http://compbio.chemistry.uq.edu.au/atb/molecule.py?molid={0}&outputType=top&atbVersion=v2Top&ffVersion=Gromos#files".format(mol_id)).read()
qm0 = l.find("qm0") != -1
# fetch mtb file
f = open("{0}.mtb".format(mol_id), "w"... |
import numpy as np
from scipy import sparse as S
from scipy.sparse.csr import csr_matrix
def sigmoid(x):
#return x*(x > 0)
#return numpy.tanh(x)
return 1.0/(1+numpy.exp(-x))
def d_sigmoid(z):
return np.multiply(z, 1 - z)
def identity(x):
return x
def d_identity(x):
return 1
def softmax(X)... |
# -*- coding: utf-8 -*-
##############################################################################
#
# pynexus, a Python library for easy playing with Nexus
# Copyright (C) 2016 by the pynexus team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU L... |
"""
Author: RedFantom
Contributors: Daethyra (Naiii) and Sprigellania (Zarainia)
License: GNU GPLv3 as in LICENSE
Copyright (C) 2016-2018 RedFantom
"""
# Standard Library
from os import path
import pickle as pickle
# Project Modules
from data import abilities
from data.components import *
from data.ships import ship_na... |
# Copyright 2019 DeepMind Technologies Ltd. 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 appl... |
# -*- coding: utf-8 -*-
"""
Django settings for djangotwoscopes project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
from __future__ import absolute_import, uni... |
# -*- coding: utf-8 -*-
#
# Licensed under the terms of the Qwt License
# Copyright (c) 2002 Uwe Rathmann, for the original C++ code
# Copyright (c) 2015 Pierre Raybaut, for the Python translation/optimization
# (see LICENSE file for more details)
"""
QwtPlotDirectPainter
--------------------
.. autoclass:... |
#!/usr/bin/env python3
# Copyright (c) 2016-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test label RPCs.
RPCs tested are:
- getaddressesbylabel
- listaddressgroupings
- setlabel
... |
# 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 agreed to in writing, ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'Jason'
from . import cookies
import random
class CustomCookiesMiddleware(object):
def __init__(self, settings):
custom_cookies = settings.get('CUSTOM_COOKIES')
if custom_cookies:
self.cookie_list = settings.get('REQUEST_CU... |
# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import NoAlertPresentException... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from mock import Mock
from mock import patch
from squirrel.common.unittest import TestCase
from squirrel.launcher.squirrel_dev import run as run... |
def login_user(username, password):
"""
This method tries to login a user, if it has success, it will return a json
with information about username availability and password availability and
a json with all cookies, if password and username were correct, these cookies
can be used to make more intera... |
# -*- coding: utf-8 -*-
"""
Minbif - IRC instant messaging gateway
Copyright(C) 2009 Romain Bignon
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, version 2 of the License.
This program is distribu... |
# Copyright (C) 2015 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be u... |
#!/usr/bin/python
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, eit... |
# -*- coding: utf-8 -*-
# Copyright(C) 2012 Lord
#
# This module is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# h... |
# --------------------------------------------------------
# Fully Convolutional Instance-aware Semantic Segmentation
# Copyright (c) 2016 by Contributors
# Copyright (c) 2017 Microsoft
# Licensed under The Apache-2.0 License [see LICENSE for details]
# Modified by Guodong Zhang, Haozhi Qi
# ---------------------------... |
import re
import url_decoder
from url_decoder import UrlDecoder, UrlDecoderException
class _GitHubUrlDecoder(UrlDecoder):
@staticmethod
def can_decode_url(url, parsed_url):
if not parsed_url.netloc.startswith("github."):
return False
return True
class GitHubRepositoryOwnerItem:
"""The owner in ... |
# coding: utf-8
import os
import shutil
import tarfile
import tempfile
import time
from beaker.middleware import CacheMiddleware
from beaker.cache import Cache
from webtest import TestApp
# Tarballs of the output of:
# >>> from beaker.cache import Cache
# >>> c = Cache('test', data_dir='db', type='dbm')
# >>> c['foo']... |
import pickle
import unittest
import numpy
import cupy
from cupy.cuda import curand
class TestGenerateNormal(unittest.TestCase):
def setUp(self):
self.generator = curand.createGenerator(
curand.CURAND_RNG_PSEUDO_DEFAULT)
def test_invalid_argument_normal_float(self):
out = cupy.... |
import yaml
import pandas as pd
import numpy as np
import sys
import os
from math import sqrt
import matplotlib
import matplotlib.pyplot as plot
import networkx as nx
def get_script_directory():
"""
This function returns the directory of the script in scrip mode
In interactive mode returns interpreter name... |
from netaddr import *
from datetime import datetime
import blescan
import time
import sys
import bluetooth._bluetooth as bluez
from Kitty import Kitty
from CheckKittys import CheckKittys
from BLESerialScanner import BLESerialScanner
import SendMail
import config
def process(mac, rssi):
found = False
for k in confi... |
# Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
# This source code is licensed under both the GPLv2 (found in the
# COPYING file in the root directory) and Apache 2.0 License
# (found in the LICENSE.Apache file in the root directory).
from advisor.rule_parser import RulesSpec
from advisor.db_log_... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Grub2 Control Module
#
# Copyright 2011 Alberto Mattea <alberto@mattea.info>
#
# 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 o... |
# -*- coding: utf-8 -*-
# StreetSign Digital Signage Project
# (C) Copyright 2013 Daniel Fairhead
#
# StreetSign 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, o... |
import json
import math
import os
import sys
BASE_DIR = os.getcwd()
sys.path.append(BASE_DIR)
from .honey_enc import DTE, DTE_random
from pcfg.pcfg import TrainedGrammar
import honeyvault_config as hny_config
from Crypto.Cipher import AES
from Crypto.Hash import SHA256
from Crypto.Protocol.KDF import PBKDF1
from Crypt... |
#!/usr/bin/env python3
"""Run a Python script and format the exception traceback as Vim quickfix.
quickfix.py
Copyright (C) 2015 Tony Beta Lambda <tonybetalambda@gmail.com>
This file is licensed under the MIT license. See LICENSE for more details.
"""
import os
import sys
import functools
import argparse
from runpy im... |
import sys
from datetime import date, timedelta
from configuration import Configuration
from service import raven_service, email_service
def main():
configuration_file_path = sys.argv[1]
configuration = Configuration(configuration_file_path)
_authenticate_services(configuration)
_make_user_bookings(co... |
#!/usr/bin/env python2.7
from __future__ import print_function
""" This module is an API module for ThreeSpace devices.
The ThreeSpace API module is a collection of classes, functions, structures,
and static variables use exclusivly for ThreeSpace devices. This module can
be used with a system running... |
import logging
import unittest
from Orange.data import Table
from orangecontrib.imageanalytics.image_grid import ImageGrid
class ImageGridTest(unittest.TestCase):
def setUp(self):
logging.disable(logging.CRITICAL)
self.grid = ImageGrid(Table("iris"))
def tearDown(self):
logging.disa... |
"""Tests for parallize."""
import os
from absl import logging
from absl.testing import absltest
from PIL import Image
from PIL import ImageFile
import parallelize
import convert
TESTDATA_DIR = 'testdata'
class ParallelizeTests(absltest.TestCase):
def setUp(self):
self.testdata_dir = os.path.join(os.getcwd(), ... |
#!/usr/bin/env python
# This file is based havily on the astropy version here:
# https://github.com/astropy/package-template/blob/master/setup.py
# Which is licensed under the astropy license.
import glob
import os
import sys
import ah_bootstrap
from setuptools import setup
# A dirty hack to get around some early im... |
"""
Django settings for aplicaciones_informaticas project.
Generated by 'django-admin startproject' using Django 1.10.3.
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/settin... |
import xml.etree.ElementTree as ET
from .property_decorators import property_is_enum, property_not_empty
from .. import NAMESPACE
class ProjectItem(object):
class ContentPermissions:
LockedToProject = 'LockedToProject'
ManagedByOwner = 'ManagedByOwner'
def __init__(self, name, description=Non... |
#!/usr/bin/env python3
import tempfile
import unittest
from apis.kink_api import KinkAPI
from hamcrest import *
from movie import Movie
from utils import Settings, FileProperties, SceneProperties
class MovieShould(unittest.TestCase):
def setUp(self):
Movie.settings = Settings({})
self.temp_movi... |
#!/usr/bin/env python3
# written by sqall
# twitter: https://twitter.com/sqall01
# blog: https://h4des.org
# github: https://github.com/sqall01
#
# Licensed under the GNU Affero General Public License, version 3.
import sys
import os
import stat
from lib import ServerCommunication, ConnectionWatchdog, Receiver
from l... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# pkg_find.py file is part of slpkg.
# Copyright 2014-2021 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved.
# Slpkg is a user-friendly package manager for Slackware installations
# https://gitlab.com/dslackw/slpkg
# Slpkg is free software: you can redis... |
"""
Management command for adding a package to the repository. Supposed to be the
equivelant of calling easy_install, but the install target is the chishop.
"""
from __future__ import with_statement
import os
import tempfile
import shutil
import urllib
import pkginfo
from django.core.files.base import File
from djan... |
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
import json
import sqlite3
from tkinter import *
def get_room(i2d, dbname):
ret = None
con = sqlite3.connect(dbname)
for row in con.execute("select description from rooms where id=?", (i2d,)):
jsontext = row[0]
d = json.loads(jsontext)
d['id'] = i2d
ret = Room(**d)
... |
#
# The Qubes OS Project, https://www.qubes-os.org/
#
# Copyright (C) 2010-2015 Joanna Rutkowska <joanna@invisiblethingslab.com>
# Copyright (C) 2013-2015 Marek Marczykowski-Górecki
# <marmarek@invisiblethingslab.com>
# Copyright (C) 2014-2015 Wojtek Porczyk <woju@invisiblethingslab.com>... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.