src stringlengths 721 1.04M |
|---|
import click
from pathlib import Path
from ipype.pipeline import IPypeApp, Pipeline
from traitlets.config import Config
@click.group(invoke_without_command=True)
@click.pass_context
def main(ctx, **args):
if ctx.invoked_subcommand is None:
rerun()
else:
pass
@main.command(context_settings=di... |
import movie
import fresh_tomatoes
# I have collecte my favourite movie and its most important
# details together to build an intresting webpage
dangal = movie.Movie('Dangal',
'Story about first indian woman wrestler.',
'https://upload.wikimedia.org/wikipedia/en/9/99/Dan'
... |
#!/usr/bin/env python
"""clipcaptcha is a CAPTCHA Provider masquerading tool based off Moxie Marlinspike's SSLStrip codebase"""
# Copyright (c) 2012 Gursev Singh Kalra @ McAfee Foundstone
# Copyright (c) 2004-2011 Moxie Marlinspike
__author__ = "Gursev Singh Kalra"
__email__ = "gursev.kalra@foundstone.com"
__license... |
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, String, DateTime, Integer, Boolean
from sqlalchemy import orm
from json import loads as json_loads
from json import dumps as json_dumps
from wrflow.common import hash_dict, hash_list
Base = declarative_base()
__all__ = [
'Node... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Testing suite for MultiDensity class.
"""
from __future__ import print_function, division
import unittest as ut
import numpy as np
import numpy.testing as npt
from multidensity import SkStAC
class SkStACTestCase(ut.TestCase):
"""Test SkStAC distribution class."... |
# The MIT License (MIT)
#
# Copyright (c) 2014 ImmobilienScout GmbH
#
# 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 u... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# author: Kun Jia
# date: 2/23/17
# email: me@jarrekk.com
from datetime import datetime
from bson import ObjectId
from flask import current_app
from flask_login import UserMixin, AnonymousUserMixin
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from... |
#!/usr/bin/env python
"""A translation decoder."""
from collections import defaultdict, namedtuple
import models
Hypothesis = namedtuple('Hypothesis',
['logprob', 'future_cost', 'coverage',
'lm_state', 'predecessor', 'candidate'])
def decode(tm, lm, source_sentence... |
from django.conf.urls import patterns, url
from restaurante import views
urlpatterns = patterns('',
url(r'^$', views.index, name='index'),
url(r'^about/', views.about, name='about'),
url(r'^menu/', views.menu, name='menu'),
#url(r'^login/', views.login, name='auth_login'),
#url(r'^bar/add_tapa/$', view... |
#!/usr/bin/env python
import os
import cv2
import numpy as np
import subprocess
import tempfile
import connor_util as cutil
def draw_arrow(image, p, q, color, arrow_magnitude=9, thickness=1, line_type=8, shift=0):
# adapted from http://mlikihazar.blogspot.com.au/2013/02/draw-arrow-opencv.html
# draw arrow t... |
import argparse
import copy
import dataset_walker
import json
import time
from collections import defaultdict
def labels(user_act, mact):
# get context for "this" in inform(=dontcare)
# get context for affirm and negate
this_slot = None
confirm_slots = {"explicit": [], "implicit": []}
for act in ... |
# Copyright (c) <2013-2014>, <Samuel J. Tan (samueltan@gmail.com)>
# 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
# no... |
from sanskrit_parser.generator.paninian_object import PaninianObject
from sanskrit_parser.base.sanskrit_base import SLP1
class Pratipadika(PaninianObject):
""" Sanskrit Object Class: Derived From SanskritString
Attributes:
"""
def __init__(self, thing=None, linga="pum",
other_tags=[... |
#
# Copyright: Copyright (c) MOSEK ApS, Denmark. All rights reserved.
#
# File: TrafficNetworkModel.py
#
# Purpose: Demonstrates a traffix network problem as a conic quadratic problem.
#
# Source: Robert Fourer, "Convexity Checking in Large-Scale Optimization",
# OR 53 --- Nottingham 6-8 September... |
# -*- coding: utf-8 -*-
"""
(c) 2015-2017 - Copyright Red Hat Inc
Authors:
Pierre-Yves Chibon <pingou@pingoured.fr>
"""
from __future__ import print_function, unicode_literals, absolute_import
import flask
import datetime
import logging
import arrow
from sqlalchemy.exc import SQLAlchemyError
import pagure.e... |
# coding=utf-8
"""
This module, formatting.py, is just utility functions to format source code text.
"""
# This is needed for the custom compiler.
KEYWORDS = []
def sort_by_deliminator(deliminator, code_text, lines_to_ignore=None):
"""This method will take a chunk of code and format it so that it is sorted by colu... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import traceback
import copy
import listservers
import buckets
import info
import util_cli as util
import cb_bin_client
import stats_buffer
class StatsCollector:
def __init__(self, log):
self.log = log
def seg(self, k, v):
# Parse ('some_... |
"""
Create a mongo database if it doesn't exist and load a bunch of data into it.
We need a directory with one or more JSON files in it. We look for JSON on the end of the filename.
e.g. python load_models.py -d /data/Genotype-Phenotype-Modeling/models/Citrobacter/Citrobacter/models/ -n fba_models -c citrobacter
"""
... |
from rez.solver import Solver, SolverStatus, PackageVariantCache
from rez.package_repository import package_repository_manager
from rez.packages_ import get_variant, get_last_release_time
from rez.package_filter import PackageFilterList, TimestampRule
from rez.utils.memcached import memcached_client, pool_memcached_con... |
# -*- coding: utf-8 -*-
#
# forgi documentation build configuration file, created by
# sphinx-quickstart on Fri Oct 19 10:44:58 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 file.
#
# All c... |
#!/usr/bin/python3
import getopt
import os
import sys
import chrome_common
# Where the Chrome binary lives
CHROME_PATHS = {
"stable": "/opt/google/chrome",
"beta": "/opt/google/chrome-beta",
"dev": "/opt/google/chrome-unstable"
}
# Where Chrome profile data lives, relative to $HOME
CHROME_USER_DIR... |
# -*- 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):
# Adding model 'FriendJoinedEmailLog'
db.create_table('custom_friendjoinedemaillog', (
('id', se... |
from __future__ import absolute_import
import six
from collections import OrderedDict
class Role(object):
def __init__(self, priority, id, name, desc="", scopes=(), is_global=False):
assert len(id) <= 32, "Role id must be no more than 32 characters"
self.priority = priority
self.id = id... |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from zlib import crc32
from hashlib import sha256
from math import log, ceil
import collections
import threading
__all__ = ['HashedDict']
__version__ = "0.1.0"
__author__ = "Johannes Schreiner, johannes@schreiner.io"
__credits__ = ["Johannes Schreiner"]
__url... |
"""
Support for Tahoma cover - shutters etc.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/cover.tahoma/
"""
import logging
from datetime import timedelta
from homeassistant.components.cover import CoverDevice
from homeassistant.components.tahoma impor... |
import calendar
# Input commands:
SHOW = 'show' # show current days remaining (optional)
LOG = 'log' # print taken days off
ECHO = 'echo' # print entire .vacationrc file
TAKE = 'take' # take a day off ('take' is optional)
CANCEL = 'cancel' # cancel a day off
SET = 'set' # Set one of either rate or days
RATE = 'r... |
import os
from functools import wraps
from PIL import Image
from residue import CoerceUTF8 as UnicodeText, UTCDateTime, UUID
from sqlalchemy import and_
from sideboard.lib import on_startup
from sqlalchemy.schema import ForeignKey
from sqlalchemy.types import Boolean, Integer
from sqlalchemy.ext.hybrid import hybrid_p... |
"""
The scripts implements functionality fo AWS usage for locust
:TODO: Security group authorize checks
:ssh-add for windows machines
:When creating new slaves the range should begin from last of existing slaves
"""
import subprocess
import time
import itertools
import boto.ec2
AWS_ACCESS_KEY_ID = ''
AWS_SECRET_ACCES... |
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from contabilidad.views import Tablero, ListadoCuentasContables, \
CargarCuentasContables, ListadoTiposDocumentos, CrearTipoDocumento, \
EliminarTipoDocumento, DetalleTipoDocumento, ModificarTipoDocumento, \
Repo... |
#!/usr/bin/python
import numpy
import re
import cPickle as pickle
import gzip
import time
def getSetpointsFromRaw(filename,verbose=False):
printEvery = 1
if(verbose):
startTime = time.time()
print "Opened raw file %s."%(filename)
else:
startTime = 0
f=open(filename,'rb')
data = []
for line in f:
if re.... |
from rswail.bytecode import Instruction
from rswail.closure import Closure
from rswail.cons_list import cons_list, from_list, to_list
from rswail.struct import Struct, StructInstance, construct
from rswail.value import Integer, String, Value
statement = Struct(u"statement", {
u"declaration": [u"header", u"name", u"ar... |
###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... |
# -*- coding: utf-8 -*-
"""
Django REST framework tests generator which is based on API Blueprint
(https://apiblueprint.org/) documents.
Released under New BSD License.
Copyright © 2015, Vadim Markovtsev :: AO InvestGroup
All rights reserved.
Redistribution and use in source and binary forms, with or without
modifica... |
from tipi_data.models.stats import Stats
from tipi_data.models.topic import Topic
from tipi_data.models.initiative import Initiative
class GenerateStats(object):
def __init__(self):
self.topics = Topic.objects()
self.subtopics = self.topics.distinct('tags.subtopic')
self.stats = Stats()
... |
# gizela
#
# Copyright (C) 2010 Michal Seidl, Tomas Kubin
# Author: Tomas Kubin <tomas.kubin@fsv.cvut.cz>
# URL: <http://slon.fsv.cvut.cz/gizela>
#
# $Id: ObsClusterVector.py 107 2010-12-06 23:18:55Z tomaskubin $
from gizela.util.Error import Error
from gizela.data.ObsHeightDiff import ObsHeightDiff
from gizela... |
#!/usr/bin/env python
import pytest
import fleet
import jsonobject
class TestFleetList(object):
def pytest_funcarg__fleet_list(self):
fleet_list = fleet.FleetList()
fleet_list.fleets.append(fleet.Fleet(
id=1,
name=u'FleetName',
ship_ids=[1, 2, 3]))
re... |
from cis.data_io.products import NetCDF_Gridded
import cis.data_io.gridded_data as gd
import logging
from cis.utils import demote_warnings
class Grosvenor_CDNC(NetCDF_Gridded):
"""
Plugin for reading Dan Grosvenor's MODIS CDNC files.
"""
@staticmethod
def load_multiple_files_callback(cube, fi... |
from setproctitle import setproctitle
import json
import os
import redis
import subprocess
import time
class DisplayControlConsumer(object):
def __init__(self, redis_host, redis_port):
self.redis_instance = redis.StrictRedis(host=redis_host, port=redis_port)
self.env = {"DISPLAY": ":0"}
def ... |
# Copyright 2013 the Melange 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 applicable law or agreed to in wr... |
# -*- coding: utf-8 -*-
import re
import time
from pyload.plugin.Account import Account
class Keep2ShareCc(Account):
__name = "Keep2ShareCc"
__type = "account"
__version = "0.05"
__description = """Keep2Share.cc account plugin"""
__license = "GPLv3"
__authors = [("aeronaut", "... |
#!/usr/bin/env python3
# coding: utf-8
from __future__ import unicode_literals, print_function
import os
import sys
import stat
from molbiox.frame.command import Command
from molbiox.frame.locate import locate_template
class CommandGen(Command):
abbr = 'gen'
name = 'generate'
desc = 'generate scripts'
... |
'''Dump the contents of the target hash file to be examined'''
import sys
import gflags
from rsync_usb.ui.ConsoleUI import ConsoleUI
from rsync_usb.ParameterError import ParameterError
from rsync_usb.trx_files.TargetHashesReader import TargetHashesReader
from rsync_usb.trx_files.TargetHashesReader impor... |
#!/usr/bin/env python
# encoding: utf-8 -*-
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2017 Prof. William H. Green (whgreen@mit.edu),
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu)
#
... |
""" Event-handling around gtk.FileChoosers of various sorts """
from baseevents import StateChangeEvent
from storytext.definitions import UseCaseScriptError
import gtk, os
# At least on Windows this doesn't seem to happen immediately, but takes effect some time afterwards
# Seems quite capable of generating too many... |
#
# Module which supports allocation of ctypes objects from shared memory
#
# multiprocessing/sharedctypes.py
#
# Copyright (c) 2007-2008, R Oudkerk --- see COPYING.txt
#
import sys
import ctypes
import weakref
from multiprocessing import heap, RLock
from multiprocessing.forking import assert_spawning, ForkingPickler... |
# Copyright 2015 Brocade Communications System, 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 ... |
# Copyright 2016 Andrich van Wyk
#
# 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, ... |
import io
import os
import os.path
def makedirs(dir):
try:
os.makedirs(dir)
except:
pass
class jsdict(dict):
def __init__(self, data):
self.__dict__ = data
class CachedDataLoader:
def __init__(self, dir):
self.dir = dir
makedirs(dir)
# try to load data ... |
# -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Copyright 2012, 2015 BigML
#
# 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... |
# No relation between Rank and Matches Fought
import subprocess as sp
tmp = sp.call('cls',shell=True)
import pandas as pd
import numpy as np
from sklearn.cluster import KMeans
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
df = ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""PlayListSelector is a dialog for constructing a playlist.
A playlist is simply a list of filepaths written as rows in
a plain text file.
The selector is called as a modal dialog and can be initiated with
a base list or an empty list. """
##################
## Drag n dr... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from future.builtins import int, object
import re
import six
import unicodedata
import random
from abc import ABCMeta
from bitstring import BitArray
class Component(object):
"""Base class for all ISCC identifier components"""... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'items\ui_commit_item.ui'
#
# Created: Sat Oct 5 00:17:13 2019
# by: pyside-uic 0.2.15 running on PySide 1.2.4
#
# WARNING! All changes made in this file will be lost!
from thlib.side.Qt import QtWidgets as QtGui
from thlib.side.Qt imp... |
# --------------------------------------------------------------------------------
# Copyright (c) 2018 Shi Chi(Mack Stone). 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 Soft... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... |
#!/usr/bin/env python
import base64
import jsonfield
import uuid
from dimagi.ext.couchdbkit import *
from datetime import datetime, timedelta
from django.db import models, transaction
from django.http import Http404
from collections import namedtuple
from corehq.apps.app_manager.dbaccessors import get_app
from corehq.... |
#!/usr/bin/env python
# coding: utf-8
"""
PlanningsApi.py
Copyright 2015 SmartBear Software
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... |
from vectordatasource.meta.python import FilterCompiler
from vectordatasource.meta.python import create_matcher
class CollisionRanker(object):
def __init__(self, cases):
def _output_fn(datum):
return datum['index']
index = 1
matchers = []
for case in cases:
... |
# Copyright 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the ... |
import os
from collections import defaultdict, OrderedDict
from twisted.internet.protocol import Factory
from twisted.protocols.basic import LineReceiver
from twisted.internet import reactor
class ZooKeeper(LineReceiver):
def __init__(self, connection_addr, znodes, ephem_nodes):
self.address = connection... |
from StringIO import StringIO
import mock
from django.test import TestCase
from helpers import test_data
from django.test.client import Client
__author__ = 'tony'
class TestProjectViews(TestCase):
def setUp(self):
self.project = test_data.create_dummy_project()
self.client = Client() ... |
# -*- coding: utf-8 -*-
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
# Generally useful functions
# Copyright (c) 2018 Aubrey Barnard. This is free software. See
# LICENSE for details.
import itertools as itools
def firsts(items, key=None):
"""Generates the first occurrence of each unique item.
* items: Iterable of items.
* key: Function computing the key for each ite... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'sampleman.ui'
#
# Created: Sun Mar 7 13:00:58 2010
# by: PyQt4 UI code generator 4.7
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_MainWindow(object):
def setupUi(self, MainWind... |
import sqlalchemy
from shapely import geometry, wkb
class Geography(sqlalchemy.types.TypeEngine):
"""PostGIS Geometry Type."""
def __init__(self, type_, dimension):
super(Geography, self).__init__()
self.SRID = 4326
self.type = type_.upper()
self.dimension = dimension
... |
import logging
import sys
import pytest
from click.testing import CliRunner
from banneret import Banneret, Docker
from banneret.cli import LINUX, MACOS
only_mac = pytest.mark.skipif(sys.platform not in MACOS, reason='Not macOS')
only_linux = pytest.mark.skipif(sys.platform not in LINUX, reason='Not Linux')
@pytest... |
# Copyright (c) 2015 Duke University.
# This software is distributed under the terms of the MIT License,
# the text of which is included in this distribution within the file
# named LICENSE.
#
# Portions of this software are derived from the "rest_router" controller
# application included with Ryu (http://osrg.github.i... |
# -*- coding: utf-8 -*-
'''
Mepinta
Copyright (c) 2011-2012, Joaquin G. Duo
This file is part of Mepinta.
Mepinta 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 opti... |
import itertools
import logging
import os
import platform
import sys
if platform.system() == 'Windows': # noqa
import msvcrt
else: # noqa
import fcntl
from porcupine import dirs
def _lock(fileno):
"""Try to lock a file. Return True on success."""
# closing the file unlocks it, so we don't need to... |
from gen import *
from pdataset import *
import numpy as np
import argparse
from arcade_universe.fg import Foreground, FGTextureType
import time
import copy
class PentominoGenerator(object):
def __init__(self,
batch_size,
use_patch_centers=False,
seed=1321, patc... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-11-03 03:24
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import sigs.managers
class Migration(migrations.Migration):
initial = True
dependencies... |
from game.ai.defence.yaku_analyzer.yaku_analyzer import YakuAnalyzer
from mahjong.constants import HONOR_INDICES, TERMINAL_INDICES
class TanyaoAnalyzer(YakuAnalyzer):
id = "tanyao"
def __init__(self, enemy):
self.enemy = enemy
def serialize(self):
return {"id": self.id}
def is_yaku_... |
from __future__ import unicode_literals
class Choices(object):
"""
A class to encapsulate handy functionality for lists of choices
for a Django model field.
Each argument to ``Choices`` is a choice, represented as either a
string, a two-tuple, or a three-tuple.
If a single string is provided... |
# topics.models
# Topic modeling for data survey analysis
#
# Author: Benjamin Bengfort <bbengfort@districtdatalabs.com>
# Created: Tue Sep 08 19:43:58 2015 -0400
#
# Copyright (C) 2015 District Data Labs
# For license information, see LICENSE.txt
#
# ID: models.py [] benjamin@bengfort.com $
"""
Topic modeling for ... |
# coding: utf-8
"""
KubeVirt API
This is KubeVirt API an add-on for Kubernetes.
OpenAPI spec version: 1.0.0
Contact: kubevirt-dev@googlegroups.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class K8sIoApi... |
"""fileloader.py unit tests."""
from pathlib import Path
from unittest.mock import mock_open, patch
from pypyr.errors import PipelineNotFoundError
import pypyr.pypeloaders.fileloader
import pytest
# ------------------------- get_pipeline_path --------------------------------#
cwd = Path.cwd()
def test_get_pipeline... |
#! /usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, Takashi Ogura
#
# based on
#
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditi... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
"""pconf lives at <https://github.com/tony/pconf>.
pconf
~~~~~
Python configuration management for humans.
"""
import os
import sys
from setuptools import setup, find_packages
with open('requirements.pip') as f:
install_reqs = [line for line in f.read().split('\n') ... |
from model.group import Group
#import pytest
#from data.groups import constant as testdata
import pytest
#@pytest.mark.parametrize("group", testdata, ids = [repr(x) for x in testdata] ) # ids- список с текстовым представлением данных (преобразование в строки )
#The builtin pytest.mark.parametrize decorator enables ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django
from django.contrib.admin.sites import AdminSite
from django.utils.functional import SimpleLazyObject
from djadmin import settings
from .models import DjadminModelSetting
from .signals import get_register_model_with_mixin, handle_djadmin_fi... |
# Copyright 2016, 2019 IBM Corp.
#
# 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 require... |
# -*- coding: UTF-8 -*-
import pytest
from delphin.mrs.components import (
Pred,
ElementaryPredication as EP,
elementarypredications as eps,
HandleConstraint as Hcons,
hcons,
IndividualConstraint as Icons,
icons,
)
from delphin.mrs.config import (FIRST_NODEID, UNKNOWNSORT)
from delphin.mrs... |
from core.validation.validation import TSValidationError, validate_request, sanitize_objectify_json, stringify_objectid_cursor
from core.api.crud import db
from bson.objectid import ObjectId
from core.validation.permissions import get_role_approval_step, check_datamine_permissions
from core.notifications import notific... |
"""
Copyright 2011-13 Attila Zseder
Email: zseder@gmail.com
This file is part of hunmisc project
url: https://github.com/zseder/hunmisc
hunmisc 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
versi... |
import django
from django.conf import settings
from django.template import Library, Node
from django.template.loader import get_template
from fluent_comments.utils import get_comment_template_name, get_comment_context_data
from tag_parser import parse_token_kwargs
from tag_parser.basetags import BaseInclusionNode
from ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Solid-State-Relay test for the River System Control and Monitoring Software Version 0.9.2
# This file is part of the River System Control and Monitoring Software.
# Copyright (C) 2017-2018 Wimborne Model Town
# This program is free software: you can redistribute it and/or... |
"""!
@brief Examples of usage and demonstration of abilities of BIRCH algorithm in cluster analysis.
@authors Andrei Novikov (pyclustering@yandex.ru)
@date 2014-2020
@copyright BSD-3-Clause
"""
from pyclustering.cluster import cluster_visualizer
from pyclustering.cluster.birch import birch
from pyclus... |
from .callbacks import Callback
from timeit import default_timer
from numbers import Number
import sys
overhead = sys.getsizeof(1.23) * 4 + sys.getsizeof(()) * 4
class Cache(Callback):
""" Use cache for computation
Examples
--------
>>> cache = Cache(1e9) # doctest: +SKIP
The cache ca... |
# coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
im... |
'''
dcc
----
'''
from bs4 import BeautifulSoup
import logging
import requests
import time
# Local imports
from utils.common.browser import SelfClosingBrowser
from utils.common.datapipeline import DataPipeline
def get_field_from_box(field, box):
''''''
for row in box.find("ul"):
# Accept rows co... |
import pygame
class Ball(pygame.sprite.Sprite):
def __init__(self, screen_size, position, speed):
pygame.sprite.Sprite.__init__(self)
self.surface = pygame.image.load('imgs/ball.png')
self.screen_size = screen_size
self.rect = self.surface.get_rect()
self.rect.left = positi... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('hcore', '0005_remove_is_active'),
]
operations = [
migrations.AlterField(
model_name='timeseries',
n... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Clases.py
#
# Copyright 2016 Daniel Rene <danielrenechaparro@openmailbox.org>
#
# 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 ... |
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2008-2010 (ita)
"""
Execute the tasks with gcc -MD, read the dependencies from the .d file
and prepare the dependency calculation for the next run.
Usage:
def configure(conf):
conf.load('gccdeps')
"""
import os, re, threading
from waflib import Task, Logs, Ut... |
# Copyright 2010 Hakan Kjellerstrand hakank@gmail.com
#
# 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 ... |
"""
This recipe generates a module convert.py and convertTest.txt which is used
to test conversion.py when it is run.
conversion.py is built from the table defining the unit conversions
* uses the decimal module as a base class and unit types are class properties.
* provides exact decimal representation
* contro... |
# This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
import os
import re
import textwrap
from collections import defau... |
from random import choice, randint
from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand
from faker import Faker
from backend.posts import models
fake = Faker()
def make_text(min_paragraphs, max_paragraphs):
return '\n'.join(fake.paragraphs(
nb=randint(min_p... |
#
# Copyright (c) SAS Institute 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 w... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.