text stringlengths 12 6.59M |
|---|
"""Recruiters manage the flow of participants to the experiment."""
from rq import Queue
from dallinger.config import get_config
from dallinger.heroku.worker import conn
from dallinger.models import Participant
from dallinger.mturk import MTurkService
from dallinger.mturk import DuplicateQualificationNameError
from da... |
from __future__ import absolute_import, unicode_literals
import traceback
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from dash.orgs.models import Org
from django.conf import settings
from django.template.response import TemplateResponse
from django.utils import translati... |
# Copyright (C) 2010, 2011 Linaro Limited
#
# Author: Zygmunt Krynicki <zygmunt.krynicki@linaro.org>
#
# This file is part of Launch Control.
#
# Launch Control is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License version 3
# as published by the Free Soft... |
#!/usr/bin/env python
# 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 argparse
import importlib
import inspect
import os
import sys
from fnmatch import fnmatch... |
# Copyright (C) 2010 Linaro Limited
#
# Author: Zygmunt Krynicki <zygmunt.krynicki@linaro.org>
#
# This file is part of Launch Control.
#
# Launch Control is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License version 3
# as published by the Free Software F... |
import fnmatch
import os.path
import re
EXPAND_BRACES_RE = re.compile(r'.*(\{.*?[^\\]?\})')
def get_real_metric_path(absolute_path, metric_path):
# Support symbolic links (real_metric_path ensures proper cache queries)
real_absolute_path = os.path.realpath(absolute_path)
if absolute_path != real_absolute... |
import six
from graphite.errors import InputParameterError
from graphite.render.attime import parseTimeOffset
from graphite.logger import log
from graphite.functions.aggfuncs import aggFuncs, aggFuncAliases
class ParamTypes(object):
pass
class ParamType(object):
options = []
def __init__(self, name, v... |
from cloudinitd.exceptions import *
from cloudinitd.user_api import *
from cloudinitd.statics import *
import urlparse
service_state_initial = 0
service_state_launched = 2
service_state_contextualized = 4
service_state_terminated = 6
g_open_loggers = []
Version = "1.2"
def find_true():
cmds = [
"t... |
"""Generate Swadesh lists for classical languages"""
__author__ = ['Patrick J. Burns <patrick@diyclassics.org>']
__license__ = 'MIT License. See LICENSE.'
swadesh_la = ['ego', 'tū', 'is, ea, id', 'nōs', 'vōs', 'eī, iī, eae, ea', 'hic, haec, hoc', 'ille, illa, illud', 'hīc', 'illic, ibi', 'quis, quae', 'quid', 'ubi', ... |
# Copyright 2022 The CLU 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 writ... |
#!/usr/bin/python
# -* coding: UTF-8 -*-
#import iso8602
import pprint
import cgi
import cgitb
import json
from slackclient import SlackClient
import datetime
import pytz
import re
import os
cgitbLogDir = os.environ.get('SLACKBOTS_J3B_CGI_LOGDIR')
cgitb.enable(display=0, logdir=cgitbLogDir, format='text') # display=1 ... |
# Python
import cgi
import os
import json
import urllib2
# Flask
from flask import render_template, flash, redirect, request, url_for
from flask import session, abort
from flask.ext.login import login_user, logout_user, login_required, current_user
from forms import SignupForm, LoginForm_1, LoginForm_2
# App
from log... |
'''Utilities.py - Tools for writing reproducible scripts
=========================================================
The :mod:`Utilities` modules contains utility functions for argument
parsing, logging and record keeping within scripts.
This module is imported by most UMI-tools tools. It provides convenient
and consis... |
class CommandException(Exception):
"""
This custom exception can be thrown by commands when something goes wrong during execution.
The parameter is a message sent to the source that called the command (a channel or a user)
"""
def __init__(self, displayMessage=None, shouldLogError=True):
"""
Create a new Comm... |
#!/usr/bin/env python
import roslib
roslib.load_manifest('simulator')
import rospy
import numpy as np
from pedsim_msgs.msg import AllAgentsState
from std_msgs.msg import String
import sys
import math
ANGLES = np.array( [-1, math.cos( 3 * math.pi / 4 ), math.cos( math.pi / 4 )], dtype = np.float32 )
PROXEMICS = np... |
#!/usr/bin/env python
# Copyright 2018-2020 Arm Limited.
# SPDX-License-Identifier: Apache-2.0
#
# 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-... |
#!/opt/python-2.7.6/bin/python
# -*- coding: utf-8 -*-
import os
import sys
import argparse
import datetime
import time
import pwd
import grp
import MySQLdb
from pseudo_cluster.task import Task_record
from pseudo_cluster.tasks_list import Tasks_list
def main(argv=None):
"""
Главная функция программы
... |
#!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Run regression test suite.
This module calls down into individual test cases via subprocess. It will
f... |
'''
This file creates a .csv file containing the name of each laptop and its last changed date
'''
import argparse
import csv
from datetime import datetime, timezone
import os
import svn.local
import pandas as pd
'''
Constants -- paths for reports, default save names, SLA, columns, and sites
TO-DO: Change SLA_DAYS to ... |
# -*- coding: utf-8 -*-
"""JSON deserializer for API classes.
Note, this module is mainly intended for internal use and the API may
change in the future
"""
import binascii
import iso8601
from clx.xms import api
from clx.xms.exceptions import UnexpectedResponseException
def _date_time(json, date_string):
"""De... |
#!/usr/bin/env python3
# Copyright (c) 2009-2019 The Bitcoin Core developers
# Copyright (c) 2014-2019 The DigiByte Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Run regression test suite.
This module calls do... |
# -*- coding: utf-8 -*-
from collections import defaultdict
from asciitree import LeftAligned
class SimplexTree:
def __init__(self):
self.root = SimplexTreeNode("root", None,-1)
self.sibling_tree = defaultdict(lambda : defaultdict(list))
self.depth = 0
def add_simplex(sel... |
#! /usr/bin/env python
# msg/srv generator for precompiled system
# It is useful if you are using precompiled ROS system,
# because it needs root access and there are ROS_NOBUILD file in the packages.
# This script generates *.rb files in the rosruby dir.
import sys
import os
import genrb
from genrb.generator import... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Basic interface to Amazon MWS
# Based on http://code.google.com/p/amazon-mws-python
#
import urllib
import hashlib
import hmac
import base64
import md5
from xml.etree.ElementTree import fromstring, ParseError
from time import strftime, gmtime
from requests import requ... |
#!/usr/bin/env python
# coding: utf-8
import scanpy as sc
import scIB
import warnings
warnings.filterwarnings('ignore')
def runIntegration(inPath, outPath, method, hvg, batch):
"""
params:
method: name of method
batch: name of `adata.obs` column of the batch
max_genes_hvg: maximum num... |
#!/usr/bin/env python
# Detect Ponto-Medullary Junction
#
# Copyright (c) 2017 Polytechnique Montreal <www.neuro.polymtl.ca>
# Author: Charley
# Created: 2017-07-21
#
# About the license: see the file LICENSE.TXT
import os
import shutil
import sys
import numpy as np
from scipy.ndimage.measurements import center_of_ma... |
from time import sleep
import docker
import dronekit
# connect to the Docker daemon
client = docker.client.from_env()
# provision a container from an ArduPilot image
image_name = "squareslab/ardubugs:base"
container = client.containers.create(image_name, "/bin/bash", stdin_open=True, detach=True, working_dir="/experi... |
# -*- coding: utf-8 -*-
"""Persistence layer for the google drive addon.
"""
import os
import urllib
from datetime import datetime
from modularodm import fields
from framework.auth import Auth
from website.oauth.models import ExternalProvider
from website.addons.base import exceptions
from website.addons.base import... |
#!/usr/bin/env python
# Created by Raul Peralta-Lozada
import sys
import rospy
from json_msgs.srv import *
from geometry_msgs.msg import PoseWithCovarianceStamped
def service_call(service_name):
rospy.wait_for_service(service_name)
try:
swapper_call = rospy.ServiceProxy(service_name, JsonSrv)
... |
import os
import base64
import random
import time
from datetime import datetime
from django.db.models import F, Q
from planetstack.config import Config
from ec2_observer.syncstep import SyncStep
from core.models.user import User
from core.models.site import *
from ec2_observer.awslib import *
from ec2_observer.creds i... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This demo demonstrates how to draw a dynamic mpl (matplotlib)
plot in a wxPython application.
It allows "live" plotting as well as manual zooming to specific
regions.
Both X and Y axes allow "auto" or "manual" settings. For Y, auto
mode sets the scaling of the graph ... |
import itertools as it
from conference_scheduler.resources import Shape, Constraint
from conference_scheduler.lp_problem import utils as lpu
def _schedule_all_events(events, slots, X, summation_type=None):
shape = Shape(len(events), len(slots))
summation = lpu.summation_functions[summation_type]
label =... |
#!/usr/bin/python
# NATINAL
# (c) 2016-20 J. W. Crockett, Jr., josh.crockett@gmail.com
# Not
# Another
# Twit
# Issuing
# Notifications
# About the
# Lineups!
# yes, the acronym's a terrible stretch. ref: http://www.uni-watch.com/2009/04/18/natinal-joke/, and the daily race of Nationals beat writers for who tweets t... |
import os
from azure.common.credentials import ServicePrincipalCredentials
class AzureCredentials(object):
def __init__(self, client_id, secret, tenant, subscription_id):
self.client_id = client_id
self.secret = secret
self.tenant = tenant
self.subscription_id = subscription_id
... |
##############################################################################
# Medical Image Registration ToolKit (MIRTK)
#
# Copyright 2016 Imperial College London
# Copyright 2016 Andreas Schuh
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with ... |
"""
Handle the NBT (Named Binary Tag) data format
"""
from struct import Struct, error as StructError
from gzip import GzipFile
import zlib
from collections import MutableMapping, MutableSequence, Sequence
import os, io
try:
unicode
basestring
except NameError:
unicode = str # compatibility for Python 3
basestri... |
# -*- coding: utf-8 -*-
import datetime
from flask import session, redirect, url_for, flash, render_template
from . import app
from .forms import ShortenedURLForm
from .models import ShortenedURL, register
from .validation import get_msg_if_blacklisted_or_spam
@app.context_processor
def inject_year():
now = dat... |
import numpy as np
import numpy.random
from _mc import integrate_importance
from mc_base import _MC_Base
__all__ = [ "mcimport" ]
class _MC_Importance_Integrator(_MC_Base):
def __init__(self,f,npoints,distribution,
args, rng, nprocs,seed,batch_size,
dist_kwargs,weight):
self.f =... |
# -*- coding: utf-8 -*-
# Copyright (C) 2016,2017 Simone Marsili
# All rights reserved.
# License: BSD 3 clause
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import ( # pylint: disable=redefined-builtin, unused-import
bytes, dict, int, li... |
# -*- coding: utf-8 -*-
# Author: Simone Marsili <simomarsili@gmail.com>
# License: BSD 3 clause
"""Functions module."""
import logging
import numpy
import ndd
from ndd.estimators import Entropy, JSDivergence
from ndd.exceptions import (CardinalityError, CombinationError, DataArrayError,
E... |
from django import forms
from django.contrib.auth import login, authenticate
from django.http import HttpResponse
from django.views.generic import View,TemplateView
from django.template import RequestContext
from django.shortcuts import render_to_response, redirect, get_object_or_404
from django.core.urlresolvers impor... |
# -*- coding: utf-8 -*-
# Author: Simone Marsili <simomarsili@gmail.com>
# License: BSD 3 clause
"""Functions module."""
import logging
import numpy
import ndd
from ndd.estimators import Entropy, JSDivergence
from ndd.exceptions import (CardinalityError, CombinationError, DataArrayError,
E... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 Smile (<http://www.smile.fr>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Aff... |
#!/usr/bin/env python3
import os
import requests
import json
import logging
from io import BytesIO
from PIL import Image
__version__ = '0.0.3'
logger = logging.getLogger('netatmo')
HOME = os.getenv('HOME') + '/'
#######################
# MODULE EXCEPTIONS #
#######################
class NetatmoError(Excepti... |
"""
A number of functions that help the Amcat3 selection page to retrieve selections from the database
"""
from amcat.models import article
def getQuerySet(projects=None, articlesets=None, mediums=None, startDate=None, endDate=None, articleids=None, **kargs):
queryset = article.Article.objects
if articlesets:... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Migration script for Search-enabled Models.'''
from __future__ import absolute_import
import logging
from elasticsearch import helpers
from modularodm.query.querydialect import DefaultQueryDialect as Q
from framework.mongo.utils import paginated
from website import se... |
from random import choice, randint
from struct import pack
from binascii import unhexlify
from array import array
from socket import inet_aton, inet_pton, htons, IPPROTO_TCP, IPPROTO_UDP, AF_INET6, IPPROTO_ICMPV6
from re import search
class Ethernet_raw:
# +--------------------------------------------------------... |
from cms import settings
from cms.admin.change_list import CMSChangeList
from cms.admin.dialog.views import get_copy_dialog
from cms.admin.forms import PageForm, PageAddForm
from cms.admin.permissionadmin import PAGE_ADMIN_INLINES, \
PagePermissionInlineAdmin
from cms.admin.utils import get_placeholders
from cms.ad... |
from cms import settings
from cms.admin.change_list import CMSChangeList
from cms.admin.dialog.views import get_copy_dialog
from cms.admin.forms import PageForm, PageAddForm
from cms.admin.permissionadmin import PAGE_ADMIN_INLINES, \
PagePermissionInlineAdmin
from cms.admin.utils import get_placeholders
from cms.ad... |
"""Stuff to make working with the NearlyFreeSpeech.NET API easier."""
__author__ = "Damien Dart, <damiendart@pobox.com>"
__license__ = "Unlicense"
__title__ = "nfsnapi"
__version__ = "0.1.0"
import hashlib
import json
import random
import string
import time
import urllib2
def auth_header(username, API_key, request... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
1837. Isenbaev's Number
Time limit: 0.5 second
Memory limit: 64 MB
[Description]
Vladislav Isenbaev is a two-time champion of Ural, vice champion of TopCoder
Open 2009, and absolute champion of ACM ICPC 2009. In the time you will spend
reading this problem statement Vladi... |
# -*- coding: utf-8 -*-
from cms.constants import PUBLISHER_STATE_DIRTY
from cms.models import CMSPlugin, Title, Page, StaticPlaceholder, Placeholder
def get_placeholder(plugin):
if plugin.placeholder_id:
try:
return plugin.placeholder
except Placeholder.DoesNotExist:
retur... |
# -*- coding: utf-8 -*-
import argparse
import configparser
import hashlib
import hmac
import io
import json
import logging
import mimetypes
import os
import re
import smtplib
import socket
import tempfile
import traceback
import urllib.request
import urllib.parse
import urllib.error
from base64 import b64decode, b64e... |
#!/usr/bin/env python
# vim:ts=4:sw=4:ft=python:fileencoding=utf-8
"""Checks rss feed and posts to twitter.
Check an rss feed and if the latest entry is different than post it to twitter.
"""
import sys
import os
import traceback
import cPickle
from ConfigParser import SafeConfigParser
from optparse import OptionPa... |
#!/usr/bin/python
#-*- coding:utf-8 -*-
import sys
import codecs
#from konlpy.tag import Kkma
from konlpy.tag import Komoran
#kkma = Kkma()
komoran = Komoran()
def getKeyword(nlp_result) :
keyword = []
for word in nlp_result :
if (word[1] == 'NNG' or word[1] == 'VV') and len(word[0]) > 1:
... |
# **************************************************************************** #
# #
# ::: :::::::: #
# 42Header.py :+: :+: :+: ... |
#Is it better to restrict a Reaction to a single model or
#should we allow a Reaction to be associated with multiple models?
#
from collections import defaultdict
import re
from copy import deepcopy
from .Object import Object
from .Metabolite import Metabolite
from .Gene import Gene
from warnings import warn
class Re... |
"""The constants module defines the gyromagnetic ratios and scalar coupling
constants.
Define the gyromagnetic ratios in rad/s/T
IUPAC values: Harris et al, Concepts in Magn. Reson., (2002) 14, p326
"""
import collections
import numpy as np
GAMMA = {
"h": 26.752_212_8e07,
"q": 26.752_212_8e07,
"n": -2.7... |
# Copyright (c) 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.
"""Upload all debug symbols required for crash reporting purposes.
This script need only be used to upload release builds symbols or to debug
crashes... |
import os
import multiprocessing
import logging
logger = logging.getLogger(__name__)
HARTREETOEV = 27.211383858491185
SYMBOLS = {
'1': 'H',
'2': 'He',
'3': 'Li',
'4': 'Be',
'5': 'B',
'6': 'C',
'7': 'N',
'8': 'O',
'9': 'F',
'10': 'Ne',
'11': 'Na',
'12': 'Mg',
'13': '... |
'''
Pretty prints a bitboard to the console given its hex or decimal value from
argv or stdin.
'''
import sys, textwrap
FULL_BITBOARD = 0xFFFFFFFFFFFFFFFF # 64 set bits
def print_bb(bb_str):
# Handle hex/decimal bitboards
if bb_str.startswith('0x'):
base = 16
else:
base = 10
if int(bb... |
#!usr/bin/env python
#===============================================================================
# Import modules
#===============================================================================
# Standard Library
import os
import sys
import datetime
import time
import collections
import json
# Third party modul... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from django.db import models
from django.utils.timezone import now
from django.utils.encoding import python_2_unicode_compatible
from qq.models import CheckinRecord
@python_2_unicode_compatible
cla... |
from scipy.io import loadmat
from sklearn.cluster import KMeans
import matplotlib.pyplot as plt
import pyprobml_utils as pml
from matplotlib import cm
from matplotlib.colors import ListedColormap, LinearSegmentedColormap
import requests
from io import BytesIO
url = 'https://github.com/probml/probml-data/blob/main/data... |
# -*- coding: utf-8 -*-
''' Text Annotation module
Latest version can be found at https://github.com/letuananh/chirptext
:copyright: (c) 2012 Le Tuan Anh <tuananh.ke@gmail.com>
:license: MIT, see LICENSE for more details.
'''
import os
import logging
import json
import csv
import warnings
from collections import na... |
import numpy as np
import restrictedBoltzmannMachine as rbm
from batchtrainer import *
from activationfunctions import *
from common import *
from debug import *
from trainingoptions import *
import theano
from theano import tensor as T
from theano.tensor.shared_randomstreams import RandomStreams
theanoFloat = thea... |
# -*- coding: utf-8 -*-
'''
noxfile
~~~~~~~
Nox configuration script
'''
# Import Python libs
from __future__ import absolute_import, unicode_literals, print_function
import os
import sys
import glob
import json
import pprint
import shutil
import tempfile
import datetime
if __name__ == '__main__':
sys.stderr.wri... |
"""
Network polling code.
The reactor works in tandem with the socket operations.
Here's the basic workflow:
* the coroutine yields a operation
* the scheduler runs that operation (the [Docs_CogenCoreEventsOperation#process process] method)
Note: all the socket operations share the same [Docs_CogenCor... |
# Copyright 2013-2015 ARM Limited
#
# 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... |
import time
from datetime import datetime
import re
import lxml.html
from util import parse_arg
from model import Deck
from database_op import database_connect, database_close, deck_create, deck_insert, deck_find_by_id, deck_remove_unscanned
from card_id import get_id as get_card_id
from key_store import save as save_k... |
import sublime
import sublime_plugin
from collections import OrderedDict
from operator import itemgetter
from datetime import datetime
from time import time
from bisect import bisect
from zipfile import ZipFile
from tempfile import mkstemp
import stat
import os
import threading
import subprocess
import sys
from ..li... |
# -*- coding: utf-8 -*-
"""
numconv
-------
:synopsys: Python library to convert strings to numbers and numbers to
strings.
:copyright: 2008-2009 by Gustavo Picon
:license: Apache License 2.0
:version: 2.1a
:url: http://code.tabo.pe/numconv/
:documentation:
`numconv-docs
<http://docs.tabo.pe/numconv/... |
'''
Install and manage python packages
search - Searches for packages
versions - Lists all versions for a package
install - Installs the package off pypi
list - Lists currently installed backages.
remove - remove a package installed by pip
update - update a package installed by pip
usage: pip.py [-h] [-n RESULT_COUNT... |
#!/usr/bin/python
#
# Compile test for a lot of option combinations
#
# XXX: rewrite as nodejs and parallelize (large indices handling need bigint)
import os
import sys
import time
import datetime
import json
import random
import optparse
import subprocess
import StringIO # no need for cStringIO
#
# Test matrix h... |
#!/vega/astro/users/amp2217/yt-x86_64/bin/python
# coding: utf-8
""" Create and submit a job to the cluster given a streams config file. """
from __future__ import division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
# Standard library
import os, sys
import logging
from subprocess import Popen, PI... |
"""
Install and manage python packages
usage: pip.py [-h] [--verbose] sub-command ...
optional arguments:
-h, --help show this help message and exit
--verbose be more chatty
List of sub-commands:
sub-command "pip sub-command -h" for more help on a sub-command
list list packages inst... |
import sys
import os
import boto
import boto.s3.connection
import argparse
import json
class OBO:
def __init__(self, access_key, secret_key, host):
self.conn = boto.connect_s3(
aws_access_key_id = access_key,
aws_secret_access_key = secret_key,
host = host,
... |
# Copyright (c) 2005-2006 The Regents of The University of Michigan
# 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 ... |
from mitxmako.shortcuts import render_to_response
from django.http import HttpResponse
from django.contrib.auth.decorators import login_required
from django.contrib.auth.decorators import user_passes_test
from django.db.models import Q
import json
import logging
from django import db
from models import *
from student... |
from aiida import load_dbenv
load_dbenv()
from aiida.orm import load_node, load_workflow
from aiida.orm import Code, DataFactory
import matplotlib.pyplot as plt
StructureData = DataFactory('structure')
ParameterData = DataFactory('parameter')
ArrayData = DataFactory('array')
KpointsData = DataFactory('array.kpoints'... |
#!/usr/bin/env python
import logging
import os.path
import select
import textwrap
from argparse import ArgumentParser
from argparse import RawDescriptionHelpFormatter
from cifsdk.constants import CONFIG_PATH, REMOTE_ADDR, TOKEN, SEARCH_LIMIT, FORMAT, FEED_LIMIT, FEED_DAYS_LIMIT, \
COLUMNS, ADVANCED
from cifsdk.ex... |
"""
An implementation of :class:`XBlockUserStateClient`, which stores XBlock Scope.user_state
data in a Django ORM model.
"""
import itertools
from operator import attrgetter
from time import time
try:
import simplejson as json
except ImportError:
import json
import dogstats_wrapper as dog_stats_api
from dja... |
#!/usr/bin/env python3
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
import shutil
import sys
import os
import argparse
import subprocess
import logging
import difflib
logger = logging.getLogger('verible_format')
VER... |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
INCLUDES = """
#include <openssl/engine.h>
"""
TYPES = """
static const ... |
from __future__ import division
from logging import info, debug, warn
import json
import math
import os
import re
import sys
from i19.util.procrunner import run_process
help_message = '''
This program processes screening data obtained at Diamond Light Source
Beamline I19-1.
Examples:
i19.screen datablock.json
... |
#import regula exprssions library to help with finding patterns for the function arguments
import re
def add_BDS_OPT_CHAIN (ticker_cell, type_cell, date_override_cell):
'''
Creates a string representing the Bloomberg BDS function for options chains to be inserted into an excel worksheet.
Note: the document needs t... |
import uuid
from django.db import connection
from django.conf import settings
from django.contrib.auth.hashers import make_password
salt = None
UPDATE_QUERY_TEMPLATE = """
UPDATE {table_name}
SET {assignments};
"""
ASSIGNMENT_TEMPLATE = """
{field_name} = {value_method}"""
OBFUSCATED_SOURCES = {
... |
import os
import imp
import six
class PluginRegistry(type):
"""
Metaclass that registers any classes using it in the `plugins` array
"""
plugins = []
def __init__(cls, name, bases, attrs):
if name != 'Plugin' and cls.__name__ not in map(lambda x: x.__name__, PluginRegistry.plugins):
... |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
"""
pyScss, a Scss compiler for Python
@author German M. Bravo (Kronuz) <german.mb@gmail.com>
@version 1.1.4
@see https://github.com/Kronuz/pyScss
@copyright (c) 2012 German M. Bravo (Kronuz)
@license MIT License
http://www.opensource.org/licen... |
import glob, inspect, json, os, random, re
from CommandTemplate import CommandTemplate
from IrcMessage import IrcMessage
import SharedFunctions
import GlobalStore
class Command(CommandTemplate):
triggers = ['generate', 'gen']
helptext = "Generate random stories or words. Call a specific generator with '{commandPre... |
import logging
from typing import Union
from rich.logging import RichHandler
from rich.console import Console
import torch
import numpy as np
logger = logging.getLogger(__name__)
scvi_logger = logging.getLogger("scvi")
autotune_formatter = logging.Formatter(
"[%(asctime)s - %(processName)s - %(threadName)s] %(le... |
from collections import Counter
from os import PathLike
from typing import (
Any,
Callable,
Collection,
Dict,
Iterable,
Iterator,
List,
Optional,
Sequence,
Tuple,
Union,
)
import torch
import utils
def _apply(s: str, f: Optional[Callable[[str], str]]) -> str:
return f... |
import datetime, glob, inspect, json, os, random, re, string
from CommandTemplate import CommandTemplate
from IrcMessage import IrcMessage
from util import FileUtil
from util import IrcFormattingUtil
from util import StringUtil
import GlobalStore
from CommandException import CommandException
fieldCommandPrefix = u"$... |
"""Functions to visualize matrices of data."""
from __future__ import division
import itertools
import matplotlib as mpl
from matplotlib.collections import LineCollection
import matplotlib.pyplot as plt
from matplotlib import gridspec
import numpy as np
import pandas as pd
from scipy.cluster import hierarchy
from . i... |
"""Utils used in the preprocessing stage"""
import pandas as pd
def one_hot_encoding(data, categorical_features):
"""Encode a list of categorical features using a one-hot scheme.
Parameters
----------
data : Pandas DataFrame
DataFrame containing the categorical features.
categorical_feat... |
from datetime import datetime
from django.utils.translation import ugettext as _
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models import Q
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth.models import User
from django.conf import setti... |
import Database
class User:
def __init__(self, name, email):
self.name = name
self.email = email
def user_creation(self, db):
"""user creation returns error string if unsuccessfull"""
if (db.query("select '%s' from db") % (self.name)) != self.name):
db.update("insert '%s") % (self.name)
else:
return... |
import glob, json, os, random, re
from CommandTemplate import CommandTemplate
from IrcMessage import IrcMessage
import SharedFunctions
import GlobalStore
class Command(CommandTemplate):
triggers = ['generate', 'gen']
helptext = "Generate random stories or words. Call a specific generator with '{commandPrefix}gener... |
import numpy as np
import scipy as sp
from scipy.sparse import spdiags
from scipy.sparse import linalg
from scipy import special
import matplotlib.pyplot as plt
import numexpr as ne
from scipy import special
from numba import jit, vectorize
import time
def runge_kutta_integrate(C0, dcdt, rates, coef, dt):
"""Integ... |
from datetime import datetime
from django.utils.translation import ugettext as _
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models import Q
from django.contrib.auth.models import User
from django.conf import settings
from basenode import BaseNode
from node import No... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.