code stringlengths 1 199k |
|---|
import asm, datetime, os
"""
Import script for Shelterpro databases in DBF format
Requires my hack to dbfread to support VFP9 -
copy parseC in FieldParser.py and rename it parseV, then remove
encoding so it's just a binary string that can be ignored.
Requires address.dbf, addrlink.dbf, animal.dbf, incident.dbf, license... |
import time
start = time.time()
def prime_factors(n):
l = []
i = 2
while n != 1:
if n % i == 0:
l.append(i)
while n % i == 0:
n = n // i
i += 1
return l
print(prime_factors(600851475143)[-1])
elapsed = time.time() - start
print("time elapsed:", ela... |
"""TBD
"""
import os
import sys
import time
import subprocess
import xmlrpc.client
class ApplicationMonitor(object):
"""Responsible for launching, monitoring, and terminating the FLDIGI application process, using subprocess.Popen()
:param hostname: The FLDIGI XML-RPC server's IP address or hostname (usually loc... |
import ppfem.user_elements
import ppfem.user_equations
import ppfem.quadrature
from ppfem.user_elements import *
from ppfem.user_equations import *
from ppfem.quadrature import *
from ppfem.mesh.mesh import Mesh
from ppfem.geometry import Point, Vertex, Line, Face, Cell, Mapping
from ppfem.fem.assembler import DefaultS... |
from random import random, seed
import numpy as np
from skued import biexponential, exponential, with_irf
seed(23)
def test_exponential_tzero_limits():
"""Test that the output of ``exponential`` has the correct time-zero"""
tzero = 10 * (random() - 0.5) # between -5 and 5
amp = 5 * random() + 5 # between ... |
import manage_pressure.constants, manage_pressure.work_device, time
def control(motor_id, pressure_1_id, pressure_2_id):
devices = manage_pressure.work_device.WorkDevice(motor_id, pressure_1_id, pressure_2_id)
while 1:
devices.check()
devices.action()
time.sleep(manage_pressure.constants.TIME_REQUEST_DEVICE) |
from queue import Queue
from lxml import etree
import requests
import random
from settings import *
import time
import socket
from pybloom_live import BloomFilter
from settings import log
import os
from settings import REFRESH_BF
from settings import MIN_NUM
import redis
import threading
import traceback
bloom = Bloom... |
""" Performing mathematical calculations """
WEEKS = (((19 % 10) + 100) + (2 ** 8)) / 7 |
__all__ = ["sqlite_dump", "sqlite_merge"]
from random import Random
import math
def random_expectations(depth=0, breadth=3, low=1, high=10, random=Random()):
"""
Generate depth x breadth array of random numbers where each row sums to
high, with a minimum of low.
"""
result = []
if depth == 0:
... |
from __future__ import absolute_import, division, unicode_literals
from jx_base.expressions import NotOp as NotOp_
from jx_elasticsearch.es52.painless._utils import Painless
from jx_elasticsearch.es52.painless.es_script import EsScript
from jx_elasticsearch.es52.painless.false_op import false_script
from jx_elasticsear... |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import taggit.managers
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... |
"""
sandman_pasta reimplements the behaviour of decaf-masta, but instead evaluates all calls to deployable heat templates
"""
import json
from decaf_storage.json_base import StorageJSONEncoder
from decaf_storage import Endpoint
from decaf_utils_components.base_daemon import daemonize
import yaml
import time
import urll... |
from __future__ import absolute_import
from datetime import datetime, timedelta
from flask import current_app
from typing import Iterator, List, Tuple
from werkzeug.exceptions import Conflict, NotFound
from .models import Message, Policy
from .channels import send_notifications
from requests import get
from json import... |
from django.forms import ModelForm
from django.contrib.auth.forms import UserChangeForm
from django.contrib.auth.forms import UserCreationForm, AdminPasswordChangeForm
from agent.models import AgentProfile, Agent
from agent.function_def import manager_list
from crispy_forms.helper import FormHelper
from crispy_forms.la... |
"""
Audit groups and removes inactive users.
"""
import datetime
from django.contrib.auth.models import Group, User
from django.contrib.admin.models import LogEntry, CHANGE
from django.contrib.contenttypes.models import ContentType
from django.core.management.base import BaseCommand
from django.utils import timezone
fr... |
import signal
import sys
from functools import partial
from isac import IsacNode, IsacValue
from isac.tools import green
class DemoNode(object):
def __init__(self):
self.node = IsacNode('demo-zwave-react')
green.signal(signal.SIGTERM, partial(self.sigterm_handler))
self.action_value = IsacVa... |
try:
import unittest.mock as mock
except ImportError:
import mock
import subprocess
import dags.utils.helpers as helpers
from dags.operators.postgres_to_s3_transfer import PostgresToS3Transfer
class TestPostgresToS3Transfer(object):
def test_its_created_successfully(self):
operator = PostgresToS3Tra... |
import django
import sys
sys.path.append("../..")
sys.path.append("../../../../..")
from siteconf import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': MYSQL_... |
from odoo import api, models, _
from odoo.addons.http_routing.models.ir_http import url_for
class Website(models.Model):
_inherit = "website"
@api.model
def page_search_dependencies(self, page_id=False):
dep = super(Website, self).page_search_dependencies(page_id=page_id)
page = self.env['we... |
from openerp.tests import common
from openerp.tools import SUPERUSER_ID
class TestPurchaseRequest(common.TransactionCase):
def setUp(self):
super(TestPurchaseRequest, self).setUp()
self.purchase_request = self.env['purchase.request']
self.purchase_request_line = self.env['purchase.request.li... |
{
"name" : "Exporting and Intrastat",
"version" : "1.0",
"author" : "Open Solutions Finland",
"description" : """
OpenERP module for exporting goods. Intrastat additions to invoices. Adds country of origin and customs code fields to products.
""",
"website" : "www.opensolutions.fi",
"dep... |
from datetime import datetime
from collections import defaultdict
DEFAULT_RELEASE = datetime(1970, 1, 1)
_SORT_KEY = lambda eps: eps[0].released or DEFAULT_RELEASE
class PodcastGrouper(object):
"""Groups episodes of two podcasts based on certain features
The results are sorted by release timestamp"""
DEFAUL... |
import where_query |
import logging
from math import log
import django
from django.db import models, connection
from django.db.models import F, Max
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
try:
from django.utils.timezone import now
except ImportError:
now = datetime.... |
from django.db import models
from django.contrib.auth.models import User |
from django.utils.translation import ugettext as _
from django.db import models
from django.core.urlresolvers import reverse
from django.contrib.auth.models import Group#,User #possible accès User
from django.conf import settings
INSTALLED_APPS = settings.INSTALLED_APPS
LDAP_CONNECTOR=False
if 'apmanager.ldapconnector'... |
import init_django
from django.db import transaction
from common.utils import utcnow
from main.archive import DataArchiver
from main.delete import DataDeleter
from main.models import Ranking
from main.purge import purge_player_data
from tasks.base import Command
class Main(Command):
def __init__(self):
supe... |
"""
Module exports :class:'ArroyoEtAl2010SInter'
"""
import numpy as np
from scipy.constants import g
from scipy.special import exp1
from openquake.hazardlib.gsim.base import GMPE, CoeffsTable
from openquake.hazardlib import const
from openquake.hazardlib.imt import PGA, SA
def _compute_mean(C, g, ctx):
"""
Com... |
{
'name': 'Bangkok Rubber Module',
'version': '0.1',
'category': 'Tools',
'description': """
""",
'author': 'Mr.Tititab Srisookco',
'website': 'http://www.ineco.co.th',
'summary': '',
'depends': ['account','purchase','sale','stock','product'],
'data': [ ],
'update_xml': [
... |
import re
from django.contrib.auth.models import User
from django.db import models
from common.models import ExtraBase
CHALLENGES_TYPE = (
('p', 'playable player'),
('np', 'not playable player'),
)
class Challenge(models.Model, ExtraBase):
name = models.CharField(max_length=200, blank=True, null=True)
d... |
from django.contrib import admin
from django.contrib.flatpages.admin import FlatpageForm, FlatPageAdmin
from django.contrib.flatpages.models import FlatPage
from tinymce.widgets import TinyMCE
class PageForm(FlatpageForm):
class Meta:
model = FlatPage
widgets = {
'content': TinyMCE(attrs... |
from . import account_analytic_attribution
from . import account_analytic_distribution_line |
import deform
import colander
from pyramid.view import view_config
from dace.objectofcollaboration.principal.util import get_current
from dace.processinstance.core import DEFAULTMAPPING_ACTIONS_VIEWS
from pontus.form import FormView
from pontus.schema import Schema, select
from pontus.widget import RadioChoiceWidget
fr... |
'''
Created on Jan 18, 2013
@author: brian
'''
import openid
from openid.fetchers import HTTPFetcher, HTTPResponse
from urlparse import parse_qs, urlparse
from django.conf import settings
from django.test import TestCase, LiveServerTestCase
from django.core.cache import cache
from django.test.utils import override_sett... |
{
"name": 'Operating Unit - Changeable Invoice Line',
"version": "8.0.1.0.0",
"summary": "Default use operating unit of Invoice but be able to change per line",
"author": "ICTSTUDIO",
"website": "http://www.ictstudio.eu",
"category": "Accounting & Finance",
"depends": ['account_operating_uni... |
from __future__ import unicode_literals
import base.models.learning_unit_year
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('base', '0259_auto_20180416_1404'),
]
operations = [
... |
from __future__ import division
import numpy as np
import cv2
def geo_ref_tracks(tracks, frame, uav, debug=False):
"""
Geo-references tracks'points
:param tracks: list of drifters' trajectories
:param frame: CV2 frame
:param uav: UAV class object
:return: geo-referenced tracks in degrees and tra... |
from django.urls import reverse
from course_discovery.apps.api.v1.tests.test_views.mixins import APITestCase, SerializationMixin
from course_discovery.apps.core.tests.factories import USER_PASSWORD, UserFactory
from course_discovery.apps.course_metadata.models import LevelType
from course_discovery.apps.course_metadata... |
from django.db import models
from django.contrib.auth.models import User
class Greeting(models.Model):
when = models.DateTimeField('date created', auto_now_add=True)
class Material(models.Model):
name = models.CharField(max_length=200)
price = models.FloatField(blank=True, null=True)
created = models.Da... |
import pygtk
pygtk.require("2.0")
import gtk
from GenericObject import ObjectPageAbstract
from GenericObject import PageFrame
from GenericObject import FrameLabel
from skarphedadmin.gui import IconStock
from skarphedadmin.glue.lng import _
class RolePage(ObjectPageAbstract):
def __init__(self,parent,role):
... |
"""Utilities for working with ID tokens."""
import json
from time import time
from django.conf import settings
from django.utils.functional import cached_property
from jwkest import jwk
from jwkest.jws import JWS
from student.models import UserProfile, anonymous_id_for_user
class JwtBuilder(object):
"""Utility for ... |
from telecommand import Telecommand
class GetCompileInfoTelecommand(Telecommand):
def __init__(self):
Telecommand.__init__(self)
def apid(self):
return 0x27
def payload(self):
return [] |
"""
The latest version of this package is available at:
<http://github.com/jantman/webhook2lambda2sqs>
Copyright 2016 Jason Antman <jason@jasonantman.com> <http://www.jasonantman.com>
This file is part of webhook2lambda2sqs, also known as webhook2lambda2sqs.
webhook2lambda2sqs is free software: you can redistri... |
from odoo import api, fields, models, tools
class UnrelatedDocumentsReport(models.Model):
_name = "sicon.unrelated_documents.report"
_description = 'Documents not related yet to any concession'
_auto = False
dependence_id = fields.Many2one(comodel_name='tmc.dependence',
... |
import time
from openerp.report import report_sxw
from openerp import pooler
class doctor_disability(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(doctor_disability, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
'select_type': self.select_t... |
from annoying.functions import get_object_or_None
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
from django.db.models import Q
class CustomBackend(ModelBackend):
def authenticate(self, request, username=None, password=None, **kwargs):
UserModel = get_us... |
from __future__ import unicode_literals
from django.db import migrations, models
import datetime
class Migration(migrations.Migration):
dependencies = [
('ccx', '0017_auto_20170721_0437'),
]
operations = [
migrations.AlterField(
model_name='customcourseforedx',
name='... |
"""Auth pipeline definitions.
Auth pipelines handle the process of authenticating a user. They involve a
consumer system and a provider service. The general pattern is:
1. The consumer system exposes a URL endpoint that starts the process.
2. When a user visits that URL, the client system redirects the user to ... |
"""
.. module:: examples.benchmarks
:platform: Agnostic, Windows
:synopsis: Full suite of benchmarks
Created on 10/08/2013
"""
def standard_iges_setup(system, filename):
system.StartSection.Prolog = " "
system.GlobalSection.IntegerBits = int(32)
system.GlobalSection.SPMagnitude = int(38)
system.Gl... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='NewsItem',
fields=[
('id', models.AutoField(auto_created=... |
import uuid
from sqlalchemy.types import TypeDecorator, CHAR
from sqlalchemy.dialects.postgresql import UUID
class GUID(TypeDecorator):
"""Platform-independent GUID type.
Uses Postgresql's UUID type, otherwise uses
CHAR(32), storing as stringified hex values.
"""
impl = CHAR
def load_dialect_imp... |
from ..models import Post, Category, Tag
from django.db.models.aggregates import Count
from django import template
register = template.Library()
@register.simple_tag
def get_recent_posts(num=9):
return Post.objects.all().order_by('-modified_time')[:num]
@register.simple_tag
def archives():
return Post.objects.d... |
"""
Views for the verification flow
"""
import json
import logging
import decimal
from mitxmako.shortcuts import render_to_response
from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseRedirect
from django.shortcuts impor... |
from odoo import api, models
from odoo.tools import safe_eval
class DeliveryCarrier(models.Model):
_inherit = 'delivery.carrier'
@api.multi
def get_price_available(self, order):
self.ensure_one()
category_price = 0.0
price_dict = self.get_price_dict(order)
for line in self.pr... |
import time
import uuid as uuid
from splinter.browser import Browser
from django.contrib.auth.models import User
from webparticipation.apps.ureporter.models import Ureporter
from webparticipation.apps.ureport_auth.models import PasswordReset
def before_all(context):
context.browser = Browser('chrome')
time.slee... |
from nose.tools import raises
from openfisca_core import periods
from openfisca_core.columns import IntCol
from openfisca_core.formulas import CycleError, SimpleFormulaColumn
from openfisca_core.tests import dummy_country
from openfisca_core.tests.dummy_country import Individus, reference_formula
from openfisca_core.to... |
from django.test import TestCase
from django.views.generic import TemplateView
from django.contrib.contenttypes.models import ContentType
from jsonattrs import models, mixins
from . import factories
class XLangLabelsTest(TestCase):
def test_dict(self):
res = mixins.template_xlang_labels({'en': 'Field 1', 'd... |
import json as json_
def ok(d=None, *, json=True):
code = {'code': 200, 'status': 'OK', 'data': d}
if json:
code = json_.dumps(code)
return code
def invalid_request(*, json=True):
code = {'code': 400, 'status': 'MALFORMED_REQUEST'}
if json:
code = json_.dumps(code)
return code
de... |
"""URLs to run the tests."""
try:
from django.urls import include
except ImportError:
from django.conf.urls import include
from django.conf.urls import url
from django.contrib import admin
admin.autodiscover()
urlpatterns = (
url(r'^admin/', admin.site.urls),
url(r'^status', include('server_status.urls'... |
from django.conf import settings
def posthog_configurations(request):
return {
'POSTHOG_API_KEY': settings.POSTHOG_API_KEY,
'POSTHOG_API_URL': settings.POSTHOG_API_URL,
} |
"""Add replies column
Revision ID: 3b0d1321079e
Revises: 1e2d77a2f0c4
Create Date: 2021-11-03 23:32:15.720557
"""
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
from sqlalchemy.dialects import postgresql
revision = "3b0d1321079e"
down_revision = "1e2d77a2f0c4"
branch_labels = None
depends_on = N... |
"""Monitor the transaction log for changes that should be synced back to the
account backend.
TODO(emfree):
* Track syncback failure/success state, and implement retries
(syncback actions may be lost if the service restarts while actions are
still pending).
* Add better logging.
"""
import gevent
from sqlalchem... |
"""
Base function to handle the policy entries in the database.
This module only depends on the db/models.py
The functions of this module are tested in tests/test_lib_policy.py
A policy has the attributes
* name
* scope
* action
* realm
* resolver
* user
* client
* active
``name`` is the unique identifier of a ... |
import re
from decimal import Decimal
from datetime import datetime
from weboob.browser.filters.json import Dict
from weboob.browser.elements import ItemElement, ListElement, method
from weboob.browser.pages import JsonPage, HTMLPage, pagination
from weboob.browser.filters.standard import CleanText, CleanDecimal, Regex... |
"""
Django module container for classes and operations related to the "Course Module" content type
"""
import logging
from cStringIO import StringIO
from lxml import etree
from path import Path as path
from pytz import utc
import requests
from datetime import datetime
from lazy import lazy
from xmodule import course_me... |
import os
import sys
import logging
import openerp
import pickle
import xlrd
import openerp.netsvc as netsvc
import openerp.addons.decimal_precision as dp
from openerp.osv import fields, osv, expression, orm
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
from openerp import SU... |
from datetime import timedelta
from openerp import _, api, fields, models
from openerp.exceptions import UserError
class AccountInvoice(models.Model):
_name = 'account.invoice'
_inherit = 'account.invoice'
invoice_replaced = fields.Many2one(
'account.invoice',
string=_("Invoice that replaces... |
import functools
from itertools import combinations
from bears.c_languages.ClangBear import clang_available, ClangBear
from bears.c_languages.codeclone_detection.ClangCountingConditions import (
condition_dict)
from bears.c_languages.codeclone_detection.ClangCountVectorCreator import (
ClangCountVectorCreator)
... |
from __future__ import unicode_literals
from django.conf import settings
from django.core.urlresolvers import NoReverseMatch, reverse
from django.db import models
from django.db.models import Q
from django.utils.timezone import now
from django.utils.translation import ugettext_lazy as _
from enumfields import EnumInteg... |
from odoo import api, fields, models
from odoo.fields import first
class StockPicking(models.Model):
_inherit = 'stock.picking'
returned_ids = fields.Many2many(
comodel_name="stock.picking", compute="_compute_returned_ids",
string="Returned pickings")
source_picking_id = fields.Many2one(
... |
import shutil
from pprint import pprint
import pandas as pd
import csv
import pickle
import inspect, os
import requests
from os import listdir
import numpy as np
import subprocess
from luigi import six
from sklearn.decomposition import NMF
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
fro... |
import mock
from odoo.addons.connector_carepoint.models import account_invoice_line
from ..common import SetUpCarepointBase
model = 'odoo.addons.connector_carepoint.models.account_invoice_line'
class EndTestException(Exception):
pass
class AccountInvoiceLineTestBase(SetUpCarepointBase):
def setUp(self):
... |
from datetime import datetime
from dateutil.relativedelta import relativedelta
from openerp import api, fields, models
from openerp.exceptions import UserError
class PersonManagement(models.Model):
_name = 'myo.person.mng'
name = fields.Char('Name', required=True)
alias = fields.Char('Alias', help='Common n... |
""" Form widget classes """
from __future__ import absolute_import
from django.conf import settings
from django.forms.utils import flatatt
from django.forms.widgets import CheckboxInput
from django.urls import reverse
from django.utils.encoding import force_text
from django.utils.html import format_html
from django.uti... |
import pandas as pd
import sys
from builtins import str as text
from utils import find_zipcode, str2date
header_mapping = {
'origin': 'ORIGIN',
'company_name': 'LABO',
'lastname_firstname': 'BENEF_PS_QUALITE_NOM_PRENOM',
'address': 'BENEF_PS_ADR',
'job': 'BENEF_PS_QUALIFICATION',
'rpps': 'BENEF_... |
import datetime
import logging
import json
import os
from django.core.paginator import Paginator, InvalidPage, EmptyPage
from django.urls import reverse
from django.http import HttpResponseRedirect, HttpResponseBadRequest, HttpResponseNotFound, HttpResponse, Http404
from django.db.transaction import TransactionManageme... |
from datetime import datetime, timedelta
from pathlib import Path
from flask import (Flask, session, redirect, url_for, flash, g, request,
render_template)
from flask_assets import Environment
from flask_babel import gettext
from flask_wtf.csrf import CSRFProtect, CSRFError
from os import path
import... |
class Beer(object):
def sing(self, first, last=0):
verses = ''
for number in reversed(range(last, first + 1)):
verses += self.verse(number) + '\n'
return verses
def verse(self, number):
return ''.join([
"%s of beer on the wall, " % self._bottles(number).ca... |
from __future__ import print_function
"Tests for classes in controls\common_controls.py"
__revision__ = "$Revision: 234 $"
import sys
import ctypes
import unittest
import time
import pprint
import pdb
import os
sys.path.append(".")
from pywinauto import six
from pywinauto.controls import common_controls
from pywinauto.... |
import analyze_conf
import sys
import datetime, glob, job_stats, os, subprocess, time
import operator
import matplotlib
if not 'matplotlib.pyplot' in sys.modules:
try:
matplotlib.use(analyze_conf.matplotlib_output_mode)
except NameError:
matplotlib.use('pdf')
import matplotlib.pyplot as plt
import numpy
imp... |
from pysignfe.xml_sped import *
from .Rps import IdentificacaoPrestador, IdentificacaoRps
import os
DIRNAME = os.path.dirname(__file__)
class MensagemRetorno(XMLNFe):
def __init__(self):
super(MensagemRetorno, self).__init__()
self.Codigo = TagCaracter(nome=u'Codigo', tamanho=[1, 4], raiz=u'/[nfse]'... |
from Tribler.Core.Subtitles.MetadataDomainObjects.SubtitleInfo import SubtitleInfo
from Tribler.Core.Subtitles.MetadataDomainObjects.MetadataDTO import MetadataDTO
from Tribler.Core.CacheDB.SqliteCacheDBHandler import BasicDBHandler
import threading
from Tribler.Core.CacheDB.sqlitecachedb import SQLiteCacheDB
import sy... |
__author__ = 'fpena'
import numpy as np
import lda
import lda.datasets
def run():
# document-term matrix
X = lda.datasets.load_reuters()
print("type(X): {}".format(type(X)))
print("shape: {}\n".format(X.shape))
# the vocab
vocab = lda.datasets.load_reuters_vocab()
print("type(vocab): {}".for... |
"""Header for the hsms linktest response."""
from .header import HsmsHeader
class HsmsLinktestRspHeader(HsmsHeader):
"""
Header for Linktest Response.
Header for message with SType 6.
"""
def __init__(self, system):
"""
Initialize a hsms linktest response.
:param system: mess... |
import sys, time, os
import pymedia.muxer as muxer
import pymedia.video.vcodec as vcodec
import pymedia.audio.acodec as acodec
import pymedia.audio.sound as sound
if os.environ.has_key( 'PYCAR_DISPLAY' ) and os.environ[ 'PYCAR_DISPLAY' ]== 'directfb':
import pydfb as pygame
YV12= pygame.PF_YV12
else:
import pygam... |
from spack import *
class RProtgenerics(RPackage):
"""S4 generic functions needed by Bioconductor proteomics packages."""
homepage = "https://bioconductor.org/packages/ProtGenerics/"
url = "https://git.bioconductor.org/packages/ProtGenerics"
list_url = homepage
version('1.8.0', git='https://git... |
import sys
import warnings
import numpy as np
if sys.platform[:5] == 'linux':
BACKEND = 'ALSA'
elif sys.platform[:6] == 'darwin':
BACKEND = 'CoreAudio'
else:
BACKEND = None
if BACKEND == 'ALSA':
try:
from audiolab.soundio._alsa_backend import AlsaDevice
except ImportError, e:
warning... |
import os, sys, shutil, copy
import numpy as np
from ..util import bunch, ordered_bunch, switch
from .tools import *
from config_options import *
try:
from collections import OrderedDict
except ImportError:
from ..util.ordered_dict import OrderedDict
inf = 1.0e20
class Config(ordered_bunch):
""" config = SU... |
import re
import os
from contextlib import contextmanager
from llnl.util.lang import match_predicate
from spack import *
class Perl(Package): # Perl doesn't use Autotools, it should subclass Package
"""Perl 5 is a highly capable, feature-rich programming language with over
27 years of development."""
ho... |
import http.server
import urllib.parse
class BaseServer(http.server.BaseHTTPRequestHandler):
pass
HTTPServer = http.server.HTTPServer
urllib_urlparse = urllib.parse.urlparse |
"""
An x11 bridge provides a secure/firewalled link between a desktop application and the host x11 server. In this case, we use XPRA to do the bridging.
::.
------------- -------------
|desktop app| <--/tmp/.X11-unix--> |xpra server| Untrusted
------------- -----------... |
"""
Contains functionality relate to interfacing wiggly and puq
"""
import binascii,os,re
import numpy as np
import matplotlib.pyplot as plt
import shapely.geometry
import CrispObjects,FuzzyObjects,fuzz,utilities
import _distributions as distributions
import puq
class ObjectManager(object):
"""
Manages Wiggly o... |
import logging
import json
import struct
import numpy as np
def ParseBinaryData(binaryData, binaryDataFormat, dimensions):
elementSize = struct.calcsize(binaryDataFormat)
elementsNumber = len(binaryData) / elementSize
#Single element case
if elementsNumber == 1:
return struct.unpack(binaryDataFo... |
from __future__ import unicode_literals
import archives.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('archives', '0... |
from .imshow import imshow |
import datetime
import json
import logging
import socket
import subprocess
import sys
import time
import couchdb
def readHostsFile(filename):
hosts = []
json_data = open( filename )
data = json.load(json_data)
for name in data:
info = data[name]
host = info['host']
port = info['p... |
from __future__ import print_function
import re
import sys
import socket
from untwisted.mode import Mode
from untwisted.network import Work
from untwisted.event import DATA, BUFFER, FOUND, CLOSE, RECV_ERR
from untwisted.utils import std
from untwisted.utils.common import append, shrug
from untwisted.magic import sign
i... |
from gutenberg.acquire import load_etext
from gutenberg.cleanup import strip_headers
librosCodigo = {"Francés":[13735,13808],"Español":[24925,15027],"Portugés":[14904,16384],"Inglés":[10422,1013]}
dic_idiomas={}
for idioma in librosCodigo.keys():
diccionario_largo_palabras={}
for indeCo in librosCodigo[idioma]:... |
by_ext = [
('py.png', 'py'),
('python.png', 'pyc'),
('page_white_text_width.png', ['md', 'markdown', 'rst', 'rtf']),
('page_white_text.png', 'txt'),
('page_white_code.png', ['html', 'htm', 'cgi']),
('page_white_visualstudio.png', ['asp', 'vb']),
('page_white_ruby.png', 'rb'),
('page_code... |
"""Module with utility functions that act on molecule objects."""
from __future__ import absolute_import
import math
import re
from psi4 import core
from psi4.driver.p4util import constants, filter_comments
from psi4.driver.inputparser import process_pubchem_command, pubchemre
def extract_clusters(mol, ghost=True, clus... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.