src stringlengths 721 1.04M |
|---|
#! /usr/bin/env python
import sys
from pbcore.io.FastaIO import FastaReader, FastaWriter
from pbhla.fasta.utils import write_fasta
def subset_sequences( fasta_file, summary_file, output_file ):
seq_ids = identify_sequences( summary_file )
sequences = subset_sequence_records( fasta_file, seq_ids )
write_f... |
# -*- coding: utf-8 -*-
from datetime import datetime
from random import random
from flask import current_app
from flask_babel import gettext
from flask_login import AnonymousUserMixin
from werkzeug.local import LocalProxy
from sipa.model.user import BaseUser
from sipa.model.fancy_property import active_prop, unsuppo... |
from radar.api.serializers.ins import InsClinicalPictureSerializer, InsRelapseSerializer
from radar.api.views.common import (
PatientObjectDetailView,
PatientObjectListView,
StringLookupListView,
)
from radar.models.ins import DIPSTICK_TYPES, InsClinicalPicture, InsRelapse, KIDNEY_TYPES, REMISSION_TYPES
c... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/yeison/Documentos/Desarrollo/Pinguino/GitHub/pinguino-ide/pinguino/qtgui/gide/bloques/widgets/control_spin.ui'
#
# Created: Wed Mar 16 13:19:35 2016
# by: pyside-uic 0.2.15 running on PySide 1.2.4
#
# WARNING! All changes made in ... |
"""
This script trains the TrueCase System
"""
import nltk
import os
import sys
import argparse
import cPickle
script_path=os.path.dirname(os.path.realpath(__file__))
truecaser_script_dir = os.path.join(script_path,"dependencies","truecaser")
sys.path.insert(1,truecaser_script_dir)
from TrainFunctions import *
def mai... |
###############################################################################
# battleship #
# #
# Originally based off of the battleship game that the Python course on #
... |
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
# pylint: disable=too-few-public-methods
"""... |
def _recipes_pil_prescript(plugins):
try:
import Image
have_PIL = False
except ImportError:
from PIL import Image
have_PIL = True
import sys
def init():
if Image._initialized >= 2:
return
if have_PIL:
try:
import ... |
#------------------------------------------------------------------------------
# Copyright 2017 Esri
# 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/LICENS... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import wx
import os
import time
import select
from collections import OrderedDict
import subprocess
import tempfile
import ConfigFile as cfgfile
import Helpers as hlp
#class ExportDialog(wx.Dialog):
#class ExecutionProgressDialog(wx.Dialog):
#class VolIdImageNameDialog(w... |
# -*- coding: utf-8 -*-
from canaimagnulinux.userdata import _
from plone.app.users.userdataschema import IUserDataSchema
from plone.app.users.userdataschema import IUserDataSchemaProvider
from zope import schema
from zope.interface import implements
from zope.schema import ValidationError
class TermsNotAccepted(V... |
import logging, doc, connection
class CollabClient:
def __init__(self, host, port):
self.docs = {}
self.state = 'connecting'
self.waiting_for_docs = []
self.connected = False
self.id = None
self.socket = connection.ClientSocket(host, port)
sel... |
from PIL import Image, ImageDraw, ImageFont
import os
def imgen(size, fmt='jpg', outdir='./'):
outfile='{}x{}.{}'.format(size[0], size[1], fmt)
img = Image.new('RGB', size, (210,210,210))
d=ImageDraw.Draw(img)
d.text((0,0), outfile, (0,0,0))
img.save(os.path.join(outdir,outfile))
def imgen_echo(tx... |
from rx.disposable import CompositeDisposable, SingleAssignmentDisposable
from rx.internal import Struct
from rx.observable import Producer
import rx.linq.sink
from collections import deque
class TakeLastCount(Producer):
def __init__(self, source, count, scheduler):
self.source = source
self.count = count
... |
from collections import defaultdict
import inspect
import unittest
from random import Random
from fito.operation_runner import OperationRunner
from fito.operations.operation import Operation
from fito.specs.fields import NumericField, SpecField
class SentinelOperation(Operation):
def __init__(self, *args, **kwar... |
'''
Created on Jul 26, 2013
@author: Mission Liao
'''
import unittest
import funhook
from funhook.builtin.cls import adapt_hook_from
class TestClsInherit(unittest.TestCase):
"""
Test cases for built-in hooks for
class inheritance
"""
def test_basic(self):
"""
Test Basic Usage ... |
#!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
# Number of "papers using libmesh" by year.
#
# Note 1: this does not count citations "only," the authors must have actually
# used libmesh in part of their work. Therefore, these counts do not include
# things like Wolfgang citing us in his pap... |
"""Something to dump current warnings to a shapefile."""
import zipfile
import os
import shutil
import subprocess
from osgeo import ogr
from pyiem.util import utc
def main():
"""Go Main Go"""
utcnow = utc()
os.chdir("/tmp")
fp = "current_ww"
for suffix in ["shp", "shx", "dbf"]:
if os.pat... |
import sys
from typing import Sequence
import exceptions
from looker_sdk import client, error, models
sdk = client.setup("../looker.ini")
def main():
"""Given a dashboard title, get the ids of all dashboards with matching titles
and move them to trash.
$ python soft_delete_dashboard.py "An Unused Dash... |
"""Methods for getting information about short phone numbers,
such as short codes and emergency numbers.
Note most commercial short numbers are not handled here, but by phonenumberutil.py
"""
# Based on original Java code:
# java/src/com/google/i18n/phonenumbers/ShortNumberInfo.java
# Copyright (C) 2013 The Libpho... |
#
# This file is part of Simpleline Text UI library.
#
# Copyright (C) 2020 Red Hat, Inc.
#
# Simpleline is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your o... |
# File generated by script - DO NOT EDIT manually
# 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 Licens... |
import time
import six
from . import packet
from . import payload
class Socket(object):
"""An Engine.IO socket."""
upgrade_protocols = ['websocket']
def __init__(self, server, sid):
self.server = server
self.sid = sid
self.queue = self.server.async.Queue()
self.last_ping ... |
# -*- coding: utf-8 -*-
"""Color routines."""
#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------
import numpy as np
from random import uniform
from colorsys import hsv_to_rgb
#-------------------... |
# -*- coding: utf-8 -*-
from cStringIO import StringIO
import gzip
import mock
import os
import re
import shutil
import tempfile
import unittest
import zipfile
from bs4 import BeautifulSoup
from flask import session, g, escape
import gnupg
os.environ['SECUREDROP_ENV'] = 'test' # noqa
import config
import crypto_util... |
from django.core.exceptions import ImproperlyConfigured
from django.utils.six import string_types
from ..settings import PUSH_NOTIFICATIONS_SETTINGS as SETTINGS
from .base import BaseConfig, check_apns_certificate
SETTING_MISMATCH = (
"Application '{application_id}' ({platform}) does not support the setting '{setti... |
#!/usr/bin/env python
"""Setup script for the package."""
import os
import sys
import setuptools
from gitvier import __project__, __version__, __author__, DESCRIPTION
PACKAGE_NAME = "gitvier"
MINIMUM_PYTHON_VERSION = (3, 5)
def check_python_version():
"""Exit when the Python version is too low."""
if sys.... |
#Ask A patient LDA Engine
#Author Yedurag Babu yzb0005
#Date 10/26/2015
from pattern.en import ngrams
from pattern.vector import stem, PORTER, LEMMA
from nltk.corpus import stopwords
from pattern.en import parsetree
import re
import collections
import numpy as np
import lda
import time
import threading
import mys... |
import random
import re
import sys
import os
import shutil
from multiprocessing import Pool
import requests
import soundcloud
from pydub import AudioSegment
import OSC
streams = []
filename = 'concrete.conf'
lines = open(filename, 'r').read().split('\n')
for line in lines:
matches = re.match(r'^stream(\d+)Url... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... |
#!/home/epicardi/bin/python27/bin/python
# Copyright (c) 2013-2014 Ernesto Picardi <ernesto.picardi@uniba.it>
#
# 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 ... |
#
# Handler library for Linux IaaS
#
# Copyright 2014 Microsoft 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 requi... |
# -*- coding: utf-8 -*-
# Copyright (C) 2015 ZetaOps Inc.
#
# This file is licensed under the GNU General Public License v3
# (GPLv3). See LICENSE.txt for details.
#
"""
Görevlendirme
İki tür görevlendirme vardır.
- Kurum içi görevlendirme
- Kurum dışı görevlendirme
Bu iş akışı CrudView nesnesi... |
# coding=utf-8
import logging
from logging.handlers import SMTPHandler
from handlers import MultiProcessTimedRotatingFileHandler
from application import config
_Levels = {
'DEBUG': logging.DEBUG,
'INFO': logging.INFO,
'WARN': logging.WARN,
'WARNING': logging.WARNING,
'ERROR': logging.ERROR,
'... |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import, print_function, unicode_literals
from . import transform
class ChecksumsSigni... |
import responses
import gtr
@responses.activate
def test_publication():
"Searching for publications by id works"
with open("tests/results.json") as results:
body = results.read()
responses.add(
responses.GET,
"http://gtr.rcuk.ac.uk/gtr/api/outcomes/publications/glaciers",
... |
from flask import Flask,request,render_template,url_for,send_file
from werkzeug.contrib.fixers import ProxyFix
import hashlib
import xmltodict
import subprocess
import time
##BASIC SETTINGS##
#set the server's url here
urlbase = 'http://'
#set your token here
token = ''
#currently 2 options: xmas and lomolive (as in ... |
# -*- coding: utf-8 -*-
# File: palette.py
import numpy as np
__all__ = ['PALETTE_RGB']
# copied from https://stackoverflow.com/questions/2328339/how-to-generate-n-different-colors-for-any-natural-number-n
PALETTE_HEX = [
"#000000", "#FFFF00", "#1CE6FF", "#FF34FF", "#FF4A46", "#008941", "#006FA6", "#A30059",
... |
"""Test the performance of simple HTTP serving and client using the Tornado
framework.
A trivial "application" is generated which generates a number of chunks of
data as a HTTP response's body.
"""
import sys
import socket
import pyperf
from tornado.httpclient import AsyncHTTPClient
from tornado.httpserver import ... |
from datetime import datetime
from django.test import TestCase
from django.utils.dateparse import parse_datetime
from restclients.exceptions import DataFailureException
from restclients.models.bridge import BridgeUser, BridgeCustomField,\
BridgeUserRole
from restclients.test import fdao_pws_override
class TestBri... |
import sys
import re
import os
import shutil
import logging as log
sys.path.append('..')
from config import OUTPUT_FOLDER, UPLOAD_FOLDER
PARENT_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
TMP_DIR = os.path.join(PARENT_DIR, UPLOAD_FOLDER)
from html_pdf import HtmlPdf
from html_txt import HtmlTx... |
import unittest
import pyrtl
from random import randint
# -------------------------------------------------------------------
class RTLMemBlockDesignBase(unittest.TestCase):
def setUp(self):
pyrtl.reset_working_block()
self.bitwidth = 3
self.addrwidth = 5
self.output1 = pyrtl.Outpu... |
### extends 'class_empty.py'
### block ClassImports
# NOTICE: Do not edit anything here, it is generated code
from . import gxapi_cy
from geosoft.gxapi import GXContext, float_ref, int_ref, str_ref
### endblock ClassImports
### block Header
# NOTICE: The code generator will not replace the code in this block
### end... |
#!/usr/bin/env python
#-*-*- encoding: utf-8 -*-*-
#
# Copyright (C) 2005 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 individual... |
"""
Given an integer array nums, find the sum of the elements between indices i and j (i ¡Ü j), inclusive.
Example:
Given nums = [-2, 0, 3, -5, 2, -1]
sumRange(0, 2) -> 1
sumRange(2, 5) -> -1
sumRange(0, 5) -> -3
Note:
You may assume that the array does not change.
There are many calls to sumRange function.
"""
cl... |
# pylint: disable=line-too-long
import datetime
import psycopg2
import pytz
CREATE_PROBE_TABLE_SQL = 'CREATE TABLE builtin_rawlocationprobe(id SERIAL PRIMARY KEY, user_id TEXT, guid TEXT, timestamp BIGINT, utc_logged TIMESTAMP, latitude DOUBLE PRECISION, longitude DOUBLE PRECISION, altitude DOUBLE PRECISION, accuracy... |
import sys
from expression_walker import walk
from pass_utils import INFIX, BINOPS, UNOPS, SYMBOLIC_CONSTS
try:
import gelpia_logging as logging
import color_printing as color
except ModuleNotFoundError:
sys.path.append("../")
import gelpia_logging as logging
import color_printing as color
logger... |
from django.forms.models import inlineformset_factory
from django.forms.widgets import CheckboxSelectMultiple
from django.utils.translation import ugettext as _
from crispy_forms.layout import Submit, Layout, Field, Div
from crispy_forms.bootstrap import (
FormActions, InlineField, InlineCheckboxes)
from crispy_f... |
from django.conf.urls import url
from . import views
from django.contrib.auth.views import (login, logout,
password_reset,
password_reset_complete,
password_reset_done,
... |
from django.db import models
from datetime import datetime
from django.db.models.signals import post_save, post_delete
from cat.models import Category
from location.models import GlobalRegion, Country, StateProvince, RegionDistrict, Locality
from django.utils.xmlutils import SimplerXMLGenerator
from django.core.urlreso... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
try:
from setuptools import setup, find_packages, Command
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages, Command
long_description = codecs.open("README.rst", "r", "utf-8... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Functional tests using WebTest."""
import datetime as dt
import httplib as http
import logging
import unittest
import markupsafe
import mock
import pytest
from nose.tools import * # noqa: F403
import re
from django.utils import timezone
from addons.wiki.utils import t... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author : Cheng.Zhang
# Email : zccode@gmail.com
#
import requests
import json
from tqdm import tqdm
from mylog import get_logger
import csv
logger = get_logger('taobao_mm_spider.txt')
URL = 'https://sp0.baidu.com/9_Q4sjW91Qh3otqbppnN2DJv/pae/channel/data/asyncqu... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- coding: utf-850 -*-
#Titulo :HarmGen.py
#Descripción :Biblioteca para la generación de vectores de señales con armonicas.
#Autor :Javier Campos Rojas
#Fecha :Junio-2017
#Versión :1.0
#Notas :
#=============================... |
# coding: utf-8
from future.utils import raise_with_traceback, viewitems, listvalues
from .api import APIConsumer
from .proxy import Proxy
from .exceptions import ProxyExists
from .utils import can_connect_to
class Toxiproxy(object):
""" Represents a Toxiproxy server """
def proxies(self):
""" Retur... |
from __future__ import unicode_literals, absolute_import
import click
import hashlib, os, sys
import frappe
from frappe.commands import pass_context, get_site
from frappe.commands.scheduler import _is_scheduler_enabled
from frappe.limits import update_limits, get_limits
from frappe.installer import update_site_config
f... |
'''
Copyright (c) 2012, Simon Aquino
All rights reserved.
Made available under the BSD license - see the LICENSE file
'''
#Imports
import sys
import random
# File specs
INPUT_PATH = '../inputs/'
NO_FILE = 'input%d.mr'
#Number specs
MAX_NO_FILES = 5
MAX_NUMS_IN_FILES = 100
MAX_RANGE_IN_FILES = 1000
WELCOME_MESSAGE=... |
# Copyright (c) 2011-2016 Cisco Systems, 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
#
# Unl... |
# =============================================================================
# Copyright (c) 2016, Cisco Systems, Inc
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of sour... |
from __future__ import absolute_import
import sys
import pandas as pd
from path_helpers import path
def main(root, old_name, new_name):
names = pd.Series([old_name, new_name], index=['old', 'new'])
underscore_names = names.map(lambda v: v.replace('-', '_'))
camel_names = names.str.split('-').map(lambda x... |
# Copyright 2013 Donald Stufft
#
# 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, so... |
import paramiko
import select
import argparse
import sys
import threading
import uuid
import tempfile
import os
import getpass
from ForwardSshTunnel import ForwardSshTunnel
class SecureRemoteLauncher(object) :
#-------------------------------------------------------------------------
# SecureRemoteLauncher... |
# MantelTest v1.2.10
# http://jwcarr.github.io/MantelTest/
#
# Copyright (c) 2014-2016 Jon W. Carr
# Licensed under the terms of the MIT License
import numpy as np
from itertools import permutations
from scipy import spatial, stats
def test(X, Y, perms=10000, method='pearson', tail='two-tail'):
"""
Takes two dist... |
# AGDeviceControl
# Copyright (C) 2005 The Australian National University
#
# This file is part of AGDeviceControl.
#
# AGDeviceControl 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 L... |
# -*- coding: utf-8 -*-
# Copyright 2004-2006 Joe Wreschnig, Michael Urman, Iñigo Serna
# 2012 Christoph Reiter
# 2013,2017 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 Fou... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" Test Toolchain Add Package """
from __future__ import absolute_import
from __future__ import unicode_literals
from __fu... |
# -*- coding: utf-8 -*-
import re
from utils import detect_string, gen_hashcode, detect_all
from symbols import translate_traces
from symbols import backtrace as remote_traces
IGNORE = ['/data/app-lib', '/mnt/asec/', '/data/data/', '/data/app/']
def detect_trace(contents):
for content in contents:
if "... |
#------------------------------------------------------------------------------
# File: system_rules.py
# Purpose:
# Author: James Mynderse
# Revised:
# License: GPLv3 see LICENSE.TXT
#------------------------------------------------------------------------------
import datetime
... |
#!/usr/bin/python3
# Copyright (C) 2017 Secured By THEM
# Original Author: Michael Casadevall <mcasadevall@them.com>
#
# 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... |
#!/usr/bin/env python
# Copyright (c) 2008, Bruce M. Simpson.
# 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 nltk.chunk import _MULTICLASS_NE_CHUNKER
from nltk.data import load
from nltk.tag.perceptron import PerceptronTagger
from nltk import ne_chunk, word_tokenize
from os import listdir
from os.path import dirname, realpath
from re import findall, finditer, MULTILINE, UNICODE
from re import compile as re_compile
flags ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# EzPyGame documentation build configuration file, created by
# sphinx-quickstart on Thu Mar 30 19:31:45 2017.
#
# 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
# a... |
#!/usr/bin/env python3
"""
@author: Lasha Khasaia
@license: GNU General Public License 3.0
@contact: @_qaz_qaz
@Description: SSMA - Simple Static Malware Analyzer
"""
import argparse, os, json
import shutil, magic, uuid
import hashlib, contextlib
from elasticsearch import Elasticsearch
from src impo... |
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from tr55.tablelookup import lookup_load, lookup_nlcd
def get_volume_of_runoff(runoff, cell_count, cell_resolution):
"""
Calculate the volume of runoff over the entire modeled... |
#
# Copyright Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0
#
# or in the "license" file accompanyi... |
from typing import List, Pattern
from datetime import datetime
import regex
from recognizers_text import ExtractResult
from ..extractors import DateTimeExtractor
from ..utilities import Token, merge_all_tokens
from ..base_set import BaseSetExtractor
from .set_extractor_config import ChineseSetExtractorConfiguration
... |
from __future__ import division, absolute_import, print_function
import os
import sys
import warnings
import collections
from numpy.core import multiarray
from . import umath
from .umath import (invert, sin, UFUNC_BUFSIZE_DEFAULT, ERR_IGNORE,
ERR_WARN, ERR_RAISE, ERR_CALL, ERR_PRINT, ERR_LOG,
... |
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
#
# This module contains all the RPC-related functions the RHN code uses
#
# Copyright (c) 2005--2018 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTAB... |
import os
from lizard_ui.settingshelper import setup_logging
from lizard_ui.settingshelper import STATICFILES_FINDERS
DEBUG = True
TEMPLATE_DEBUG = True
# SETTINGS_DIR allows media paths and so to be relative to this settings file
# instead of hardcoded to c:\only\on\my\computer.
SETTINGS_DIR = os.path.dirname(os.pa... |
"""
Agglomerative clustering with and without structure
===================================================
This example shows the effect of imposing a connectivity graph to capture
local structure in the data. The graph is simply the graph of 20 nearest
neighbors.
Two consequences of imposing a connectivity can be s... |
# -*- coding: utf-8 -*-
#
# COFFEE documentation build configuration file, created by
# sphinx-quickstart on Tue Sep 30 11:25:59 2014.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... |
from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
# Standard imports
from future import standard_library
standard_library.install_aliases()
from builtins import *
from past.utils import old_div
import unittest
import json... |
from __future__ import annotations
import argparse
import dataclasses
from datetime import datetime, timedelta, timezone
from typing import NamedTuple, Optional, Tuple
from redbot.core.commands import BadArgument, Context
from .time_utils import parse_time, parse_timedelta
class NonNumeric(NamedTuple):
parsed:... |
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.dna.DNAVisGroup
from panda3d.core import LVector3, LVector3f
import DNAGroup
import DNABattleCell
import DNAUtil
class DNAVisGroup(DNAGroup.DNAGroup):
COMPONENT_CODE = 2
def __init__(self, name):
DNAGroup.DNAGroup.__init__(s... |
from .tensor_core import (
get_contract_strategy,
set_contract_strategy,
contract_strategy,
get_contract_backend,
set_contract_backend,
contract_backend,
get_tensor_linop_backend,
set_tensor_linop_backend,
tensor_linop_backend,
tensor_contract,
tensor_split,
tensor_direct... |
# -*- coding:utf-8 -*-
import json
from django.contrib.auth.decorators import login_required
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponse, HttpResponseRedirect, Http404, JsonResponse
from django.shortcuts import render, get_object_or_404, redirect
from django.views.generic... |
from provglish import transform, prov
from provglish.lexicalisation import urn_from_uri as lex
from provglish.lexicalisation import plural_p
from provglish.prov import PROV
from provglish.nl.tools import SETTINGS, realise_sentence
import rdflib
from rdflib.plugins import sparql
from rdflib import RDF
import urllib2
... |
# -*- coding: utf-8 -*-
#
# complexity documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# 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.
#
# ... |
AR = '/usr/bin/ar'
ARFLAGS = 'rcs'
CCFLAGS = ['-g']
CCFLAGS_MACBUNDLE = ['-fPIC']
CCFLAGS_NODE = ['-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64']
CC_VERSION = ('4', '4', '5')
COMPILER_CXX = 'g++'
CPP = '/usr/bin/cpp'
CPPFLAGS_NODE = ['-D_GNU_SOURCE']
CPPPATH_EXPAT.H = ['/usr/include', '/usr/local/include']
CPPPATH_NOD... |
from geoalchemy2 import Geography
from sqlalchemy.dialects import postgresql
from database import db
from util import fips
from util import text
SRID = 4326
# This table is auto-generated by shp2sql based on the TIGER shapefile
# tl_2016_us_cd115.zip (https://www.census.gov/cgi-bin/geo/shapefiles/index.php?year=2016... |
################################################################################
#
# This file is part of Gato (Graph Animation Toolbox)
# version _VERSION_ from _BUILDDATE_. You can find more information at
# http://www.zpr.uni-koeln.de/~gato
#
# file: Graph.py
# author: Alexander Schliep (schlie... |
"""Bot class"""
import os
import socket
from parser import Parser
from logger import Logger
from sandbox import Sandbox
import botcode
MAX_CONSOLE_LEN = 50
BUFFER_SIZE = 1024
STATE_DISCONNECTED = 0
STATE_CONNECTING = 1
STATE_HANDSHAKE = 2
STATE_CONNECTED = 3
STATE_ONLINE = 4
class Bot:
def __init__(self):
... |
import viz
import os
import fnmatch
import random
import math
import vizmat
import vetools
import kinect
import time
#Voice Includes
from win32com.client import constants
import win32com.client
import pythoncom
VOICE_ACTIONS = { "pickup" : 0
,"drop" : 1
,"move" : 2
,"turn right" : 3
... |
import os
import time
uv4l_address = 'http://localhost:1337/janus'
janus_port = ":8088"
def connect_local():
os.system('svc -du /etc/service/janus')
time.sleep(1)
connect_remote("localhost")
def connect_remote(janus_address):
os.system('svc -du /etc/service/uv4l')
time.sleep(1)
_launch_uv4l("http://" ... |
# Author: Nikolay Mayorov <n59_ru@hotmail.com>
# License: 3-clause BSD
import numpy as np
from scipy.sparse import issparse
from scipy.special import digamma
from ..metrics.cluster import mutual_info_score
from ..neighbors import NearestNeighbors, KDTree
from ..preprocessing import scale
from ..utils import check_ran... |
import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-juno-testrunner',
version='0.4.1',
description='A ... |
"""Device tracker platform that adds support for OwnTracks over MQTT."""
from homeassistant.components.device_tracker import (
ATTR_BATTERY,
ATTR_GPS,
ATTR_GPS_ACCURACY,
ATTR_LOCATION_NAME,
)
from homeassistant.components.device_tracker.config_entry import TrackerEntity
from homeassistant.components.dev... |
# -*- coding: utf-8 -*-
import random
from sympy.abc import x
from sympy import log, latex
from mamchecker.hlp import Struct, norm_int as norm
jsFuncs = {'exp': 'return Math.pow(({0}),x-({1}))+({2})',
'log': 'if (x-({0})>0) return Math.log(x-({0}))+({1})',
'pow': 'return ({0})*Math.pow(x-({1}),(... |
# -*- coding: UTF-8 -*-
## Copyright 2013 Luc Saffre
## This file is part of the Lino project.
## Lino 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 op... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.