src stringlengths 721 1.04M |
|---|
#!/usr/bin/env python3
# To run the tests, use: python3 -m pytest --capture=sys
from pokemonterminal.database import Database
from pokemonterminal.filters import Filter, RegionFilter, NonExtrasFilter
from pokemonterminal.main import main
from tests.test_utils import region_dict
import random
db = Database()
def br... |
# -*- coding: utf-8 -*-
"""
A Cell
A cell is a single input/output block. Worksheets are built out of
a list of cells.
"""
###########################################################################
# Copyright (C) 2006 William Stein <wstein@gmail.com>
#
# Distributed under the terms of the GNU General Public ... |
# websocket_server -- WebSocket/HTTP server/client library
# https://github.com/CylonicRaider/websocket-server
"""
WebSocket protocol constants.
"""
# Opcode constants.
# Individual constants
OP_CONT = 0x00 # Continuation frame
OP_TEXT = 0x01 # Text frame
OP_BINARY = 0x02 # Binary frame
OP_CLOSE = 0x08 # Close ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'syuson'
'''
JSON API definition
'''
import json, logging, inspect, functools
class APIError(Exception):
"""
the base APIError which contains error(required), data(optional) and message(optional)
"""
def __init__(self, error, data='', mes... |
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
Criado em 10 de Outubro de 2016
Descricao: este modulo tem como entrada uma serie de dados da FFT, assim como a posicao neste vetor de cada um dos picos. Retorna um vetor com a probabilidade de cada um dos picos nao ser um sinal verdadeiro. Essa probabilidade e c... |
# MIT License
#
# Copyright (c) 2017, Stefan Webb. All Rights Reserved.
#
# 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 us... |
# -*- coding: utf-8 -*-
import os
from unipath import Path
from fabric.api import *
env.kits = {
'swat4': {
'mod': 'Mod',
'content': 'Content',
'server': 'Swat4DedicatedServer.exe',
'ini': 'Swat4DedicatedServer.ini',
},
'swat4exp': {
'mod': 'ModX',
'content... |
import types
import bach_ast
import compiler
import bach_stl
from errors import MacroMatchError
def register_macro(mapping, label, macro, count=None):
if label not in mapping:
mapping[label] = []
if isinstance(macro, types.FunctionType):
mapping[label].append((count, macro))
else:
m... |
# coding: utf-8
# @ 2015 Valentin CHEMIERE @ Akretion
# © @author Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
import openerp
from openerp import tools
from base64 import b64encode
import os
imp... |
"""
Bok choy acceptance and a11y tests for problem types in the LMS
"""
from __future__ import absolute_import
import random
import textwrap
from abc import ABCMeta, abstractmethod
import ddt
import pytest
import six
from bok_choy.promise import BrokenPromise
from selenium.webdriver import ActionChains
from six.moves... |
import pyb
from pyb import Pin
from pyb import ExtInt
# We need to use global properties here as any allocation of a memory (aka declaration of a variable)
# during the read cycle causes non-acceptable delay and we are loosing data than
nc = None
gnd = None
vcc = None
data = None
timer = None
micros = None
FALL_EDGES... |
from random import randint
import cadquery as cq
from Helpers import show
# Generates a random solid, and keeps trying till it finds one
def generate(width=10, height=10, startingPoints=6):
points = []
# Make sure that we get stop points for the random points that make sense
xStop = w
yStop = h / 2.0... |
"""
# Copyright (c) 04 2015 | surya
# 21/04/15 nanang.ask@kubuskotak.com
# 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 ve... |
"""SmartApp functionality to receive cloud-push notifications."""
import asyncio
import functools
import logging
from urllib.parse import urlparse
from uuid import uuid4
from aiohttp import web
from pysmartapp import Dispatcher, SmartAppManager
from pysmartapp.const import SETTINGS_APP_ID
from pysmartthings import (
... |
import os
from flask import (
Blueprint, flash, g, redirect, render_template, request, url_for,
current_app, Markup
)
from markdown import markdown
from werkzeug.exceptions import abort
from miki.auth import login_required
from miki.db import connect
bp = Blueprint('edit', __name__)
@bp.app_template_filt... |
from urllib.parse import urlparse
from datetime import datetime, timedelta
from flask import request
from tests.base import BaseTestCase
from app import db
from app.models import UrlLink
class TestApiService(BaseTestCase):
"""
Test the API for the URL Shortener Service.
"""
def test_should_return_orig... |
# Amara, universalsubtitles.org
#
# Copyright (C) 2013 Participatory Culture Foundation
#
# 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 op... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE... |
# This file contains the default stats and general stat categories
ATTRIBUTE_TYPE = {'mental': ['intelligence', 'wits', 'resolve'],
'physical': ['strength', 'dexterity', 'stamina'],
'social': ['presence', 'manipulation', 'composure']
}
SKILL_TYPE = {'mental... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
LinesToPolygons.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***********************... |
# -*- coding: utf-8 -*-
#
# Cherokee-admin's uWSGI Wizard
#
# Authors:
# Taher Shihadeh <taher@octality.com>
# Alvaro Lopez Ortega <alvaro@alobbs.com>
#
# Copyright (C) 2010 Alvaro Lopez Ortega
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GN... |
#
# doom_instance_bt.py, doom-net
#
# Created by Andrey Kolishchak on 01/21/17.
#
import os
import glob
from vizdoom import *
from doom_instance import DoomInstance
from doom_object import DoomObject
import numpy as np
import math
import itertools
from wad import Wad
class DoomInstanceBt(DoomInstance):
def __init... |
"""Copyright 2014 Cyrus Dasadia
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, software
distr... |
##
##
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 09/10/14 #3623 randerso Manually created, do not regenerate
#
##
class SiteActivationNotification(object):
def __ini... |
#! /usr/bin/env python3
"""
This file is for gathering EMG data using the Q2W I2C PCF8591 ADC Breakout Board with a Raspberry PI. It's best used in conjunction with a script to control recording flow. See "simple_svr.py" for the actual control flow used.
"""
import sys, time
from quick2wire.parts.pcf8591 import *
from... |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 CERN.
##
## Invenio 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 ... |
import os
class Macro:
def __init__(self, name, value):
self.name = name
self.value = value
def __str__(self):
return '#define {nam} {val}'.format(nam=self.name, val=self.value)
class Typedef:
def __init__(self, type_specifier, declarator):
self.type_specifier = type_speci... |
# -*- coding: utf-8 -*-
# ###
# Copyright (c) 2016, Rice University
# This software is subject to the provisions of the GNU Affero General
# Public License version 3 (AGPLv3).
# See LICENCE.txt for details.
# ###
import codecs
import io
import json
import mimetypes
import os
import subprocess
import sys
import unittest... |
#!/usr/bin/env python
import gitlab
P1 = "root/project1"
P2 = "root/project2"
MR_P1 = 1
I_P1 = 1
I_P2 = 1
EPIC_ISSUES = [4, 5]
G1 = "group1"
LDAP_CN = "app1"
LDAP_PROVIDER = "ldapmain"
def start_log(message):
print("Testing %s... " % message, end="")
def end_log():
print("OK")
gl = gitlab.Gitlab.from_c... |
# coding=utf-8
# Copyright 2021 The Mesh TensorFlow 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... |
"""
Copyright (c) 2017-2021, Vanessa Sochat
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 the fo... |
"""
A program that extract features from images using CNN.
"""
import argparse
import sys
from os.path import isdir
import numpy as np
from image_features import FeatureExtractor, FeaturesNpzIO, FeaturesHdf5IO
def main():
# parse program arguments
parser = argparse.ArgumentParser()
parser.add_argument... |
#!/usr/bin/env python
# coding: utf-8
"""
Given two sentences words1, words2 (each represented as an array of strings), and a list of similar word pairs pairs, determine if two sentences are similar.
For example, words1 = ["great", "acting", "skills"] and words2 = ["fine", "drama", "talent"] are similar, if the simil... |
def es_estadistico_orden_k(conjunto, candidato, k):
menores = 0
for elem in conjunto:
if elem < candidato:
menores += 1
return menores == k
################################################################################
##########################################################... |
# Copyright 2013 OpenStack Foundation
# 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 requ... |
"""Blocks that execute when someone is connected."""
from .statement import SensorGraphStatement
from ...known_constants import user_connected, user_disconnected
from ...node import InputTrigger
from ...stream import DataStream
from ..scopes import GatedClockScope
class WhenBlock(SensorGraphStatement):
"""A bloc... |
# -*- coding: utf-8 -*-
import asyncio
import logging
from datetime import datetime
from typing import Dict, List, Optional
import pkg_resources
from alamo_common import aiostats
from pytz import utc
from stevedore import NamedExtensionManager
from zmq.asyncio import ZMQEventLoop
from alamo_worker.conf import setting... |
import pytest
import fbchat
import os
pytestmark = pytest.mark.online
def test_fetch(client):
client.fetch_users()
def test_search_for_users(client):
list(client.search_for_users("test", 10))
def test_search_for_pages(client):
list(client.search_for_pages("test", 100))
def test_search_for_groups(cl... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Edward Mountjoy
#
# 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, includin... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-21 20:52
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Creat... |
# -*- coding: utf-8 -*-
__author__ = 'Heungsub Lee'
from glicko2 import Glicko2, WIN, DRAW, LOSS
class almost(object):
def __init__(self, val, precision=3):
self.val = val
self.precision = precision
def almost_equals(self, val1, val2):
if round(val1, self.precision) == round(val2, ... |
#
# NEPI, a framework to manage network experiments
# Copyright (C) 2014 INRIA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This tool helps you to rebase package to the latest version
# Copyright (C) 2013-2014 Red Hat, Inc.
#
# 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
# he Free Software Foundat... |
import api
import db
from utils import parse_timestamp
from django.db import transaction
from collections import OrderedDict
import hashlib
import json
@transaction.commit_manually
def download_logs():
""" Download mailgun logs and store them in the database """
# use ordered dict to protect against new logs... |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2016 Tom Samstag
#
# 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 ... |
# Spiral FOV is my pet FOV algorithm. However, I always struggle
# with it for 7DRLs -- it's become a tradition. Let's see how I
# do this year. Starting 1847.
# Angles are measured such that 1.0 is one full circle. This is
# convenient to work with angles without many floating-point
# hassles.
from math import atan2... |
# -*- coding: utf-8 -*-
#
# Copyright 2015 Ramil Nugmanov <stsouko@live.ru>
# This file is part of nmrdb.
#
# nmrdb 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
# ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# run_cmd.py
#
# Copyright © 2013-2016 Antergos
#
# This file is part of Cnchi.
#
# Cnchi 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... |
import unittest
import numpy
import chainer
from chainer import testing
import chainer.testing.backend
import chainerx
def _get_expected_xp(backend_config, is_function):
# Returns a pair of xp's expected in forward() and backward() respectively.
xp = backend_config.xp
if xp is chainerx:
forward... |
# -*- 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, software... |
#!/usr/bin/env python
# -*- mode: python; encoding: utf-8 -*-
"""These are tests for the file store-related RDFValues implementations."""
from grr.lib.aff4_objects import filestore
from grr.lib.rdfvalues import test_base
class FileStoreHashTest(test_base.RDFValueTestCase):
"""Test the FileStoreHash implementatio... |
""" Python Character Mapping Codec koi8_r generated from 'MAPPINGS/VENDORS/MISC/KOI8-R.TXT' with gencodec.py.
""" # "
import codecs
# ## Codec APIs
class Codec(codecs.Codec):
def encode(self, input, errors='strict'):
return codecs.charmap_encode(input, errors, encoding_table)
def decode(self, inpu... |
"""
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, software
distributed under the Li... |
from pyramid.view import view_config
from bulbs.components.subcategory import number_of_threads, number_of_posts, last_post
from bulbs.components import db
def catinfo(cat):
keys = "id", "title", "desc", "slug"
keys_values = zip(keys, cat)
return dict(keys_values)
def categories():
"""Return a dict c... |
from django.core.management.base import BaseCommand
from django.contrib.postgres.aggregates import ArrayAgg
from django.db.models import Max, Min
from contactnetwork.distances import Distance, Distances
from contactnetwork.models import distance_scaling_factor
from protein.models import ProteinFamily, ProteinState
fro... |
import logging
import select
import Pyro4
import Pyro4.core
import Pyro4.naming
import Pyro4.socketutil
class Robot(object):
def __init__(self):
self._sensors = []
self._actuators = []
self.n_steps = 0
@property
def actuators(self):
return self._actuators
@actuators.... |
import itertools
import numpy as np
from skimage.transform import integral_image
from skimage.util import dtype_limits
import numba
def broadcast_mgrid(arrays):
shape = tuple(map(len, arrays))
ndim = len(shape)
result = []
for i, arr in enumerate(arrays, start=1):
reshaped = np.broadcast_to(ar... |
"""
ex_temp_convert.py
Celcius-Fahrenheit converter
Copyright (C) 2007-2008 Leif Roschier
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, o... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.18
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... |
# -*- coding: utf-8 -*-
from django.utils.encoding import python_2_unicode_compatible
from django.contrib.gis.db import models
@python_2_unicode_compatible
class NamedModel(models.Model):
name = models.CharField(max_length=255)
geometry = models.MultiPolygonField() # Multipolygon in NAD83
objects = mod... |
# -*- coding: utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _
class Backup(models.Model):
title = models.CharField(blank=True, max_length=128, verbose_name=_('Title'), help_text=_('Just a title'))
file_name = models.CharField(max_length=64, verbose_name=_('File n... |
import json
import requests
from urllib.parse import urlparse, parse_qs
from opencontext_py.libs.general import LastUpdatedOrderedDict
from opencontext_py.libs.generalapi import GeneralAPI
class ArachneAPI():
""" Interacts with Arachne """
ARACHNE_SEARCH = 'arachne.dainst.org/search'
DEFAULT_API_BASE_URL ... |
#------------------------------------------------------------------------------
# pycparser: c_parser.py
#
# CParser class: Parser and AST builder for the C language
#
# Copyright (C) 2008-2013, Eli Bendersky
# License: BSD
#------------------------------------------------------------------------------
import re
from ... |
class RedisList:
import redis
r = redis.StrictRedis(host='localhost', port=6379, db=0)
def __init__(self, key):
self.key = key
def append(self, *values):
self.r.rpush(self.key, *values)
def unshift(self, *values):
self.r.lpush(self.key, *values)
def insert(self, pivot,... |
#!/usr/bin/env python
# Safe Eyes is a utility to remind you to take break frequently
# to protect your eyes from eye strain.
# Copyright (C) 2017 Gobinath
# 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... |
# MolMod is a collection of molecular modelling tools for python.
# Copyright (C) 2007 - 2008 Toon Verstraelen <Toon.Verstraelen@UGent.be>
#
# This file is part of MolMod.
#
# MolMod 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... |
from flask.ext.testing import TestCase
import websmash
from websmash.models import Job, Notice
from tests.test_shared import ModelTestCase
class JobTestCase(ModelTestCase):
def test_job_instantiate(self):
"""Test if job can be instantiated"""
job = Job()
assert job is not None
def test... |
import torch
import contextlib
import warnings
from torch._C import default_generator
def set_rng_state(new_state):
r"""Sets the random number generator state.
Args:
new_state (torch.ByteTensor): The desired state
"""
default_generator.set_state(new_state)
def get_rng_state():
r"""Retu... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Moodle bundle for Sublime Text
Copyright (c) 2013 Frédéric Massart - FMCorz.net
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of... |
from django.conf import settings
class SiteManager(object):
def __init__(self):
self.cur = None
# Map of Site instances
self.sites = {}
def get_current(self):
if not self.cur:
self.cur = Site()
return self.cur
def get_d... |
from flask import url_for, json
from flask_babel import gettext as _
from catwatch.tests.lib.util import ViewTestMixin
from catwatch.tests.lib.assertions import assert_status_with_message
class TestBilling(ViewTestMixin):
def test_pricing_page(self):
""" Pricing page renders successfully. """
res... |
#!/usr/bin/env python
import curses
import time
import fileinput
import random
import string
screen = curses.initscr()
lines = []
chance = 0.1
confirmed_per_line = []
def main():
curses.noecho()
try:
curses.curs_set(0)
except:
pass
screen.keypad(1)
try:
for line in fileinp... |
# Copyright 2011 OpenStack LLC.
# 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... |
# -*- coding: utf-8 -*-
# Copyright 2017 Niphlod <niphlod@gmail.com>
#
# This file is part of ssis_dash.
#
# ssis_dash 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... |
# Copyright 2017 Andrey Sobolev, Tilde Materials Informatics (Berlin)
# This file is a part of quantum_esperanto project. The project is licensed under the MIT license.
# See the LICENSE file in the project root for license terms.
from setuptools import setup, Extension
from quantum_esperanto import __version__
# ch... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
import time
from selenium import webdriver
sample_email_address = "demo@engagespark.com"
sample_password = "Password123"
email_addresses = ["invalid_email", "another_invalid_email@", "not_another_invalid_email@blah"]
passwords = ["weak_password", "generic_p... |
# antfs-cli distutils setup script
#
# Copyright (c) 2012, Gustav Tiger <gustav@tiger.name>
#
# 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... |
# -*- coding: utf-8 -*-
import os
import re
from typing import Any, Dict, Iterable
import logging
from django.conf import settings
from django.test import override_settings
from django.template import Template, Context
from django.template.loader import get_template
from django.test.client import RequestFactory
from... |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
# Copyright (C) 1999--2002 Joel Rosdahl
#
# This library 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 2.1 of the License, or (at your option) any later version.
#
# This library is ... |
"""Quiz urls."""
from django.conf.urls import patterns, url, include
from quiz2.apps.quiz import views
from quiz2.apps.quiz.admin import quiz_admin_site
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^$', views.home, name='quizapp_home'),
url(r'^quiz/index/$', vi... |
'''
TestCPU
=======
Tested platforms:
* Windows
* Linux - nproc
'''
import unittest
from os import environ
from os.path import join
from mock import patch, Mock
from textwrap import dedent
from plyer.tests.common import PlatformTest, platform_import, splitpath
class MockedKernelCPU:
def __init__(self, *args, ... |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Extracts native methods from a Java file and generates the JNI bindings.
If you change this, please run and update the tests."""... |
#
# Copyright (c) 2017 Juniper Networks, Inc. All rights reserved.
#
from cStringIO import StringIO
import json
import socket
import time
import requests
from cfgm_common.utils import cgitb_hook
class KubeMonitor(object):
def __init__(self, args=None, logger=None, q=None, db=None,
resource_nam... |
from __future__ import print_function
import sys
from catkin_pkg.package import parse_package_string
from rosdistro import get_distribution_cache
from rosdistro import get_index
from ros_buildfarm.common import get_doc_job_name
from ros_buildfarm.common import get_doc_view_name
from ros_buildfarm.common import git_g... |
"""
@package medpy.graphcut.generate
Provides functionality to generate graphs efficiently from nD label-images and image voxels.
Functions:
- def graph_from_labels(label_image,
fg_markers,
bg_markers,
regional_term = False,
bo... |
from sys import platform
import subprocess
from web_utils import get_text
import psutil
application_code = get_text()
ClintC = ["system" , "cmd" , "fstream"]
ClintJava = ["cmd" , "Runtime" , "Process" , "InputStream" ]
ClintPython = ["popen" , "getopt" , "sys" , "cmd"]
def kill(pid):
process = psutil.Process(pi... |
"""
This class brings together a L{solve.Solver} to choose a set of implmentations, a
L{fetch.Fetcher} to download additional components, and the user's configuration
settings.
@since: 0.53
"""
# Copyright (C) 2011, Thomas Leonard
# See the README file for details, or visit http://0install.net.
from zeroinstall impor... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... |
from django.conf import settings
from django.db import models
from django.utils.encoding import smart_str
from django.utils import timezone
from django.template.defaultfilters import slugify
from geopy import geocoders
import pytz
import time
import datetime
import requests
import logging
logger = logging.getLogger("f... |
#!/usr/bin/env/ python
################################################################################
# Copyright 2016 Brecht Baeten
# This file is part of plottools.
#
# plottools is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publish... |
# This file is part of wger Workout Manager.
#
# wger Workout Manager 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.
#
# wger W... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 William Adams
# Distributed under the terms of the Modified BSD License.
# The full license is in the file LICENSE, distributed with this software.
#
from izdvd.dvdmenu import DVDMenu
from izdvd.encoder import Encoder
from izdvd import utils
from... |
from data_parser import DataParser
from parsed_locus import ParsedLocus
from exceptions import TooManyAlleles
from exceptions import TooFewAlleles
import gzip
import numpy
__copyright__ = "Eric Torstenson"
__license__ = "GPL3.0"
# This file is part of libGWAS.
#
# libGWAS is free software: you can redistribute... |
# Copyright 2011-2014 MongoDB, 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 writin... |
import os
import numpy
import logging
from nbodykit import CurrentMPIComm
from nbodykit.binned_statistic import BinnedStatistic
from nbodykit.meshtools import SlabIterator
from nbodykit.base.catalog import CatalogSourceBase
from nbodykit.base.mesh import MeshSource
class FFTBase(object):
"""
Base class provid... |
import uuid
from django.conf import settings
from django.db.backends.base.operations import BaseDatabaseOperations
from django.utils import timezone
from django.utils.duration import duration_microseconds
class DatabaseOperations(BaseDatabaseOperations):
compiler_module = "django.db.backends.mysql.compiler"
... |
import traceback
import weakref
from typing import List, Optional, cast
from typing_extensions import Literal
import fsui
from fsbc.util import unused
from fsui import Widget
from fsui.common.layout import HorizontalLayout, Layout, VerticalLayout
from fsui.qt.color import Color
from fsui.qt.drawingcontext import Drawi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.