text stringlengths 17 737k |
|---|
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from compas.geometry import Surface
from compas_rhino.conversions import point_to_rhino
from compas_rhino.conversions import point_to_compas
from compas_rhino.conversions import vector_to_compas
from compas_rh... |
#
#
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Google 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later... |
# -*- coding: utf-8 -*-
#
# nighres documentation build configuration file, created by
# sphinx-quickstart on Wed Aug 2 19:13:46 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... |
#!/usr/bin/python
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# The refactoring about the OpenSSL support come from Tryton
# C... |
# coding: utf-8
import logging
import threading
from typing import Callable
from il2fb.commons.events import Event, EventParsingException
from il2fb.ds.airbridge.typing import EventHandler
from il2fb.ds.airbridge.typing import StringOrNoneProducer, StringHandler
LOG = logging.getLogger(__name__)
class GameLogWo... |
import logging
import asyncio
import time
import random
import collections
import discord
import markovify
from discord.ext import commands
from .common import Cog
log = logging.getLogger(__name__)
SENTENCE_PRICE = '0.05'
def make_textmodel(texter, data):
texter.model = markovify.NewlineText(data, texter.chain... |
# -*- coding: utf-8 -*-
#
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
#
# Documentation build configuration file.
#
# 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 file.
#
# All configuration v... |
import argparse
import righter
import collections
import json
from statistics import mean, stdev
import textwrap
from terminaltables import AsciiTable
TEXTWRAP = 40
def filter_changes(writing, mistake_type):
if mistake_type is not None:
writing["changes"] = [i for i in writing["changes"] if i["symbol"] ... |
# -*- coding: utf-8 -*-
"""
libpqxx documentation build configuration file, created by
sphinx-quickstart on Sun Dec 3 00:43:33 2017.
This file is execfile()d with the current directory set to its containing dir.
All configuration values have a default; values that are commented out serve
to show the default.
"""
im... |
# -*- coding: utf-8 -*-
#
# RollerworksSearch documentation build configuration file, created by
# sphinx-quickstart on Thu Aug 02 16:57:26 2012.
#
# 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 fil... |
#!/usr/bin/env python3
# Copyright 2013 The Chromium OS 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 script to pack EC binary into SPI flash image for MEC1322
# Based on MEC1322_ROM_Doc_Rev0.5.pdf.
import argparse
import hashl... |
import os
import string
try:
from OpenSSL import crypto
except ImportError:
crypto = None
from PyQt5.QtCore import QTextCodec, QRegularExpression, Qt
from PyQt5.QtGui import QTextCursor, QTextCharFormat, QBrush, QColor, QIcon
from PyQt5.QtWidgets import QWidget, QLabel, QApplication, QFileDialog, QTreeWidgetI... |
"""
Connector adapters.
To register connectors registered in this module, it is imported from
gaphor.adapter package.
"""
from zope import interface, component
from gaphas.item import NW, NE, SW, SE
from gaphas.canvas import CanvasProjection
from gaphas.matrix import Matrix
from gaphas import geometry
from gaphas im... |
#!/bin/python3
import re
def string_parser(string):
str_list = []
if string[0] == '"':
i = 1
s = ''
while string[i] is not '"':
s = s + string[i]
i = i + 1
str_list.append(s)
str_list.append(string[i+1:])
return str_list
def colon_parser(... |
#!/usr/bin/env python
import sys, os, os.path, time, shutil
import commands, glob, traceback
SCRIPT_PATH = os.path.realpath(__file__)
ConstPath = os.path.dirname(SCRIPT_PATH)
ARCH = "x86"
def caseExecute():
try:
global ARCH
#genarate package and execute
packageInfo = open(ConstPat... |
from __future__ import unicode_literals
from django.test import TestCase
from wtl.wtparser.parsers import RequirementsParser
REQUIREMENTS = """
# Example requirements.txt
Django==1.5.4
south>=0.8.2
gondor
gunicorn>=18.0,<19
-e git+git://github.com/user/package#egg=package
"""
class BaseTestCase(TestCase):
def ... |
#!/usr/bin/env python
DOCUMENTATION = '''
---
module: jail
short_description: creates chrooted jail folder
description:
- Creates custom chrooted jail folder
options:
state:
description:
- Folder absent or present
required: false
default: present
choices: [
... |
from django.db import models
class Pizza(models.Model):
name = models.CharField(max_length=128)
price = models.DecimalField(decimal_places=2, max_digits=5)
ingredients = models.TextField()
def __unicode__(self):
return u'Pizza: {}'.format(self.name)
def __repr__(self):
return unic... |
import unittest, time, sys, csv
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_hosts, h2o_import as h2i, h2o_exec as h2e, h2o_kmeans, random
# translate provides the mapping between original and predicted
def compare_csv_at_one_col(csvPathname, msg, colIndex=-1, translate=None, skipHeader=0):
predictOu... |
__author__ = 'giacomov'
# DMFitFunction and DMSpectra add by Andrea Albert (aalbert@slac.stanford.edu) Oct 26, 2016
import exceptions
import math
import astropy.units as astropy_units
import numpy as np
import warnings
from scipy.special import gammaincc, gamma, erfcinv
from astromodels.core.units import get_units
f... |
import nltk
import io
import json
with io.open('/Users/KYD/Dropbox/논문/MSCOCO/captions_train-val2014/annotations/val_test.json', 'r') as f:
annotation = json.loads(f.read())
caption_list = []
for elem in annotation:
caption_list.append(elem['caption'])
tokenized_caption_list = []
for elem i... |
##########################################################################
#
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Red... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Test behavior related to masked tables"""
from distutils import version
import numpy as np
import numpy.ma as ma
from ...tests.helper import pytest
from ...table import Column, MaskedColumn, Table
numpy_lt_1p5 = version.LooseVersion(np.__version__) <... |
# -*- coding: utf-8 -*-
#BEGIN_HEADER
import os
import sys
import shutil
import hashlib
import subprocess
import requests
requests.packages.urllib3.disable_warnings()
import re
import traceback
import uuid
from datetime import datetime
from pprint import pprint, pformat
import numpy as np
import math
from Bio import ... |
import sys
import socket
import select
import collections
import json
import errno
import os.path
try:
import ssl
assert ssl
except ImportError:
ssl = False
try:
from ... import editor
from .. import api, cert, msg, shared as G, utils
from ..exc_fmt import str_e
from . import base, proxy
... |
# -*- coding: utf-8 -*-
#BEGIN_HEADER
from __future__ import print_function
from __future__ import division
import os
import sys
import shutil
import hashlib
import subprocess
import requests
requests.packages.urllib3.disable_warnings()
import re
import traceback
import uuid
from datetime import datetime
from pprint i... |
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Regression tests for the units.format package
"""
import pytest
import numpy as np
from numpy.testing import assert_allclose
from astropy.tests.helper import catch_warnings
from astropy import units as u
from astropy.constant... |
import pytest
from grove.alpha.jordan_gradient.gradient_utils import real_to_binary, binary_to_real, measurements_to_bf
import numpy as np
def test_real_to_binary():
precision = 9
decimal_rep = 0.345703125
binary_rep = 0.010110001
binary_convert = real_to_binary(decimal_rep, precision)
assert(np.... |
#!/usr/bin/python
#
# Prototype for the beng-proxy translation server.
#
# Author: Max Kellermann <mk@cm4all.com>
import re
import os.path
from twisted.python import log
from twisted.internet import reactor, defer
from twisted.internet.protocol import Protocol, Factory
from beng_proxy.translation import *
from beng_pr... |
from templates import TextTemplate, add_quick_reply
import json
from utilities import send_message
from app import usersdb
def send_subscription_prompt(id):
message = TextTemplate(text="Subscribe to our notifications? We'll send out a message to you "+
"when someone of your choice is lo... |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import logging
import sys
from . import config
config.load()
# We can remove this hack and load utils in the same lin... |
from mock import Mock, PropertyMock, call, patch
from django.test import TestCase, override_settings
from twitterbot.management.twitter import TwitterAPIData
from people.tests.factories import PersonFactory
def fake_twitter_api_post(*args, **kwargs):
data = kwargs["data"]
mock_result = Mock()
if "scree... |
__author__ = 'Ronny Restrepo'
import numpy as np
from matplotlib import pyplot as plt
# ==============================================================================
# TALLY_AND_PLOT
# ====================================================================... |
"""
Hunts for Python 2 code in all Narratives in a Workspace environment.
Needs an Administrator token.
"""
import sys
import requests
import argparse
import json
from biokbase.workspace.client import Workspace
import biokbase.workspace.baseclient as baseclient
import lib2to3
from lib2to3.refactor import (
Refactor... |
from django.core.urlresolvers import get_callable
from django.utils.text import capfirst
from django.utils.translation import ugettext as _
from pdfdocument.document import PDFDocument, cm, mm
from pdfdocument.elements import create_stationery_fn, ExampleStationery
from pdfdocument.utils import pdf_response
import pl... |
# 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 in the hope that it will be useful,
# bu... |
from urllib import urlencode
from urlparse import urlparse, parse_qs
from saml2.entity import Entity
from saml2.response import VerificationError
__author__ = 'rolandh'
IDPDISC_POLICY = "urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol:single"
class DiscoveryServer(Entity):
def __init__(self, config=N... |
from pymongo import MongoClient
from bson import ObjectId
class TrafficEvaluator(object):
def __init__(self, config):
"""
Returns a TrafficEvaluator object.
`config` is a dict() object, the deserialized JSON result of the HTTP GET `/api/config`
"""
config = config['config'... |
# -*- coding: utf-8 -*-
"""This python module aims to manage
`DokuWiki <https://www.dokuwiki.org/dokuwiki>`_ wikis by using the
provided `XML-RPC API <https://www.dokuwiki.org/devel:xmlrpc>`_. It is
compatible with python2.7 and python3+.
Installation
------------
It is on `PyPi <https://pypi.python.org/pypi/dokuwik... |
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.contrib.auth.models import User
from phonenumber_field.modelfields import PhoneNumberField
from wagtail.contrib.settings.models import BaseSetting, register_setting
from django.utils.translation ... |
from os import mkdir
from os import listdir
from os import link
from os import unlink
from os import symlink
from os import readlink
from os import rmdir
from os import stat
from os import chmod
from errno import ENOENT as FileDoesNotExist
from errno import EEXIST as FileExists
from errno import EISDIR as DirectoryExis... |
import datetime
import json
from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.shortcuts import render, get_object_or_404
fr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
from glob import glob
from ..libraries import paths
from ..libraries.file import File
from ..libraries.tools imp... |
"""All models for extension."""
from django.conf import settings
from django.dispatch import receiver
from django.db import models
from model_utils.models import StatusModel, TimeStampedModel
from geokey.projects.models import Project
from .base import STATUS, FORMAT
from .managers import WebResourceManager
class... |
# Copyright 2014, Oliver Nagy <olitheolix@gmail.com>
#
# This file is part of Azrael (https://github.com/olitheolix/azrael)
#
# Azrael is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of... |
#!/usr/bin/env python
import datetime, calendar, math, random
# doomsday.py: a command line trainer for the mental calculation
# of the day of the week for any date in the Gregorian calendar,
# using the Doomsday algorithm original developed by John Horton Conway.
# Given that the Doomsday algorithm works for the Gr... |
from datetime import datetime
from django.core.management.base import BaseCommand
from django.contrib.sessions.models import Session
"""
>>> def clean(count):
... for idx, s in enumerate(Session.objects.filter(expire_date__lt=now)[:count+1]):
... s.delete()
... if str(idx).endswith('000'): print idx
... p... |
from __future__ import absolute_import
# Set default logging handler to avoid "No handler found" warnings.
import logging
try: # Python 2.7+
from logging import NullHandler
except ImportError:
class NullHandler(logging.Handler):
def emit(self, record):
pass
logging.getLogger(__name__).ad... |
import warnings
import numpy as nu
_APY_LOADED= True
try:
from astropy import units
except ImportError:
_APY_LOADED= False
if _APY_LOADED:
import astropy
_APY3= astropy.__version__ > '3'
_APY_GE_31= tuple(map(int,(astropy.__version__.split('.')))) > (3,0,5)
from astropy.coordinates import SkyCoo... |
#!/usr/bin/env python
#
# switch_tests.py: testing `svn switch'.
#
# Subversion is a tool for revision control.
# See http://subversion.apache.org for more information.
#
# ====================================================================
# Licensed to the Apache Software Foundation (ASF) under one
# or mo... |
# -*- coding: utf-8 -*-
# Copyright 2018 Coop IT Easy SCRLfs.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import _, api, fields, models
from datetime import date, datetime, timedelta
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT as DTF
from openerp.exceptions imp... |
#!/usr/bin/env python
#
# svnadmin_tests.py: testing the 'svnadmin' tool.
#
# Subversion is a tool for revision control.
# See http://subversion.apache.org for more information.
#
# ====================================================================
# Licensed to the Apache Software Foundation (ASF) under one
#... |
# Copyright (c) 2008, Humanized, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditi... |
from __future__ import annotations
import functools
import logging
import os
import urllib
from typing import TYPE_CHECKING
import tornado.escape
import tornado.ioloop
import tornado.web
import tornado.websocket
import mopidy
from mopidy import core, models
from mopidy.internal import jsonrpc
if TYPE_CHECKING:
... |
"""Unofficial API for duolingo.com"""
import re
import json
import random
from datetime import datetime
from json import JSONDecodeError
import requests
__version__ = "0.4.2"
__author__ = "Kartik Talwar"
__email__ = "hi@kartikt.com"
__url__ = "https://github.com/KartikTalwar/duolingo"
class Struct:
def __init__... |
"""Test Stern Spike Platform."""
import time
import serial_asyncio
from mpf.platforms.spike.spike import SpikePlatform
from mpf.tests.MpfTestCase import MpfTestCase
from mpf.tests.loop import MockSerial
class MockSpikeSocket(MockSerial):
"""Serial mock."""
def read(self, length):
"""Read from seri... |
import tensorflow as tf
#from tensorflow import *
import pdb
from tcga_encoder.models.layers import *
from tcga_encoder.models.regularizers import *
from tcga_encoder.algorithms import *
#from models.vae.tcga_models import *
from tcga_encoder.utils.helpers import *
#from tcga_encoder.data import load_sources
#from ut... |
# -*- coding: utf-8 -*-
#
# defivelo-intranet -- Outil métier pour la gestion du Défi Vélo
# Copyright (C) 2015, 2016 Didier Raboud <me+defivelo@odyx.org>
#
# 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 Sof... |
#!/usr/bin/env python3
# file: dvd2webm.py
# vim:fileencoding=utf-8:ft=python
#
# Author: R.F. Smith <rsmith@xs4all.nl>
# Created: 2016-02-10 22:42:09 +0100
# Last modified: 2017-04-24 21:24:17 +0200
#
# To the extent possible under law, R.F. Smith has waived all copyright and
# related or neighboring rights to dvd2web... |
"""Modifiable runtime configuration parameters."""
from __future__ import absolute_import, division, print_function
import argparse
import logging
from pprint import pformat
import shlex
from .types import Path
from . import util
log = logging.getLogger(__name__)
class DefaultValueHelpFormatter(argparse.HelpFormat... |
"""Utility functionality."""
from __future__ import absolute_import, division, print_function
import glob
from collections import defaultdict, OrderedDict
from itertools import ifilter, islice
import os
import random
import re
import sys
import numpy as np
import scipy as sp
import scipy.stats
import scipy.spatial
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Exercise 25: Guessing Game Two
In a previous exercise, we’ve written a program that “knows” a number
and asks a user to guess it.
This time, we’re going to do exactly the opposite. You, the user, will
have in your head a number between 0 and 100. The program will gues... |
#########
# Copyright (c) 2017-2019 Cloudify Platform Ltd. 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 ... |
from django.http import (
Http404,
HttpRequest,
HttpResponse,
JsonResponse,
QueryDict,
)
from django.template.loader import render_to_string
from django.urls import reverse
from django.utils.decorators import method_decorator
from django.utils.html import format_html
from django.utils.translation im... |
from random import choice
from django.db import IntegrityError
from django.utils.text import slugify
from mygpo.decorators import query_if_required
from mygpo.categories.models import Category, CategoryEntry
class Topics(object):
def __init__(self, total=100, num_cat=10, podcasts_per_cat=10):
self.tota... |
#########
# Copyright (c) 2017-2019 Cloudify Platform Ltd. 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 ... |
import sys
import argparse
import configparser
from distutils.util import strtobool
from datetime import datetime, timedelta
import plexapi.video
from plexapi.myplex import MyPlexUser
from plexapi.exceptions import BadRequest, Unauthorized
from sqlalchemy import create_engine, MetaData
from sqlalchemy.schema import Tab... |
import glob
import os
import os.path
import platform
import shutil
import elocation
import eutils
from elogger import SystemLogger
############## Platform specifics #####################
d_target_directory_raw = os.path.expandvars (os.path.join ("$ISE_EIFFEL", "studio", "spec", "$ISE_PLATFORM"))
d_target_includedir_... |
import sys
from math import ceil
from OpenGL.GL import GL_LESS, GL_TRUE, GL_DEPTH_TEST, GL_STENCIL_TEST
from OpenGL.GL import GL_COLOR_ARRAY, GL_VERTEX_ARRAY, GL_TRIANGLES
from OpenGL.GL import GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT
from OpenGL.GL import GL_UNSIGNED_SHORT, GL_FLOAT, GL_MODELVIEW
from OpenGL.GL impor... |
# -*- coding:utf-8 -*-
from ritsu_utils import *
from ritsu_api import *
from ritsu_config import PROXY
import requests
import re
import logging as log
log.basicConfig(format="%(levelname)s: %(message)s", level=log.ERROR)
def get_search_page(query, engine='google', custom_query_url=None):
if not isinstance(quer... |
# -*- coding: utf-8 -*-
from Xml2Json import Xml2Json
from selenium.webdriver.firefox import webdriver
import time
import Image
from selenium import selenium
import os
import argparse
import re
from xml.dom.minidom import parseString
from xml.dom.minidom import Document
import pickle
def parseCode(htmlCode,dir,id,set... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... |
###
# Copyright (c) 2002-2005, Jeremiah Fincher
# Copyright (c) 2010, James Vega
# 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 copyri... |
from django.db import models
from django.core.files.base import ContentFile
from django.core.files.images import get_image_dimensions
from django.conf import settings
import datetime
import StringIO
import Image
import uuid
from django.db.models import Q
import mysite.customs
def get_image_data_scaled(image_data, wid... |
"""
fs.hadoop
=========
This module provides the class 'HadoopFS', which implements the FS filesystem
interface for files stored on a deployment of the Hadoop Distributed Filesystem.
Note: This filesystem is only compatible with Hadoop 2.0 or above.
The `pywebhdfs` module is used as a wrapper around the Hadoop 2 Web... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from pyecs import *
from pycompupipe.components import DrawPath, GuiElement
import mock
import pygame
import re
import os.path
from testing import *
class TestDrawPath():
def _support_point(self,x,y):
e = Entity()
e.add_component(GuiElement((x,y)))... |
import functools
class StreamException(RuntimeError):
pass
class StreamNotFoundException(StreamException):
def __init__(self, message=None):
super().__init__(message or 'Error: Stream not found')
class InvalidStreamException(StreamException):
def __init__(self, message=None):
super().__init__(message or 'E... |
import os
import sys
def create_user(username, email, password):
from django.contrib.auth.models import User
user = User.objects.create_user(username, email, password)
user.is_superuser = True
user.is_staff = True
user.save()
def create_demo_user(use_dotenv=False):
root = os.path.abspath(os.... |
# pylint: disable=no-member,line-too-long
from pushjack import APNSClient, APNSSandboxClient
from django.conf import settings
from django.core.management.base import BaseCommand
from ...decorators import handle_lock
from ...models import DataPoint
class Command(BaseCommand):
help = 'Send silent notifications t... |
# The MIT License (MIT)
#
# Copyright (c) 2016 Sean Quinn
#
# 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... |
"""
This file duplicates the functionality of django.contrib.admin.options exactly.
The only code differences are due to refactoring, to make extending the
ModelAdmin add_view and change_view easier. Any functional differences from
that module should be considered a bug.
"""
from six.moves import zip
import django
fro... |
#! /usr/bin/env python
import os
import sys
import rospy
from mdp_plan_exec.top_map_mdp import TopMapMdp
from mdp_plan_exec.product_mdp import ProductMdp
from mdp_plan_exec.prism_java_talker import PrismJavaTalker
from std_msgs.msg import String
from actionlib import SimpleActionServer, SimpleActionClient
from action... |
data codeString256
# workaround for now
self.codeString256 = text("0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz")
data pos
data buf[]
data tmpScriptLen
data tmpScriptArr[] # 'id' is 2
def f1(string:s):
setch(string, 0, "a")
setch(string, 1, "b")
return(string)
def t... |
"""
This module contains several flavors of constraint solver classes.
Each has a method solve_for(name) and a method set(\*\*kwds). These methods
are used by the constraint solver (solver.Solver) to set the variables.
Variables should be of type solver.Variable.
Available constraints are:
- EqualsConstraint - make ... |
import github3
from .helper import IntegrationHelper
def find(func, iterable):
return next(filter(func, iterable))
class TestDeployment(IntegrationHelper):
def test_create_status(self):
"""
Test that using a Deployment instance, a user can create a status.
"""
self.basic_log... |
from __future__ import absolute_import
from django.conf import settings
from django.contrib.sessions.models import Session
from zephyr.lib.context_managers import lockfile
from zephyr.models import Realm, Stream, UserProfile, UserActivity, \
Subscription, Recipient, Message, UserMessage, valid_stream_name, \
D... |
# Copyright 2010 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... |
try:
from itertools import izip
except ImportError:
izip = zip
from django import forms, template
from django.conf import settings
from django.template import Context, loader
from crispy_forms.utils import TEMPLATE_PACK, get_template_pack
register = template.Library()
@register.filter
def is_checkbox(field... |
#!/usr/bin/env python2.7
# Copyright (c) 2013 - present Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory... |
import json, base64, sys, re
from lxml import etree
from datetime import datetime, timedelta
from flask import Blueprint, request, make_response
from portality.core import app
from portality.models import OAIPMHJournal, OAIPMHArticle
from copy import deepcopy
blueprint = Blueprint('oaipmh', __name__)
################... |
from metakernel.tests.utils import get_kernel, get_log_text, clear_log_text
def test_python_magic():
kernel = get_kernel()
text = '%python imp'
comp = kernel.do_complete(text, len(text))
assert 'import' in comp['matches']
helpstr = kernel.get_help_on('%python bin')
assert 'bin(number)' in ... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2007 Ferran Pegueroles <ferran@pegueroles.com>
# Copyright (c) 2009 Albert Cervera i Areny <albert@nan-tic.com>
# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
# ... |
import monitoring.log
__version__ = '1.0.4'
|
# coding=utf-8
# Copyright 2022 The Uncertainty Baselines 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 ap... |
"""
.. module:: analyze
:synopsis: Extract data from chains and produce plots
.. moduleauthor:: Karim Benabed <benabed@iap.fr>
.. moduleauthor:: Benjamin Audren <benjamin.audren@epfl.ch>
Collection of functions needed to analyze the Markov chains.
This module defines as well a class :class:`Information`, that sto... |
# -*- coding: utf-8 -*-
from fractions import Fraction
def vnmax(features):
return sum([max([j['value'] for j in i['enum']]) for i in features])
def calculate_coeficient(features, parameters):
vmax = Fraction(vnmax(features))
vn = sum([Fraction(i['value']) for i in parameters])
return 1 + vn / (1 -... |
from tic.appengine import utils
if utils.in_development():
import os
import unittest
import logging
from google.appengine.api import apiproxy_stub_map
from google.appengine.api import datastore_file_stub
from google.appengine.api import mail_stub
from google.appengine.api import user_servic... |
"""
.. module:: analyze
:synopsis: Extract data from chains and produce plots
.. moduleauthor:: Karim Benabed <benabed@iap.fr>
.. moduleauthor:: Benjamin Audren <benjamin.audren@epfl.ch>
Collection of functions needed to analyze the Markov chains.
This module defines as well a class :class:`Information`, that sto... |
import tkinter as tk
class ConfigObject:
"""
"""
headers = None
def __init__(self):
self.headers = {}
def __getitem__(self, x):
return self.get_header(x)
def add_header(self, header_name, header):
self.headers[header_name] = header
return header
def add... |
import sys
import argparse
import config
import csv
import logging
import input
import connector
from umapi import UMAPI
from umapi.auth import Auth, JWT, AccessRequest
from umapi.helper import paginate
def error_hook(exctype, value, tb):
"""Set up the Error Hook (default exception handler)"""
logging.error('... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.