code stringlengths 1 199k |
|---|
import unittest
from shingles.util import *
class UtilTestCase(unittest.TestCase):
def test_generate_random_seeds(self):
seeds = generate_random_seeds(20, 8)
same_seeds = generate_random_seeds(20, 8)
diff_seeds = generate_random_seeds(20)
self.assertEqual(20, len(seeds))
self... |
from django.db import models
from django.contrib import auth
from resources.models import Resource
class Comment(models.Model):
author = models.ForeignKey(auth.models.User)
resource = models.ForeignKey(Resource, related_name="comments")
content = models.TextField(null=False, blank=False)
date_created = ... |
import yaml
from flask import Flask, render_template, request, Blueprint, session, redirect
from models import User, Tag, Question, db
import datetime
config = open("config/settings.yaml", "r")
settings = yaml.load(config)
connection = "mysql://%s:%s@%s:3306/%s" % (
settings['username'], settings['password'],
setting... |
import re
import tests
from common import TestCommon
from results import PassFailResult
@tests.add_test
class MemTest(TestCommon):
'''prints out free and total memory after system boot up'''
name = "freemem"
def get_modules(self, build, machine):
modules = super(MemTest, self).get_modules(build, mac... |
from hfss import get_active_project
import bbq
import matplotlib.pyplot as plt
import numpy as np
from scipy.constants import *
plt.close('all')
project = get_active_project()
design = project.get_design("Design")
bbq_exp = bbq.Bbq(project, design, append_analysis=False, calculate_H=True)
bbq_exp.do_bbq("LJ", surface=T... |
import contextlib, flask, pathlib, traceback, urllib
from . import flask_server, decorator
from ... util import data_file
class RestServer:
def __init__(self, port, external_access, open_page,
root_folder, index_file):
root_folder = pathlib.Path(root_folder)
static_folder = str(root... |
import pymongo as pm
def connectDB():
conn = pm.MongoClient('localhost', 27017)
db = conn.get_database('report_db')
return db
def getColList(db):
return db.collection_names()
def getDocNum(col):
return col.find().count()
def match(col, matchDict):
return list(col.find(matchDict))
def main():
db = connectDB()
pr... |
from time import ticks_ms as ticks, ticks_diff, ticks_add
import sys, select
try:
from _uasyncio import TaskQueue, Task
except:
from .task import TaskQueue, Task
class CancelledError(BaseException):
pass
class TimeoutError(Exception):
pass
_exc_context = {"message": "Task exception wasn't retrieved", "e... |
import pymysql
import string
import re
from kritzbot.configloader import BotCfg
from kritzbot.logger import Logger
log = Logger(__name__)
class DatabaseConnection:
def __init__(self, name):
self.name = name
log.info('Database connection created at {}'.format(self.name))
self.db = self.createDatabaseConnection()
... |
def _filter_entry(entry):
if ('date' in entry) or ('display_time' in entry):
if 'sgv' in entry and entry['sgv'] > 0:
return True
elif 'amount' in entry and entry['amount'] > 0:
return True
elif 'glucose' in entry and entry['glucose'] > 35:
return True
... |
import random
from multiprocessing import Pool
import sys
import numpy as np
from deap import creator, base, tools
from seizure_prediction.classifiers import make_svm
from seizure_prediction.cross_validation.legacy_strategy import LegacyStrategy
from seizure_prediction.feature_selection import generate_feature_masks
fr... |
"""
An asyncio event loop on top of the Twisted reactor.
"""
from collections import namedtuple
from asyncio.unix_events import SelectorEventLoop
from asyncio.base_events import BaseEventLoop
from asyncio.events import TimerHandle
from asyncio import tasks
from twisted.internet.abstract import FileDescriptor
class _Cal... |
"""
A serial port packet monitor that plots live data using PyQwt.
The monitor expects to receive 8 bytes data packets with a line return
as a packet EOF on the serial port.
Each received packet is analysed to extract gx, gy and gz.
When the monitor is active, you can turn the 'Update speed' knob
to control the frequen... |
"""
tkRAD - tkinter Rapid Application Development library
(c) 2013+ Raphaël SEBAN <motus@laposte.net>
This program is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
Li... |
def primes(n):
if n==2: return [2]
elif n<2: return []
s=range(3,n+1,2)
mroot = n ** 0.5
half=(n+1)/2-1
i=0
m=3
while m <= mroot:
if s[i]:
j=(m*m-3)/2
s[j]=0
while j<half:
s[j]=0
j+=m
i=i+1
m=2*i+3
return [2]+[x for x in s if x]
result = primes(1000000)[0:315]
print len(result)
print re... |
"""
Functions to subset cubes and cubelists
"""
import iris
from iris.analysis import trajectory
from iris.analysis.cartography import rotate_pole
import numpy as np
from .grid import (nearest_xy_grid_2d_index,
mask_cube_outside_circle_xy)
from .exceptions import NotYetImplementedError
def slice_cube... |
from south.db import db
from south.v2 import SchemaMigration
from django.utils import timezone
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'UserToken.granted_at'
db.add_column('facebook_auth_usertoken', 'granted_at',
self.gf('django.db.models.field... |
import numpy as np
import pandas as pd
import uuid
METHODS = [
'add', 'sub', 'mul', 'floordiv', 'div', 'truediv', 'mod',
'divmod', 'pow', 'lshift', 'rshift', 'and', 'or', 'xor'
]
_df = pd.DataFrame()
_se = pd.Series()
PANDAS_DATAFRAME_OBJECTS = [
attr for attr in dir(_df)
if not attr.startswith('_')
]
P... |
"""Learn to estimate functions from examples. (Chapters 18-20)"""
from utils import *
import copy, heapq, math, random
from collections import defaultdict
def rms_error(predictions, targets):
return math.sqrt(ms_error(predictions, targets))
def ms_error(predictions, targets):
return mean([(p - t)**2 for p, t in... |
__version__ = "2.6.14" |
"""Usage::
$ rna_align_find_seq_in_alignment.py -a pistol_noPk.sto -s hcf.fa
('Match:', 'HCF12C_58327/229-301')
ID: HCF12C_58327/229-301
Name: HCF12C_58327
Description: HCF12C_58327/229-301
Number of features: 0
/start=229
/end=301
/accession=HCF12C_58327
Per letter annotation fo... |
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_space_comm_rebel_xwing_03.iff"
result.attribute_template_id = 9
result.stfName("npc_name","human_base_female")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/encoded_disk/shared_message_fragment_base.iff"
result.attribute_template_id = -1
result.stfName("item_n","message_fragment_base")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result |
contact_list = {
'Alison' : '315-481-2904',
'Dee' : '315-555-9876',
'Sarah' : '315-555-4567'
}
contact_list['Andrea'] = '315-555-4646'
print contact_list.get('Kristen')
print contact_list.get('Kristen', 'No one here') |
"""
This file contains abstract models that form the basis for
models that are used within Kolibri to track content metadata
and are also used within Kolibri Studio to prepare content metadata
for export
These models are used in the databases of content that get imported from Studio.
*DEVELOPER WARNING regarding update... |
API_URL = 'http://adsws-staging.elasticbeanstalk.com/v1'
AUTHENTICATED_USER_EMAIL = 'tester@ads'
AUTHENTICATED_USER_ACCESS_TOKEN = ''
ORCID_OAUTH_ENDPOINT = 'https://sandbox.orcid.org/oauth/custom/login.json'
ORCID_CLIENT_ID = ''
ORCID_USER = ''
ORCID_PASS = ''
try:
from . import local_config
for x in dir(local... |
"""Test logic for skipping signature validation on old blocks.
Test logic for skipping signature validation on blocks which we've assumed
valid (https://github.com/bitcoin/bitcoin/pull/9484)
We build a chain that includes and invalid signature for one of the
transactions:
0: genesis block
1: block... |
import logging
from sipa.backends import Backends
from . import sample, pycroft
from .sqlalchemy import db
logger = logging.getLogger(__name__)
AVAILABLE_DATASOURCES = [
sample.datasource,
pycroft.datasource
]
def prepare_sqlalchemy(app):
app.config['SQLALCHEMY_BINDS'] = {}
db.init_app(app)
def build_ba... |
"""
MoinMoin - utility functions used by the migration scripts
@copyright: 2005,2007 MoinMoin:ThomasWaldmann
@license: GNU GPL, see COPYING for details.
"""
import os, sys, shutil
opj = os.path.join # yes, I am lazy
join = os.path.join
def fatalError(msg):
""" Exit with error message on fatal errors """... |
import yaml
from base.extensions import cache
from flask import (render_template,
request,
url_for,
redirect,
Response,
Blueprint,
abort,
flash,
Markup,
... |
class FailedCommand(Exception):
pass
class UserNotFound(Exception):
pass
class InvalidLogin(Exception):
pass
class InvalidPointAmount(Exception):
pass
class TimeoutException(Exception):
pass |
"""@ package BaseCamera
Different Cameras
"""
import logging as log
class BaseCamera():
"""Hold the different cameras"""
pass |
from __future__ import print_function
from os.path import dirname, join, isfile, realpath, relpath, split, exists
from os import makedirs
import os
import tarfile
import time
import subprocess
import shutil
from zipfile import ZipFile
import sys
import re
import shlex
from fnmatch import fnmatch
import jinja2
if os.nam... |
from sqlalchemy.testing import eq_, is_, assert_raises, \
assert_raises_message, expect_warnings
import decimal
import datetime
import os
from sqlalchemy import (
Unicode, MetaData, PickleType, Boolean, TypeDecorator, Integer,
Interval, Float, Numeric, Text, CHAR, String, distinct, select, bindparam,
an... |
"""
Use nose
`$ pip install nose`
`$ nosetests`
"""
from hyde.loader import load_python_object
from nose.tools import raises
import os
from hyde.exceptions import HydeException
from hyde.fs import File, Folder
from hyde.generator import Generator
from hyde.site import Site
def test_can_load_locals():
file_class = l... |
from swgpy.object import *
def create(kernel):
result = Weapon()
result.template = "object/weapon/melee/baton/shared_victor_baton_gaderiffi.iff"
result.attribute_template_id = 10
result.stfName("weapon_name","victor_baton_gaderiffi")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result |
"""Support for beets plugins."""
from __future__ import division, absolute_import, print_function
import traceback
import re
import inspect
import abc
from collections import defaultdict
from functools import wraps
import beets
from beets import logging
import mediafile
import six
PLUGIN_NAMESPACE = 'beetsplug'
LASTFM_... |
import Tkinter as tk
from cfg import Config
from log import logTC
from log import logArrTC
from errorwin import ErrorWindow
from dialog import DWindow
from authwindow import AuthWindow
from moddb import editQuery
from errors import InvalidFieldException
from smfunctions import validateBarcode
from smfunctions import va... |
import numpy as np
from bokeh.plotting import *
x = np.linspace(0, 4*np.pi, 200)
y = np.sin(x)
output_server("line")
p = figure(title="simple line example")
p.line(x,y, color="#2222aa", line_width=2)
show(p) |
"""
:mod:`lab_json` -- JSON to YAML and back again
=========================================
LAB_JSON Learning Objective: Learn to navigate a JSON file and convert to a
python object.
::
a. Create a script that expects 3 command line arguments: -j or -y, json_filename, yaml_filename
Th... |
"""
This script read/write data comming from a fanatec wheel.
Copyright (C) 2015 darknao
https://github.com/darknao/btClubSportWheel
This file is part of btClubSportWheel.
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 S... |
import random
import inspect
from struct import *
from impacket import uuid
from impacket.winregistry import hexdump
from impacket.dcerpc.v5.enum import Enum
from impacket.uuid import uuidtup_to_bin
class NDR(object):
"""
This will be the base class for all DCERPC NDR Types.
It changes the structure behavio... |
from urbansim.gridcell.total_number_of_possible_SSS_jobs_from_buildings import total_number_of_possible_SSS_jobs_from_buildings as gc_total_number_of_possible_SSS_jobs_from_buildings
from variable_functions import my_attribute_label
class total_number_of_possible_SSS_jobs(gc_total_number_of_possible_SSS_jobs_from_build... |
from runtest import TestBase
import subprocess as sp
TDIR = 'xxx'
TDIR2 = 'xxx/uftrace.data'
class TestCase(TestBase):
def __init__(self):
TestBase.__init__(self, 'sdt', """
9.392 us [28141] | __monstartup();
12.912 us [28141] | __cxa_atexit();
[28141] | main() {
[28141] | fo... |
"""QGIS Unit tests for QgsComposerShape.
.. note:: 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.
"""
__author__ = '(C) 2012 by... |
from .Utils.core import *
class DeleteMenu(bpy.types.Menu):
bl_label = "Delete"
bl_idname = "MESH_MT_context_delete_menu"
@classmethod
def poll(self, context):
if get_mode() == 'EDIT':
return True
else:
return False
def init(self):
sel_verts_num, sel_e... |
import subprocess
import threading
import time
import sys
def startdb(dbpath, OS):
print "Opening database @ %s" %dbpath
if "linux" in OS:
subprocess.call(['gnome-terminal -x mongod --dbpath '+dbpath], shell=True)
elif "win" in OS:
proc = subprocess.Popen('cmd.exe', stdin = subprocess.PIPE, stdout = subprocess.P... |
"""
Narrative Web Page generator.
Classe:
PlacePage - Place index page and individual Place pages
"""
from collections import defaultdict
from decimal import getcontext
import logging
from gramps.gen.const import GRAMPS_LOCALE as glocale
from gramps.gen.lib import (PlaceType, Place, PlaceName, Media)
from gramps.ge... |
"""
KeepNote
Notebook indexing
"""
from itertools import chain
import os
import sys
import time
import traceback
try:
import pysqlite2
import pysqlite2.dbapi2 as sqlite
except Exception, e:
import sqlite3 as sqlite
import keepnote
INDEX_FILE = u"index.sqlite"
INDEX_VERSION = 3
NULL = object()
def m... |
version = '0.16.0'
short_version = '0.16.0' |
import unittest
from pyanaconda.core.regexes import IBFT_CONFIGURED_DEVICE_NAME
def _run_tests(testcase, expression, goodlist, badlist):
got_error = False
for good in goodlist:
try:
testcase.assertIsNotNone(expression.match(good))
except AssertionError:
got_error = True
... |
import re
from virtaal.views.theme import current_theme
_fancy_spaces_re = re.compile(r"""(?m) #Multiline expression
[ ]{2,}| #More than two consecutive
^[ ]+| #At start of a line
[ ]+$ #At end of line""", re.VERBOSE)
"""A regular expression object to find all unusual spaces we... |
from twisted.trial import unittest
from twisted.web import server, resource, microdom, domhelpers
from twisted.protocols import http
from twisted.test import test_web
from twisted.internet import reactor, defer
from twisted.web.woven import template, model, view, controller, widgets, input, page, guard
outputNum = 0
cl... |
import RPi.GPIO as GPIO
import sys
import signal
import time
def signal_handler(signal, frame):
print 'You pressed Ctrl+C! Cleaning up.'
GPIO.cleanup()
sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
def read_distance(rfpin):
'''Read the distance from the rangefinder, using PWM.
Empirically... |
import re
from random import getrandbits, randrange
from ..helpers.command import Command
@Command('random')
def cmd(send, msg, args):
"""For when you don't have enough randomness in your life.
Syntax: {command} [--int] [len]
"""
match = re.match(r'--(.+?)\b', msg)
randtype = 'hex'
if match:
... |
import unittest
class ByteRangeTests(unittest.TestCase):
def testEmptyRange(self):
try:
server.byterange.parse_byteranges("")
self.fail()
except server.byterange.InvalidByteRangeException:
# Expected result
pass
def testNoRangeGroups(self):
... |
from cStringIO import StringIO
from gzip import GzipFile
from twisted.web.http import parseContentRange # package management sucks! if you have trouble with this line, stop using it!
from twisted.web import error
from twisted.web import client
from twisted.python import failure
from BTL.reactor_magic import reactor
cla... |
from cloudbot import hook
import requests
url = 'http://randomusefulwebsites.com/jump.php'
headers = {'Referer': 'http://randomusefulwebsites.com'}
@hook.command('randomusefulsite', 'randomwebsite', 'randomsite')
def randomusefulwebsite():
response = requests.head(url, headers=headers, allow_redirects=True)
return re... |
from contextlib import contextmanager
import sys
from io import StringIO
@contextmanager
def fetch_std_streams():
"""
A context manager which can be used to temporarily fetch the standard output streams
``sys.stdout`` and ``sys.stderr``.
Usage:::
with fetch_std_streams() as stdout, stderr
... |
import numpy as np
from astropy import units as u
from astropy.modeling.blackbody import blackbody_lambda
from numina.instrument.hwdevice import HWDevice
from megaradrp.simulation.extended import create_th_ar_arc_spectrum
class Lamp(HWDevice):
def __init__(self, name, factor=1.0, illumination=None):
super(L... |
import logging
from django import template
from django.middleware.csrf import get_token
from django.conf import settings
from django.core.files.storage import get_storage_class
from django.utils.text import mark_safe
staticfiles_storage = get_storage_class(settings.STATICFILES_STORAGE)()
register = template.Library()
l... |
"""
tsprocess - time series processing
Copyright (C) 2005-2011 National Technical University of Athens
Copyright (C) 2011 Stefanos Kozanis, Antonis Christofides
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 Fou... |
"""
Calculates the Angular Harmonic potential as:
.. math::
U = K (\\theta - \\theta_0)^2,
where angle :math:`\\theta` is the planar angle formed by three binded particles
(triplet or triple). The usual coefficient of :math:`1/2` is included in :math:`K`.
This potential is employed by:
.. py:class:: espressopp.inte... |
type = "passive"
def handler(fit, src, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Nosferatu", "falloffEffectiveness",
src.getModifiedItemAttr("eliteBonusReconShip2"), skill="Recon Ships") |
"Assignment 4: Parking Lot Topology" |
"""
- This simulation seeks to emulate the CUBA benchmark simulations of (Brette
et al. 2007) using the Brian2 simulator for speed benchmark comparison to
DynaSim. However, this simulation does NOT include synapses, for better
comparison to Figure 5 of (Goodman and Brette, 2008).
- The time taken to simulate will... |
"""
Provides a dialog with client locale or exiting port counts.
"""
import curses
import operator
import cli.controller
import cli.popups
from util import connections, enum, log, uiTools
CountType = enum.Enum("CLIENT_LOCALE", "EXIT_PORT")
EXIT_USAGE_WIDTH = 15
def showCountDialog(countType, counts):
"""
Provides a... |
import argparse
import shutil, os
import re, sys
import urllib.parse
from collections import Counter, defaultdict
from multiprocessing import Pool
from tqdm import tqdm
import json
from ieml import IEMLDatabase
from ieml.constants import LANGUAGES
from ieml.dictionary.table import TableSet
from ieml.ieml_database.descr... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
class ModuleDocFragment(object):
# info standard oVirt documentation fragment
DOCUMENTATION = r'''
deprecated:
removed_in: "2.10"
why: When migrating to collection we decided to use only _info modules.
alternativ... |
"""
The module :mod:`openerp.tests.common` provides unittest2 test cases and a few
helpers and classes to write tests.
"""
import errno
import glob
import importlib
import json
import logging
import os
import select
import subprocess
import threading
import time
import itertools
import unittest2
import urllib2
import x... |
from import_relative import import_relative
Mbase_subcmd = import_relative('base_subcmd', '..', 'trepan')
class SetDifferent(Mbase_subcmd.DebuggerSetBoolSubcommand):
"""**set** **different** [**on**|**off**]
Set consecutive stops must be on different file/line positions.
By default, the debugger traces all events p... |
from django.contrib.auth.models import User
from .models import (
MapDefinition, Profile)
from rest_framework import serializers
from rest_framework.exceptions import ValidationError
from rest_framework.validators import UniqueTogetherValidator
from urllib.parse import quote_plus
from ..util import make_logger
logg... |
import unittest
from page_objects import LoginPage, MyAjaxExerciseGrader
from test_initializer import TestInitializer
class MyAjaxExerciseGraderTest(unittest.TestCase):
def setUp(self):
testInitializer = TestInitializer()
self.driver = testInitializer.getDefaultDriver()
testInitializer.recre... |
../../../../../../../share/pyshared/papyon/service/description/AB/ABGroupContactDelete.py |
"""
Problem
"""
ALPHA = {'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n',\
'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'z'}
VOWEL = {'a', 'e', 'i', 'o', 'u', 'y', }
WORD = list(input().strip())
LEN = len(WORD) - 1
X = 0
F = 0
while X < LEN:
if WORD[X] in VOWEL and WORD[X + 1] in VOWEL:
F = 1
break... |
import json
import datetime
import urllib.parse
from pprint import pprint as pp
import click
from tvoverlord.db import DB
class Tracking:
def __init__(self):
pass
def save(self, show_title, season, episode, data,
chosen_url, nondbshow=False):
magnet_hash = self._extract_hash(chosen_... |
"""
higwidgets/higboxes.py
box related classes
"""
__all__ = ['HIGHBox', 'HIGVBox']
import gtk
class HIGBox(gtk.Box):
def _pack_noexpand_nofill(self, widget):
self.pack_start(widget, expand=False, fill=False)
def _pack_expand_fill(self, widget):
self.pack_start(widget, expand=True, fill=True)... |
from wrapper import *
class Skybox:
FOG_GREY=0.8
def __init__(self):
textureDir = 'data/textures/'
print imageLoad(textureDir + 'top.bmp')
self.top = imageLoad(textureDir + 'top.bmp').get_texture()
self.left = imageLoad(textureDir + 'lt.bmp').get_texture()
self.right = imageLoad(textureDir + 'rt.bmp').get_t... |
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
exce... |
DOCUMENTATION = '''
---
module: stat
version_added: "1.3"
short_description: retrieve file or file system status
description:
- Retrieves facts for a file similar to the linux/unix 'stat' command.
options:
path:
description:
- The full path of the file/object to get the facts of
required: true
... |
"""Release data for the IPython project."""
name = 'ipython'
_version_major = 2
_version_minor = 0
_version_patch = 0
_version_extra = '' # Uncomment this for full releases
codename = ''
_ver = [_version_major, _version_minor, _version_patch]
__version__ = '.'.join(map(str, _ver))
if _version_extra:
__version__ = ... |
"""
A two-step (registration followed by activation) workflow, implemented
by emailing an HMAC-verified timestamped activation token to the user
on signup.
"""
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.sites.shortcuts import get_current_site
from django.core imp... |
import argparse
import numpy as np
import dendropy
from collections import defaultdict
from datetime import date
from itertools import izip
from fitness_predictors import *
ymin = 2005
ymax = 2015
min_freq = 0.1
max_freq = 0.9
min_tips = 10
pc=1e-2
regularization = 1e-3
default_predictors = ['lb', 'ep', 'ne_star']
clas... |
from udata.frontend import csv
from .models import Organization
@csv.adapter(Organization)
class OrganizationCsvAdapter(csv.Adapter):
fields = (
'id',
'name',
'slug',
('url', 'external_url'),
'description',
('logo', lambda o: o.logo(external=True)),
('badges',... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('salesforce', '0009_salesforcesettings'),
]
operations = [
migrations.AddField(
model_name='school',
name='testimonial_name',
field=models.CharField(blank=Tru... |
from . import stock
from . import sale
from . import wizard |
from django.conf import settings
from taiga.base.api import serializers
from taiga.base.fields import Field, MethodField, I18NField
from taiga.base.utils.thumbnails import get_thumbnail_url
from taiga.projects.models import Project
from .services import get_user_photo_url, get_user_big_photo_url
from taiga.users.gravat... |
import unittest
import json
import requests
import os
from papers.orcid import OrcidProfile
from papers.orcid import OrcidWorkSummary
from papers.orcid import OrcidWork
class OrcidProfileStub(OrcidProfile):
def __init__(self, orcid_id, instance='orcid.org'):
super(OrcidProfileStub, self).__init__(orcid_id=o... |
class FEEDBACK_EVENT_ID(object):
MINIMAP_SHOW_MARKER = 1 |
from generator import ProgrammableComponentGenerator, loader
def factory(**opts):
return ProgrammableComponentGenerator(**opts) |
import sys
import numpy as np
single_values = 4
def convert(infile,outprefix):
# get relevant information from first line
first_line = ''
with open(infile,'r') as f:
first_line = f.readline()
f.close()
fspl = first_line.split(' ',3)
dim = int(fspl[0])
seed = fspl[1]
fspl = fi... |
"""distutils.command.bdist_dumb
Implements the Distutils 'bdist_dumb' command (create a "dumb" built
distribution -- i.e., just an archive to be unpacked under $prefix or
$exec_prefix)."""
import os
from distutils.core import Command
from distutils.util import get_platform
from distutils.dir_util import remove_tree, en... |
import re
import os
import csv
import uuid
import zipfile
from datetime import datetime
import folium
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.dates as md
import matplotlib.pyplot as plt
from IPython.display import HTML, Javascript, display
from utilities import css_styles, inli... |
from django.core.management.base import BaseCommand
from op_tasks.models import *
class Command(BaseCommand):
help = 'our help string comes here'
def _create_data(self):
Data(name='Kiva').save()
def handle(self, *args, **options):
self._create_data() |
import logging
def find_log_level(message):
"""Attempts to find the log level this message has been logged. Can return -1 if the log level cannot be determined. The found
log level can then be used to re-log the message in the orchestrator."""
target = message.lower()
if target.find('info') > 0: return ... |
from __future__ import absolute_import, division, print_function
__author__ = "Lynn Root"
__version__ = "0.1.7"
__license__ = "Apache 2.0"
__email__ = "lynn@spotify.com"
__uri__ = "https://ramlfications.readthedocs.org"
__description__ = "A Python RAML parser"
from ramlfications.config import setup_config
from ramlfica... |
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
import unittest
import kubern... |
"""
Copyright 2012 GroupDocs.
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... |
"""Unit tests for Cisco FC san lookup service."""
from cinder import exception
from cinder.tests.unit import test
from cinder.volume import configuration as conf
from cinder.zonemanager import fc_san_lookup_service as san_service
_target_ns_map = {'100000051e55a100': ['20240002ac000a50']}
_initiator_ns_map = {'10000005... |
from django.contrib.sitemaps import Sitemap
from django.urls import reverse
from groups.models import Group
from projects.models import Project
class StaticViewSitemap(Sitemap):
priority = 0.8
changefreq = 'daily'
def items(self):
return [
'homepage', 'account_login', 'account_signup',
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.