src stringlengths 721 1.04M |
|---|
"""Test the allgather API on a distributed Ray cluster."""
import pytest
import ray
import cupy as cp
import torch
from ray.util.collective.tests.util import create_collective_workers, \
init_tensors_for_gather_scatter
@pytest.mark.parametrize("tensor_backend", ["cupy", "torch"])
@pytest.mark.parametrize("array... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 朔のキャッシュをmikaのデータベースへインポートします
# 使い方:
# python3 cache2db.py path/to/cache/dir
# OR
# python3 cache2db.py --exclude-removed path/to/cache/dir
# DBの設定
DB_NAME = 'mika'
DB_USER = 'root'
DB_PASSWD = 'root'
from mysql.connector import connect as mysqlConnect
import... |
import logging
import time
import yamlconf
from ..score_caches import Empty
logger = logging.getLogger("ores.score_processors.score_processor")
class ScoreResult():
def get(self, *args, **kwargs):
raise NotImplementedError()
class ScoreProcessor(dict):
def __init__(self, scoring_contexts, score_c... |
from mongo_base import MongoBase
from resource_management.core.logger import Logger
from resource_management.core.resources.system import Execute
from resource_management.libraries.functions import check_process_status
class MongoStartable(MongoBase):
def start(self,env):
self.configure(env)
Logger... |
#coding=utf8
import time
from cjh.music import Pitch, Note
from cjh.misc import speak
"""
translate the Roman alphabet into, e.g.,
radiophonic words, morse code, braille, etc....
"""
class Letter(object):
"""
convert between different forms of Roman-alphabet letters
"""
morse_dict = {
'1':'.---... |
from django.db import transaction
from django.utils import timezone
from django.utils.dateparse import datetime_re, parse_datetime
from django.utils.translation import ugettext_lazy as _
from rest_framework.serializers import ValidationError
from waldur_mastermind.booking.utils import (
get_offering_bookings,
... |
import re
from setuptools import setup
# Get version without importing
with open('qr_code/__init__.py', 'rb') as f:
VERSION = str(re.search('__version__ = \'(.+?)\'', f.read().decode('utf-8')).group(1))
setup(
name='django-qr-code',
version=VERSION,
packages=['qr_code', 'qr_code.qrcode', 'qr_code.tem... |
#!/usr/bin/env python
#
# Copyright 2012-2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your opt... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class Racestat(object):
"""
Object that represents a race statistic snapshot
**Attributes:**
**racestat_id** (str): Unique id for this racestat
**comp_number** (str): Competitor number assigned for the race
**comp_class*... |
#!/usr/bin/env python3
# boreasprov.py
import hafwl2l3prov
import fwl2l3prov
import halbl2l3prov
import lbl2l3prov
import ipsprov
import hafwiloprov
import fwiloprov
def main():
title ='\n****************************************\n'
title += 'BOREAS NETWORK DEVICE PROVISIONING SUITE\n'
title += '**********... |
import unittest
from nitrous.module import module
from nitrous.function import function
from nitrous.types import Float
from nitrous.types.array import Slice
from nitrous.exp.vector import Vector, load, store, get_element, set_element, fill
FloatP = Slice(Float, (4,))
Float4 = Vector(Float, 4)
load4f = load(Float4)
... |
# ##### 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 2
# of the License, or (at your option) any later version.
#
# This program is distributed ... |
from __future__ import print_function, absolute_import, division
from ast import literal_eval
from distutils.core import setup
def get_version(source='petl/__init__.py'):
with open(source) as f:
for line in f:
if line.startswith('__version__'):
return literal_eval(line.split(... |
import warnings
import pandas as pd
from . import utils
from .alignment import align
from .merge import merge
from .pycompat import iteritems, OrderedDict, basestring
from .variable import Variable, as_variable, Coordinate, concat as concat_vars
def concat(objs, dim=None, data_vars='all', coords='different',
... |
#!/usr/bin/env python2.7
# Face recognition example from https://www.youtube.com/watch?v=88HdqNDQsEk
# and https://pythonprogramming.net/haar-cascade-face-eye-detection-python-opencv-tutorial/
#
# Haar cascade creation for recognition
#
# Authors: C. Birnie, M. Ravasi
import urllib
import cv2
import numpy as np
impor... |
from django.http import Http404
from django.core.exceptions import PermissionDenied
from django.views.generic import DetailView, TemplateView, UpdateView
from wafer.pages.models import Page
from wafer.pages.forms import PageForm
class ShowPage(DetailView):
template_name = 'wafer.pages/page.html'
model = Page... |
from flask import url_for
from tests import service_json
def test_find_services_by_name_page_loads_correctly(client_request, platform_admin_user):
client_request.login(platform_admin_user)
document = client_request.get('main.find_services_by_name')
assert document.h1.text.strip() == 'Find services by na... |
import factory
from datetime import timedelta
from faker import Factory
from random import randint
from zeus import models
from zeus.config import db
from zeus.constants import Result, Status
from zeus.utils import timezone
from .base import ModelFactory
from .repository import RepositoryFactory
from .types import G... |
import math
class Paginate:
def __init__(self, pagetab_count = 5, per_page = 10):
pass
self.pagetab_count = pagetab_count
self.per_page = per_page
def paginate(self, result_count, current_page):
paginate_list = []
pagetab_count = self.pagetab_count
per_page = se... |
"""
This script attempts to determine important characteristics of a Yaffs phone image.
Ideally, this functionality will be incorporated into a new version of the Yaffs parser.
"""
__author__ = 'wallsr'
import argparse
import os
from . import utilities
from .YaffsClasses.YaffsChunk import YaffsHeader
from .YaffsCla... |
# @MUNTJAC_COPYRIGHT@
# @MUNTJAC_LICENSE@
"""Allows you to chain (compose) many validators to validate one field."""
from muntjac.data.validators.abstract_validator import AbstractValidator
from muntjac.data.validator import InvalidValueException
class CompositeValidator(AbstractValidator):
"""The C{CompositeVa... |
# -*- coding: 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 in writing, softw... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from six import with_metaclass
import django.core.exceptions
import django.db.models
import django.forms
from django.utils.encoding import smart_text
from . import fields
class SouthMixinBase(object):
south_field_class = ''
def ... |
# Largely equivalent to GPSS example at:
# http://en.wikipedia.org/wiki/GPSS#Sample_code
from opflow import *
customer_num = 0
total_service_times = []
waiting_times = []
def create_customer(sim, gen):
global customer_num
customer_num += 1
return WorkUnit({'start': sim.now, 'work': 0.0})
def collect_cu... |
import unittest
from dart.client.python.dart_client import Dart
from dart.model.exception import DartRequestException
from dart.model.datastore import Datastore, DatastoreData, DatastoreState
from dart.model.trigger import Trigger
from dart.model.trigger import TriggerData
from dart.model.workflow import WorkflowData,... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-03-24 15:00
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('questionnaire', '0014_auto_20170323_2344'),
]
operations = [
migrations.AlterF... |
"""
Scrapy engine tests
This starts a testing web server (using twisted.server.Site) and then crawls it
with the Scrapy crawler.
To view the testing web server in a browser you can start it by running this
module with the ``runserver`` argument::
python test_engine.py runserver
"""
from __future__ import print_... |
from functools import wraps
from flask import request, Response
import requests
import config
GOOGLE_AUTH_URL=config.BaseConfig.GOOGLE_AUTH_URL
AUTH_DOMAIN = config.BaseConfig.AUTH_DOMAIN
PAST_AUTHED = []
# check url but if bad check later
def check_auth_url(token):
# Testing
if token == "TEST":
ret... |
def input_jk_output_index(j,k,kmax):
return j*(kmax) + k
def extrap1d(interpolator):
xs = interpolator.x
ys = interpolator.y
def pointwise(x):
if x < xs[0]:
return ys[0]+(x-xs[0])*(ys[1]-ys[0])/(xs[1]-xs[0])
elif x > xs[-1]:
return ys[-1]+(x-xs[-1])*(ys[-1]-ys... |
#-------------------------------------------------------------------------------
#
# Define classes for (uni/multi)-variate kernel density estimation.
#
# Currently, only Gaussian kernels are implemented.
#
# Written by: Robert Kern
#
# Date: 2004-08-09
#
# Modified: 2005-02-10 by Robert Kern.
# Contr... |
# This file is part of Korman.
#
# Korman 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.
#
# Korman is distributed i... |
import calendar
from sqlagg import CountUniqueColumn
from sqlagg.columns import SimpleColumn
from sqlagg.filters import LT, LTE, AND, GTE, GT, EQ, NOTEQ, OR, IN
from corehq.apps.reports.datatables import DataTablesHeader, DataTablesColumn
from corehq.apps.reports.sqlreport import DatabaseColumn
from corehq.apps.reports... |
from io import StringIO
import logging
from parameterized import parameterized, param
from dateparser.languages import default_loader, Locale
from dateparser.languages.validation import LanguageValidator
from dateparser.conf import apply_settings
from dateparser.search.detection import AutoDetectLanguage, ExactLangua... |
from typing import Optional, List
from randovania.game_description.item.ammo import Ammo
from randovania.game_description.item.item_category import ItemCategory
from randovania.game_description.item.major_item import MajorItem
from randovania.game_description.resources.pickup_entry import ResourceConversion, PickupEnt... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2016 University of Oslo, Norway
#
# This file is part of Cerebrum.
#
# Cerebrum 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... |
# -*- coding: utf-8 -*-
from __future__ import with_statement
import contextlib
import os.path
import StringIO
import sys
import traceback
import warnings
import weakref
from behave import matchers
from behave.step_registry import setup_step_decorators
from behave.formatter import formatters
from behave.configuration... |
# -*- coding: utf-8 -*-
import pytest
import os
import shutil
from cfme.intelligence.reports import reports
from utils.providers import setup_a_provider as _setup_a_provider
from utils.wait import wait_for
from utils import browser
TIMEOUT = 60.0 # Wait time for download
def clean_temp_directory():... |
# Jaikrishna
# Karan Nayan
# John Cole
# Initial Date: June 24, 2013
# Last Updated: Nov 4, 2013
# http://www.dexterindustries.com/
#
# These files have been made available online through a Creative Commons Attribution-ShareAlike 3.0 license.
# (http://creativecommons.org/licenses/by-sa/3.0/)
#
# Ported from Matthew R... |
# -*- coding: utf-8 -*-
#
# pysec documentation build configuration file, created by
# sphinx-quickstart on Mon Feb 9 07:46:05 2015.
#
# 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... |
# Copyright 2014 Cloudera 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, so... |
# Authors: Mark Kelly <c00198041@gmail.com>
from flask_user import UserMixin
from flask_user.forms import RegisterForm
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, DateField, validators
from app.init_app import db
# Define the User data model. Make sure to add the flask_user.UserMixi... |
import pytest
import modelx as mx
from modelx import new_model, defcells
from modelx.testing.testutil import SuppressFormulaError
@pytest.fixture
def setitemsample():
space = new_model(name="samplemodel").new_space(name="samplespace")
funcdef = """def func(x): return 2 * x"""
space.new_cells(formula=fu... |
# -*- coding:utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import babel.dates
from odoo import api, fields, models
from odoo.fields import Datetime
class FleetVehicle(models.Model):
_inherit = 'fleet.vehicle'
co2_fee = fields.Float(compute='_compute_co2_fee', string=... |
## Script (Python) "form_addFolder"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
request = container.REQUEST
REQUEST = context.REQUEST
publicStatus = ''
if not context.anonymousHasPermission(context):
publicStat... |
#
# As with the perceptron exercise, you will modify the
# last functions of this sigmoid unit class
#
# There are two functions for you to finish:
# First, in activate(), write the sigmoid activation function
#
# Second, in train(), write the gradient descent update rule
#
# NOTE: the following exercises c... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
Gridify.py
---------------------
Date : May 2010
Copyright : (C) 2010 by Michael Minn
Email : pyqgis at michaelminn dot com
*****************************... |
import collections
import re
import furl
from django.core.urlresolvers import resolve, reverse, NoReverseMatch
from django.core.exceptions import ImproperlyConfigured
from django.utils import six
from rest_framework import exceptions, permissions
from rest_framework import serializers as ser
from rest_framework.field... |
# by amounra 0216 : http://www.aumhaa.com
# written against Live 9.6 release on 021516
from ableton.v2.control_surface.elements.color import Color
from aumhaa.v2.livid.colors import *
"""
Alias_Map.py
Created by amounra on 2012-12-30.
Copyright (c) 2010 __artisia__. All rights reserved.
This file allows the reassi... |
# Copyright (c) 2010-2017 Samuel Abels
#
# 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, merge, publish, d... |
from argparse import SUPPRESS
from .input import Parser
from . import __doc__
def _(text):
"""Normalize whitespace."""
return ' '.join(text.strip().split())
parser = Parser(
description='%s <http://www.pyscape.com/pmpd>' % __doc__.strip(),
epilog='Suggestions and bug reports are greatly appreciated:\n... |
'''
Sanitize the ATS-generated custom log file from the all_headers test.
'''
# 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 fi... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-15 15:31
from __future__ import unicode_literals
from django.db import migrations
def adjust_spent_time(member, spent_time, date):
spent_time_factors = member.spent_time_factors.all()
for spent_time_factor in spent_time_factors:
if (spent_... |
from __future__ import absolute_import
import os
import StringIO
import mock
import py.test
import supermann.supervisor
def local_file(name):
return os.path.join(os.path.dirname(__file__), name)
@py.test.fixture
def listener():
with open(local_file('supervisor.txt'), 'r') as f:
return supermann.s... |
from django.db import models
from django.core.validators import MaxValueValidator, MinValueValidator
class DateModelBase(models.Model):
# Learn about model fields:
# https://docs.djangoproject.com/en/2.1/ref/models/fields/
created_date = models.DateTimeField(auto_now_add=True)
modified_date = models.D... |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import serialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import... |
#! /usr/bin/env python
# retrieve_vis04_data.py
import formatter
import htmllib
import os
import re
import string
import urllib
def _attrs2dict(attrs):
"""Take an (attribute, value) list and make a dict"""
dict = {}
for (a,v) in attrs:
dict[a] = v
return dict
class FileList(htmllib.HTMLParse... |
# I use the print function in this code, even though I don't in the book text,
# so that you can run it as a regular script and still get the output. You only
# get output without using print if you're using the interactive window.
# Set this variable to your osgeopy-data directory so that the following
# examples wi... |
# -*- coding: utf-8 -*-
"""
阿里云 OSS SDK: https://docs.aliyun.com
"""
import os
import oss2
from .base import BaseBackend
from ..utils import filter_delete_filename_list
class OSSBackend(BaseBackend):
"""
阿里OSS后端,依赖 oss v2
pip install oss2
"""
bucket = None
def __init__(self, access_key_id, ... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
# python3
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
# -*- coding: utf-8 -*-
# pylint: disable=modernize-parse-error
"""
Verify that an automated upgrade is possible
"""
from __future__ import absolute_import
from __future__ import print_function
# pylint: disable=import-error,3rd-party-module-not-gated,redefined-builtin
import salt.client
import salt.utils.error
class... |
from rtfmapi.modules.crypto.base import Cipher
from rtfmapi.modules.crypto.columnartransposition import ColTrans
from rtfmapi.modules.crypto.polybius import PolybiusSquare
####################################################################################
class ADFGX(Cipher):
"""The ADFGX Cipher has a key consist... |
from haystack import indexes
from speeches.models import Speech, Speaker, Section
class SpeechIndex(indexes.SearchIndex, indexes.Indexable):
# Use a template here to include speaker name as well... TODO
text = indexes.CharField(document=True, model_attr='text') # , use_template=True)
title = indexes.Char... |
from __future__ import print_function
import numpy as np
import scipy.interpolate
import matplotlib.pyplot as plt
import os
import pdb
import sys
import glob
def read_marcs(teff=5000, logg=4.5, turbulence=2.0, metallicity=0.0):
"""
Reads in MARCS spectrum of specified properties
and returns two arrays, on... |
#! /usr/bin/python
# keep record of grades. Made by Caleb Herbert. 0.1-PUBLIC
# NOTE! All letter answers are to be written in quotes (including dates)!
print """############################################
# Welcome to Gradebook! v 0.1 #
# YOUR LIGHT WEIGHT SCHOOL RECORD MANAGER! #
#######################... |
# Copyright (C) 2011 Victor Semionov
# 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
# list of conditions and t... |
"""
This test file tests the lib.tokenclass
The lib.tokenclass depends on the DB model and lib.user
"""
PWFILE = "tests/testdata/passwords"
from .base import MyTestCase
from privacyidea.lib.resolver import (save_resolver)
from privacyidea.lib.realm import (set_realm)
from privacyidea.lib.user import (User)
from priva... |
from django.core import signing
from django.test import TestCase
from django.utils.encoding import force_unicode
class TestSigner(TestCase):
def test_signature(self):
"signature() method should generate a signature"
signer = signing.Signer('predictable-secret')
signer2 = signing.Signer('pr... |
# -*- coding: utf-8 -*-
import pytest
from PyQt5.QtWidgets import QFileDialog
from hamcrest import ends_with, assert_that, equal_to
from cute.widgets import QFileDialogDriver, window
from test.ui import show_, close_
from tgit.ui import locations
from tgit.ui.dialogs.file_dialogs import make_file_dialog, name_... |
'''
Created on 17-sep.-2012
@author: ldevocht
'''
import urllib.parse, lxml.objectify, logging, configparser, re, ujson, requests
from core.resourceretriever import Resourceretriever
from core import resourceretriever, config_search
config = resourceretriever.config
mappings = resourceretriever.mappings
logger = loggi... |
'''
simple/fast python impl of a couple radix/prefix trees.
'''
import threading
class RadixIntTree:
'''
An integer indexed suffix tree.
'''
def __init__(self, bits=32):
# each node is [ left, right, answers ]
self.precount = 0
self.bitwidth = bits
self.treelock = thre... |
"""
Utility functions for simulations using openeye toolkits
"""
__author__ = 'John D. Chodera'
from simtk import unit
from simtk.openmm import app
import simtk.unit as unit
import numpy as np
import logging
logging.basicConfig(level=logging.NOTSET)
_logger = logging.getLogger("utils.openeye")
_logger.setLevel(lo... |
"""
Plots the Histogram
"""
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import matplotlib.cm as cm
import PVReadWeights as rw
import PVConversions as conv
import scipy.cluster.vq as sp
import math
import random
if len(sys.argv) < 2:
print "usage: time_stabi... |
"""n-body simulator to derive TDV+TTV diagrams of planet-moon configurations.
Credit for part of the source is given to
https://github.com/akuchling/50-examples/blob/master/gravity.rst
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
"""
import numpy
import math
import matplotlib.pylab as plt... |
"""
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2010 Nathanael C. Fritz
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
from socket import _fileobject
import socket
class FileSocket(_fileobject):
"""
Create a file object wrapper for a socket to work aro... |
from django.db.models import get_model
from django import template
from django.contrib.comments.models import Comment, FreeComment
from template_utils.templatetags.generic_content import GenericContentNode
from coltrane.models import Entry, Link
register = template.Library()
class LatestFeaturedNode(GenericContent... |
from feebb import *
import matplotlib.pyplot as plt
pre = Preprocessor()
pre.load_json('ex_json/test2.json')
elems = [Element(elem) for elem in pre.elements]
print(pre.supports)
beam = Beam(elems, pre.supports)
post = Postprocessor(beam, 10)
print(max(post.interp('moment')))
print(min(post.interp('moment')))
plt.plot(... |
import theano.tensor as T
from .base import MergeLayer
__all__ = [
"autocrop",
"autocrop_array_shapes",
"ConcatLayer",
"concat",
"ElemwiseMergeLayer",
"ElemwiseSumLayer",
]
def autocrop(inputs, cropping):
"""
Crops the given input arrays.
Cropping takes a sequence of inputs and... |
#!/usr/bin/env python
import Command
import recalboxFiles
from generators.Generator import Generator
import os.path
import glob
class DosBoxGenerator(Generator):
def getResolution(self, config):
return 'default'
# Main entry of the module
# Return command
def generate(self, system, rom, ... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, 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
#
# ... |
import os
import sys
import django
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
DEBUG = True
USE_TZ = True
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfi... |
# encoding: utf-8
from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
ExtractorError,
int_or_none,
orderedSet,
sanitized_Request,
str_to_int,
unescapeHTML,
unified_strdate,
urlencode_postd... |
import bpy
import addon_utils
import sys
bpy.context.user_preferences.filepaths.use_relative_paths= False
if(str(bpy.app.version).find("(2, 78") < 0 ):
bpy.context.user_preferences.filepaths.use_load_ui = False
bpy.context.user_preferences.filepaths.save_version=0
bpy.context.user_preferences.system.use_scripts_auto_... |
#!/usr/bin/env python3
import sys
import os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.dirname... |
# 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.
"""A subclass of commands.SVN that allows more flexible error recovery.
This code is only used on the slave but it is living in common/ because it is
di... |
# Copyright 2008-2014 Nokia Solutions and Networks
#
# 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 l... |
#!/usr/bin/python2.7
# Part of the WiFi Harvester project.
# AUTHOR: Harvey Phillips
# Project Home: https://github.com/xcellerator/wifi_harvester
# Released under GPL v2
import csv
import sys
import requests
if ( len(sys.argv) != 2 ):
print ("Usage: " + str(sys.argv[0]) + " <kismet csv>")
exit
else:
file = str(s... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-12-10 05:03
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0011_auto_20161209_2249'),
]
operations = [
migrations.AddFiel... |
# -*- coding: utf-8 -*-
#
# Copyright (C)2005-2009 Edgewall Software
# Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.e... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'GroupMigration.members_deactivated_entered'
db.delete_column('vkontakte_groups_groupstatme... |
# Copyright 2014: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
from django.conf import settings
from django.contrib.auth.models import User
from django.test import TestCase
from djaludir.core.models import Address, EXCLUDE_FIELDS
from djtools.utils.logging import seperator
import json
class CoreAddressTestCase(TestCase):
fixtures = ['user.json', 'address.json']
def ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from celerybeatmongo.models import PeriodicTask as BasePeriodicTask, PERIODS
from udata.i18n import lazy_gettext as _
from udata.models import db
__all__ = ('PeriodicTask', 'PERIODS')
CRON = '{minute} {hour} {day_of_month} {month_of_year} {day_of_week... |
# -*- coding: utf-8 -*-
#
# Polycircles documentation build configuration file, created by
# sphinx-quickstart on Mon Apr 21 13:22: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.
#... |
import sys
# for mate-pair FASTQ files: @N_NNN...._1/2
# python mate_rebuild.py original.fq tokeep.readids new.fq
def main(fastq, idlist, fqout):
ids = []
with open(idlist) as idl:
for line in idl:
ids.append(line.strip())
ids = set(ids)
with open(fastq) as fq:
with open(fq... |
# -*- coding: utf-8 -*-
"""
Test cases related to ISO-Schematron parsing and validation
"""
from __future__ import absolute_import
import unittest
from lxml import isoschematron
from .common_imports import etree, HelperTestCase, fileInTestDir, doctest, make_doctest
class ETreeISOSchematronTestCase(HelperTestCase)... |
"""JSON implementations of logging records."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods,too-few-public-methods
# Number of methods are defined in specification
# pylint: disable=protected-access
# Access to protected methods allowed in p... |
# -*- coding: utf-8 -*-
"""
obtenir els coeficients de train i calcular l'error
vull veure com funciona el mètode
@author: Jordi
"""
import re
from math import fabs
import random as python_random
from numpy import *
from scipy import linalg
DEBUG = True
DEBUG_INPUT = 'C:/Users/Jordi/Documents/CARTT-Jordi/point_clean... |
import pytest
from django.db.utils import IntegrityError
SAME_SUITE_PUBLIC_NAME = 'same suite name'
SAME_TEST_PUBLIC_NAME = 'same test name'
SAME_SUITE = 'same suite'
SAME_TEST = 'same test'
@pytest.mark.parametrize("suite_public_name, suite_public_name_2,"
"test_public_name, test_public_nam... |
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
from pyNastran.gui.qt_version import qt_version
if qt_version == 4:
#from PyQt4 import QtCore, QtGui
from PyQt4.QtGui import (
QDialog, QLineEdit, QPushButton, QGridLayout, QVBoxLayout, QHBoxLayout, QApplication,
QC... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.