content stringlengths 5 1.05M |
|---|
# Generated by Django 3.0.7 on 2020-09-18 18:07
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('projects', '0011_project_link'),
]
operations = [
migrations.RemoveField(
model_name='project',
name='link',
),
... |
import bpy
from . import bake_manager
from . import string_manager
from enum import Enum
from bpy.props import (
IntProperty,
BoolProperty,
BoolVectorProperty,
EnumProperty,
FloatProperty,
FloatVectorProperty,
StringProperty,
PointerProperty
)
class BakeType(Enum):
TRANSMISSION = 0... |
from pathlib import Path
from typing import Any, Dict, Text, Optional, Union
from importlib import import_module
import torch_audiomentations
from torch_audiomentations import Compose
from torch_audiomentations.core.transforms_interface import BaseWaveformTransform
# TODO: define this elsewhere?
# TODO: update when a... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
=============
Cadc TAP plus
=============
"""
|
#!/usr/bin/python
import subprocess
import time
import os
import signal
PID = 10128
def check_pid(pid):
""" Check For the existence of a unix pid. """
try:
os.kill(pid, 0)
except OSError as ex:
template = "An exception of type {0} occured.\nArguments:\n{1!r}"
message = temp... |
# Generated by Django 3.2.9 on 2021-11-15 09:27
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="MpesaCallbacks",
fields=[
(
... |
import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import framework.configbase
from framework.ops import l2norm
from modules.transformer_encoder import Encoder, VISEncoder, CrossEncoder
from modules.common import gelu
class Transform... |
import gym
import gym_sokoban
from common.fix_and_reinit import fix_and_reinit
from common.train_the_agent import train_the_agent
from common.ActorCritic import ActorCritic
from common.RolloutStorage import RolloutStorage
from common.multiprocessing_env import SubprocVecEnv
import torch
import torch.autograd as autog... |
from typing import Iterable
class CollectorType(type):
# it is a staticmethod
def __new__(
collectorType: type, new_cls_name: str, new_cls_bases: tuple, class_definition_dict: dict,
):
new_cls = super().__new__(collectorType, new_cls_name, new_cls_bases, class_definition_dict)
ret... |
'''
You will now make use of what you've learned from this chapter to solve a simple data extraction problem. You will also be introduced to a data structure, the pandas Series, in this exercise. We won't elaborate on it much here, but what you should know is that it is a data structure that you will be working with a ... |
import logging
import os
import hashlib
from intent import Intent
class App(object):
"""
this class describes an app
"""
def __init__(self, app_path, output_dir=None):
"""
create a App instance
:param app_path: local file path of app
:return:
"""
assert... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2018 the HERA Project
# Licensed under the MIT License
import numpy
import optparse
from hera_cal import omni
from hera_qm import vis_metrics
from pyuvdata import UVData
import aipy as a
import sys
o = optparse.OptionParser()
o.set_usage("omni_run.py -C [calf... |
#%%
import re
#%%
r = r"[^a-z]*([y]o|[h']?ello)?"
re_greeting = re.compile(r,flags=re.IGNORECASE)
re_match = re_greeting.match(input())
print(re_match)
# %%
# %%
|
import datetime
import decimal
from typing import Dict, Any
from django import template
from django.conf import settings
from django.template.defaultfilters import date
from django.urls import NoReverseMatch, reverse
from django.utils import timezone
from django.utils.safestring import mark_safe
from utilities.forms ... |
from yeti.core.model.settings.setting import Setting
from yeti.core.errors import RuntimeException
class Vocabs(Setting):
"""This object interacts with vocabularies stored in Yeti.
Attributes:
name: Name of the Vocab setting
"""
name = 'vocabs'
def get_vocab(self, vocab_name):
"""... |
# encoding: utf-8
"""
Copyright 2017 Brocade Communications Systems, 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... |
# Copyright 2004-2008 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
"""
contains enumeration of all compilers supported by the project
"""
GCC_XML_06 = "GCC-XML 0.6"
GCC_XML_07 = "GCC-XML 0.7"
G... |
# *****************************************************************************
# Copyright (c) 2018, NVIDIA CORPORATION.
# Copyright (c) 2019, Hubert Siuzdak
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following con... |
#coding=utf-8
'''
author: c0ny1<root@gv7.me>
github: https://github.com/c0ny1/upload-fuzz-dic-builder
date: 2018-11-04 23:16
description: 生成符合漏洞实际场景fuzz字典的脚本
'''
import argparse
import copy
import urllib
## 各类语言可解析的后缀
html_parse_suffix = ['html','htm','phtml','pht','Html','Htm','pHtml']
asp_parse_suffix = ['asp','asp... |
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from common_variables import demographic_variables, clinical_variables
pd.set_option("display.max_rows", 50)
results_path = "output/practice_summ.txt"
long_covid_codelists = [
"opensafely-nice-managing-the-long-term-effects-of-covid-1... |
# Copyright (c) Metakernel Development Team.
# Distributed under the terms of the Modified BSD License.
from IPython.core.magic import magic_escapes
from metakernel import Magic
import os
class LSMagicMagic(Magic):
def line_lsmagic(self):
"""
%lsmagic - list the current line and cell magics
... |
from django.db import models
from django.contrib import admin
from rest_framework import serializers
class Team(models.Model):
class Meta:
verbose_name = 'Team'
name = models.CharField(max_length=255)
event = models.ForeignKey(
to='Event',
on_delete=models.CASCADE
)
def _... |
"""
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... |
"""
**User** record management implemented by factories
---------------------------------------------------
This module defines API routes for managing **User** records, and defines the :class:`JoinAssoc` data to describe the relationship between **User** records and other record types: **Domain**, **Email**, and **Qu... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Test suite for zcomx/modules/torrents.py
"""
import os
import shutil
import unittest
from gluon import *
from applications.zcomx.modules.book_types import BookType
from applications.zcomx.modules.books import Book
from applications.zcomx.modules.creators import \
... |
from time import *
from discord_webhook import DiscordWebhook
import json, subprocess, random, string, time, requests, colorama, ctypes, os
import requests
import rainbowtext
colors = {\
'B' : '\033[94m',
'OKGREEN' : '\033[92m',
'WARNING' : '\033[93m',
'RED' : '\033[1;31;40m',
'reset':'... |
from logging import getLogger
from yarl import URL
from aiohttp import BasicAuth
try:
from aiosocks import Socks4Auth, Socks5Auth
except ImportError:
class Socks4Auth(Exception):
def __init__(*args, **kwargs):
raise ImportError(
'You must install aiosocks to use a SOCKS prox... |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import json
import boto3
from botocore.config import Config
import time
class ConfigRecordersCheck(object):
def __init__(self, accountid):
self.accountid = accountid
self.config = Config(
... |
# -*- coding: utf-8 -*- #
DEBUG = True
TEMPLATE_DEBUG = DEBUG
TIME_ZONE = 'America/Chicago'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en'
# If you set this to False, Django will make some optimizations so as not... |
# (C) Copyright 2019 StackHPC 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 wri... |
#
# Copyright 2017 Canonical Ltd
# Copyright 2020 Consortium GARR
#
# 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 applic... |
#!/usr/bin/env python3
"""A script to do diagnostic checks on reduced ghost data.
It displays several windows showing how good the fits are and a few other things
This script should be ran from within the finished reduction folder, which
should contain the 'calibrations/' directory that are needed and finished
reduc... |
from .encoding_controller import blp
|
from django.views.generic import TemplateView
class HomeView(TemplateView):
template_name = 'main/home.html'
|
from fidget.backend.QtWidgets import QHBoxLayout
from fidget.widgets import FidgetMinimal, FidgetInt, FidgetTuple, inner_fidget, SimplePlainEdit
from fidget.tests.gui.__util__ import test_as_main
@test_as_main()
class MinInt(FidgetMinimal):
MAKE_TITLE = True
OUTER_TEMPLATE = SimplePlainEdit.template('outer')... |
# -*- coding: utf-8 -*-
##############################################
# The MIT License (MIT)
# Copyright (c) 2017 Kevin Walchko
# see LICENSE for full details
##############################################
from collections import namedtuple
import time
class Data(namedtuple('Data', 'data timestamp')):
"""
G... |
####
# plot_creation.py
#
# Functions will be in charge of creating plots using matplotlib
# and then converting them into html string so that they can be
# posted onto the webpages as images
###
import pandas as pd
import matplotlib
import matplotlib.figure as figure
import base64
from io import BytesIO
# Function ... |
from lib import action
class KeycloakDeleteClientRoleAction(action.KeycloakBaseAction):
def run(self, role_name):
self.keycloak_admin.delete_client_role(role_name=role_name)
|
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
class Reference():
metadata = {}
def __init__(self, metadata: dict, figures: list):
self.metadata.update(metadata)
for fig in figures:
setattr(self, fig.name, fig)
class Figure():
"""
This is the base class for figure data.
"""
def __init__(self, name: str, l... |
"""test_filtertools.py
Test code for pyret's filtertools module.
(C) 2016 The Baccus Lab.
"""
import numpy as np
import pytest
from pyret import filtertools as flt
from pyret.stimulustools import slicestim
import utils
def test_ste():
"""Test computing a spike-triggered ensemble."""
np.random.seed(0)
ti... |
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from wired_module import *
# Generated By WiredQT for Python: by Rocky Nuarin, 2021 Phils
class Handler(QtWidgets.QWidget,usercontrol):
def __init__(self, *param):
super(Handler, self).__init__(None)
initUI(self,param... |
#!/usr/bin/env python3
#This sample demonstrates detecting tilt without using the I2C bus.
#Install LoRa HAT library with "pip3 install turta-lorahat"
from time import sleep
from turta_lorahat import Turta_Accel
#Initialize
accel = Turta_Accel.AccelTiltSensor()
try:
while True:
#Read tilt states in one ... |
# Copyright 2018 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
#! /usr/bin/env python
# encoding: UTF-8
# Thomas Nagy 2008-2010 (ita)
"""
Doxygen support
Variables passed to bld():
* doxyfile -- the Doxyfile to use
When using this tool, the wscript will look like:
def options(opt):
opt.load('doxygen')
def configure(conf):
conf.load('doxygen')
... |
from context import search
import unittest
class BasicTestSuite(unittest.TestCase):
global isf
global corpus
global corpus_complex
corpus = 'The quick brown fox jumped over the lazy dog'
corpus_complex = 'When in the Course of human events, it becomes necessary for one people to dissolve the poli... |
#作者 Github@layou233
#从原mcsg.js脚本重写
import base64, json, webbrowser
from urllib import request
def getUuid(playerName):
url="https://api.mojang.com/users/profiles/minecraft/"+playerName #Mojang API
return json.loads(request.urlopen(url).read().decode("utf-8"))["id"]
def getSkinUrl(uuid):
url="https://sess... |
from snappy import Manifold
from cypari import *
from multiprocessing import *
import copy
import sys
from ManifoldIterators import *
from VolumeUtilities import *
def prepare_pvolume_file(maniter, ofilenm, append = False, engine = 'magma', max_secs = 20, sln = 2, retrieve = True, period = 100, separator = ';'):
... |
maior = None
menor = None
cont = 0
while True:
entr = input('Digite algum número, ou fim para finalizar: ')
if entr == 'fim': break
try:
int(entr)
except:
print('Erro de entrada')
continue #retorna ao começo do input
if menor is None:
menor = entr
elif maior i... |
from collections import OrderedDict
jobfile="source/job.txt"
liquiddatafile="source/liquiddata.csv"
soliddatafile="source/soliddata.csv"
postprocfile="source/postproc.txt"
###ROCKETS SETTINGS
rockets=OrderedDict({
"Ariane 5 ECA":[
{
'name':"Core stage",
'index':0,
'qty':1,
... |
class Solution(object):
def XXX(self, n):
"""
:type n: int
:rtype: str
"""
a = '1'
for i in range(1,n):
a = a.replace('111', 'a')
a = a.replace('222', 'b')
a = a.replace('333', 'c')
a = a.replace('11', 'd')
... |
from utils.reporter import runtimeError as _RuntimeError
from utils.tokens import Token as _Token
from utils.tokens import TokenType as _TokenType
from utils.misc import isValNeg as _isValNeg
from native.datastructs.rocketClass import RocketCallable as _RocketCallable
from native.datastructs.rocketClass i... |
from __future__ import absolute_import, division, print_function
from contextlib import contextmanager
import inspect
import datetime
import tempfile
import os
import numpy as np
def raises(err, lamda):
try:
lamda()
return False
except err:
return True
def expand_tuples(L):
"""
... |
#
# PySNMP MIB module NMS510-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/NMS510-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:12:45 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:... |
'''
Kaya Baber
Physics 440 - Computational Physics
Assignment 4 - Quantum Simulations
Exploration 1
'''
import numpy as np
from numpy import linalg as LA
import matplotlib.pyplot as plt
import math
def make_banded(N):
stepSize = 1.0/N
N-=2 #we reduce N by 2 because we aren't u... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 1 16:32:44 2018
@author: dawnstear
"""
import numpy as np
import pandas as pd
from utils import Data
from dimred import DimensionReduction
'''
import pyqtgraph as pg
from pyqtgraph.Qt import QtGui, QtCore
pg.setConfigOption('leftButtonPan', False... |
# -*- coding: utf-8 -*-
from functools import wraps
from datetime import timedelta
from .models import DataPresence, HitViewByUser
from django.utils import timezone
from django.utils.decorators import available_attrs
from django.db.models import F
def bdg_data_presence(view_func):
@wraps(view_func, assigned=avai... |
class OrkgResponse(object):
@property
def succeeded(self):
return str(self.status_code)[0] == '2'
def __init__(self, response):
self.status_code = response.status_code
self.content = response.json()
self.url = response.url
|
"""
Solutions for day 6 of 2020's Advent of Code
"""
def part_a(data) -> int:
"""
Solution for part a
Parameters
----------
data: str
Returns
-------
answer: int
"""
groups = data.split('\n\n')
as_one = (group.replace('\n', '') for group in groups)
unique = (set(gro... |
import unittest
from neural_bezier.dataset import BezierDataset
class BezierDatasetTest(unittest.TestCase):
def test_iter_seed(self):
dataset = iter(BezierDataset(length=16, size=128))
params, img = next(dataset)
self.assertEqual((10,), params.shape)
self.assertEqual((128, 128), i... |
"""
Imports
"""
from .datacontroller import UserStore, QuestionStore, AnswerStore
store = UserStore()
questionstore = QuestionStore()
answerstore = AnswerStore()
|
"""Phish Stats"""
from . import utils
# from .models import Show, Collection
from .show import Show
from .collection import Collection
|
# r1
import csv
import logging
from helpers.save.data_saver import DataSaver
logger = logging.getLogger('ddd_site_parse')
class DataSaverCSV(DataSaver):
def __init__(self, params: {}):
super().__init__(params)
self.ext = 'csv'
self.newline = params.get('newline', '')
self.csv_d... |
from flask_security.forms import LoginForm
class BabelLoginForm(LoginForm):
pass
|
#25adecimal (vquex)
ls = '0123456789ABCDEFGHIJKLMNO'
e = 0
p = 0
t = int(raw_input('to vquex: '))
r = t % 25
q = t / 25
while p < q:
e += 1
p += 1
print str(e) + ls[r]
|
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/05a_inference_anime_heads.ipynb (unless otherwise specified).
__all__ = []
# Cell
import torch
import matplotlib.pyplot as plt
from fastcore.all import *
from .torch_utils import Normalizer
from .data_anime_heads import Tokenizer
from .model import Anime_Export
# Inte... |
#!/usr/bin/env python
import os
import os.path as osp
import gc
import time
from mpi4py import MPI
import matplotlib.pyplot as plt
import pprint
import argparse
import pyathena as pa
from ..util.split_container import split_container
from ..plt_tools.make_movie import make_movie
if __name__ == '__main__':
movie... |
from typing import Awaitable, Callable, Union
from dis_snek.models.discord_objects.role import Role
from dis_snek.models.snowflake import Snowflake_Type, to_snowflake
from dis_snek.models.context import Context
TYPE_CHECK_FUNCTION = Callable[[Context], Awaitable[bool]]
def has_role(role: Union[Snowflake_Type, Role]... |
import discord
from discord_components import DiscordComponents
from discord.ext import commands
from dotenv import load_dotenv
import os
load_dotenv()
# global settings
bot = commands.Bot(command_prefix=commands.when_mentioned, description='poe trade bot!')
DiscordComponents(bot)
cogs_folder = 'cogs'
@bot.event
as... |
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.BootStates import BootState, BootStates
from PLC.Auth import Auth
class GetBootStates(Method):
"""
Returns an array of all valid node boot states.
"""
roles = ['admin', 'pi', 'user', 'tech', 'nod... |
# -*- coding:utf-8 -*-
#
# Author : TangHanYi
# E-mail : thydeyx@163.com
# Create Date : 16-10-28 16:06:01
# File Name : Word_Search.py
# Desc :
class Solution(object):
def dfs(self, board, x, y, word, i):
if i == self.w_l:
return True
if x < 0 or y < 0 or x >= self.n or y >= self.m or or... |
import cgi
import os
import sys
import wsgiref.handlers
import datetime
from google.appengine.api import users
from google.appengine.ext import db
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from google.appengine.ext.db import djangoforms
# Helper Classes
from xml.dom.mi... |
"""Basic settings for EveryVoter project"""
# pylint: disable=invalid-name
import os
import environ
env = environ.Env(
DEBUG=(bool, False),
ALLOWED_HOSTS=(list, []),
APP_NAME=(str, 'everyvoter-default'),
TIME_ZONE=(str, 'US/Eastern'),
LANGUAGE_CODE=(str, 'en-us'),
KEY_PREFIX=(str, ''),
CSR... |
#
# Copyright 2012 Canonical Ltd.
#
# This file is sourced from lp:openstack-charm-helpers
#
# Authors:
# James Page <james.page@ubuntu.com>
# Paul Collins <paul.collins@canonical.com>
# Adam Gandelman <adamg@ubuntu.com>
#
import grp
import os
import pwd
from charmhelpers.core.hookenv import (
local_unit,
... |
import torch
from torch import Tensor
from .field_type import FieldType
from typing import List, Union
import itertools
from collections.abc import Iterable
__all__ = ["GeometricTensor", "tensor_directsum"]
class GeometricTensor:
def __init__(self, tensor: Tensor, type: FieldType):
r"""
... |
import sys
from typing import Any, Dict, Iterable, List, Optional, Tuple
import boost_histogram.axis as bha
import hist
from hist.axestuple import ArrayTuple, NamedAxesTuple
if sys.version_info >= (3, 8):
from typing import Protocol
else:
from typing_extensions import Protocol
from . import transform
__all... |
from __future__ import absolute_import, unicode_literals
from django.utils.translation import ugettext_lazy
from tuiuiu.tuiuiuadmin.views import generic
from tuiuiu.tuiuiuadmin.viewsets.model import ModelViewSet
from tuiuiu.tuiuiucore.models import Site
from tuiuiu.tuiuiucore.permissions import site_permission_policy... |
celsius = float(input('Digite a temperatura em °C: '))
f = ((9*celsius)/5)+32
print ('A temperatura de {}°C corresponde a {}F'.format(celsius,f)) |
"""
"""
import abc
from os.path import dirname
import pkgutil
import sys
__all__ = ['registry', 'Release', 'Vendor', 'VendorRegistry']
class Vendor(metaclass=abc.ABCMeta):
def __init__(self, config):
pass
@staticmethod
@abc.abstractproperty
def id():
"""Vendor IDentifier used to whe... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import re
import os
import filecmp
def replace_if_changed(new, old):
'''
Compare contents and only replace if changed to avoid triggering a rebuild.
'''
try:
changed = not filecmp.cmp(new, old, shallow=False)
except FileNotFoundError:
changed... |
# this file shows how you could use Bot.add_cog to add games to your bot
# first, create the bot instance
from discord.ext import commands
bot = commands.Bot("!") # ! is the prefix in this case
# now import the game you need
from disgames import Hangman
bot.add_cog(Hangman(bot))
# if you need 2 or more commands o... |
import sys
import random
import copy
import resource
from base_client import LiacBot
WHITE = 1
BLACK = -1
INFINITY = 100000000
# BOT =========================================================================
class KillBot(LiacBot):
name = 'KillBot'
ip = '127.0.0.1'
port = 50100
depth = 1
def __i... |
# vim:set ts=4 sw=4 et:
"""Leash server plugin for docker.
This module is responsible for dispatching HTTP requests.
"""
import sys
from flask import jsonify, request
from . import app
from .exceptions import (InvalidRequestException, NoSuchCheckModuleException,
UnauthorizedException)
from ... |
import numpy as np
class CuboidMesh():
"""docstring for CuboidMesh"""
def __init__(self, arg):
super(CuboidMesh, self).__init__()
@staticmethod
def meshgrid_3d(x_1d, y_1d, z_1d):
'''
Suppose x_1d.shape = M, y_1d.shape = N, z_1d.shape = P
Then, this function will ... |
import numpy, random, math
v = [0]
while numpy.std(v) <= 3:
v = [int(random.gauss(0, 3)) for i in range(8)]
for i in range(8):
if v[i] == 0:
v[i] = 1
for i in range(8):
print -math.pi+i*math.pi/4, v[i]
|
# code dependencies
import kb_services
import parsing
import interpretation
# network toolkit
import networkx as nx
# regular expressions
import re
# drawing
# from pyrobotics.messages import Command
def interpret_command(sentence_string):
print "lol"
G = kb_services.load_semantic_network()
grounded_commands =... |
from statsmodels.compat.numpy import lstsq
from statsmodels.compat.pandas import assert_index_equal
from statsmodels.compat.platform import PLATFORM_WIN
from statsmodels.compat.python import lrange
import os
import warnings
import numpy as np
from numpy.testing import (
assert_,
assert_allclose,
assert_al... |
class Solution:
def sortArrayByParity(self, A):
"""
:type A: List[int]
:rtype: List[int]
"""
even = [x for x in A if x%2 == 0 ]
odd = [x for x in A if x%2 != 0 ]
return even + odd
|
# AUTOGENERATED! DO NOT EDIT! File to edit: 00_core.ipynb (unless otherwise specified).
__all__ = ['say_hello', 'add']
# Cell
def say_hello(to):
"""Say hello to somebody!"""
return f'Hello {to}!'
# Cell
def add(a, b):
"""adding two numbers"""
return a+b |
# Author': a101269
# Date ': 2020/3/4
configs={
'use_cuda':True,
'seed': 123,
'epochs':30,
'eval_interval':500,
'batch_size': 12,
'columns':[0,1,3,5,8,9], # 5,9misc杂项可放知识库信息
# {'id': 0, 'word': 1, 'lemma': 2, 'upos': 3, 'xpos': 4, 'feats': 5, 'head': 6, 'deprel': 7, 'deps': 8,'misc': 9}
'le... |
#!/usr/bin/python
from dbus import Bus, DBusException
bus = Bus(Bus.TYPE_SESSION)
def get_clem():
try:
return bus.get_object('org.mpris.clementine', '/Player')
except DBusException:
#print "\x02Either Clementine is not running or you have something wrong with your D-Bus setup."
return... |
__all__ = ['layout']
import ipywidgets as widgets
item_layout = widgets.Layout(height='80px', min_width='30px', min_height='50px', width ='60px',flex_wrap='wrap')
button_styles = ['primary',
'success',
'info',
'warning',
'danger']
items = [widgets.Button(layout=item_layout, description=str(i), button_style=button... |
from flask import Blueprint, jsonify, render_template, request, url_for
from flask_login import login_required
from app.models.entities.driver import Driver
from app.models.view.driver_view_model import DriverViewModel
from app.service.driver_service import DriverService
from app.utils import TEMPLATES_ROOT_PATH
driv... |
import networkx as nx
import os
import numpy as np
from tqdm import tqdm
import copy
def ext(name):
return {
'julia': '.jl'
}[name]
def load_graph(data_dir, min_num_nodes, max_num_nodes, node_labels, graph_labels):
#Each file should contain the datasetname at the front of the file
name = data_dir.split... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
'''
Contaisn the functions for printing the evaluation results in an HTML file
'''
def coda_html(num, ill_drs_ids, counts, measures, types, cr_mdict):
'''Gets the number of CLFs, ids of ill DRSs, counts for produced, gold and matching clauses,
evaluation measures like... |
# -*- coding: utf-8 -*-
import pytest
from html2ans.parsers.embeds import YoutubeEmbedParser
@pytest.mark.parametrize('tag_string,expected_id', [
('<iframe src="https://www.youtube.com/embed/7IBERQ9abkk?feature=oembed"></iframe>',
"https://www.youtube.com/watch?v=7IBERQ9abkk"),
('<iframe src=\"http://www... |
#!/usr/bin/env python
import os
import subprocess
import threading
import time
import logging
from os.path import expandvars
from icecube import icetray, dataclasses
import math
def taskset(pid,tt=None):
# get/set the taskset affinity for pid
# uses a binary number string for the core affinity
l = ['/bin... |
# Generated by Django 3.2.5 on 2021-11-29 18:37
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.expressions
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='AD... |
#!/bin/env python
#-*-coding:utf-8-*-
import MySQLdb
import string
import sys
reload(sys)
sys.setdefaultencoding('utf8')
import ConfigParser
def get_item(data_dict,item):
try:
item_value = data_dict[item]
return item_value
except:
pass
def get_parameters(conn):
try:
curs=c... |
from unittest import TestCase
from shared.BaseUnitTest import BaseUnitTest
from shared.products import get_products
from shared.users import get_users
import cProfile
import pstats
def profile_method(fn):
profiler = cProfile.Profile()
profiler.enable()
data = fn()
profiler.disable()
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.