code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
"""Application helper utilities.""" import importlib import pkgutil from flask import Blueprint __all__ = ('check_required_settings', 'register_blueprints',) DOES_NOT_EXIST = '!@DNE@!' # Placeholder value to use for missing settings. REQUIRED_SETTINGS = 'SECRET_KEY', 'SECURITY_PASSWORD_SALT' def check_required_s...
[ "pkgutil.iter_modules" ]
[((770, 804), 'pkgutil.iter_modules', 'pkgutil.iter_modules', (['package_path'], {}), '(package_path)\n', (790, 804), False, 'import pkgutil\n')]
# # tasks.py # ======== # # Copying # ------- # # Copyright (c) 2015 cf-propane authors and contributors. # # This file is part of the *cf-propane* project. # # cf-propane is a free software project. You can redistribute it and/or # modify if under the terms of the MIT License. # # This software project is distributed ...
[ "os.remove", "jinja2.PrefixLoader", "os.walk", "os.path.isfile", "yaml.safe_load", "shutil.rmtree", "os.path.join", "os.path.lexists", "os.path.abspath", "os.path.exists", "contextlib.suppress", "jinja2.FileSystemLoader", "invoke.task", "copy.deepcopy", "os.path.expandvars", "invoke.Co...
[((947, 959), 'invoke.Collection', 'Collection', ([], {}), '()\n', (957, 959), False, 'from invoke import Collection, task, run\n'), ((31693, 31711), 'invoke.task', 'task', ([], {'name': '"""clean"""'}), "(name='clean')\n", (31697, 31711), False, 'from invoke import Collection, task, run\n'), ((32510, 32566), 'invoke.t...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
[ "ansible.module_utils.network.f5.bigip.F5Client", "ansible.module_utils.network.f5.common.cleanup_tokens", "time.sleep", "ansible.module_utils.network.f5.common.F5ModuleError", "f5.bigip.contexts.TransactionContextManager", "ansible.module_utils.basic.AnsibleModule" ]
[((19612, 19754), 'ansible.module_utils.basic.AnsibleModule', 'AnsibleModule', ([], {'argument_spec': 'spec.argument_spec', 'supports_check_mode': 'spec.supports_check_mode', 'mutually_exclusive': 'spec.mutually_exclusive'}), '(argument_spec=spec.argument_spec, supports_check_mode=spec.\n supports_check_mode, mutual...
from datetime import datetime from flask_sqlalchemy import SQLAlchemy from api import db, ma class User(db.Model): id = db.Column(db.Integer, primary_key = True) username = db.Column(db.String(20), unique=True) email = db.Column(db.String(50), unique=True) created = db.Column(db.DateTime) def __in...
[ "datetime.datetime.now", "api.db.Column", "api.db.String" ]
[((125, 164), 'api.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_key=True)\n', (134, 164), False, 'from api import db, ma\n'), ((284, 306), 'api.db.Column', 'db.Column', (['db.DateTime'], {}), '(db.DateTime)\n', (293, 306), False, 'from api import db, ma\n'), ((192, 205), '...
import time t_start=time.time() from prettytable import PrettyTable import datetime file = open('testresult.txt','w') file.write("Query: Enter Query Here\n\n") file.write("Output Location: Enter location here\n\n") file.write("Test start time: "+str(datetime.datetime.now())+"\n\n") t= PrettyTable(['Start Ti...
[ "datetime.datetime.now", "prettytable.PrettyTable", "time.time" ]
[((21, 32), 'time.time', 'time.time', ([], {}), '()\n', (30, 32), False, 'import time\n'), ((298, 370), 'prettytable.PrettyTable', 'PrettyTable', (["['Start Time', 'Run', 'No of Records', 'Time(s)', 'Errors']"], {}), "(['Start Time', 'Run', 'No of Records', 'Time(s)', 'Errors'])\n", (309, 370), False, 'from prettytable...
import sys sys.path.append("./") from brainrender.Utils.data_io import connected_to_internet import requests import time mouselight_base_url = "http://ml-neuronbrowser.janelia.org/" def request(url): """ Sends a request to a url :param url: """ if not connected_to_internet(): raise ConnectionError("You ...
[ "sys.path.append", "time.sleep", "requests.get", "requests.post", "brainrender.Utils.data_io.connected_to_internet" ]
[((11, 32), 'sys.path.append', 'sys.path.append', (['"""./"""'], {}), "('./')\n", (26, 32), False, 'import sys\n'), ((388, 405), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (400, 405), False, 'import requests\n'), ((943, 967), 'requests.get', 'requests.get', (['full_query'], {}), '(full_query)\n', (955, 9...
############################################################################## # Copyright 2016-2017 Rigetti Computing # # 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...
[ "pyquil.api.QVMConnection", "pyquil.paulis.PauliTerm", "grove.pyqaoa.qaoa.QAOA", "numpy.hstack" ]
[((939, 958), 'pyquil.api.QVMConnection', 'api.QVMConnection', ([], {}), '()\n', (956, 958), True, 'import pyquil.api as api\n'), ((2098, 2297), 'grove.pyqaoa.qaoa.QAOA', 'QAOA', (['CXN', 'n_qubits'], {'steps': 'steps', 'cost_ham': 'cost_operators', 'ref_hamiltonian': 'ref_operators', 'store_basis': '(True)', 'minimize...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import glob import os.path import sys import shutil import random import matplotlib.pyplot as plt import xml.etree.ElementTree as ET import scipy.io as scio import tensorflow_datasets as tfds import tensorflow...
[ "matplotlib.pyplot.title", "tensorflow.reduce_sum", "numpy.sum", "tensorflow.clip_by_value", "tensorflow_datasets.features.Image", "scipy.io.loadmat", "matplotlib.pyplot.figure", "numpy.tile", "tensorflow.split", "tensorflow.image.crop_to_bounding_box", "tensorflow.image.random_crop", "matplot...
[((8348, 8373), 'tensorflow.constant', 'tf.constant', (['train_images'], {}), '(train_images)\n', (8359, 8373), True, 'import tensorflow as tf\n'), ((8393, 8418), 'tensorflow.constant', 'tf.constant', (['train_labels'], {}), '(train_labels)\n', (8404, 8418), True, 'import tensorflow as tf\n'), ((8438, 8463), 'tensorflo...
import numpy as np from ..utils import GeneticAlgorithm as GA from ..utils import round_vars from .lcb_merit import lcb_merit def lcb_ga(num_pts, opt_prob, surrogate, X, fX, Xpend=None, kappa=2.0, dtol=1e-3, lcb_target=None): """Minimize the LCB using a genetic algorithm. :param num_pts: Number of points to...
[ "numpy.empty", "numpy.zeros", "numpy.vstack" ]
[((1152, 1173), 'numpy.vstack', 'np.vstack', (['(X, Xpend)'], {}), '((X, Xpend))\n', (1161, 1173), True, 'import numpy as np\n'), ((1192, 1225), 'numpy.zeros', 'np.zeros', (['(num_pts, opt_prob.dim)'], {}), '((num_pts, opt_prob.dim))\n', (1200, 1225), True, 'import numpy as np\n'), ((1115, 1142), 'numpy.empty', 'np.emp...
# coding: utf8 import requests import json if __name__ == "__main__": # 指定用于匹配的文本并生成字典{"text_1": [text_a1, text_a2, ... ] # "text_2": [text_b1, text_b2, ... ]} text = { "text_1": ["这道题太难了", "这道题太难了", "这道题太难了"], "text_2": ["这道题是上一年的考题", "这道题不简单", "这道题很有意思"] }...
[ "requests.post" ]
[((423, 456), 'requests.post', 'requests.post', ([], {'url': 'url', 'data': 'text'}), '(url=url, data=text)\n', (436, 456), False, 'import requests\n')]
from django.db import models from django.utils.translation import gettext_lazy as _ from common.models import ProductBaseModel from .product_brand import ProductBrand from .product_group import ProductGroup from .product_type import ProductType class Product(ProductBaseModel): name = models.CharField( ma...
[ "django.db.models.Index", "django.utils.translation.gettext_lazy" ]
[((352, 373), 'django.utils.translation.gettext_lazy', '_', (['"""Name of product."""'], {}), "('Name of product.')\n", (353, 373), True, 'from django.utils.translation import gettext_lazy as _\n'), ((533, 560), 'django.utils.translation.gettext_lazy', '_', (['"""related product group."""'], {}), "('related product gro...
# Generated by Django 3.1.2 on 2020-12-29 20:56 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('recipients', '0041_auto_20201220_2242'), ] operations = [ migrations.AlterField( model_name='groceryrequest', name='...
[ "django.db.models.TextField" ]
[((353, 579), 'django.db.models.TextField', 'models.TextField', ([], {'help_text': '"""Our deliveries will be done on Fridays, Saturdays and Sundays between 12 and 8 PM. Please list the days and times that you\'re available to receive a delivery"""', 'verbose_name': '"""Availability"""'}), '(help_text=\n "Our delive...
import csv import os import pickle from os import listdir from os.path import isfile, join import shutil # Verify the current working directory. Depending on your environment / editor, it may not be where you think it is # since paths are relative this will be problematic, so double check cwd = os.getcwd() print...
[ "os.remove", "csv.reader", "os.getcwd", "os.path.exists", "os.path.join" ]
[((303, 314), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (312, 314), False, 'import os\n'), ((699, 742), 'os.path.join', 'os.path.join', (['data_root_dir', 'info_file_name'], {}), '(data_root_dir, info_file_name)\n', (711, 742), False, 'import os\n'), ((5681, 5707), 'os.path.exists', 'os.path.exists', (['saved_path'],...
from pettingzoo.butterfly import pistonball_v4 env = pistonball_v4.env() print(env.observation_spaces) print(env.action_spaces) obs = env.reset() print(env.num_agents) print(env.agents)
[ "pettingzoo.butterfly.pistonball_v4.env" ]
[((53, 72), 'pettingzoo.butterfly.pistonball_v4.env', 'pistonball_v4.env', ([], {}), '()\n', (70, 72), False, 'from pettingzoo.butterfly import pistonball_v4\n')]
"""add delivered_on to order Revision ID: 080534ba8038 Revises: 4e8c2eb9ae96 Create Date: 2019-01-14 23:07:47.734911 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '080534ba8038' down_revision = '4e8c2eb9ae96' branch_labels = None depends_on = None def upgra...
[ "alembic.op.drop_column", "sqlalchemy.DateTime", "alembic.op.f" ]
[((761, 800), 'alembic.op.drop_column', 'op.drop_column', (['"""order"""', '"""delivered_on"""'], {}), "('order', 'delivered_on')\n", (775, 800), False, 'from alembic import op\n'), ((496, 525), 'alembic.op.f', 'op.f', (['"""ix_order_delivered_on"""'], {}), "('ix_order_delivered_on')\n", (500, 525), False, 'from alembi...
from flask import Flask application = Flask(__name__) @application.route("/") def hello(): return "<h1>Demo via Nginx with uWSGI!</h1>" if __name__ == "__main__": application.run(host='127.0.0.1', port=9001)
[ "flask.Flask" ]
[((38, 53), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (43, 53), False, 'from flask import Flask\n')]
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2021-06-12 23:33 # @Author : Nuonuo # @Site : # @File : ffmpeg.py # @Software: PyCharm ''' ffmeg下载地址 http://www.ffmpeg.org/download.html ''' import ffmpy3 import datetime from moviepy.editor import * import os def 获取_视频_信息(path): data = 运行2(r'ffprobe ...
[ "datetime.datetime.strptime", "ffmpy3.FFmpeg", "os.walk", "os.popen" ]
[((1449, 1535), 'ffmpy3.FFmpeg', 'ffmpy3.FFmpeg', ([], {'inputs': '{path: None}', 'outputs': "{保存地址: f'-b:a {音频比特率}k -b:v {视频比特率}k'}"}), "(inputs={path: None}, outputs={保存地址:\n f'-b:a {音频比特率}k -b:v {视频比特率}k'})\n", (1462, 1535), False, 'import ffmpy3\n'), ((1689, 1782), 'ffmpy3.FFmpeg', 'ffmpy3.FFmpeg', ([], {'inputs...
"""OneSignal Base Client class.""" import requests import json class OneSignalBaseClient(object): """OneSignal Base Client.""" MODE_APP = "app" MODE_USER = "user" def _url(self, endpoint): """ Build the full OneSignal API URL. :return: Returns the complete url string ...
[ "requests.put", "requests.post", "requests.delete", "json.dumps" ]
[((1777, 1796), 'json.dumps', 'json.dumps', (['payload'], {}), '(payload)\n', (1787, 1796), False, 'import json\n'), ((1881, 1941), 'requests.post', 'requests.post', (['url'], {'data': 'json_payload', 'headers': 'final_headers'}), '(url, data=json_payload, headers=final_headers)\n', (1894, 1941), False, 'import request...
# encoding: utf-8 from __future__ import annotations from typing import Any from urllib.parse import urlencode from flask import Blueprint from ckan.common import json from ckan.plugins.toolkit import get_action, request, h import re datatablesview = Blueprint(u'datatablesview', __name__) def merge_filters(view_...
[ "flask.Blueprint", "ckan.plugins.toolkit.get_action", "ckan.common.json.loads", "re.sub", "ckan.common.json.dumps", "ckan.plugins.toolkit.h.url_for" ]
[((256, 294), 'flask.Blueprint', 'Blueprint', (['u"""datatablesview"""', '__name__'], {}), "(u'datatablesview', __name__)\n", (265, 294), False, 'from flask import Blueprint\n'), ((1873, 1904), 'ckan.plugins.toolkit.get_action', 'get_action', (['u"""datastore_search"""'], {}), "(u'datastore_search')\n", (1883, 1904), F...
from DarkForestCreature import DarkForestCreature # Dragon(300, 1.0, 1000, 1.0, 2000, 3600), # dpm of 200. Reward increases over time, difficult to kill. class Dragon(DarkForestCreature): def __init__(self, delay=300, delayMulti=1.0, attack=800, attackMulti=1.0, health=900, reward=3600, inciner...
[ "DarkForestCreature.DarkForestCreature.__init__" ]
[((345, 459), 'DarkForestCreature.DarkForestCreature.__init__', 'DarkForestCreature.__init__', (['self', 'delay', 'delayMulti', 'attack', 'attackMulti', 'health', 'reward', 'incineration_resist'], {}), '(self, delay, delayMulti, attack, attackMulti,\n health, reward, incineration_resist)\n', (372, 459), False, 'from...
import pickle import re import string import docx2txt import nltk from nltk.corpus import stopwords from nltk.tokenize import word_tokenize def save_doc_as_txt(doc_loc, new_doc_loc): text = docx2txt.process(doc_loc) with open(new_doc_loc, 'wb') as text_file: print(text, file=text_file) def read_do...
[ "pickle.dump", "nltk.download", "re.escape", "nltk.corpus.stopwords.words", "docx2txt.process", "re.sub", "nltk.tokenize.word_tokenize" ]
[((197, 222), 'docx2txt.process', 'docx2txt.process', (['doc_loc'], {}), '(doc_loc)\n', (213, 222), False, 'import docx2txt\n'), ((1135, 1164), 're.sub', 're.sub', (['"""\\\\[.*?\\\\]"""', '""""""', 'text'], {}), "('\\\\[.*?\\\\]', '', text)\n", (1141, 1164), False, 'import re\n'), ((1242, 1273), 're.sub', 're.sub', ([...
#!/usr/bin/env python from motor.motor_asyncio import AsyncIOMotorClient from src.config import CONFIG from src.utils.tools import singleton @singleton class MotorBase: """ 更改mongodb连接方式 单例模式下支持多库操作 About motor's doc: https://github.com/mongodb/motor """ _db = {} _collection = {} MONGODB ...
[ "motor.motor_asyncio.AsyncIOMotorClient" ]
[((940, 974), 'motor.motor_asyncio.AsyncIOMotorClient', 'AsyncIOMotorClient', (['self.motor_uri'], {}), '(self.motor_uri)\n', (958, 974), False, 'from motor.motor_asyncio import AsyncIOMotorClient\n'), ((2403, 2437), 'motor.motor_asyncio.AsyncIOMotorClient', 'AsyncIOMotorClient', (['self.motor_uri'], {}), '(self.motor_...
import tulip import viol from demolib import set_title, make_widget, make_widget_synchronous set_title('Bar runs code in another thread') @viol.connect('#go click') def start(client, data): coroutines = [foo(client), bar(client)] for future in tulip.as_completed(coroutines): result = yield from future...
[ "demolib.make_widget_synchronous", "demolib.set_title", "viol.run", "demolib.make_widget", "tulip.as_completed", "viol.connect", "tulip.get_event_loop" ]
[((94, 138), 'demolib.set_title', 'set_title', (['"""Bar runs code in another thread"""'], {}), "('Bar runs code in another thread')\n", (103, 138), False, 'from demolib import set_title, make_widget, make_widget_synchronous\n'), ((141, 166), 'viol.connect', 'viol.connect', (['"""#go click"""'], {}), "('#go click')\n",...
import os from random import random, sample import numpy as np from PIL import Image, ImageDraw from skimage.segmentation import felzenszwalb from skimage.morphology import skeletonize, remove_small_objects from skimage.util import invert from tqdm import tqdm import cv2 def cv2pil(cv2_img): if len(cv2_img.shape)...
[ "cv2.GaussianBlur", "numpy.abs", "cv2.arcLength", "numpy.argmin", "cv2.bilateralFilter", "numpy.arange", "numpy.unique", "numpy.multiply", "cv2.cvtColor", "skimage.morphology.skeletonize", "cv2.convertScaleAbs", "numpy.linspace", "cv2.drawContours", "numpy.dstack", "cv2.Canny", "numpy....
[((628, 645), 'numpy.array', 'np.array', (['pil_img'], {}), '(pil_img)\n', (636, 645), True, 'import numpy as np\n'), ((661, 701), 'cv2.cvtColor', 'cv2.cvtColor', (['cv2_img', 'cv2.COLOR_RGB2BGR'], {}), '(cv2_img, cv2.COLOR_RGB2BGR)\n', (673, 701), False, 'import cv2\n'), ((808, 825), 'numpy.arange', 'np.arange', (['(0...
import logging import os from posixpath import join as posix_join from urllib.parse import urljoin from feedgenerator import Atom1Feed, Rss201rev2Feed, get_tag_uri from markupsafe import Markup from pelican.paginator import Paginator from pelican.plugins import signals from pelican.utils import (get_relative_path, i...
[ "pelican.plugins.signals.feed_generated.send", "pelican.utils.get_relative_path", "pelican.plugins.signals.feed_written.send", "os.path.dirname", "pelican.paginator.Paginator", "pelican.utils.sanitised_join", "markupsafe.Markup", "feedgenerator.get_tag_uri", "pelican.utils.is_selected_for_writing", ...
[((427, 454), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (444, 454), False, 'import logging\n'), ((5930, 5977), 'pelican.plugins.signals.feed_generated.send', 'signals.feed_generated.send', (['context'], {'feed': 'feed'}), '(context, feed=feed)\n', (5957, 5977), False, 'from pelican.p...
"""Basic message handler.""" import json from ...base_handler import BaseHandler, BaseResponder, RequestContext from ..manager import PresentationManager from ..messages.presentation_request import PresentationRequest from ....holder.base import BaseHolder class PresentationRequestHandler(BaseHandler): """Mes...
[ "json.loads" ]
[((1728, 1763), 'json.loads', 'json.loads', (['context.message.request'], {}), '(context.message.request)\n', (1738, 1763), False, 'import json\n')]
import glob import numpy as np def _word_to_bool(word): """convert a string to boolean according the first 2 characters.""" _accepted_bool_prefixes = ("T", ".T") return word.upper().startswith(_accepted_bool_prefixes) class Photons: pass class Wavelengths: pass class Physics: pass class ...
[ "numpy.deg2rad", "numpy.arange", "glob.glob" ]
[((18379, 18411), 'glob.glob', 'glob.glob', (["(directory + '/*.par*')"], {}), "(directory + '/*.par*')\n", (18388, 18411), False, 'import glob\n'), ((17628, 17676), 'numpy.deg2rad', 'np.deg2rad', (['[self.map.RT_imin, self.map.RT_imax]'], {}), '([self.map.RT_imin, self.map.RT_imax])\n', (17638, 17676), True, 'import n...
from django.utils.translation import gettext_lazy as _ from rest_framework import exceptions as rf_exceptions from rest_framework import serializers from waldur_core.structure.models import CUSTOMER_DETAILS_FIELDS from waldur_core.structure.serializers import ( CountrySerializerMixin, ProjectDetailsSerializerM...
[ "rest_framework.serializers.ReadOnlyField", "django.utils.translation.gettext_lazy" ]
[((577, 630), 'rest_framework.serializers.ReadOnlyField', 'serializers.ReadOnlyField', ([], {'source': '"""get_state_display"""'}), "(source='get_state_display')\n", (602, 630), False, 'from rest_framework import serializers\n'), ((642, 687), 'rest_framework.serializers.ReadOnlyField', 'serializers.ReadOnlyField', ([],...
from django.shortcuts import render,redirect from django.http import HttpResponse,Http404 from .models import Author,Picture,Category,Location # Create your views here. def pics(request): category = Category.get_categories() pictures = Picture.all_pics() location_pics = Location.get_location() return...
[ "django.shortcuts.render", "django.http.Http404" ]
[((321, 431), 'django.shortcuts.render', 'render', (['request', '"""pics.html"""', "{'pictures': pictures, 'category': category, 'location_pics': location_pics}"], {}), "(request, 'pics.html', {'pictures': pictures, 'category': category,\n 'location_pics': location_pics})\n", (327, 431), False, 'from django.shortcut...
# ------------------------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. # -------------------------------------------------------------------...
[ "numpy.sum", "InnerEyeDataQuality.evaluation.metrics.compute_accuracy", "numpy.copy", "numpy.argmax", "InnerEyeDataQuality.evaluation.metrics.total_variation", "numpy.setdiff1d", "logging.info", "InnerEyeDataQuality.evaluation.metrics.compute_label_entropy", "numpy.where", "numpy.arange", "numpy...
[((658, 680), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (667, 680), False, 'from dataclasses import dataclass\n'), ((3503, 3539), 'numpy.argmax', 'np.argmax', (['true_label_counts'], {'axis': '(1)'}), '(true_label_counts, axis=1)\n', (3512, 3539), True, 'import numpy as np\n')...
from FastTextRank.FastTextRank4Word import FastTextRank4Word from cnlglsearch.utils.legal_doc import LegalDoc tr4s = FastTextRank4Word(tol=0.0001) fp = open("aaa.txt",encoding="utf-8") aa = fp.read() fp.close() tr4s.summarize("原告孙高长与被告长沙斯盛消防安全工程有限公司、娄底市三湘房地产开发有限公司追索劳动报酬纠纷民事一审调解书\n 湖南省新化县人民法院\n民 事 裁 定 书\n(2018)湘132...
[ "FastTextRank.FastTextRank4Word.FastTextRank4Word" ]
[((118, 147), 'FastTextRank.FastTextRank4Word.FastTextRank4Word', 'FastTextRank4Word', ([], {'tol': '(0.0001)'}), '(tol=0.0001)\n', (135, 147), False, 'from FastTextRank.FastTextRank4Word import FastTextRank4Word\n')]
import msl.package_manager as pm def test_github(): pkgs = pm.github() assert pm._PKG_NAME in pkgs pkg = pkgs[pm._PKG_NAME] assert len(pkg['description']) > 0 assert len(pkg['version']) > 0 assert len(pkg['tags']) > 10 assert len(pkg['branches']) > 0
[ "msl.package_manager.github" ]
[((65, 76), 'msl.package_manager.github', 'pm.github', ([], {}), '()\n', (74, 76), True, 'import msl.package_manager as pm\n')]
import os import sys import psycopg2 as sql from importlib import import_module db_conf = import_module('0_postgres_db_conf',os.getcwd() + '\\0_postgres_db_conf.py').db_conf log = import_module('write_log', os.getcwd() + '\\write_log.py').Log('1_load_source_data') source_data_directory = db_conf['source_data_dire...
[ "os.getcwd", "os.listdir", "sys.exc_info", "psycopg2.connect" ]
[((365, 412), 'os.listdir', 'os.listdir', (["(source_data_directory + '\\\\patient')"], {}), "(source_data_directory + '\\\\patient')\n", (375, 412), False, 'import os\n'), ((430, 478), 'os.listdir', 'os.listdir', (["(source_data_directory + '\\\\practice')"], {}), "(source_data_directory + '\\\\practice')\n", (440, 47...
#!/usr/bin/env python3 """This Python program stops the Hillview service on the machines specified in the configuration file.""" # pylint: disable=invalid-name from argparse import ArgumentParser from hillviewCommon import ClusterConfiguration, get_config, get_logger logger = get_logger("stop") def stop_webserve...
[ "hillviewCommon.get_config", "hillviewCommon.get_logger", "argparse.ArgumentParser" ]
[((283, 301), 'hillviewCommon.get_logger', 'get_logger', (['"""stop"""'], {}), "('stop')\n", (293, 301), False, 'from hillviewCommon import ClusterConfiguration, get_config, get_logger\n'), ((1055, 1071), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (1069, 1071), False, 'from argparse import ArgumentP...
import copy import logging from itertools import chain import numpy as np import torch from torch.nn import functional as F from rltoolkit import config from rltoolkit.algorithms.ddpg import DDPG from rltoolkit.algorithms.sac.models import SAC_Actor, SAC_Critic logger = logging.getLogger(__name__) class SAC(DDPG):...
[ "copy.deepcopy", "torch.tensor", "numpy.log", "torch.nn.functional.mse_loss", "rltoolkit.algorithms.sac.models.SAC_Actor", "rltoolkit.algorithms.sac.models.SAC_Critic", "torch.no_grad", "torch.min", "logging.getLogger" ]
[((274, 301), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (291, 301), False, 'import logging\n'), ((4135, 4198), 'rltoolkit.algorithms.sac.models.SAC_Actor', 'SAC_Actor', (['self.ob_dim', 'self.ac_lim', 'self.ac_dim', 'self.discrete'], {}), '(self.ob_dim, self.ac_lim, self.ac_dim, self...
import argparse import asyncio import shlex import sys import pathlib from asyncio.subprocess import PIPE async def tee(stream, streams, prefix): line = await stream.readline() while line.endswith(b'\n'): for s, p in zip(streams, prefix): s.write(p + line) if hasattr(s, 'flush'...
[ "pathlib.Path", "shlex.split" ]
[((727, 748), 'pathlib.Path', 'pathlib.Path', (['argv[0]'], {}), '(argv[0])\n', (739, 748), False, 'import pathlib\n'), ((2034, 2060), 'shlex.split', 'shlex.split', (['args.program1'], {}), '(args.program1)\n', (2045, 2060), False, 'import shlex\n'), ((2154, 2180), 'shlex.split', 'shlex.split', (['args.program2'], {}),...
# Copyright 2017 Mycroft AI, 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 writ...
[ "padatious.match_data.MatchData" ]
[((689, 760), 'padatious.match_data.MatchData', 'MatchData', (['"""name"""', "['one', 'two']", "{'{word}': ['value', 'tokens']}", '(0.5)'], {}), "('name', ['one', 'two'], {'{word}': ['value', 'tokens']}, 0.5)\n", (698, 760), False, 'from padatious.match_data import MatchData\n'), ((894, 953), 'padatious.match_data.Matc...
# -*- coding: utf-8 -*- # snapshottest: v1 - https://goo.gl/zC4yUc from __future__ import unicode_literals from snapshottest import Snapshot snapshots = Snapshot() snapshots['TestCase01GetPayThroughDetailsAPITestCase::test_case status'] = 200 snapshots['TestCase01GetPayThroughDetailsAPITestCase::test_case body'] =...
[ "snapshottest.Snapshot" ]
[((156, 166), 'snapshottest.Snapshot', 'Snapshot', ([], {}), '()\n', (164, 166), False, 'from snapshottest import Snapshot\n')]
# Our approach to model groups is: # * Build an NFA out of them. # * Translate our NFA to automata-lib's NFA. # * Using automata-lib, convert the NFA to a DFA. # * Using python-automata, minify the DFA. # * Rename the DFA states. # * Return the DFA, where it would be emitted as C++ code. import xmlschema # type: ignor...
[ "automata.fa.dfa.DFA.from_nfa", "automata.fa.nfa.NFA" ]
[((3998, 4133), 'automata.fa.nfa.NFA', 'NFA', ([], {'states': '_nfa_states', 'input_symbols': 'input_symbols', 'transitions': '_nfa_state_transitions', 'initial_state': 'init', 'final_states': '{final}'}), '(states=_nfa_states, input_symbols=input_symbols, transitions=\n _nfa_state_transitions, initial_state=init, f...
import requests from datetime import datetime, timedelta import xml.etree.ElementTree as ET from urllib import parse class Covid19: items = None covid19Url = None c19Key = None covid19Url = None covid19QueryParams = None def __init__(self): # 오늘 날짜 todayDate = datetime.today()...
[ "datetime.datetime.today", "xml.etree.ElementTree.fromstring", "urllib.parse.quote_plus", "datetime.timedelta", "requests.get" ]
[((304, 320), 'datetime.datetime.today', 'datetime.today', ([], {}), '()\n', (318, 320), False, 'from datetime import datetime, timedelta\n'), ((1553, 1582), 'xml.etree.ElementTree.fromstring', 'ET.fromstring', (['covid19XMLData'], {}), '(covid19XMLData)\n', (1566, 1582), True, 'import xml.etree.ElementTree as ET\n'), ...
import asyncio import copy import random import sys import time from typing import Callable, Dict, List, NoReturn from abc import ABCMeta, abstractclassmethod, abstractmethod import praft.exceptions from praft.typing import T_URL from praft.log import Entity, EntityType, ConfChangeType, ConfChangeData from praft.mes...
[ "praft.message.LearnReq.new", "praft.message.VoteReq.new", "praft.message.LearnerJoinRes.new", "asyncio.as_completed", "praft.message.ErrorMessage.new", "praft.message.VoteRes.new", "random.randint", "praft.message.HeartBeatRes.new", "praft.message.HeartBeatReq.new", "praft.message.InstallSnapshot...
[((7743, 7775), 'praft.message.LearnReq.new', 'LearnReq.new', (['(0)', 'self.listen_url'], {}), '(0, self.listen_url)\n', (7755, 7775), False, 'from praft.message import Message, MessageType, HeartBeatReq, HeartBeatRes, PrevVoteReq, PrevVoteRes, VoteReq, VoteRes, StartElectionReq, StartElectionRes, InstallSnapshotReq, ...
# -*- coding: utf-8 -*- # framework from django.core.urlresolvers import reverse from django.contrib import admin from django.contrib.admin.views import main as admin_views from django.utils.translation import ugettext as _ from django.http import Http404, HttpResponseRedirect # module local from . import models, for...
[ "django.utils.translation.ugettext", "django.http.HttpResponseRedirect", "django.contrib.admin.site.register", "django.core.urlresolvers.reverse" ]
[((599, 609), 'django.utils.translation.ugettext', '_', (['"""Value"""'], {}), "('Value')\n", (600, 609), True, 'from django.utils.translation import ugettext as _\n'), ((981, 1010), 'django.utils.translation.ugettext', '_', (['"""Clear cache for settings"""'], {}), "('Clear cache for settings')\n", (982, 1010), True, ...
#!/usr/bin/env python # coding: utf-8 #%% ---- DEPENDENCIES import matplotlib.pyplot as plt from skimage import io import manynames as mn #%% ---- FUNCTION TO SHOW OBJECT WITH BOUNDING BOX AND NAMES def show_objects(url, bbox, objname, block_display=True): im = io.imread(url) fig = plt.figure() ax = ...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.axis", "matplotlib.pyplot.Rectangle", "matplotlib.pyplot.draw", "matplotlib.pyplot.figure", "manynames.load_cleaned_results", "matplotlib.pyplot.gca", "matplotlib.pyplot.tight_layout", "skimage.io.imread" ]
[((273, 287), 'skimage.io.imread', 'io.imread', (['url'], {}), '(url)\n', (282, 287), False, 'from skimage import io\n'), ((298, 310), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (308, 310), True, 'import matplotlib.pyplot as plt\n'), ((855, 870), 'matplotlib.pyplot.axis', 'plt.axis', (['"""off"""'], {}...
""" Twitter only supports the application-only flow of OAuth2 for certain API endpoints. This OAuth2 authenticator only supports the application-only flow right now. To authenticate with OAuth2, visit the Twitter developer page and create a new application: https://dev.twitter.com/apps/new This will get you a CO...
[ "urllib.quote", "urllib.urlencode" ]
[((2169, 2186), 'urllib.urlencode', 'urlencode', (['params'], {}), '(params)\n', (2178, 2186), False, 'from urllib import quote, urlencode\n'), ((2686, 2710), 'urllib.quote', 'quote', (['self.consumer_key'], {}), '(self.consumer_key)\n', (2691, 2710), False, 'from urllib import quote, urlencode\n'), ((2736, 2763), 'url...
"""Handle OAuth from Google API.""" import argparse import logging from oauth2client import tools from oauth2client.client import flow_from_clientsecrets from oauth2client.file import Storage CLIENT_SECRETS_FILE = "client_id.json" SCOPE = 'https://www.googleapis.com/auth/youtube.force-ssl' STORAGE_FILE = 'credentials...
[ "oauth2client.file.Storage", "argparse.ArgumentParser", "oauth2client.client.flow_from_clientsecrets", "oauth2client.tools.run_flow", "logging.getLogger" ]
[((332, 357), 'logging.getLogger', 'logging.getLogger', (['"""auth"""'], {}), "('auth')\n", (349, 357), False, 'import logging\n'), ((532, 582), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'parents': '[tools.argparser]'}), '(parents=[tools.argparser])\n', (555, 582), False, 'import argparse\n'), ((629, ...
import os import random import json import numpy as np def separate_data(genre): d_path = '/h/nng/data/sentiment/aws' with open(os.path.join(d_path, genre, 'orig', 'raw.json'), 'r') as ifile, \ open(os.path.join(d_path, genre, 'orig', 'train.raw.input0'), 'w') as t0file, \ open(os.path.join(d...
[ "random.shuffle", "random.seed", "os.path.join", "json.loads" ]
[((2900, 2914), 'random.seed', 'random.seed', (['(1)'], {}), '(1)\n', (2911, 2914), False, 'import random\n'), ((2079, 2100), 'random.shuffle', 'random.shuffle', (['lines'], {}), '(lines)\n', (2093, 2100), False, 'import random\n'), ((137, 184), 'os.path.join', 'os.path.join', (['d_path', 'genre', '"""orig"""', '"""raw...
# -*- coding: utf-8 -*- """ Test Generic Map """ import os import pytest import numpy as np import astropy.units as u from astropy.coordinates import SkyCoord import matplotlib.pyplot as plt import sunpy import sunpy.map import sunpy.coordinates import sunpy.data.test from sunpy.tests.helpers import figure_test tes...
[ "numpy.zeros_like", "os.path.join", "numpy.ma.array", "numpy.arange", "matplotlib.pyplot.gca", "astropy.coordinates.SkyCoord" ]
[((711, 758), 'numpy.zeros_like', 'np.zeros_like', (['aia171_test_map.data'], {'dtype': 'bool'}), '(aia171_test_map.data, dtype=bool)\n', (724, 758), True, 'import numpy as np\n'), ((1876, 1885), 'matplotlib.pyplot.gca', 'plt.gca', ([], {}), '()\n', (1883, 1885), True, 'import matplotlib.pyplot as plt\n'), ((2024, 2100...
# -*- coding: utf-8 -*- # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document from frappe import _ from frappe.utils import flt from frappe.model.mapper impo...
[ "frappe.utils.flt", "erpnext.hr.utils.get_total_exemption_amount", "frappe.whitelist", "frappe.model.mapper.get_mapped_doc", "erpnext.hr.utils.validate_tax_declaration", "erpnext.hr.utils.validate_duplicate_exemption_for_payroll_period", "erpnext.hr.utils.calculate_annual_eligible_hra_exemption" ]
[((1632, 1650), 'frappe.whitelist', 'frappe.whitelist', ([], {}), '()\n', (1648, 1650), False, 'import frappe\n'), ((1719, 2116), 'frappe.model.mapper.get_mapped_doc', 'get_mapped_doc', (['"""Employee Tax Exemption Declaration"""', 'source_name', "{'Employee Tax Exemption Declaration': {'doctype':\n 'Employee Tax Ex...
#! /usr/bin/env python # Public domain; MZMcBride, 2011; Legoktm, 2014 from flask import Flask, request, render_template from flask_caching import Cache import re import requests import operator import toolforge app = Flask(__name__) cache = Cache( app, config={'CACHE_TYPE': 'redis', 'CACHE_REDIS_...
[ "flask_caching.Cache", "flask.request.args.get", "flask.Flask", "toolforge.connect", "requests.get", "toolforge.set_user_agent", "operator.itemgetter", "re.sub" ]
[((220, 235), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (225, 235), False, 'from flask import Flask, request, render_template\n'), ((244, 361), 'flask_caching.Cache', 'Cache', (['app'], {'config': "{'CACHE_TYPE': 'redis', 'CACHE_REDIS_HOST': 'tools-redis',\n 'CACHE_KEY_PREFIX': 'tool-checker'}"}), ...
""" Contains methods for YOLOv3 models for object detection. Trained on COCO dataset. """ import re import numpy as np from collections import defaultdict from kenning.core.model import ModelWrapper from kenning.datasets.open_images_dataset import DectObject, compute_iou, Dataset # noqa: E501 import sys if sys.ver...
[ "kenning.datasets.open_images_dataset.DectObject", "numpy.argmax", "numpy.frombuffer", "numpy.transpose", "numpy.prod", "collections.defaultdict", "numpy.append", "pathlib.Path", "numpy.where", "numpy.array", "importlib.resources.path", "numpy.exp", "kenning.datasets.open_images_dataset.comp...
[((2457, 2474), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (2468, 2474), False, 'from collections import defaultdict\n'), ((2498, 2541), 're.compile', 're.compile', (['"""(width|height|classes)=(\\\\d+)"""'], {}), "('(width|height|classes)=(\\\\d+)')\n", (2508, 2541), False, 'import re\n'), (...
import torch import torch.nn as nn import numpy as np import os import time from zhiqiang.utils.data_parallelism import DataParallelism # define a simple model class SimpleModel(nn.Module): def __init__(self): super(SimpleModel, self).__init__() self.random_start = torch.tensor(np.ones([1, 3, ...
[ "os.getpid", "torch.nn.Conv2d", "multiprocessing.set_start_method", "numpy.ones", "zhiqiang.utils.data_parallelism.DataParallelism" ]
[((1281, 1309), 'multiprocessing.set_start_method', 'mp.set_start_method', (['"""spawn"""'], {}), "('spawn')\n", (1300, 1309), True, 'import multiprocessing as mp\n'), ((1474, 1492), 'zhiqiang.utils.data_parallelism.DataParallelism', 'DataParallelism', (['(2)'], {}), '(2)\n', (1489, 1492), False, 'from zhiqiang.utils.d...
# -*- coding: utf-8 -*- import six from flask import abort, current_app, escape, url_for from flask_login import current_user from dmapiclient.audit import AuditTypes from dmutils.email.dm_notify import DMNotifyClient from dmutils.email.exceptions import EmailError from dmutils.email.helpers import hash_string from ...
[ "flask.abort", "six.text_type", "dmutils.email.dm_notify.DMNotifyClient", "dmutils.env_helpers.get_web_url_from_stage", "flask.url_for", "dmutils.formats.dateformat", "dmutils.email.helpers.hash_string", "flask.escape" ]
[((1266, 1321), 'dmutils.email.dm_notify.DMNotifyClient', 'DMNotifyClient', (["current_app.config['DM_NOTIFY_API_KEY']"], {}), "(current_app.config['DM_NOTIFY_API_KEY'])\n", (1280, 1321), False, 'from dmutils.email.dm_notify import DMNotifyClient\n'), ((676, 686), 'flask.abort', 'abort', (['(404)'], {}), '(404)\n', (68...
import os from unittest.mock import MagicMock import pytest from azureml.core.workspace import Workspace import prefect from prefect.tasks.azureml import ( DatastoreRegisterBlobContainer, DatastoreList, DatastoreGet, DatastoreUpload, ) from prefect.utilities.configuration import set_temporary_config ...
[ "prefect.tasks.azureml.DatastoreList", "unittest.mock.MagicMock", "prefect.utilities.configuration.set_temporary_config", "os.path.isdir", "pytest.raises", "prefect.tasks.azureml.DatastoreRegisterBlobContainer", "prefect.tasks.azureml.DatastoreUpload", "prefect.tasks.azureml.DatastoreGet" ]
[((371, 396), 'unittest.mock.MagicMock', 'MagicMock', ([], {'spec': 'Workspace'}), '(spec=Workspace)\n', (380, 396), False, 'from unittest.mock import MagicMock\n'), ((547, 639), 'prefect.tasks.azureml.DatastoreRegisterBlobContainer', 'DatastoreRegisterBlobContainer', ([], {'workspace': 'mock_workspace', 'container_nam...
from fontTools.ttLib import TTFont class TTFTool: def __init__(self, font_path): self._font = TTFont(font_path) def char_exists(self, unicode_char) -> bool: for cmap in self._font['cmap'].tables: if cmap.isUnicode() and ord(unicode_char) in cmap.cmap: return True ...
[ "fontTools.ttLib.TTFont" ]
[((108, 125), 'fontTools.ttLib.TTFont', 'TTFont', (['font_path'], {}), '(font_path)\n', (114, 125), False, 'from fontTools.ttLib import TTFont\n')]
import pandas as pd import numpy as np from sklearn.metrics.pairwise import cosine_similarity from sklearn.preprocessing import MinMaxScaler df = pd.read_csv('Database fields - RecommendationMatrix.csv') df.index = df['Unnamed: 0'] df = df.drop(columns ='Unnamed: 0') df = df.fillna(0) def Standarize(row): new_row...
[ "pandas.read_csv", "sklearn.metrics.pairwise.cosine_similarity", "pandas.DataFrame" ]
[((147, 204), 'pandas.read_csv', 'pd.read_csv', (['"""Database fields - RecommendationMatrix.csv"""'], {}), "('Database fields - RecommendationMatrix.csv')\n", (158, 204), True, 'import pandas as pd\n'), ((462, 489), 'sklearn.metrics.pairwise.cosine_similarity', 'cosine_similarity', (['df_std.T'], {}), '(df_std.T)\n', ...
#!/usr/bin/env python import zmq def broker(pullAddress, pubAddresses): """ - pullAddress - zmq-style address to pull updates from - pubAddresses - list of zmq-style addresses to publish on """ context = zmq.Context() receiver = context.socket(zmq.PULL) receiver.bind(pullAddress) publis...
[ "optparse.OptionParser", "zmq.Context" ]
[((225, 238), 'zmq.Context', 'zmq.Context', ([], {}), '()\n', (236, 238), False, 'import zmq\n'), ((666, 691), 'optparse.OptionParser', 'OptionParser', ([], {'usage': 'usage'}), '(usage=usage)\n', (678, 691), False, 'from optparse import OptionParser\n')]
# -*- coding: utf-8 -*- import logging import time from aiohttp import web from fundingapi.utils import generate_key_pair from fundingapi.utils import is_address_valid from ...schema import createPairRequest from ...schema import validate logger = logging.getLogger(__name__) @validate(createPairRequest) async def...
[ "fundingapi.utils.generate_key_pair", "time.time", "aiohttp.web.json_response", "fundingapi.utils.is_address_valid", "logging.getLogger" ]
[((252, 279), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (269, 279), False, 'import logging\n'), ((713, 732), 'fundingapi.utils.generate_key_pair', 'generate_key_pair', ([], {}), '()\n', (730, 732), False, 'from fundingapi.utils import generate_key_pair\n'), ((1114, 1183), 'aiohttp.we...
# Copyright 2020 The Magenta 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 ...
[ "tensorflow.compat.v1.pad", "fractions.gcd", "magenta.music.mfcc_mel.SpectrogramToMelMatrix", "tensorflow.compat.v1.rank", "tensorflow.compat.v1.signal.linear_to_mel_weight_matrix", "tensorflow.compat.v1.log", "tensorflow.compat.v1.signal.frame", "tensorflow.compat.v1.matmul", "tensorflow.compat.v1....
[((3488, 3521), 'tensorflow.compat.v1.pad', 'tf.pad', (['signal_tensor', 'pad_values'], {}), '(signal_tensor, pad_values)\n', (3494, 3521), True, 'import tensorflow.compat.v1 as tf\n'), ((3543, 3584), 'tensorflow.compat.v1.matmul', 'tf.matmul', (['padded_signal', 'real_dft_tensor'], {}), '(padded_signal, real_dft_tenso...
# Author: <NAME> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 op...
[ "sickbeard.helpers.makeDir", "sickbeard.helpers.chmodAsParent", "sickbeard.helpers.sanitizeFileName", "sickbeard.searchQueueScheduler.action.add_item", "sickbeard.search_queue.BacklogQueueItem", "sickbeard.logger.log", "sickbeard.ROOT_DIRS.split" ]
[((1554, 1618), 'sickbeard.logger.log', 'logger.log', (['u"""Starting trakt show watchlist check"""', 'logger.DEBUG'], {}), "(u'Starting trakt show watchlist check', logger.DEBUG)\n", (1564, 1618), False, 'from sickbeard import logger, db\n'), ((3340, 3407), 'sickbeard.logger.log', 'logger.log', (['u"""Starting trakt e...
import logging from compas.datastructures import Mesh from compas.geometry import Frame import compas_fab from compas_fab.robots import * from compas_fab.robots import rfl from compas_fab.backends import VrepClient # Configure logging to DEBUG to see detailed timing of the path planning logging.basicConfig(level=log...
[ "compas_fab.backends.VrepClient", "logging.basicConfig", "compas_fab.get", "compas_fab.robots.rfl.Robot", "compas.geometry.Frame" ]
[((291, 331), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (310, 331), False, 'import logging\n'), ((392, 443), 'compas.geometry.Frame', 'Frame', (['(7.453, 2.905, 0.679)', '(1, 0, 0)', '(0, -1, 0)'], {}), '((7.453, 2.905, 0.679), (1, 0, 0), (0, -1, 0))\n', ...
# -*- coding: utf-8 -*- """ Created on 01/26/2022 @author: maxcurie """ import numpy as np import csv from mpi4py import MPI from Dispersion import VectorFinder_auto_Extensive from MPI_tools import task_dis comm=MPI.COMM_WORLD rank=comm.Get_rank() size=comm.Get_size() print('*******rank='+str(rank)+'*************'...
[ "csv.writer", "MPI_tools.task_dis", "numpy.imag", "numpy.arange", "Dispersion.VectorFinder_auto_Extensive", "numpy.real", "numpy.random.shuffle" ]
[((455, 480), 'numpy.arange', 'np.arange', (['(0.1)', '(10.0)', '(0.5)'], {}), '(0.1, 10.0, 0.5)\n', (464, 480), True, 'import numpy as np\n'), ((492, 514), 'numpy.arange', 'np.arange', (['(1)', '(2.5)', '(0.2)'], {}), '(1, 2.5, 0.2)\n', (501, 514), True, 'import numpy as np\n'), ((526, 550), 'numpy.arange', 'np.arange...
"""@author: <NAME> <<EMAIL>>""" import os.path import tempfile import resource import subprocess import borg logger = borg.get_logger(__name__, default_level = "INFO") def normalized_claspre_names(raw_names): """Convert names from claspre to "absolute" names.""" parent = None names = [] for raw_nam...
[ "tempfile.NamedTemporaryFile", "borg.domains.asp.run_lp2sat", "borg.util.call_capturing", "borg.util.check_call_capturing", "borg.get_accountant", "resource.getrusage", "borg.get_logger", "borg.domains.sat.features.get_features_for" ]
[((120, 167), 'borg.get_logger', 'borg.get_logger', (['__name__'], {'default_level': '"""INFO"""'}), "(__name__, default_level='INFO')\n", (135, 167), False, 'import borg\n'), ((1205, 1270), 'borg.util.check_call_capturing', 'borg.util.check_call_capturing', (["[claspre_path, '--list-features']"], {}), "([claspre_path,...
# The MIT License (MIT) # # Copyright (c) 2019 <NAME> for Adafruit Industries LLC # # 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 right...
[ "neopixel.NeoPixel" ]
[((2068, 2194), 'neopixel.NeoPixel', 'neopixel.NeoPixel', (['pixel_pin', '(self.rows * self.columns)'], {'brightness': 'brightness', 'auto_write': '(False)', 'pixel_order': 'neopixel.GRB'}), '(pixel_pin, self.rows * self.columns, brightness=\n brightness, auto_write=False, pixel_order=neopixel.GRB)\n', (2085, 2194),...
from __future__ import unicode_literals import unittest, vmraid from vmraid.modules import patch_handler class TestPatches(unittest.TestCase): def test_patch_module_names(self): vmraid.flags.final_patches = [] vmraid.flags.in_install = True for patchmodule in patch_handler.get_all_patches(): if patchmodule.s...
[ "vmraid.modules.patch_handler.get_all_patches" ]
[((268, 299), 'vmraid.modules.patch_handler.get_all_patches', 'patch_handler.get_all_patches', ([], {}), '()\n', (297, 299), False, 'from vmraid.modules import patch_handler\n')]
import os, sys import numpy as np import time import glob import random import math from typing import Any, Callable, cast, Dict, List, Optional, Tuple from PIL import Image import pickle import torch as tc from torchvision import transforms from torchvision import datasets #from torchvision.datasets.folder import de...
[ "numpy.random.seed", "numpy.sum", "torch.utils.data.DataLoader", "random.shuffle", "accimage.Image", "torchvision.transforms.ToPILImage", "torch.cat", "time.time", "PIL.Image.open", "numpy.cumsum", "data.get_aug_tforms", "random.seed", "torchvision.transforms.Compose", "pickle.load", "to...
[((1242, 1262), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (1256, 1262), True, 'import numpy as np\n'), ((1277, 1306), 'numpy.random.permutation', 'np.random.permutation', (['n_data'], {}), '(n_data)\n', (1298, 1306), True, 'import numpy as np\n'), ((1951, 1968), 'random.seed', 'random.seed', ([...
# -*- coding: utf-8 -*- # Copyright 2020 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """ The get_path lookup plugin """ from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = """ name: get_path author:...
[ "ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate.AnsibleArgSpecValidator", "ansible_collections.ansible.utils.plugins.module_utils.common.get_path.get_path", "ansible.errors.AnsibleLookupError" ]
[((5129, 5203), 'ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate.AnsibleArgSpecValidator', 'AnsibleArgSpecValidator', ([], {'data': 'terms', 'schema': 'DOCUMENTATION', 'name': '"""get_path"""'}), "(data=terms, schema=DOCUMENTATION, name='get_path')\n", (5152, 5203), False, 'from ansible_c...
""" Functions to load xps data from measurement files """ import numpy as np import matplotlib.pyplot as plt from heuslertools.tools.measurement import Measurement from heuslertools.tem.ser_reader import serReader class TEMMeasurement(Measurement): """Object representing a Measurement Parameters ---------...
[ "heuslertools.tem.ser_reader.serReader" ]
[((621, 641), 'heuslertools.tem.ser_reader.serReader', 'serReader', (['self.file'], {}), '(self.file)\n', (630, 641), False, 'from heuslertools.tem.ser_reader import serReader\n'), ((1002, 1017), 'heuslertools.tem.ser_reader.serReader', 'serReader', (['file'], {}), '(file)\n', (1011, 1017), False, 'from heuslertools.te...
import math import sys def merge(arr, l, m, r): n1 = m - l + 1 n2 = r- m L = [0] * (n1) R = [0] * (n2) for i in range(0 , n1): L[i] = arr[l + i] for j in range(0 , n2): R[j] = arr[m + 1 + j] i = 0 j = 0 k = l while i < n1 and j < n2 : if L[i] <= R[j]: arr[k] = L[i] i += 1...
[ "math.floor", "sys.stdin.readlines" ]
[((627, 648), 'sys.stdin.readlines', 'sys.stdin.readlines', ([], {}), '()\n', (646, 648), False, 'import sys\n'), ((516, 545), 'math.floor', 'math.floor', (['((l + (r - 1)) / 2)'], {}), '((l + (r - 1)) / 2)\n', (526, 545), False, 'import math\n')]
# Copyright 2021 Dice Finding Authors. 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 applicabl...
[ "numpy.maximum", "numpy.arctan2", "numpy.abs", "numpy.sum", "cv2.solvePnP", "collections.defaultdict", "numpy.linalg.svd", "numpy.linalg.norm", "tensorflow.compat.v2.expand_dims", "DiceConfig.get_local_face_forward", "tensorflow.compat.v2.math.greater", "DiceProjection.get_local_dots_facing_ca...
[((7780, 7812), 'tensorflow.compat.v2.ones_like', 'tf.ones_like', (['idx'], {'dtype': 'tf.bool'}), '(idx, dtype=tf.bool)\n', (7792, 7812), True, 'import tensorflow.compat.v2 as tf\n'), ((7879, 7916), 'tensorflow.compat.v2.boolean_mask', 'tf.boolean_mask', (['tensor', 'm'], {'axis': 'axis'}), '(tensor, m, axis=axis)\n',...
import numpy as np from scipy import optimize def circle_fit(coords): """ Find the least squares circle fitting a set of 2D points ``(x,y)``. Parameters ---------- coords : (N, 2) ndarray Set of ``x`` and ``y`` coordinates. Returns ------- centre_i : (2,) The 2D coord...
[ "numpy.mean", "numpy.sqrt", "numpy.sum", "scipy.optimize.leastsq" ]
[((762, 785), 'numpy.mean', 'np.mean', (['coords'], {'axis': '(0)'}), '(coords, axis=0)\n', (769, 785), True, 'import numpy as np\n'), ((849, 918), 'scipy.optimize.leastsq', 'optimize.leastsq', (['residuals', 'c_est'], {'args': '(coords[:, 0], coords[:, 1])'}), '(residuals, c_est, args=(coords[:, 0], coords[:, 1]))\n',...
# # Results generators and caching # import json import gevent import Database import Options import RHUtils import logging from monotonic import monotonic from Language import __ from eventmanager import Evt, EventManager from RHRace import WinCondition Events = EventManager() logger = logging.getLogger(__name__) ...
[ "Database.HeatNode.query.filter_by", "Database.Heat.query.get", "Database.SavedRaceMeta.query.filter_by", "Language.__", "Options.set", "monotonic.monotonic", "Database.Pilot.query.filter", "Database.SavedRaceLap.id.in_", "json.loads", "Database.RaceClass.query.get", "Database.SavedRaceLap.query...
[((266, 280), 'eventmanager.EventManager', 'EventManager', ([], {}), '()\n', (278, 280), False, 'from eventmanager import Evt, EventManager\n'), ((291, 318), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (308, 318), False, 'import logging\n'), ((493, 527), 'Database.SavedRaceMeta.query.a...
# Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 from unittest import TestCase from uw_canvas.utilities import fdao_canvas_override from uw_canvas.sis_import import SISImport from uw_canvas.models import SISImport as SISImportModel from uw_canvas import MissingAccountID import moc...
[ "mock.patch.object", "uw_canvas.sis_import.SISImport", "uw_canvas.models.SISImport" ]
[((717, 763), 'mock.patch.object', 'mock.patch.object', (['SISImport', '"""_post_resource"""'], {}), "(SISImport, '_post_resource')\n", (734, 763), False, 'import mock\n'), ((1471, 1517), 'mock.patch.object', 'mock.patch.object', (['SISImport', '"""_post_resource"""'], {}), "(SISImport, '_post_resource')\n", (1488, 151...
import numpy as np class KITTICategory(object): CLASSES = ['Car', 'Pedestrian', 'Cyclist'] CLASS_MEAN_SIZE = { 'Car': np.array([3.88311640418, 1.62856739989, 1.52563191462]), 'Pedestrian': np.array([0.84422524, 0.66068622, 1.76255119]), 'Cyclist': np.array([1.76282397, 0.59706367, 1...
[ "numpy.array", "numpy.zeros" ]
[((400, 431), 'numpy.zeros', 'np.zeros', (['(NUM_SIZE_CLUSTER, 3)'], {}), '((NUM_SIZE_CLUSTER, 3))\n', (408, 431), True, 'import numpy as np\n'), ((139, 194), 'numpy.array', 'np.array', (['[3.88311640418, 1.62856739989, 1.52563191462]'], {}), '([3.88311640418, 1.62856739989, 1.52563191462])\n', (147, 194), True, 'impor...
import numpy as np x = np.ones((2,2)) print("Original array:") print(x) print("0 on the border and 1 inside in the array") x = np.pad(x, pad_width=1, mode='constant', constant_values=0) print(x)
[ "numpy.pad", "numpy.ones" ]
[((24, 39), 'numpy.ones', 'np.ones', (['(2, 2)'], {}), '((2, 2))\n', (31, 39), True, 'import numpy as np\n'), ((132, 190), 'numpy.pad', 'np.pad', (['x'], {'pad_width': '(1)', 'mode': '"""constant"""', 'constant_values': '(0)'}), "(x, pad_width=1, mode='constant', constant_values=0)\n", (138, 190), True, 'import numpy a...
# --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.11.4 # kernelspec: # display_name: Python 3 # name: python3 # --- # + from pathlib import Path import geopandas as gpd import pandas as pd fro...
[ "pathlib.Path", "geopandas.sjoin", "shapely.geometry.box", "geopandas.read_file" ]
[((366, 378), 'pathlib.Path', 'Path', (['"""data"""'], {}), "('data')\n", (370, 378), False, 'from pathlib import Path\n'), ((1339, 1370), 'geopandas.read_file', 'gpd.read_file', (["FILEPATHS['nta']"], {}), "(FILEPATHS['nta'])\n", (1352, 1370), True, 'import geopandas as gpd\n'), ((1658, 1707), 'geopandas.read_file', '...
#!/usr/bin/env python3 # Copyright 2019 <NAME>. All rights reserved. # Use of this source code is governed by the GNU-GPL # license that can be found in the LICENSE file. # Date created: May 21, 2018 from setuptools import setup, find_packages from extension import __version__ with open('README.md', 'r') as file...
[ "setuptools.find_packages" ]
[((618, 633), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (631, 633), False, 'from setuptools import setup, find_packages\n')]
#!/usr/bin/env python3 """ Test all Mappings """ from unittest import TestCase, main from g2p.mappings import Mapping from g2p.mappings.create_ipa_mapping import create_mapping from g2p.transducer import Transducer class MappingCreationTest(TestCase): def setUp(self): self.mappings = [ {"in...
[ "unittest.main", "g2p.mappings.create_ipa_mapping.create_mapping", "g2p.mappings.Mapping", "g2p.transducer.Transducer" ]
[((3106, 3112), 'unittest.main', 'main', ([], {}), '()\n', (3110, 3112), False, 'from unittest import TestCase, main\n'), ((684, 772), 'g2p.mappings.Mapping', 'Mapping', (['self.mappings'], {'in_lang': '"""eng-ipa"""', 'out_lang': '"""eng-arpabet"""', 'out_delimiter': '""" """'}), "(self.mappings, in_lang='eng-ipa', ou...
"""Steps for features of Oneprovider's spaces. """ from selenium.common.exceptions import NoSuchElementException from pytest_bdd import parsers, given, when, then from tests.gui.utils.generic import implicit_wait, repeat_failed from tests.gui.conftest import SELENIUM_IMPLICIT_WAIT, WAIT_BACKEND __author__ = "<NAME...
[ "tests.gui.utils.generic.implicit_wait", "tests.gui.utils.generic.repeat_failed", "pytest_bdd.parsers.parse" ]
[((492, 542), 'tests.gui.utils.generic.repeat_failed', 'repeat_failed', ([], {'attempts': 'WAIT_BACKEND', 'timeout': '(True)'}), '(attempts=WAIT_BACKEND, timeout=True)\n', (505, 542), False, 'from tests.gui.utils.generic import implicit_wait, repeat_failed\n'), ((1383, 1522), 'pytest_bdd.parsers.parse', 'parsers.parse'...
#!/usr/bin/env python # 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, software # di...
[ "list_resources.list_metric_descriptors", "pytest.fixture", "list_resources.list_monitored_resource_descriptors", "list_resources.list_timeseries", "re.compile" ]
[((1054, 1084), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (1068, 1084), False, 'import pytest\n'), ((1291, 1367), 'list_resources.list_monitored_resource_descriptors', 'list_resources.list_monitored_resource_descriptors', (['client', 'PROJECT_RESOURCE'], {}), '(client, P...
import cv2 import numpy as np ''' This part is just to see how to capture video from Webcam and show it to you cap = cv2.VideoCapture(0) cap.set(3,640) #width cap.set(4,480) #height cap.set(10,100) #brightness while True: success, img = cap.read() cv2.imshow('Video',img) if cv2.waitKey(1) & 0xFF == o...
[ "cv2.GaussianBlur", "cv2.Canny", "cv2.dilate", "cv2.cvtColor", "cv2.waitKey", "numpy.ones", "cv2.imread", "cv2.erode", "cv2.imshow", "cv2.resize" ]
[((354, 404), 'cv2.imread', 'cv2.imread', (['"""D:\\\\Github\\\\python\\\\emilia_small.jpg"""'], {}), "('D:\\\\Github\\\\python\\\\emilia_small.jpg')\n", (364, 404), False, 'import cv2\n'), ((411, 436), 'numpy.ones', 'np.ones', (['(5, 5)', 'np.uint8'], {}), '((5, 5), np.uint8)\n', (418, 436), True, 'import numpy as np\...
import numpy as np from .agent import Agent class RandMinQlearning(Agent): def __init__(self, env, thres, discount=0.9, learning_rate=0.01, epsilon=0.1): super().__init__(env, discount, learning_rate, epsilon) self.name = "RandMin" + str(thres) self.q = np.random.uniform(low=-1, high=1, s...
[ "numpy.random.rand", "numpy.random.uniform", "numpy.max", "numpy.argmax" ]
[((285, 356), 'numpy.random.uniform', 'np.random.uniform', ([], {'low': '(-1)', 'high': '(1)', 'size': '(self.n_states, self.n_actions)'}), '(low=-1, high=1, size=(self.n_states, self.n_actions))\n', (302, 356), True, 'import numpy as np\n'), ((383, 454), 'numpy.random.uniform', 'np.random.uniform', ([], {'low': '(-1)'...
import warnings from collections import namedtuple from typing import List, Union, Tuple, Callable from openeo.util import deep_get from openeo.internal.jupyter import render_component class MetadataException(Exception): pass class Dimension: """Base class for dimensions.""" def __init__(self, type: s...
[ "openeo.util.deep_get", "openeo.internal.jupyter.render_component", "collections.namedtuple" ]
[((2358, 2429), 'collections.namedtuple', 'namedtuple', (['"""Band"""', "['name', 'common_name', 'wavelength_um', 'aliases']"], {}), "('Band', ['name', 'common_name', 'wavelength_um', 'aliases'])\n", (2368, 2429), False, 'from collections import namedtuple\n'), ((12065, 12118), 'openeo.util.deep_get', 'deep_get', (['se...
''' My solution to Triangle Peg Solitaire by <NAME>. https://www.think-maths.co.uk/coin-puzzle https://www.youtube.com/watch?v=TEkJMFTyZwM ''' import random from math import ceil, sqrt ROUNDS = 10 ** 3 BOARD_DIMENSION = 4 CELL_COUNT = BOARD_DIMENSION * (BOARD_DIMENSION + 1) // 2 def main(): scores = [] for _ in ra...
[ "random.choice", "math.sqrt" ]
[((1238, 1264), 'random.choice', 'random.choice', (['moveOptions'], {}), '(moveOptions)\n', (1251, 1264), False, 'import random\n'), ((1614, 1633), 'math.sqrt', 'sqrt', (['(9 + 8 * from_)'], {}), '(9 + 8 * from_)\n', (1618, 1633), False, 'from math import ceil, sqrt\n')]
from __future__ import annotations import requests def get_hackernews_story(story_id: str) -> dict: url = f"https://hacker-news.firebaseio.com/v0/item/{story_id}.json?print=pretty" return requests.get(url).json() def hackernews_top_stories(max_stories: int = 10) -> list[dict]: """ Get the top max_s...
[ "requests.get" ]
[((199, 216), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (211, 216), False, 'import requests\n'), ((484, 501), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (496, 501), False, 'import requests\n')]
""" @file: get_circle_point.py @author: Tatsumi0000 @brief: ブロックサークルと交点サークルを囲むだけで各サークルの座標を取得. """ import cv2.cv2 as cv2 import numpy as np class GetCirclePoint: def __init__(self, window_name=None): """コンストラクタ """ self.CROSS_CIRCLE_POINTS = 16 # 交点サークルの個数 self.BLOCK_CIRCLE_POINT...
[ "cv2.cv2.namedWindow", "cv2.cv2.destroyAllWindows", "cv2.cv2.circle", "cv2.cv2.waitKey", "numpy.copy", "cv2.cv2.line", "numpy.empty", "cv2.cv2.rectangle", "cv2.cv2.setMouseCallback", "numpy.zeros", "cv2.cv2.moveWindow", "numpy.array", "cv2.cv2.imread", "cv2.cv2.imshow" ]
[((8904, 8919), 'cv2.cv2.imread', 'cv2.imread', (['img'], {}), '(img)\n', (8914, 8919), True, 'import cv2.cv2 as cv2\n'), ((8964, 8992), 'cv2.cv2.namedWindow', 'cv2.namedWindow', (['window_name'], {}), '(window_name)\n', (8979, 8992), True, 'import cv2.cv2 as cv2\n'), ((8997, 9112), 'cv2.cv2.setMouseCallback', 'cv2.set...
# -------------------------------------------------------- # LightHuBERT: Lightweight and Configurable Speech Representation Learning with Once-for-All Hidden-Unit BERT (https://arxiv.org/pdf/2203.15610.pdf) # Github source: https://github.com/mechanicalsea/lighthubert # Licensed under The MIT License [see LICENSE for ...
[ "torch.nn.Dropout", "math.sqrt", "lighthubert.modules.scaling_linear.SLinear", "torch.jit.is_scripting", "torch.nn.init.xavier_uniform_", "torch.nn.init.xavier_normal_", "torch.empty", "torch.nn.init.constant_", "lighthubert.functional.sliding_attn.slide_window_attention_forward", "torch.Tensor", ...
[((14871, 14895), 'torch.empty', 'torch.empty', (['(2, 5, 768)'], {}), '((2, 5, 768))\n', (14882, 14895), False, 'import torch\n'), ((2024, 2043), 'torch.nn.Dropout', 'nn.Dropout', (['dropout'], {}), '(dropout)\n', (2034, 2043), True, 'import torch.nn as nn\n'), ((4413, 4458), 'torch.nn.init.xavier_uniform_', 'nn.init....
#!/usr/bin/env python # Copyright (C) 2009 <NAME> # # 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...
[ "vte.Terminal", "os.openpty", "shell_event.EventDistributor", "os.environ.copy", "gtk.Window", "shell_event.ObservableCell", "shell.History", "errorgui.set_excepthook", "gtk.main_quit", "struct.pack", "gtk.gdk.Color", "traceback.format_exc", "gtk.window_set_default_icon_name", "shell.Shell...
[((1100, 1112), 'os.openpty', 'os.openpty', ([], {}), '()\n', (1110, 1112), False, 'import os\n'), ((14954, 14998), 'signal.signal', 'signal.signal', (['signal.SIGHUP', 'signal.SIG_IGN'], {}), '(signal.SIGHUP, signal.SIG_IGN)\n', (14967, 14998), False, 'import signal\n'), ((15003, 15053), 'gtk.window_set_default_icon_n...
import sys import os import shutil import urllib.error import urllib.request import zipfile # ダウンロードする def fileDownload(url,filepath): try: urllib.request.urlretrieve(url, filepath) return 0 except urllib.error as e: print(e) print("Failed to download [" + url + "].") sy...
[ "os.mkdir", "zipfile.ZipFile", "os.path.exists", "os.system", "shutil.rmtree", "sys.exit" ]
[((680, 704), 'os.path.exists', 'os.path.exists', (['tempPath'], {}), '(tempPath)\n', (694, 704), False, 'import os\n'), ((760, 778), 'os.mkdir', 'os.mkdir', (['tempPath'], {}), '(tempPath)\n', (768, 778), False, 'import os\n'), ((1790, 1839), 'os.system', 'os.system', (["('.\\\\setruntime.bat ' + sys.exec_prefix)"], {...
from unittest import TestCase from tests import MockApp from i18n.i18n import I18n, translate, is_translation_available class I18nTest(TestCase): @classmethod def setUpClass(klass): I18n(MockApp()) # translation available def test_returns_false_if_translation_not_available_for_symbol(self): ...
[ "i18n.i18n.translate", "tests.MockApp", "i18n.i18n.is_translation_available" ]
[((206, 215), 'tests.MockApp', 'MockApp', ([], {}), '()\n', (213, 215), False, 'from tests import MockApp\n'), ((345, 388), 'i18n.i18n.is_translation_available', 'is_translation_available', (['"""foobar"""', '"""en-US"""'], {}), "('foobar', 'en-US')\n", (369, 388), False, 'from i18n.i18n import I18n, translate, is_tran...
from .base import Base import os class Prune(Base): """Prompts the user to prune their docker environment""" def run(self): os.system("docker system prune")
[ "os.system" ]
[((144, 176), 'os.system', 'os.system', (['"""docker system prune"""'], {}), "('docker system prune')\n", (153, 176), False, 'import os\n')]
#!/usr/bin/env python3 """ Author : <NAME> <<EMAIL>> Date : 2021-03-14 Purpose: Rock the Casbah """ import argparse # -------------------------------------------------- def get_args(): """Get command-line arguments""" parser = argparse.ArgumentParser( description="Jump the Five", formatter...
[ "argparse.ArgumentParser" ]
[((241, 354), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Jump the Five"""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), "(description='Jump the Five', formatter_class=\n argparse.ArgumentDefaultsHelpFormatter)\n", (264, 354), False, 'import argparse\n')]
from intMachine import intMachine import sys from time import sleep from PIL import Image from os import system import imageio ANIMATION = False black_points = set() new_points = set() position = [0,5] direction = 90 TX = 43 TY = 6 cont = 0 pics = [] def paintPoint(position, paint): global black_points, new_...
[ "PIL.Image.new", "intMachine.intMachine", "imageio.imread", "os.system", "sys.exit", "imageio.mimsave" ]
[((1378, 1406), 'intMachine.intMachine', 'intMachine', (['program', '[color]'], {}), '(program, [color])\n', (1388, 1406), False, 'from intMachine import intMachine\n'), ((1836, 1860), 'PIL.Image.new', 'Image.new', (['"""1"""', '(TX, TY)'], {}), "('1', (TX, TY))\n", (1845, 1860), False, 'from PIL import Image\n'), ((91...
# -*- coding: utf-8 -*- """Project Training.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1Kr15oI3Jz958EB30I3We9V278wZnGd83 """ #!pip install tensorflow-gpu import sklearn as sk from sklearn.metrics import confusion_matrix import seaborn as sn...
[ "seaborn.heatmap", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.MaxPooling2D", "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.Dense", "sklearn.model_selection.train_test_split", "os.path.dirname", "tensorflow.keras.callbacks.ModelCheckpoint", "matplotlib.pyplot.figure", ...
[((829, 858), 'google.colab.drive.mount', 'drive.mount', (['"""/content/drive"""'], {}), "('/content/drive')\n", (840, 858), False, 'from google.colab import drive\n'), ((891, 920), 'google.colab.drive.mount', 'drive.mount', (['"""/content/drive"""'], {}), "('/content/drive')\n", (902, 920), False, 'from google.colab i...
""" Lorenz system """ from scipy.integrate import odeint from scipy.stats import norm class lorenz_system_63: def __init__(self, rho = None, sigma = None, beta = None): self.rho = 28.0 self.sigma = 10.0 self.beta = 8.0 / 3.0 self.N = 3 self.x0 = norm.rvs(size = self.N).res...
[ "matplotlib.pyplot.show", "scipy.stats.norm.rvs", "scipy.integrate.odeint", "matplotlib.pyplot.figure", "numpy.arange" ]
[((705, 731), 'numpy.arange', 'np.arange', (['(0.0)', '(40.0)', '(0.01)'], {}), '(0.0, 40.0, 0.01)\n', (714, 731), True, 'import numpy as np\n'), ((745, 768), 'scipy.integrate.odeint', 'odeint', (['ls.f', 'state0', 't'], {}), '(ls.f, state0, t)\n', (751, 768), False, 'from scipy.integrate import odeint\n'), ((780, 792)...
from keras.models import Sequential, Model from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img from keras.layers import Dense, Dropout, Activation, Flatten from keras.layers import Conv2D, MaxPooling2D from keras.utils import np_utils import numpy as np from collections impor...
[ "PIL.Image.new", "numpy.set_printoptions", "numpy.asarray", "numpy.array", "keras.layers.Conv2D", "numpy.swapaxes", "keras.models.Sequential" ]
[((2812, 3309), 'numpy.array', 'np.array', (['[[[[0.0, 1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0, 9.0], [10.0, 11.0, 12.0,\n 13.0, 14.0], [15.0, 16.0, 17.0, 18.0, 19.0], [20.0, 21.0, 22.0, 23.0, \n 24.0]], [[0.0, 1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0, 9.0], [10.0, \n 11.0, 12.0, 13.0, 14.0], [15.0, 16.0, 17....
import numpy as np import tensorflow as tf from tensorflow.contrib.layers import apply_regularization, l2_regularizer class MultiDAE(object): def __init__(self, p_dims, q_dims=None, lam=0.01, lr=1e-3, random_seed=None): self.p_dims = p_dims if q_dims is None: self.q_dims = p_dim...
[ "tensorflow.contrib.layers.xavier_initializer", "tensorflow.contrib.layers.apply_regularization", "tensorflow.reduce_sum", "tensorflow.truncated_normal_initializer", "tensorflow.summary.scalar", "tensorflow.contrib.layers.l2_regularizer", "tensorflow.nn.log_softmax", "tensorflow.train.Saver", "tenso...
[((850, 910), 'tensorflow.placeholder', 'tf.placeholder', ([], {'dtype': 'tf.float32', 'shape': '[None, self.dims[0]]'}), '(dtype=tf.float32, shape=[None, self.dims[0]])\n', (864, 910), True, 'import tensorflow as tf\n'), ((954, 998), 'tensorflow.placeholder_with_default', 'tf.placeholder_with_default', (['(1.0)'], {'s...
#! /usr/bin/env python import colorsys import time import random from rclpy.qos import ( QoSProfile, QoSDurabilityPolicy, QoSHistoryPolicy, QoSReliabilityPolicy, ) from rclpy.node import Node from std_msgs.msg import Header, Char, ColorRGBA, Float32, String from geometry_msgs.msg import TwistStamped, ...
[ "px4_msgs.msg.VehicleCommand", "px4_msgs.msg.TrajectorySetpoint", "rclpy.node.Node", "px4_msgs.msg.OffboardControlMode", "rclpy.qos.QoSProfile" ]
[((680, 906), 'rclpy.qos.QoSProfile', 'QoSProfile', ([], {'history': 'QoSHistoryPolicy.RMW_QOS_POLICY_HISTORY_KEEP_LAST', 'reliability': 'QoSReliabilityPolicy.RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT', 'depth': '(1)', 'durability': 'QoSDurabilityPolicy.RMW_QOS_POLICY_DURABILITY_VOLATILE'}), '(history=QoSHistoryPolicy.RMW...
from cradmin_legacy import crinstance, crapp from cradmin_legacy.crinstance import reverse_cradmin_url from django.http import Http404 from devilry.apps.core.models import Period, Assignment from devilry.devilry_account.models import PeriodPermissionGroup, PermissionGroup from devilry.devilry_admin.cradminextensions i...
[ "devilry.apps.core.models.Assignment.objects.filter", "cradmin_legacy.crinstance.reverse_cradmin_url", "devilry.devilry_account.models.PeriodPermissionGroup.objects.get_devilryrole_for_user_on_period", "django.http.Http404", "devilry.apps.core.models.Period.objects.filter_user_is_admin" ]
[((3545, 3653), 'devilry.devilry_account.models.PeriodPermissionGroup.objects.get_devilryrole_for_user_on_period', 'PeriodPermissionGroup.objects.get_devilryrole_for_user_on_period', ([], {'user': 'self.request.user', 'period': 'period'}), '(user=self.\n request.user, period=period)\n', (3609, 3653), False, 'from de...
"""Setup initial crack schema Revision ID: 406c96d25e5e Revises: Create Date: 2020-07-31 15:23:28.430194+00:00 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '4<PASSWORD>' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### ...
[ "alembic.op.drop_table", "sqlalchemy.Time", "sqlalchemy.Date", "sqlalchemy.LargeBinary", "sqlalchemy.PrimaryKeyConstraint", "sqlalchemy.Text", "sqlalchemy.ForeignKeyConstraint", "sqlalchemy.String", "sqlalchemy.Integer" ]
[((4030, 4055), 'alembic.op.drop_table', 'op.drop_table', (['"""tracktab"""'], {}), "('tracktab')\n", (4043, 4055), False, 'from alembic import op\n'), ((4060, 4082), 'alembic.op.drop_table', 'op.drop_table', (['"""sheet"""'], {}), "('sheet')\n", (4073, 4082), False, 'from alembic import op\n'), ((4087, 4116), 'alembic...
from Trimports import trimport from Trimports.arg_process import parse_argument def main(): file_path = parse_argument() trimport.run(file_path) if __name__ == "__main__": main()
[ "Trimports.arg_process.parse_argument", "Trimports.trimport.run" ]
[((110, 126), 'Trimports.arg_process.parse_argument', 'parse_argument', ([], {}), '()\n', (124, 126), False, 'from Trimports.arg_process import parse_argument\n'), ((131, 154), 'Trimports.trimport.run', 'trimport.run', (['file_path'], {}), '(file_path)\n', (143, 154), False, 'from Trimports import trimport\n')]