code stringlengths 1 199k |
|---|
import ctypes.wintypes
READ_CONTROL = 0x00020000
STANDARD_RIGHTS_REQUIRED = 0x000F0000
STANDARD_RIGHTS_READ = READ_CONTROL
STANDARD_RIGHTS_WRITE = READ_CONTROL
STANDARD_RIGHTS_EXECUTE = READ_CONTROL
STANDARD_RIGHTS_ALL = 0x001F0000
POLICY_VIEW_LOCAL_INFORMATION = 0x00000001
POLICY_VIEW_AUDIT_INFORMATION = 0x00000002
PO... |
from app import db
class Graph(db.EmbeddedDocument):
x = db.StringField() #db.DecimalField()
y = db.StringField() #db.DecimalField()
data = db.ListField() #db.ListField(db.DictField())
data_type = db.StringField()
parameter_name = db.StringField()
class Plots(db.EmbeddedDocument):
graphs = db.Li... |
import os
from flask import Flask
app = Flask(__name__)
def setup_blueprints(app):
from jabber_logs.views import log_views
app.register_blueprint(log_views)
def make_app(config_file):
app.config.from_pyfile(os.path.join(os.getcwd(), config_file))
app.debug = app.config.get('DEBUG', False)
setup_blue... |
"""Front end Pug files, plus their route handler go here""" |
import sys, string
import os
import pyexpat
class Outputter:
def StartElementHandler(self, name, attrs):
print 'Start element:\n\t', name, attrs
def EndElementHandler(self, name):
print 'End element:\n\t', name
def CharacterDataHandler(self, data):
data = string.strip(data)
i... |
from owslib.namespaces import Namespaces
from owslib.etree import etree
from owslib.util import openURL, testXMLValue, nspath_eval, xmltag_split, dict_union, extract_xml_list
nsmap = Namespaces().get_namespaces()
def SOSElement(tag, nsmap=nsmap):
t = etree.QName(nsmap['sos'], tag)
return etree.Element(t, nsmap=... |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("admissions", "0006_auto_20211116_0124"),
]
operations = [
migrations.AlterModelOptions(
name="internalgrouppriority",
options={
"verbose_name": "Internal group p... |
""" Implements 1D and 2D Interval Arithmetic.
"""
__ALL__ = ['Interval',
'IntervalInt',
'IntervalIntSupOpen',
'Interval2D',
'Interval2DInt',
]
import math
import sys
from .Functions import middle
empty_interval_string = '[empty]'
class Interval(object):
""" One... |
from pyqtgraph_karl.dockarea.DockArea import DockArea as pgDockArea
class DockArea(pgDockArea):
"""
save the initial position of a dock and
restores it if wished
"""
# TODO: does not match overridden method
def addDock(self, dock, *args, **kwargs):
dock.init_position = kwargs
ret... |
import pandas as pd
import numpy as np
import datetime
def evaluate(y_true,y_pred):
sig=np.sqrt(np.sum(y_true))
data=[]
for i,j in zip(y_true,y_pred):
if i==0:
continue
data.append(np.power((int(j)*1.0-i)/i,2))
delta=np.sqrt(np.mean(np.array(data)))
#print sig,delta
r... |
"""
This module is responsible for all the things related to
Barman configuration, such as parsing configuration file.
"""
import inspect
import os
import re
from ConfigParser import ConfigParser, NoOptionError
import logging.handlers
from glob import iglob
from barman import output
import datetime
_logger = logging.ge... |
"""
Django settings for zuks project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
import os
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS
BA... |
import re
import os
with open('doc/doxygen/warnings.log') as f:
content = f.read()
raw_warnings = re.findall(
r'(?:^|\n)doxygen:(.+?):(\d+): warning: (.+?)(?=\n\S|\n*$)',
content, re.DOTALL)
with open('doc/doxygen/empty-params.log') as f:
content = f.read().strip()
if content:
source_code_ext = set(... |
"""
Exercice: réaliser un jeu "Guess The number"
PARTIE 1: Demander la saisie à l'utilisateur d'un nombre entre 0 et 100
PARTIE 2: Faire deviner le nombre à l'utilisateur
Utiliser une fonction pour capitaliser le code commun
"""
MIN = 0
MAX = 99
def demander_saisie_nombre(invite, minimum=MIN, maximum=MAX):
# Complé... |
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Integer, String, Column, create_engine
from sqlalchemy.orm import sessionmaker
Base=declarative_base()
class BeefyDatabase(object):
def __init__(self, url):
self.engine=create_engine(url, echo=True)
self.Session=sessionma... |
from django.contrib.auth.models import User
from django.db.models import Count
from rest_framework import (
viewsets,
)
from tourn.models import (
Team,
TeamEntry,
Match,
Tournament,
)
from tourn.serializers import (
TeamSerializer,
TeamEntrySerializer,
UserSerializer,
MatchSerialize... |
import pygame
from pygame.locals import *
pygame.init()
def Somme(morpion):
somme = 0
for k in range(3):
somme = 0
for l in range(3):
somme += morpion[k][l]
if somme == 3:
return 1
if somme == -3:
return -1
for l in range(3):
somme = 0
for k in range(3):
somme += morpion[k][l]
if somme... |
import logging
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")
import procgame.game, sys, os
import procgame.config
import random
import procgame.sound
sys.path.insert(0,os.path.pardir)
import bingo_emulator.common.units as units
import bingo_emulator.common.functi... |
import pytest
from ws.parser_helpers.title import Context
interwikimap = {
'cs': {'language': 'čeština',
'local': '',
'prefix': 'cs',
'url': 'https://wiki.archlinux.org/index.php/$1_(%C4%8Cesky)'},
'de': {'language': 'Deutsch',
'local': '',
'prefix': 'de',
... |
"""hellodjango URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... |
from __future__ import absolute_import
from .api.apps_app_id_routes_route_id import AppsAppIdRoutesRouteId
from .api.apps_app_id import AppsAppId
from .api.apps import Apps
from .api.engine import Engine
from .api.apps_app_id_routes import AppsAppIdRoutes
routes = [
dict(resource=AppsAppIdRoutesRouteId, urls=['/app... |
from functools import partial
from PyQt4 import QtGui
from lib.unidades import Length, ThermalConductivity, Pressure, Currency
from UI.widgets import Entrada_con_unidades
from equipment.parents import UI_equip
from equipment.widget import FoulingWidget, Dialog_Finned
from equipment.UI_pipe import Catalogo_Materiales_Di... |
"""Template tags for JSON serialization.
Example:
{% load jsonify %}
{{ msg|jsonify }}
"""
import json
from django import template
from django.utils.safestring import mark_safe
from django.utils.html import escapejs
register = template.Library()
@register.filter(name='jsonify')
def jsonify(value):
"""Be ... |
"""An agent to ensure consistency for transformation jobs, tasks and files.
Depending on what is the status of a job and its input and output files different actions are performed.
.. warning:: Before fully enabling this agent make sure that your transformation jobs fulfill the assumptions of the
agent. Otherwise it... |
from django.contrib import admin
from django.urls import re_path as url
from django.views.generic.base import RedirectView
from .views import EnqueueJob
admin.autodiscover()
admin.site.site_title = 'PlanB'
admin.site.site_header = 'PlanB management'
urlpatterns = [
#################
# Admin interface
######... |
from tmtpl.constants import *
from tmtpl.pattern import *
from tmtpl.document import *
from tmtpl.client import Client
from tmtpl.curves import GetCurveControlPoints, myGetControlPoints
from math import sqrt
from pysvg.filter import *
from pysvg.gradient import *
from pysvg.linking import *
from pysvg.script import *
... |
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'version': '1.0'}
DOCUMENTATION = '''
---
module: dimensiondata_network
short_description: Create, update, and delete MCP 1.0 & 2.0 networks
description:
- Create, update, and delete MCP 1.0 & 2.0 networks
... |
import parseconf, checkconf, logger, connection
import socket
class Server:
def __init__(self, confdir):
self.listen_loop = False
self.confdir = confdir
self.logfile = confdir + "/pyircd.log"
self.conffile = confdir + "/pyircd.conf"
self.logger = logger.Logger(self.logfile)
... |
{
'repo_type' : 'git',
'url' : 'https://github.com/tesseract-ocr/tesseract.git',
'conf_system' : 'cmake',
'branch': 'main',
'source_subfolder' : '_build',
'configure_options' : '.. {cmake_prefix_options} -DCMAKE_INSTALL_PREFIX={target_prefix} -DBUILD_SHARED_LIBS=0 -DBUILD_TRAINING_TOOLS=0 -DSW_BUILD=0 -DBUILD_TRA... |
'''
Weather.py
John Heenan
14 February 2014
A simple utlity to send notifications to your phone when it starts raining outside of your windowless CS lab.
Run as a login item/launchd process/drop it in .bashrc and it will only call you when you're in the lab.
'''
import urllib2
import json
import time
import pynma
'''
S... |
import pyofwave.storage
class Document(object):
"""
A document is piece of XML linked to an URI, that can be stored
into a datastore and on which operations can be applied to
transform it.
"""
def __init__(self, uri, content="", aDataStore=None):
self.uri = uri
self.content = con... |
from pyramid.config import Configurator
from cornice import Service
from cornice.tests import CatchErrors
import fxap
def includeme(config):
config.include("cornice")
config.scan("fxap.views")
def main(global_config, **settings):
config = Configurator(settings={})
config.include(fxap.includeme)
retu... |
edad = 0
while edad < 18:
edad += 1
print("Felicidades, tienes ", str(edad)) |
"""A Decision Tree for Colors"""
BASE = raw_input('Which base color, "Seattle Gray" or "Manatee"? ')
if BASE == 'Seattle Gray':
ACCENT = raw_input('Which accent color, "Ceramic Glaze" or "Cumulus '
'Nimbus"?: ')
if ACCENT is 'Ceramic Glaze':
HIGHLIGHT = raw_input('Which highlight ... |
import sys
from datetime import datetime, timedelta
from mozdef_util.utilities.toUTC import toUTC
from configlib import getConfig, OptionParser
import json
import mozdef_client as mozdef
import pickle
import jwt
import requests
import os
class UptycsFilter(object):
def __init__(self):
utc_now = toUTC(dateti... |
"""constants: Hold our handy-yet-complicated conversion factors."""
import math
amu2g = 1.6605402e-24
amu2kg = amu2g / 1000.0
bohr2ang = 0.529177249
bohr2m = bohr2ang * 1.0e-10
hartree2joule = 4.35974434e-18
planck = 6.6260755e-34
pi = math.pi
planckbar = planck/(2*pi)
speed_of_light = 299792458
avogadro = 6.0221413e+2... |
from __future__ import absolute_import, division, unicode_literals
from jx_base.expressions import MissingOp as MissingOp_, FALSE
from jx_base.language import is_op
from jx_sqlite.expressions._utils import SQLang, check
from jx_sqlite.expressions.sql_script import SQLScript
from jx_sqlite.sqlite import ConcatSQL, SQL_I... |
import mock
import pytest
from tools.wpt import run
@pytest.mark.parametrize("platform", ["Windows", "Linux", "Darwin"])
def test_check_environ_fail(platform):
m_open = mock.mock_open(read_data=b"")
with mock.patch.object(run, "open", m_open):
with mock.patch.object(run.platform, "uname",
... |
import logging
import os
FORMAT = "%(levelname)s:ABE: 🎩 %(message)s"
logging.basicConfig(format=FORMAT)
if 'LOG_LEVEL' in os.environ:
LOG_LEVEL = os.environ.get('LOG_LEVEL').upper()
level = getattr(logging, LOG_LEVEL.upper(), None)
if level:
logging.basicConfig(level=level)
else:
loggin... |
import logging
import ckan.plugins as p
import ckan.logic as logic
from ckanext.hierarchy.model import GroupTreeNode
log = logging.getLogger(__name__)
_get_or_bust = logic.get_or_bust
@logic.side_effect_free
def group_tree(context, data_dict):
'''Returns the full group tree hierarchy.
:returns: list of top-leve... |
import os
from StringIO import StringIO
from hashlib import sha512
from random import randrange
from skarphedcore.module import AbstractModule
class ModuleException(Exception):
ERRORS = {
0:"""This instance does not have a WidgetId. Therefore, Widget-bound methods cannot be used""",
1:"""Need initia... |
from . import stock_operation_type_create_menu |
import datetime
import os.path
import pytest
from openpyxl.tests.helper import DATADIR
from openpyxl.reader.iter_worksheet import get_range_boundaries
from openpyxl.reader.excel import load_workbook
from openpyxl.shared.compat import xrange
def test_open_many_sheets():
src = os.path.join(DATADIR, "reader", "bigfoot... |
from collections import defaultdict
from datetime import datetime
import random
from hypothesis import assume, settings
from hypothesis.extra.dateutil import timezones
from hypothesis.strategies import (
binary,
characters,
composite,
datetimes,
just,
lists,
sampled_from,
text,
)
from sw... |
from osv import fields,osv
from tools.translate import _
class account_analytic_account(osv.osv):
_inherit = "account.analytic.account"
_columns = {
'crm_extra_code':fields.char('Crm Extra Code', size=64)
}
account_analytic_account() |
from openerp import models, fields, api
class SaleOrder(models.Model):
_inherit = 'sale.order'
@api.multi
def action_button_confirm(self):
project_obj = self.env['project.project']
event_obj = self.env['event.event']
for sale in self.filtered(lambda x: x.project_id):
cond... |
from __future__ import unicode_literals
from django.db import migrations, models
import instance.models.utils
class Migration(migrations.Migration):
dependencies = [
('instance', '0075_remove_protocol'),
]
operations = [
migrations.CreateModel(
name='InstanceTag',
fie... |
from odoo import api, fields, models
class CalendarEvent(models.Model):
_inherit = 'calendar.event'
# Relacionados campos do Core para Adicionar Indice
# Assim teremos uma melhor performace do sistema
start = fields.Datetime(index=True)
stop = fields.Datetime(index=True)
partner_id = fields.Many... |
"""
Copyright (C) 2008 Leonard Norrgard <leonard.norrgard@gmail.com>
Copyright (C) 2015 Leonard Norrgard <leonard.norrgard@gmail.com>
This file is part of Geohash.
Geohash 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 Softwar... |
import configparser
import logging as log
import os
from webapp import app
try:
LOG_LEVEL = app.config["LOG_LEVEL"]
except Exception as e:
LOG_LEVEL = "INFO"
LOG_FORMAT = "%(asctime)s %(msecs)d - %(levelname)s - %(threadName)s: %(message)s"
LOG_DATE_FORMAT = "%Y/%m/%d %H:%M:%S"
LOG_LEVEL_NUM = log.getLevelName(... |
"""
Bok choy acceptance tests for LTI xblock
"""
from __future__ import absolute_import
import os
from common.test.acceptance.pages.lms.instructor_dashboard import (
GradeBookPage,
InstructorDashboardPage,
StudentAdminPage
)
from common.test.acceptance.pages.lms.progress import ProgressPage
from common.test... |
from django.contrib.contenttypes.models import ContentType
from django.db import connection
from django.db import DatabaseError
from django.db import transaction
from django.shortcuts import _get_queryset
from . import functions
import re
def get_object_or_none(klass, *args, **kwargs):
"""
Uses get() to return ... |
from urbansim.datasets.rate_dataset import RateDataset
from opus_core.probabilities import Probabilities
from opus_core.logger import logger
from numpy import array, zeros
class rate_based_probabilities(Probabilities):
agent_set = ''
rate_set = ''
def run(self, utilities=None, resources=None):
""" R... |
"""Index added
Revision ID: d5698d9b8bf
Revises: 57117f136777
Create Date: 2015-10-07 11:14:28.537210
"""
revision = "d5698d9b8bf"
down_revision = "57117f136777"
from alembic import op
def upgrade():
op.create_index("vj_id_idx", "trip_update", ["vj_id"], unique=False)
op.create_index("trip_update_id_idx", "stop... |
from jinja2 import Template
from moto.core.responses import BaseResponse
from moto.core.utils import camelcase_to_underscores
from .models import autoscaling_backend
class AutoScalingResponse(BaseResponse):
def _get_param(self, param_name):
return self.querystring.get(param_name, [None])[0]
def _get_int... |
"""
Classes for querying the information in a test coverage report.
"""
from __future__ import unicode_literals
import re
from collections import defaultdict
import os
import itertools
import posixpath
from diff_cover.command_runner import run_command_for_code
from diff_cover.git_path import GitPathTool
from diff_cover... |
from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
from shoop.core.fields import MoneyField
class SimpleProductPrice(models.Model):
product = models.ForeignKey("shoop.Product", related_name="+")
shop = models.ForeignKey("shoop.Shop", db_i... |
import os
import json
from superdesk.tests import TestCase
from superdesk import get_resource_service
from superdesk.vocabularies import VocabulariesService
from superdesk.vocabularies.command import VocabulariesPopulateCommand
from superdesk.errors import SuperdeskApiError
class VocabulariesPopulateTest(TestCase):
... |
import logging
import os
from base64 import b64encode
from erpbrasil.base.misc import punctuation_rm
from OpenSSL import crypto
from odoo.tools import config
from ..constants.fiscal import CERTIFICATE_TYPE_NFE, EVENT_ENV_HML, EVENT_ENV_PROD
_logger = logging.getLogger(__name__)
def domain_field_codes(
field_codes,
... |
from setuptools import setup, find_packages
import sys, os
version = '1.1.0'
setup(
name='ckanext-datarequests',
version=version,
description="CKAN Extension - Data Requests",
long_description='''
CKAN extension that allows users to ask for datasets that are not already published in the CKAN instanc... |
"""
Alfanous Setup Script
TODO pure python building & installing system
TODO include resources in installation
XXX Index building pre-install script?
"""
import json
try:
from setuptools import setup#,find_packages
except ImportError:
from alfanous.ez_setup import use_setuptools
use_setuptools()
information_file = o... |
from essentia_test import *
from essentia import *
from numpy import random
class TestSilenceRate(TestCase):
def evaluateSilenceRate(self, input):
thresh = [0, 0.15, 0.2, 0.3, 0.4, 0.5, 0.75, 0.8]
nThresh = len(thresh)
nFrames = len(input)
# expected values:
expected = zeros(... |
from odoo import tools
from odoo import api, fields, models
class HrAttendanceAnalysisReport(models.Model):
_name = "hr.attendance.analysis.report"
_description = "Attendance Analysis based on Timesheet"
_auto = False
name = fields.Many2one('hr.employee',
string='Employee')
... |
""" Checkout related views. """
from __future__ import unicode_literals
from decimal import Decimal
import logging
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.utils.decorators import method_decorator
from django.view... |
"""
Tests for the course import API views
"""
from datetime import datetime
from django.test.utils import override_settings
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmod... |
import soundcloud
import config
import json
def get_soundcloud_clips():
"""
Gets public soundcloud clips
"""
client = soundcloud.Client(client_id=config.client_id)
#tracks = client.get('/tracks', tags='hip-hop, pop, rock', license='cc-by-sa')
tracks = client.get('/tracks', tags='hip-hop, pop, ro... |
import pytest
import matrix.constants
import matrix.tests.random
test_convert_setups = [
(n, dense, complex_values, type_str, copy)
for n in (10,)
for dense in (True, False)
for complex_values in (True, False)
for type_str in matrix.constants.DECOMPOSITION_TYPES
for copy in (True, False)
]
@pyte... |
'Tests for the cluster search logic'
from api.search_parser import QueryTerm
from api.search import clusters
from api.models import BiosyntheticGeneCluster as Bgc
def test_guess_cluster_category():
tests = [
('lantipeptide', 'type'),
('NC_003888', 'acc'),
('Streptomyces', 'genus'),
(... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('organization_projects', '0005_auto_20160907_1046'),
('organization_projects', '0005_auto_20160907_1138'),
]
operations = [
] |
from django.db import migrations, models
import wger.core.models
class Migration(migrations.Migration):
dependencies = [
('core', '0009_auto_20160303_2340'),
]
operations = [
migrations.AddField(
model_name='userprofile',
name='birthdate',
field=models.Dat... |
"""
Custom plugins for Roger.
.. autosummary::
:toctree:
courses
""" |
import uuid
from suds.transport import Request
from ecommerce.extensions.payment.transport import RequestsTransport
from ecommerce.core.tests.patched_httpretty import httpretty
from ecommerce.tests.testcases import TestCase
API_URL = 'https://example.com/api.wsdl'
CONTENT_TYPE = 'text/plain'
class RequestsTransportTest... |
import nltk
from nltk.corpus import stopwords
import string
from numpy import nan
from pandas import Series
stops = set(stopwords.words('english'))
stops.add('conclusions')
def wordify(abs_list, min_word_len=2):
'''
Convert the abstract field from PLoS API data to a filtered list of words.
'''
# The abs... |
from django import template
from django.template.defaultfilters import stringfilter
from bs4 import BeautifulSoup,NavigableString
from filemanager.models import fileobject, thumbobject
from django.shortcuts import get_object_or_404, render_to_response
from django.template.loader import render_to_string
register = templ... |
import transaction
import types
import velruse
import json as _json
import tw2.core as twc
from mako.template import Template as t
from pyramid.view import (
view_config,
forbidden_view_config,
)
from pyramid.response import Response
from pyramid.httpexceptions import HTTPFound
from pyramid.security import (
... |
'''
Copyright (C) 2013 Rasmus Eneman <rasmus@eneman.eu>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is d... |
from openerp.osv import orm, fields
class product_product(orm.Model):
_inherit = 'product.product'
_columns = {
'catalog': fields.boolean('Available on Catalog'),
}
# _defaults = {
# 'catalog': True,
# } |
{
'name': 'Muskathlon',
'version': '10.0.4.2.0',
'category': 'Reports',
'author': 'Compassion CH',
'license': 'AGPL-3',
'website': 'http://www.compassion.ch',
'data': [
'security/ir.model.access.csv',
'security/access_rules.xml',
'data/default_sports.xml',
'da... |
"""Helpers for text wrapping, hyphenation, Asian text splitting and kinsoku shori.
How to split a 'big word' depends on the language and the writing system. This module
works on a Unicode string. It ought to grow by allowing ore algoriths to be plugged
in based on possible knowledge of the language and desirable 'nic... |
import account_sold_check
import account_third_check |
import hashlib
import logging
from collections import OrderedDict, deque
from datetime import datetime
import re
from lxml import etree
from widukind_common import errors
from widukind_common.debug import timeit
from dlstats.utils import Downloader, clean_datetime, get_ordinal_from_period, get_datetime_from_period
logg... |
import logging
from django.db import transaction
from django.utils import timezone
from django_filters.rest_framework import DjangoFilterBackend
from edx_rest_framework_extensions.authentication import JwtAuthentication
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from rest_framewo... |
from django.shortcuts import get_object_or_404
from rest_framework.decorators import action
from rest_framework.parsers import MultiPartParser, FormParser
from astrobin_apps_equipment.api.filters.software_edit_proposal_filter import SoftwareEditProposalFilter
from astrobin_apps_equipment.api.serializers.software_edit_p... |
""" Tests for the common package """ |
"""Tests for the login and registration form rendering. """
import urllib
import unittest
import ddt
from mock import patch
from django.conf import settings
from django.core.urlresolvers import reverse
from util.testing import UrlResetMixin
from xmodule.modulestore.tests.factories import CourseFactory
from third_party_... |
import re
import json
import itertools
import time
import operator
from shinken.log import logger
from shinken.misc.datamanager import DataManager
from shinken.objects.contact import Contact
from shinken.objects.host import Host, Hosts
from shinken.objects.hostgroup import Hostgroup, Hostgroups
from shinken.objects.ser... |
import datetime
import time
from openerp.osv import fields, osv
from openerp import tools
import openerp.addons.decimal_precision as dp
import logging
_logger = logging.getLogger(__name__)
class ineco_barcode_product_line(osv.osv):
_name = 'ineco.barcode.product.line'
_columns = {
'name': fields.char('B... |
from django.contrib.auth.mixins import LoginRequiredMixin
from django.db.models import Prefetch
from django.http import HttpResponse
from django.shortcuts import get_object_or_404
from django.utils.functional import cached_property
from django.utils.translation import gettext_lazy as _
from django.views.generic import ... |
import pytest
from unittest.mock import patch
from django.core.urlresolvers import reverse
from taiga.base.utils import json
from .. import factories as f
pytestmark = pytest.mark.django_db
def test_valid_us_creation(client):
user = f.UserFactory.create()
project = f.ProjectFactory.create(owner=user)
f.Memb... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('catalog', '0013_merge_20171004_0103'),
]
operations = [
migrations.RemoveField(
model_name='product',
... |
from cornflake import fields
from cornflake.sqlalchemy_orm import ModelSerializer
from radar.api.serializers.common import MetaMixin, PatientMixin, SystemSourceMixin
from radar.models import IndiaEthnicity
class IndiaEthnicitySerializer(PatientMixin, SystemSourceMixin, MetaMixin, ModelSerializer):
father_ancestral_... |
Application.LogMessage( "Moin" )
Application.CreatePrim("Cube", "MeshSurface", "", "") |
import numpy as np
import matplotlib.pyplot as plt
import os
diffusivity = 2.0
sink_strength = 0.05
mean = 1.2 # mean of EventInserter distribution
Lx = 2.0 # length of problem in x
Ly = 2.2 # length of problem in y
scale = 3.0 # scale of Gaussian source term
for file in os.listdir("."):
if file.endswith(".csv... |
from spack import *
class TheSilverSearcher(AutotoolsPackage):
"""Fast recursive grep alternative"""
homepage = "http://geoff.greer.fm/ag/"
url = "http://geoff.greer.fm/ag/releases/the_silver_searcher-0.32.0.tar.gz"
version('2.1.0', '3e7207b060424174323236932bf76ec2')
version('0.32.0', '3fdfd58... |
import os
import shutil
import p_haul_cgroup
import util
import fs_haul_shared
import fs_haul_subtree
from subprocess import Popen, PIPE
name = "lxc"
lxc_dir = "/var/lib/lxc/"
lxc_rootfs_dir = "/usr/lib64/lxc/rootfs"
cg_image_name = "lxccg.img"
class p_haul_type:
def __init__(self, name):
self._ctname = name
#
#... |
import karamba
import os
import time
init = 0
numOfTasks = 0
resX = 1024
resY = 768
taskList = []
activeTask = 0
taskPanels = []
taskText = []
taskMenu = 0
taskMenuLookup = {}
timeText = 0
havexwi = os.system("which xwininfo")
if (havexwi == 0):
pass
else:
print "\nCan't find xwininfo in your path."
fp ... |
import os, sys
_sep = os.path.sep
msvcbuildpath = os.path.join('build', 'win32', 'build_environments', 'visual_studio_8')
msvcbuildpath9 = os.path.join('build', 'win32', 'build_environments', 'visual_studio_9')
cbbuildpath_win32 = os.path.join('build', 'win32', 'build_environments', 'code_blocks')
cbbuildpath_linux = o... |
from . import naivecomputer
from . import naivecomputer2
from . import naivecomputer3
from . import naivecomputer5 |
"""Unit tests for smartcard.ATR
This test case can be executed individually, or with all other test cases
thru testsuite_framework.py.
__author__ = "http://www.gemalto.com"
Copyright 2001-2012 gemalto
Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com
This file is part of pyscard.
pyscard is free softwar... |
from Numberjack import *
def model_magic_square(N):
sum_val = N * (N * N + 1) // 2 # The magic number
square = Matrix(N, N, 1, N * N)
water = Matrix(N, N, 1, N * N) # water[a][b] stands for the water level in square a,b
# Sum of water depth
objective = Sum(water) - (N * N * (N * N + 1) // 2)
m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.