code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
import SLIX if SLIX.toolbox.gpu_available: print(SLIX.toolbox.gpu_available) from SLIX.GPU import _toolbox as ntoolbox import cupy from numba import cuda threads_per_block = (1, 1) blocks_per_grid = (1, 1) class TestNumbaToolboxGPU: def test_peak_cleanup(self): test_on...
[ "cupy.all", "cupy.zeros", "cupy.isclose", "cupy.array", "cupy.sum", "SLIX.toolbox.peaks", "numba.cuda.synchronize" ]
[((395, 440), 'cupy.zeros', 'cupy.zeros', (['test_one_peak.shape'], {'dtype': '"""int8"""'}), "(test_one_peak.shape, dtype='int8')\n", (405, 440), False, 'import cupy\n'), ((540, 558), 'numba.cuda.synchronize', 'cuda.synchronize', ([], {}), '()\n', (556, 558), False, 'from numba import cuda\n'), ((717, 762), 'cupy.zero...
import os, csv, json from py2neo import Graph with open("./AWSNEoConfig.json") as c: conf = json.load(c) c.close graph = Graph(conf[0]["NeoParametes"][0]["Url"], auth=(conf[0]["NeoParametes"][0]["Username"], conf[0]["NeoParametes"][0]["Password"])) regions ="US East (Ohio),us-east-2\n\ US East (N. Virginia),us-...
[ "py2neo.Graph", "json.load" ]
[((127, 259), 'py2neo.Graph', 'Graph', (["conf[0]['NeoParametes'][0]['Url']"], {'auth': "(conf[0]['NeoParametes'][0]['Username'], conf[0]['NeoParametes'][0]['Password']\n )"}), "(conf[0]['NeoParametes'][0]['Url'], auth=(conf[0]['NeoParametes'][0][\n 'Username'], conf[0]['NeoParametes'][0]['Password']))\n", (132, ...
#!/usr/bin/env python3 """Test the hashutils module.""" import hashlib import os from shutil import copyfile, rmtree import pytest from bbarchivist import hashutils as bh try: import unittest.mock as mock except ImportError: import mock __author__ = "Thurask" __license__ = "WTFPL v2" __copyright__ = "2015-2...
[ "os.mkdir", "os.remove", "hashlib.sha512", "shutil.rmtree", "hashlib.sha3_256", "hashlib.sha3_384", "os.chdir", "hashlib.sha1", "os.path.exists", "hashlib.sha384", "hashlib.sha256", "pytest.raises", "hashlib.sha224", "bbarchivist.hashutils.verifier_config_loader", "hashlib.md5", "bbarc...
[((489, 515), 'os.chdir', 'os.chdir', (['"""temp_hashutils"""'], {}), "('temp_hashutils')\n", (497, 515), False, 'import os\n'), ((636, 654), 'os.mkdir', 'os.mkdir', (['"""skipme"""'], {}), "('skipme')\n", (644, 654), False, 'import os\n'), ((734, 748), 'os.chdir', 'os.chdir', (['""".."""'], {}), "('..')\n", (742, 748)...
import os import requests from bs4 import BeautifulSoup from fake_useragent import UserAgent class Dictionary: """audio related parts""" def __init__(self, word, files_path='~/.sayit'): self.word = word self.user_agent = UserAgent().random # Random user_agent for http calls self.file...
[ "os.makedirs", "os.path.isdir", "fake_useragent.UserAgent", "os.path.exists", "requests.get", "bs4.BeautifulSoup", "os.path.expanduser" ]
[((329, 359), 'os.path.expanduser', 'os.path.expanduser', (['files_path'], {}), '(files_path)\n', (347, 359), False, 'import os\n'), ((2261, 2295), 'requests.get', 'requests.get', (['uri'], {'headers': 'headers'}), '(uri, headers=headers)\n', (2273, 2295), False, 'import requests\n'), ((248, 259), 'fake_useragent.UserA...
""" Control global computation context """ from __future__ import absolute_import, division, print_function from collections import defaultdict _globals = defaultdict(lambda: None) _globals['callbacks'] = set() class set_options(object): """ Set global state within controled context This lets you specify v...
[ "collections.defaultdict" ]
[((157, 183), 'collections.defaultdict', 'defaultdict', (['(lambda : None)'], {}), '(lambda : None)\n', (168, 183), False, 'from collections import defaultdict\n')]
""" Copyright 2019 Satellite Applications Catapult 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 applica...
[ "sedas_pyapi.sedas_api.SeDASAPI" ]
[((820, 865), 'sedas_pyapi.sedas_api.SeDASAPI', 'SeDASAPI', (['"""bogus"""', '"""<PASSWORD> real password"""'], {}), "('bogus', '<PASSWORD> real password')\n", (828, 865), False, 'from sedas_pyapi.sedas_api import SeDASAPI\n'), ((1009, 1047), 'sedas_pyapi.sedas_api.SeDASAPI', 'SeDASAPI', (['""""""', '"""is not a real p...
#coding=utf-8 ''' Created on 2015-10-23 @author: Devuser ''' from doraemon.project.models import Project,ProjectMember,Product,ProjectModule,Version from gatesidelib.common.simplelogger import SimpleLogger from django.contrib.admin.models import DELETION,CHANGE,ADDITION from business.project.version_service import Ver...
[ "business.project.version_service.VersionService.log_create_activity", "doraemon.project.models.Project.objects.log_action", "doraemon.project.models.Project.objects.all", "doraemon.project.models.ProjectMember.objects.all", "doraemon.project.models.ProjectMember", "random.randint", "doraemon.project.mo...
[((1035, 1082), 'business.project.version_service.VersionService.get_latests_project_ids', 'VersionService.get_latests_project_ids', (['request'], {}), '(request)\n', (1073, 1082), False, 'from business.project.version_service import VersionService\n'), ((1418, 1455), 'business.auth_user.user_service.UserService.is_adm...
from jinja2 import Environment, PackageLoader, select_autoescape from IPython.display import HTML # MODULE INTRODUCTION """This module contains dislay functions to render the different data layers using Jinja2 templates and IPython rendering methods for Jupyter Notebook.""" # GLOBAL VARIABLE DECLARATIONS ENV = Enviro...
[ "jinja2.PackageLoader", "jinja2.select_autoescape" ]
[((338, 379), 'jinja2.PackageLoader', 'PackageLoader', (['"""ga-capstone"""', '"""templates"""'], {}), "('ga-capstone', 'templates')\n", (351, 379), False, 'from jinja2 import Environment, PackageLoader, select_autoescape\n'), ((396, 430), 'jinja2.select_autoescape', 'select_autoescape', (["['html', 'xml']"], {}), "(['...
from abc import ABCMeta import numpy as np from six.moves import xrange import warnings import collections import cleverhans.utils as utils from cleverhans.model import Model, CallableModelWrapper class Attack(object): """ Abstract base class for all attack classes. """ __metaclass__ = ABCMeta ...
[ "tensorflow.abs", "tensorflow.clip_by_value", "tensorflow.placeholder", "tensorflow.square", "cleverhans.model.CallableModelWrapper", "warnings.warn", "tensorflow.reduce_max", "tensorflow.equal" ]
[((3880, 3921), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': 'x_shape'}), '(tf.float32, shape=x_shape)\n', (3894, 3921), True, 'import tensorflow as tf\n'), ((10986, 11027), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': 'x_shape'}), '(tf.float32, shape=x_shape)\n', (11...
import pytest from medicare_appeals.appeals import models from medicare_appeals.tests import factories @pytest.fixture(scope='function') def build_an_appeal(): """ Build a single appeal """ appeal = factories.AppealFactory() @pytest.fixture(scope='function') def build_two_appeals(): """ Buil...
[ "medicare_appeals.appeals.models.Appeal.objects.count", "medicare_appeals.appeals.models.Appeal.objects.all", "pytest.fixture", "medicare_appeals.tests.factories.AppealFactory" ]
[((106, 138), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (120, 138), False, 'import pytest\n'), ((246, 278), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (260, 278), False, 'import pytest\n'), ((217, 242), 'medicare_ap...
from __future__ import absolute_import from theanompi.lib.base import MPI_GPU_Process from mpi4py import MPI server_alpha = 0.5 class EASGD_Server(MPI_GPU_Process): ''' An implementation of the server process in the Elastic Averaging SGD rule https://arxiv.org/abs/1412.6651 implementation ...
[ "theanompi.lib.exchanger.EASGD_Exchanger", "theanompi.lib.helper_funcs.check_model", "importlib.import_module", "theanompi.lib.hwloc_utils.detect_socket_num", "time.time", "theanompi.lib.base.MPI_GPU_Process.__init__", "sys.exit", "theanompi.lib.hwloc_utils.bind_to_socket_mem" ]
[((7467, 7501), 'importlib.import_module', 'importlib.import_module', (['modelfile'], {}), '(modelfile)\n', (7490, 7501), False, 'import importlib\n'), ((461, 499), 'theanompi.lib.base.MPI_GPU_Process.__init__', 'MPI_GPU_Process.__init__', (['self', 'device'], {}), '(self, device)\n', (485, 499), False, 'from theanompi...
from tgbot import plugintest from sample_plugin import TestPlugin class TestPluginTest(plugintest.PluginTestCase): def setUp(self): self.plugin = TestPlugin() self.bot = self.fake_bot( '', plugins=[self.plugin], ) def test_print_commands(self): from cSt...
[ "cStringIO.StringIO", "sample_plugin.TestPlugin" ]
[((160, 172), 'sample_plugin.TestPlugin', 'TestPlugin', ([], {}), '()\n', (170, 172), False, 'from sample_plugin import TestPlugin\n'), ((357, 367), 'cStringIO.StringIO', 'StringIO', ([], {}), '()\n', (365, 367), False, 'from cStringIO import StringIO\n')]
import cv2 import numpy as np import sys, getopt import time import dlib import math i=False class Controller(): def __init__(self): self.detector = dlib.get_frontal_face_detector() self.predictor = dlib.shape_predictor("shape_predictor_68_face_landmarks.dat") self.frame = None self....
[ "cv2.GaussianBlur", "getopt.getopt", "cv2.bitwise_and", "cv2.fillPoly", "cv2.rectangle", "screeninfo.get_monitors", "cv2.imshow", "dlib.shape_predictor", "cv2.line", "cv2.cvtColor", "numpy.append", "numpy.max", "cv2.destroyAllWindows", "cv2.boundingRect", "cv2.resize", "cv2.circle", ...
[((161, 193), 'dlib.get_frontal_face_detector', 'dlib.get_frontal_face_detector', ([], {}), '()\n', (191, 193), False, 'import dlib\n'), ((219, 280), 'dlib.shape_predictor', 'dlib.shape_predictor', (['"""shape_predictor_68_face_landmarks.dat"""'], {}), "('shape_predictor_68_face_landmarks.dat')\n", (239, 280), False, '...
# Copyright (c) The Diem Core Contributors # SPDX-License-Identifier: Apache-2.0 """Provides utilities for working with Diem Testnet. ```python from diem import testnet from diem.testing import LocalAccount # create client connects to testnet client = testnet.create_client() # create faucet for minting coins for y...
[ "requests.Session" ]
[((2967, 2985), 'requests.Session', 'requests.Session', ([], {}), '()\n', (2983, 2985), False, 'import requests\n')]
# coding: utf-8 """ Cloudsmith API The API to the Cloudsmith Service OpenAPI spec version: v1 Contact: <EMAIL> Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import sys import os import re # python 2 and python 3 compatibility libra...
[ "six.iteritems" ]
[((3329, 3356), 'six.iteritems', 'iteritems', (["params['kwargs']"], {}), "(params['kwargs'])\n", (3338, 3356), False, 'from six import iteritems\n'), ((8188, 8215), 'six.iteritems', 'iteritems', (["params['kwargs']"], {}), "(params['kwargs'])\n", (8197, 8215), False, 'from six import iteritems\n'), ((13317, 13344), 's...
""" Books Author model factory. """ import random from factory import DjangoModelFactory, LazyAttribute from books.models import Author from .factory_faker import Faker __all__ = ( 'AuthorFactory', 'LimitedAuthorFactory', 'SingleAuthorFactory', ) class BaseAuthorFactory(DjangoModelFactory): """Ba...
[ "random.randint" ]
[((1036, 1057), 'random.randint', 'random.randint', (['(1)', '(20)'], {}), '(1, 20)\n', (1050, 1057), False, 'import random\n')]
import typing as T from pathlib import Path import re class Globals: cwd = Path(".").absolute() def cd(p: str): Globals.cwd.joinpath(p).absolute() def pwd() -> Path: return Globals.cwd def ls(p: str = ".") -> T.List[Path]: path = Globals.cwd.joinpath(p) return [p for p in path.iterdir()] def ba...
[ "pathlib.Path", "re.compile" ]
[((362, 379), 're.compile', 're.compile', (['regex'], {}), '(regex)\n', (372, 379), False, 'import re\n'), ((80, 89), 'pathlib.Path', 'Path', (['"""."""'], {}), "('.')\n", (84, 89), False, 'from pathlib import Path\n')]
from input_functions import safe_input, numbered_choice from display_funcs import decorate class Location(): def __init__(self, name, short_desc, long_desc, contains=[], level=0, starting_location=False, input_func=safe_input, output_func=print): self.name = name self.short_desc = short_desc ...
[ "input_functions.numbered_choice", "display_funcs.decorate" ]
[((1002, 1016), 'display_funcs.decorate', 'decorate', (['self'], {}), '(self)\n', (1010, 1016), False, 'from display_funcs import decorate\n'), ((709, 862), 'input_functions.numbered_choice', 'numbered_choice', (['"""What/Who/Where would you like to interact with?"""', '[s.name for s in self.contains]', 'self.contains'...
from flask import Blueprint from flask_login import current_user from app.models import Category category_routes= Blueprint('category', __name__) @category_routes.route("") def get_categories(): user_categories = Category.query.filter_by(user_id=current_user.id) default_categories = Category.query.filter_by(...
[ "app.models.Category.query.filter_by", "flask.Blueprint" ]
[((115, 146), 'flask.Blueprint', 'Blueprint', (['"""category"""', '__name__'], {}), "('category', __name__)\n", (124, 146), False, 'from flask import Blueprint\n'), ((220, 269), 'app.models.Category.query.filter_by', 'Category.query.filter_by', ([], {'user_id': 'current_user.id'}), '(user_id=current_user.id)\n', (244, ...
import time from mobyle.common.connection import connection from mobyle.common import users def groupFinder(userid, request): #try to find user in database: user = connection.User.find_one({"email": userid}) if user is not None: groups = user['groups'] if user['admin']: grou...
[ "mobyle.common.connection.connection.User.find_one" ]
[((176, 219), 'mobyle.common.connection.connection.User.find_one', 'connection.User.find_one', (["{'email': userid}"], {}), "({'email': userid})\n", (200, 219), False, 'from mobyle.common.connection import connection\n')]
import sys import os import json import json_lines output_file = 'output.jl' if not os.path.exists(output_file): print('Did not find expected output file!') sys.exit(1) change_id_to_change_number = {} with open(output_file, 'rb') as fp: for item in json_lines.reader(fp): if 'ChangeIdToChangeNumbe...
[ "json.dump", "json_lines.reader", "os.path.exists", "os.path.join", "sys.exit" ]
[((86, 113), 'os.path.exists', 'os.path.exists', (['output_file'], {}), '(output_file)\n', (100, 113), False, 'import os\n'), ((167, 178), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (175, 178), False, 'import sys\n'), ((264, 285), 'json_lines.reader', 'json_lines.reader', (['fp'], {}), '(fp)\n', (281, 285), False,...
# -*- coding: utf8 -*- import kfp def flip_coin(): return kfp.dsl.ContainerOp( name='Flip a coin', image='python:alpine3.6', command=['python', '-c', """ import random res = "heads" if random.randint(0, 1) == 0 else "tails" with open('/output', 'w') as f: f.write(res) """], ...
[ "kfp.dsl.ContainerOp", "kfp.dsl.pipeline", "kfp.compiler.Compiler", "kfp.dsl.Condition" ]
[((743, 804), 'kfp.dsl.pipeline', 'kfp.dsl.pipeline', ([], {'name': '"""Coin-flip"""', 'description': '"""Flip a coin"""'}), "(name='Coin-flip', description='Flip a coin')\n", (759, 804), False, 'import kfp\n'), ((65, 342), 'kfp.dsl.ContainerOp', 'kfp.dsl.ContainerOp', ([], {'name': '"""Flip a coin"""', 'image': '"""py...
import pandas as pd from dateutil.parser import parse import numpy as np from pandas_datareader.base import _BaseReader import json import re class GoogleQuotesReader(_BaseReader): """Get current google quote""" @property def url(self): return 'http://www.google.com/finance/info' @property...
[ "dateutil.parser.parse", "re.search" ]
[((628, 652), 're.search', 're.search', (['"""// """', 'buffer'], {}), "('// ', buffer)\n", (637, 652), False, 'import re\n'), ((836, 850), 'dateutil.parser.parse', 'parse', (["x['lt']"], {}), "(x['lt'])\n", (841, 850), False, 'from dateutil.parser import parse\n')]
import matplotlib.pyplot as plt import pandas as pd def main(): if 0: data = pd.read_html("https://csdms.colorado.edu/wiki/CSDMS_models_by_numbers")[ 2 ] languages = pd.DataFrame( {"Count": data["Count"].values}, index=data["Program language"] ) lan...
[ "pandas.read_html", "pandas.DataFrame", "matplotlib.pyplot.show", "pandas.read_csv", "matplotlib.pyplot.pie" ]
[((728, 832), 'matplotlib.pyplot.pie', 'plt.pie', (["languages['Count']"], {'autopct': '"""%1.1f%%"""', 'labels': 'languages.index', 'explode': 'explode', 'shadow': '(True)'}), "(languages['Count'], autopct='%1.1f%%', labels=languages.index,\n explode=explode, shadow=True)\n", (735, 832), True, 'import matplotlib.py...
import os import shutil path = r'C:\Users\<NAME>\Desktop\Work' destination = 'F:\\HERE' allfile = os.listdir(path) for f in allfile: if f[-3:] == 'txt': #print(f) source = os.path.join(path,f) dest = os.path.join(destination,f) print(source) print(dest) ...
[ "shutil.copy2", "os.path.join", "os.listdir" ]
[((104, 120), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (114, 120), False, 'import os\n'), ((206, 227), 'os.path.join', 'os.path.join', (['path', 'f'], {}), '(path, f)\n', (218, 227), False, 'import os\n'), ((243, 271), 'os.path.join', 'os.path.join', (['destination', 'f'], {}), '(destination, f)\n', (255...
from rubenesque.codecs.sec import encode, decode from rubenesque.signatures import ecdsa import rubenesque.curves from hashlib import sha256 from ..formatters import encode_sig, decode_sig from ...convert import int_to_hex_str from .common import point_to_hex_str, split_str_to_halves from .errors import ( UnknownP...
[ "rubenesque.signatures.ecdsa.verify" ]
[((2390, 2426), 'rubenesque.signatures.ecdsa.verify', 'ecdsa.verify', (['pub_key_point', 'h', 'r', 's'], {}), '(pub_key_point, h, r, s)\n', (2402, 2426), False, 'from rubenesque.signatures import ecdsa\n')]
from datetime import date from io import BytesIO from django.core.mail import send_mail from django.http import HttpResponse from django.template import loader from django.template.loader import get_template from xhtml2pdf import pisa from .models import * def match_skill(job_list, skill_list, preferred_job_list): ...
[ "io.BytesIO", "django.core.mail.send_mail", "django.template.loader.render_to_string", "datetime.date.today", "django.template.loader.get_template" ]
[((2297, 2309), 'datetime.date.today', 'date.today', ([], {}), '()\n', (2307, 2309), False, 'from datetime import date\n'), ((2953, 2979), 'django.template.loader.get_template', 'get_template', (['template_src'], {}), '(template_src)\n', (2965, 2979), False, 'from django.template.loader import get_template\n'), ((3029,...
#!/usr/bin/env python # Program: $Id: $ # Author: <NAME> <<EMAIL>> # Description: Example use of sc_warts_writer library. # import sys import time from sc_warts_writer import WartsWriter, WartsTrace if __name__ == "__main__": assert len(sys.argv) == 2 now = time.time() w = WartsWriter(sys.argv[...
[ "sc_warts_writer.WartsWriter", "sc_warts_writer.WartsTrace", "time.time" ]
[((281, 292), 'time.time', 'time.time', ([], {}), '()\n', (290, 292), False, 'import time\n'), ((299, 323), 'sc_warts_writer.WartsWriter', 'WartsWriter', (['sys.argv[1]'], {}), '(sys.argv[1])\n', (310, 323), False, 'from sc_warts_writer import WartsWriter, WartsTrace\n'), ((407, 419), 'sc_warts_writer.WartsTrace', 'War...
from portfolio_admin.models import Project from rest_framework import serializers class ProjectSerializer(serializers.ModelSerializer): skills = serializers.StringRelatedField(many=True) class Meta: model = Project exclude = ['id', 'created_at', 'updated_at', 'portfolio', 'private']
[ "rest_framework.serializers.StringRelatedField" ]
[((151, 192), 'rest_framework.serializers.StringRelatedField', 'serializers.StringRelatedField', ([], {'many': '(True)'}), '(many=True)\n', (181, 192), False, 'from rest_framework import serializers\n')]
from __future__ import absolute_import from __future__ import division from __future__ import print_function import shutil import sys import tempfile from observations.r.friendship import friendship def test_friendship(): """Test module friendship.py by downloading friendship.csv and testing shape of extrac...
[ "shutil.rmtree", "tempfile.mkdtemp", "observations.r.friendship.friendship" ]
[((374, 392), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {}), '()\n', (390, 392), False, 'import tempfile\n'), ((415, 436), 'observations.r.friendship.friendship', 'friendship', (['test_path'], {}), '(test_path)\n', (425, 436), False, 'from observations.r.friendship import friendship\n'), ((493, 517), 'shutil.rmtree'...
# ============================================================================ # ~/cerebstats/cerebstats/stat_scores/chi2GOFScore.py # # This py-file contains custum score functions initiated by # # from cerebstats import scoreScores # from cerebstats.scoreScores import ABCScore # ======================================...
[ "numpy.array", "scipy.stats.chisquare" ]
[((5745, 5807), 'scipy.stats.chisquare', 'chisquare', (["observation['observed_freq']"], {'f_exp': 'expected_counts'}), "(observation['observed_freq'], f_exp=expected_counts)\n", (5754, 5807), False, 'from scipy.stats import chisquare\n'), ((5377, 5414), 'numpy.array', 'np.array', (["prediction['probabilities']"], {}),...
""" A simple script for generating sample data for learning to give personalised offers. """ import json import pandas as pd import numpy as np import gzip import random import logging GENERATE_INBALANCED_DATA = False NUM_INTERACTIONS_PER_USER = 3 FIRST_TIMESTAMP = 1591803782 # 2020-06-10, 18:43:02 LAST_TIMESTAMP = ...
[ "pandas.DataFrame", "json.load", "numpy.random.seed", "gzip.open", "logging.basicConfig", "random.seed", "numpy.arange", "numpy.random.choice", "numpy.random.shuffle" ]
[((880, 904), 'random.seed', 'random.seed', (['RANDOM_SEED'], {}), '(RANDOM_SEED)\n', (891, 904), False, 'import random\n'), ((909, 936), 'numpy.random.seed', 'np.random.seed', (['RANDOM_SEED'], {}), '(RANDOM_SEED)\n', (923, 936), True, 'import numpy as np\n'), ((1803, 1832), 'numpy.random.shuffle', 'np.random.shuffle'...
import mock import unittest from mock import patch, Mock, MagicMock import boto3 from botocore.stub import Stubber import sys sys.path.append("..") import awslambda class TestHandler(unittest.TestCase): def test_handler(self): """ Test the handler operates as expected. """ pass ...
[ "sys.path.append", "unittest.main" ]
[((127, 148), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (142, 148), False, 'import sys\n'), ((512, 527), 'unittest.main', 'unittest.main', ([], {}), '()\n', (525, 527), False, 'import unittest\n')]
from kmodes.util.dissim import num_TZ_dissim,cat_TZ_dissim from sklearn.decomposition import PCA import numpy centroid = [ [1,2,3], [5,6,6] ] Xnum = [ [54,2,44], [89,6,4], [1.5,0,-5], [5346,874,212] ] centroid = numpy.array(centroid) Xnum = numpy.array(Xnum) x = numpy.array([[1,2,3],[2,3,3],[12...
[ "numpy.array", "sklearn.decomposition.PCA" ]
[((236, 257), 'numpy.array', 'numpy.array', (['centroid'], {}), '(centroid)\n', (247, 257), False, 'import numpy\n'), ((265, 282), 'numpy.array', 'numpy.array', (['Xnum'], {}), '(Xnum)\n', (276, 282), False, 'import numpy\n'), ((288, 360), 'numpy.array', 'numpy.array', (['[[1, 2, 3], [2, 3, 3], [12938, 9999, 666], [54,...
""" The Sims 4 Community Library is licensed under the Creative Commons Attribution 4.0 International public license (CC BY 4.0). https://creativecommons.org/licenses/by/4.0/ https://creativecommons.org/licenses/by/4.0/legalcode Copyright (c) COLONOLNUTTY """ from typing import Union, List, Tuple, Iterator from buffs...
[ "sims4communitylib.utils.sims.common_sim_utils.CommonSimUtils.get_sim_id", "sims4communitylib.utils.common_component_utils.CommonComponentUtils.get_component", "server_commands.argument_helpers.get_optional_target", "sims4communitylib.utils.sims.common_sim_name_utils.CommonSimNameUtils.get_full_name", "sims...
[((13429, 13486), 'sims4.commands.Command', 'Command', (['"""s4clib.add_buff"""'], {'command_type': 'CommandType.Live'}), "('s4clib.add_buff', command_type=CommandType.Live)\n", (13436, 13486), False, 'from sims4.commands import Command, CommandType, CheatOutput\n'), ((14683, 14743), 'sims4.commands.Command', 'Command'...
# Copyright 2008-2010 Nokia Siemens Networks Oyj # # 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...
[ "sys.path.append", "os.path.abspath", "os.path.basename", "os.path.dirname", "os.path.exists", "sys.path.insert", "os.environ.get", "os.path.normpath", "os.path.join" ]
[((1511, 1536), 'os.path.dirname', 'os.path.dirname', (['ROBOTDIR'], {}), '(ROBOTDIR)\n', (1526, 1536), False, 'import os\n'), ((2062, 2090), 'os.environ.get', 'os.environ.get', (['"""PYTHONPATH"""'], {}), "('PYTHONPATH')\n", (2076, 2090), False, 'import os\n'), ((1472, 1497), 'os.path.abspath', 'os.path.abspath', (['_...
"""Tests for log_linear_exp function.""" import chex import jax import jax.numpy as jnp import numpy as np from vmcnet.utils.log_linear_exp import log_linear_exp import vmcnet.utils.slog_helpers as slog_helpers def test_log_linear_exp_shape(): """Test output shape of log linear exp.""" signs = jnp.ones((5, ...
[ "jax.numpy.array", "vmcnet.utils.slog_helpers.array_to_slog", "jax.numpy.isfinite", "jax.numpy.log", "chex.assert_shape", "jax.random.normal", "jax.numpy.dot", "numpy.testing.assert_allclose", "jax.random.PRNGKey", "jax.numpy.ones", "jax.numpy.zeros", "vmcnet.utils.log_linear_exp.log_linear_ex...
[((307, 329), 'jax.numpy.ones', 'jnp.ones', (['(5, 2, 4, 3)'], {}), '((5, 2, 4, 3))\n', (315, 329), True, 'import jax.numpy as jnp\n'), ((341, 364), 'jax.numpy.zeros', 'jnp.zeros', (['(5, 2, 4, 3)'], {}), '((5, 2, 4, 3))\n', (350, 364), True, 'import jax.numpy as jnp\n'), ((379, 395), 'jax.numpy.ones', 'jnp.ones', (['(...
# Copyright 2015 Hewlett-Packard Development Company, L.P. # # 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...
[ "proliantutils.hpssa.manager.delete_configuration", "proliantutils.hpssa.manager.erase_devices", "proliantutils.hpsum.hpsum_controller.update_firmware", "proliantutils.hpssa.manager.create_configuration" ]
[((2978, 3044), 'proliantutils.hpssa.manager.create_configuration', 'hpssa_manager.create_configuration', ([], {'raid_config': 'target_raid_config'}), '(raid_config=target_raid_config)\n', (3012, 3044), True, 'from proliantutils.hpssa import manager as hpssa_manager\n'), ((3414, 3450), 'proliantutils.hpssa.manager.dele...
import pyopencl as cl import pyopencl.array as cl_array import numpy import numpy.linalg as la a = numpy.random.rand(50000).astype(numpy.float32) b = numpy.random.rand(50000).astype(numpy.float32) ctx = cl.create_some_context() queue = cl.CommandQueue(ctx) a_dev = cl_array.to_device(queue, a) b_dev = cl_array.to_dev...
[ "pyopencl.array.empty_like", "pyopencl.create_some_context", "pyopencl.array.to_device", "pyopencl.CommandQueue", "pyopencl.Program", "numpy.random.rand" ]
[((205, 229), 'pyopencl.create_some_context', 'cl.create_some_context', ([], {}), '()\n', (227, 229), True, 'import pyopencl as cl\n'), ((238, 258), 'pyopencl.CommandQueue', 'cl.CommandQueue', (['ctx'], {}), '(ctx)\n', (253, 258), True, 'import pyopencl as cl\n'), ((268, 296), 'pyopencl.array.to_device', 'cl_array.to_d...
import tensorflow as tf class Scalar_LR(tf.keras.callbacks.Callback): def __init__(self, name, TENSORBOARD_DIR): super().__init__() self.name = name # self.previous_loss = None self.file_writer = tf.summary.create_file_writer(TENSORBOARD_DIR) self.file_writer.set_as_default(...
[ "tensorflow.summary.create_file_writer", "tensorflow.summary.scalar" ]
[((233, 279), 'tensorflow.summary.create_file_writer', 'tf.summary.create_file_writer', (['TENSORBOARD_DIR'], {}), '(TENSORBOARD_DIR)\n', (262, 279), True, 'import tensorflow as tf\n'), ((840, 902), 'tensorflow.summary.scalar', 'tf.summary.scalar', (['"""end_lr"""', "logs['learning rate']"], {'step': 'epoch'}), "('end_...
#!/home/gontz/miniconda3/envs/ih/bin/python3 from itertools import product import click from conf import RACES from src import dbops, procyclingstats @click.command() @click.argument("items") @click.option("-v", "--verbose", is_flag=True) def scrape(items, verbose): """Scrape ITEMS from procyclingstats.com.""" ...
[ "src.dbops.check_exists", "src.procyclingstats.get_rider", "src.procyclingstats.get_stage", "click.argument", "src.dbops.insert_rider", "src.dbops.insert_stage", "conf.RACES.items", "click.option", "click.UsageError", "click.command", "click.echo", "src.dbops.fetch_stages", "itertools.produc...
[((154, 169), 'click.command', 'click.command', ([], {}), '()\n', (167, 169), False, 'import click\n'), ((171, 194), 'click.argument', 'click.argument', (['"""items"""'], {}), "('items')\n", (185, 194), False, 'import click\n'), ((196, 241), 'click.option', 'click.option', (['"""-v"""', '"""--verbose"""'], {'is_flag': ...
from __future__ import annotations from dataclasses import dataclass from dataclasses import field from ..ec2common.ec2exceptions import * @dataclass class NetworkInterfaceAttributes: Association: object = None Attachment: object = None Description: str = None Groups: object = field(default_factory=...
[ "dataclasses.field" ]
[((298, 325), 'dataclasses.field', 'field', ([], {'default_factory': 'list'}), '(default_factory=list)\n', (303, 325), False, 'from dataclasses import field\n'), ((354, 381), 'dataclasses.field', 'field', ([], {'default_factory': 'list'}), '(default_factory=list)\n', (359, 381), False, 'from dataclasses import field\n'...
from bs4 import BeautifulSoup import requests import time import pymysql.cursors import unittest from validate_email import validate_email class UnitTestsDataMinerYellowPagesUsa(unittest.TestCase): def test_web_scraper_email_usa(self): activites = [ {'id': '1', 'url': 'https://...
[ "unittest.main", "validate_email.validate_email", "time.sleep", "requests.get", "bs4.BeautifulSoup" ]
[((15377, 15392), 'unittest.main', 'unittest.main', ([], {}), '()\n', (15390, 15392), False, 'import unittest\n'), ((9068, 9085), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (9080, 9085), False, 'import requests\n'), ((9115, 9128), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (9125, 9128), False, '...
# Copyright 2017 gRPC 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 writing...
[ "collections.defaultdict", "threading.Condition", "grpc_testing._channel._rpc_state.State" ]
[((829, 850), 'threading.Condition', 'threading.Condition', ([], {}), '()\n', (848, 850), False, 'import threading\n'), ((878, 907), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (901, 907), False, 'import collections\n'), ((1053, 1117), 'grpc_testing._channel._rpc_state.State', '_rp...
#!/usr/bin/python # # This file is part of Ansible # # Ansible 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 option) any later version. # # Ansible is distribut...
[ "ansible.module_utils.nxos.get_module", "ansible.module_utils.nxos.NetworkModule", "ansible.module_utils.netcfg.ConfigLine", "ansible.module_utils.basic.get_exception" ]
[((9075, 9095), 'ansible.module_utils.nxos.get_module', 'get_module', ([], {}), '(**kwargs)\n', (9085, 9095), False, 'from ansible.module_utils.nxos import get_module\n'), ((9133, 9156), 'ansible.module_utils.nxos.NetworkModule', 'NetworkModule', ([], {}), '(**kwargs)\n', (9146, 9156), False, 'from ansible.module_utils...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django import template from .likert_star_tools import render_stars from django.utils.safestring import mark_safe register = template.Library() # Font-awesome stars ver 3 star_set_3 = { 'star': "<i class='icon-star likert-star'></i>", 'unl...
[ "django.template.Library" ]
[((197, 215), 'django.template.Library', 'template.Library', ([], {}), '()\n', (213, 215), False, 'from django import template\n')]
import sys sys.path.append("PerceptualSimilarity\\") import os import utils import torch import numpy as np from torch import nn import torchgeometry from kornia import color import torch.nn.functional as F from torchvision import transforms class Dense(nn.Module): def __init__(self, in_features, out_features, a...
[ "utils.get_rnd_brightness_torch", "torch.dot", "numpy.ones", "torch.cat", "torch.roll", "utils.random_blur_kernel", "sys.path.append", "torch.nn.BCELoss", "torch.nn.init.kaiming_normal_", "torch.nn.functional.grid_sample", "torch.FloatTensor", "torch.nn.Upsample", "kornia.color.rgb_to_yuv", ...
[((12, 53), 'sys.path.append', 'sys.path.append', (['"""PerceptualSimilarity\\\\"""'], {}), "('PerceptualSimilarity\\\\')\n", (27, 53), False, 'import sys\n'), ((7002, 7067), 'utils.get_rnd_brightness_torch', 'utils.get_rnd_brightness_torch', (['rnd_bri', 'rnd_hue', 'args.batch_size'], {}), '(rnd_bri, rnd_hue, args.bat...
""" (C) Copyright 2021 IBM Corp. 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 d...
[ "unittest.main", "fuse.utils.Seed.set_seed", "random.randint", "fuse.utils.Uniform", "fuse.utils.RandBool", "random.random", "fuse.utils.draw_samples_recursively", "fuse.utils.RandInt", "fuse.utils.Choice" ]
[((4522, 4537), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4535, 4537), False, 'import unittest\n'), ((847, 863), 'fuse.utils.Seed.set_seed', 'Seed.set_seed', (['(0)'], {}), '(0)\n', (860, 863), False, 'from fuse.utils import Uniform, Choice, RandInt, RandBool, draw_samples_recursively, Seed\n'), ((962, 979),...
#!/usr/bin/python import os, sys import string def usage(): print >> sys.stderr, "usage: " + sys.argv[0] + " orthomcl.out base.tree" sys.exit(1) def plausi(): if len(sys.argv) != 3: usage() inOrtho, inTree = sys.argv[1:3] return inOrtho, inTree class OrthoCluster(): def __init__(self, line): desc...
[ "sys.exit" ]
[((140, 151), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (148, 151), False, 'import os, sys\n')]
from ...database import Base from sqlalchemy import Column, Integer, String from sqlalchemy import Column, Integer, String, ForeignKey from sqlalchemy.orm import relationship from sqlalchemy.dialects.postgresql import ARRAY from ...database import Base class ApiKey(Base): api_key_id = Column(Integer, primary_ke...
[ "sqlalchemy.ForeignKey", "sqlalchemy.Column" ]
[((294, 348), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)', 'autoincrement': '(False)'}), '(Integer, primary_key=True, autoincrement=False)\n', (300, 348), False, 'from sqlalchemy import Column, Integer, String, ForeignKey\n'), ((359, 373), 'sqlalchemy.Column', 'Column', (['String'], {}), '(Str...
import sys sys.path.append('..') from tighthash import pmap from testutils import testing_map testing_map("TightHashMap", pmap)
[ "sys.path.append", "testutils.testing_map" ]
[((12, 33), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (27, 33), False, 'import sys\n'), ((97, 130), 'testutils.testing_map', 'testing_map', (['"""TightHashMap"""', 'pmap'], {}), "('TightHashMap', pmap)\n", (108, 130), False, 'from testutils import testing_map\n')]
import json import random import numpy as np from Source.Utility.Pathfinding.Graph import Graph def get_distance_to_players(game_state): own_player = game_state["players"][str(game_state["you"])] distances = [0, 0, 0, 0, 0, 0] current_position = (own_player["x"], own_player["y"]) if game_state["players...
[ "numpy.power", "Source.Utility.Pathfinding.Graph.Graph", "json.loads" ]
[((3807, 3829), 'json.loads', 'json.loads', (['game_state'], {}), '(game_state)\n', (3817, 3829), False, 'import json\n'), ((3842, 3948), 'Source.Utility.Pathfinding.Graph.Graph', 'Graph', (["game_state['cells']", 'x', 'y', "game_state['width']", "game_state['height']", 'new_direction', 'field_size'], {}), "(game_state...
from django.shortcuts import render, redirect from django.contrib import messages from django.http import HttpResponseForbidden from django.contrib.auth.decorators import login_required from .forms import * from .models import * from urllib.request import urlopen, Request import json import random # Create your views...
[ "urllib.request.Request", "django.shortcuts.redirect", "django.contrib.messages.error", "random.choice", "urllib.request.urlopen", "django.shortcuts.render", "django.contrib.messages.success" ]
[((360, 389), 'django.shortcuts.render', 'render', (['request', '"""start.html"""'], {}), "(request, 'start.html')\n", (366, 389), False, 'from django.shortcuts import render, redirect\n'), ((908, 954), 'django.shortcuts.render', 'render', (['request', '"""signup.html"""', "{'form': form}"], {}), "(request, 'signup.htm...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Functions for estimating the precision matrix based on the covariance of either the residuals (temporal based precision matrix) or of the measurements (instance based precision matrix) """ from collections.abc import Iterable import numpy as np from rsatoolbox.data im...
[ "numpy.outer", "numpy.sum", "numpy.eye", "rsatoolbox.util.data_utils.get_unique_inverse", "rsatoolbox.data.average_dataset_by", "numpy.zeros", "numpy.einsum", "numpy.expand_dims", "numpy.mean", "numpy.linalg.inv", "numpy.diag", "numpy.sqrt" ]
[((3735, 3779), 'numpy.zeros', 'np.zeros', (['(matrix.shape[1], matrix.shape[1])'], {}), '((matrix.shape[1], matrix.shape[1]))\n', (3743, 3779), True, 'import numpy as np\n'), ((3793, 3837), 'numpy.zeros', 'np.zeros', (['(matrix.shape[1], matrix.shape[1])'], {}), '((matrix.shape[1], matrix.shape[1]))\n', (3801, 3837), ...
import sys import h5py import numpy as np import torch from torch.autograd import Variable def print_args(args): print("===== Experiment Configuration =====") options = vars(args) for key, value in options.items(): print(f'{key}: {value}') print("====================================") def ran...
[ "numpy.stack", "h5py.File", "numpy.sum", "numpy.zeros", "torch.FloatTensor", "numpy.random.randint", "numpy.random.rand", "numpy.random.shuffle", "numpy.sqrt" ]
[((417, 442), 'numpy.random.randint', 'np.random.randint', (['lo', 'hi'], {}), '(lo, hi)\n', (434, 442), True, 'import numpy as np\n'), ((476, 524), 'numpy.sqrt', 'np.sqrt', (['((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2)'], {}), '((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2)\n', (483, 524), True, 'import numpy as np\n'), ((6...
#!/usr/bin/env python __description__ = 'Decode VBE script' __author__ = '<NAME>' __version__ = '0.0.2' __date__ = '2016/03/29' """ Source code put in public domain by Didier Stevens, no Copyright https://DidierStevens.com Use at your own risk History: 2016/03/28: start 2016/03/29: 0.0.2 added support for ZIP f...
[ "sys.stdout.write", "sys.stdin.read", "textwrap.fill", "optparse.OptionParser", "zipfile.ZipFile", "sys.stdout.fileno", "binascii.a2b_hex", "sys.stdout.flush", "signal.signal", "re.search", "binascii.a2b_base64" ]
[((9354, 9408), 're.search', 're.search', (['"""#@~\\\\^......==(.+)......==\\\\^#~@"""', 'content'], {}), "('#@~\\\\^......==(.+)......==\\\\^#~@', content)\n", (9363, 9408), False, 'import re\n'), ((9565, 9681), 'optparse.OptionParser', 'optparse.OptionParser', ([], {'usage': "('usage: %prog [options] [file]\\n' + __...
import os import time import numpy as np import pandas as pd from nltk import word_tokenize from nltk.util import ngrams import tensorflow as tf from transformers import TFBertModel from transformers import BertTokenizer from transformers import TFBertModel from tensorflow.keras.layers import Dense, Flatten bert_model...
[ "os.listdir", "nltk.util.ngrams", "tensorflow.keras.layers.Dense", "pandas.read_csv", "os.path.exists", "tensorflow.data.Dataset.from_tensor_slices", "transformers.BertTokenizer.from_pretrained", "os.path.join", "nltk.word_tokenize" ]
[((360, 426), 'transformers.BertTokenizer.from_pretrained', 'BertTokenizer.from_pretrained', (['bert_model_name'], {'do_lower_case': '(True)'}), '(bert_model_name, do_lower_case=True)\n', (389, 426), False, 'from transformers import BertTokenizer\n'), ((1281, 1298), 'pandas.read_csv', 'pd.read_csv', (['path'], {}), '(p...
# # Copyright 2021 Open Raven Inc. and the Mockingbird project 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
[ "docx.Document" ]
[((2215, 2225), 'docx.Document', 'Document', ([], {}), '()\n', (2223, 2225), False, 'from docx import Document\n'), ((2897, 2907), 'docx.Document', 'Document', ([], {}), '()\n', (2905, 2907), False, 'from docx import Document\n'), ((3628, 3638), 'docx.Document', 'Document', ([], {}), '()\n', (3636, 3638), False, 'from ...
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of...
[ "primaires.format.fonctions.supprimer_accents", "primaires.interpreteur.editeur.selection.Selection.afficher_apercu", "primaires.interpreteur.editeur.selection.Selection.__init__" ]
[((1967, 2021), 'primaires.interpreteur.editeur.selection.Selection.__init__', 'Selection.__init__', (['self', 'pere', 'objet', 'attribut', 'liste'], {}), '(self, pere, objet, attribut, liste)\n', (1985, 2021), False, 'from primaires.interpreteur.editeur.selection import Selection\n'), ((2192, 2247), 'primaires.interpr...
"""Models instantiated by the vessels api.""" from dataclasses import dataclass from datetime import datetime from typing import Optional @dataclass(frozen=True) class VesselClass: """Vessel class characteristics. Detailed characteristics of each vessel class, including its defining measurement and the r...
[ "dataclasses.dataclass" ]
[((141, 163), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (150, 163), False, 'from dataclasses import dataclass\n'), ((1668, 1690), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (1677, 1690), False, 'from dataclasses import dataclass\n'), (...
from PySide2 import QtWidgets, QtGui, QtCore class RulePartWidget(QtWidgets.QWidget): def __init__(self, parent=None, feature_ranges={'feature X': [0, 100]}, rule_number=-1): QtWidgets.QWidget.__init__(self, parent) self.layout = QtWidgets.QHBoxLayout(self) # combobox self.combo_...
[ "PySide2.QtWidgets.QDoubleSpinBox", "PySide2.QtWidgets.QWidget.__init__", "PySide2.QtWidgets.QLabel", "PySide2.QtWidgets.QComboBox", "PySide2.QtWidgets.QHBoxLayout" ]
[((189, 229), 'PySide2.QtWidgets.QWidget.__init__', 'QtWidgets.QWidget.__init__', (['self', 'parent'], {}), '(self, parent)\n', (215, 229), False, 'from PySide2 import QtWidgets, QtGui, QtCore\n'), ((253, 280), 'PySide2.QtWidgets.QHBoxLayout', 'QtWidgets.QHBoxLayout', (['self'], {}), '(self)\n', (274, 280), False, 'fro...
import numpy as np class LinearConstraints(): def __init__(self, A, b, mode='Intersection'): """ Defines linear functions f(x) = Ax + b. The integration domain is defined as the union of where all of these functions are positive if mode='Union' or the domain where any of the functio...
[ "numpy.dot" ]
[((832, 849), 'numpy.dot', 'np.dot', (['self.A', 'x'], {}), '(self.A, x)\n', (838, 849), True, 'import numpy as np\n')]
from time import sleep from tensorboardX import SummaryWriter with SummaryWriter(logdir='runs/purge') as w: for i in range(100): w.add_scalar('purgetest', i, i) sleep(1.0) with SummaryWriter(logdir='runs/purge', purge_step=42) as w: # event 42~99 are removed (inclusively) for i in range(42, 100):...
[ "tensorboardX.SummaryWriter", "time.sleep" ]
[((175, 185), 'time.sleep', 'sleep', (['(1.0)'], {}), '(1.0)\n', (180, 185), False, 'from time import sleep\n'), ((68, 102), 'tensorboardX.SummaryWriter', 'SummaryWriter', ([], {'logdir': '"""runs/purge"""'}), "(logdir='runs/purge')\n", (81, 102), False, 'from tensorboardX import SummaryWriter\n'), ((192, 241), 'tensor...
# Imports import math import numpy as np import matplotlib.pyplot as plt class ParkingTrajectoryGenerator: # Class Variables # Vehicle Parameters __l = 0.356 # length between front and rear axle in m __b = 0.37 # width of car in m __l_1 = 0.12 # length between front axle and bumper in m _...
[ "numpy.poly1d", "matplotlib.pyplot.show", "numpy.tanh", "math.sqrt", "numpy.degrees", "math.radians", "math.tan", "numpy.zeros", "matplotlib.pyplot.stem", "numpy.ones", "numpy.tan", "numpy.sin", "numpy.linspace", "numpy.cos" ]
[((15864, 15976), 'numpy.zeros', 'np.zeros', (['ParkingTrajectoryGenerator1._ParkingTrajectoryGenerator__parkingTrajectoryPoints_y_rear_axle.size'], {}), '(ParkingTrajectoryGenerator1.\n _ParkingTrajectoryGenerator__parkingTrajectoryPoints_y_rear_axle.size)\n', (15872, 15976), True, 'import numpy as np\n'), ((16330,...
# -*- coding: utf-8 -*- """ Created on Fri Jan 12 13:07:35 2018 @author: Sunny """ import numpy as np import cv2 print(cv2.__version__) TOTAL_CAMERAS=1 HEIGHT = 240 WIDTH = 320 RECORD_WIDTH = WIDTH*3 RECORD_HEIGHT = HEIGHT FPS = 90 cam = [] frame = [] ret = [] rgb = [] i = 0 rgb_current=0 cam = cv2.VideoCapture(0...
[ "cv2.resize", "cv2.VideoWriter_fourcc", "cv2.cvtColor", "cv2.waitKey", "cv2.imshow", "numpy.hstack", "cv2.VideoCapture", "numpy.vstack", "cv2.VideoWriter", "cv2.flip", "cv2.destroyAllWindows", "cv2.namedWindow" ]
[((302, 321), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (318, 321), False, 'import cv2\n'), ((543, 574), 'cv2.VideoWriter_fourcc', 'cv2.VideoWriter_fourcc', (["*'DIVX'"], {}), "(*'DIVX')\n", (565, 574), False, 'import cv2\n'), ((581, 690), 'cv2.VideoWriter', 'cv2.VideoWriter', (['"""C:\\\\Users\\\...
# Generated by Django 2.2.3 on 2019-09-20 05:05 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('cont...
[ "django.db.models.TextField", "django.db.models.OneToOneField", "django.db.migrations.swappable_dependency", "django.db.models.ManyToManyField", "django.db.models.CharField", "django.db.models.AutoField", "django.db.models.DateTimeField" ]
[((247, 304), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (278, 304), False, 'from django.db import migrations, models\n'), ((479, 572), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)...
import discord from discord import Embed from discord.errors import NotFound from discord.ext import commands import requests import asyncio from lib.bot import bot class Filter(commands.Cog): def __init__(self, client: bot): self.client = client @commands.Cog.listener() async def on_message(se...
[ "discord.Embed", "requests.get", "discord.ext.commands.Cog.listener" ]
[((269, 292), 'discord.ext.commands.Cog.listener', 'commands.Cog.listener', ([], {}), '()\n', (290, 292), False, 'from discord.ext import commands\n'), ((389, 492), 'requests.get', 'requests.get', (['f"""https://www.purgomalum.com/service/containsprofanity?text=${message.content}"""'], {}), "(\n f'https://www.purgom...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Master module for dlotter.arguments Called from dlotter.__main__ """ import sys import argparse from argparse import ArgumentDefaultsHelpFormatter class MyParser(argparse.ArgumentParser): def error(self, message): sys.stderr.write('error: %s\n' % message) ...
[ "sys.stderr.write", "sys.exit" ]
[((277, 318), 'sys.stderr.write', 'sys.stderr.write', (["('error: %s\\n' % message)"], {}), "('error: %s\\n' % message)\n", (293, 318), False, 'import sys\n'), ((353, 364), 'sys.exit', 'sys.exit', (['(2)'], {}), '(2)\n', (361, 364), False, 'import sys\n'), ((3387, 3398), 'sys.exit', 'sys.exit', (['(2)'], {}), '(2)\n', ...
import numpy as np from instResp.polezero import polezero from instResp.plotResp import plotResponse import os import logging logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.INFO) logger = logging.getLogger(__name__) ''' This module contains a collection of non-bulletproof codes for cr...
[ "instResp.libNom.RC", "logging.basicConfig", "numpy.logspace", "instResp.polezero.polezero", "numpy.zeros", "instResp.libNom.WA", "instResp.plotResp.plotResponse", "os.path.join", "logging.getLogger", "numpy.sqrt" ]
[((129, 204), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(levelname)s:%(message)s"""', 'level': 'logging.INFO'}), "(format='%(levelname)s:%(message)s', level=logging.INFO)\n", (148, 204), False, 'import logging\n'), ((214, 241), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__n...
# -*- coding: utf-8 -*- # pylint: disable=R0903, C0115 """ log_it.extensions.marshmallow.log --------------------------------- Marshmallow Log Models :copyright: (c) 2021 by <NAME> :license: BSD, see LICENSE for more details """ from datetime import datetime from marshmallow_sqlalchemy import SQ...
[ "marshmallow_sqlalchemy.auto_field", "marshmallow_sqlalchemy.fields.Nested" ]
[((1652, 1664), 'marshmallow_sqlalchemy.auto_field', 'auto_field', ([], {}), '()\n', (1662, 1664), False, 'from marshmallow_sqlalchemy import SQLAlchemyAutoSchema, auto_field\n'), ((1809, 1821), 'marshmallow_sqlalchemy.auto_field', 'auto_field', ([], {}), '()\n', (1819, 1821), False, 'from marshmallow_sqlalchemy import...
# -*- coding: utf-8 -*- import graphene from graphene import relay from graphene_gae import NdbObjectType, NdbConnectionField from messaging.models.accounts import ( Account as AccountModel, create, update, delete, generate_api_key, ) from messaging.models.services import Service as ServiceModel f...
[ "graphene.String", "messaging.models.accounts.Account.query", "graphene.ID", "messaging.models.accounts.generate_api_key", "messaging.utils.pick", "graphene_gae.NdbConnectionField", "messaging.models.accounts.delete", "messaging.models.messages.Message.query", "messaging.models.services.Service.quer...
[((810, 841), 'graphene_gae.NdbConnectionField', 'NdbConnectionField', (['ServiceType'], {}), '(ServiceType)\n', (828, 841), False, 'from graphene_gae import NdbObjectType, NdbConnectionField\n'), ((958, 989), 'graphene_gae.NdbConnectionField', 'NdbConnectionField', (['MessageType'], {}), '(MessageType)\n', (976, 989),...
from datetime import datetime import argparse from config.settings import DEFAULT_TIME_FORMAT def valid_date(date): try: return datetime.strptime(date,DEFAULT_TIME_FORMAT) except ValueError: msg = "Not a valid date: '{0}'.".format(date) raise argparse.ArgumentTypeError(msg)
[ "datetime.datetime.strptime", "argparse.ArgumentTypeError" ]
[((142, 186), 'datetime.datetime.strptime', 'datetime.strptime', (['date', 'DEFAULT_TIME_FORMAT'], {}), '(date, DEFAULT_TIME_FORMAT)\n', (159, 186), False, 'from datetime import datetime\n'), ((282, 313), 'argparse.ArgumentTypeError', 'argparse.ArgumentTypeError', (['msg'], {}), '(msg)\n', (308, 313), False, 'import ar...
"""Crypto API Views""" from typing import Optional from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.serialization import load_pem_private_key from cryptography.x509 import load_pem_x509_certificate from django.http.response import HttpResponse from django.urls import reverse...
[ "rest_framework.fields.IntegerField", "authentik.api.decorators.permission_required", "rest_framework.response.Response", "structlog.stdlib.get_logger", "drf_spectacular.utils.OpenApiResponse", "authentik.crypto.builder.CertificateBuilder", "rest_framework.fields.SerializerMethodField", "rest_framewor...
[((1371, 1383), 'structlog.stdlib.get_logger', 'get_logger', ([], {}), '()\n', (1381, 1383), False, 'from structlog.stdlib import get_logger\n'), ((1498, 1565), 'rest_framework.fields.DateTimeField', 'DateTimeField', ([], {'source': '"""certificate.not_valid_after"""', 'read_only': '(True)'}), "(source='certificate.not...
from django.test import TestCase from django.urls import reverse from rest_framework.test import APIClient from rest_framework import status from core.models import Item from order.serializers import ItemSerializer from core.tests.user_test_utils import create_user from core.tests.order_test_utils import sample_order...
[ "core.models.Item.objects.create", "core.models.Item.objects.filter", "core.tests.order_test_utils.sample_order", "order.serializers.ItemSerializer", "django.urls.reverse", "core.models.Item.objects.all", "rest_framework.test.APIClient", "core.tests.user_test_utils.create_user", "core.tests.order_te...
[((347, 373), 'django.urls.reverse', 'reverse', (['"""order:item-list"""'], {}), "('order:item-list')\n", (354, 373), False, 'from django.urls import reverse\n'), ((454, 465), 'rest_framework.test.APIClient', 'APIClient', ([], {}), '()\n', (463, 465), False, 'from rest_framework.test import APIClient\n'), ((715, 726), ...
from unittest import TestCase from databuild import settings from databuild.adapters.locmem.models import LocMemBook from databuild.functions import data settings.LANGUAGES['noop'] = 'databuild.environments.noop.NoopEnvironment' class FunctionsTestCase(TestCase): def test_cross(self): a_data = [ ...
[ "databuild.functions.data.cross", "databuild.adapters.locmem.models.LocMemBook", "databuild.functions.data.column" ]
[((584, 606), 'databuild.adapters.locmem.models.LocMemBook', 'LocMemBook', (['"""project1"""'], {}), "('project1')\n", (594, 606), False, 'from databuild.adapters.locmem.models import LocMemBook\n'), ((1237, 1259), 'databuild.adapters.locmem.models.LocMemBook', 'LocMemBook', (['"""project1"""'], {}), "('project1')\n", ...
from starcluster.clustersetup import ClusterSetup from starcluster.logger import log class PicardInstaller(ClusterSetup): def run(self, nodes, master, user, user_shell, volumes): for node in nodes: log.info("Installing Picard tools 1.121 on %s" % (node.alias)) node.ssh.execute('wget -c -P /opt/software/picard...
[ "starcluster.logger.log.info" ]
[((205, 265), 'starcluster.logger.log.info', 'log.info', (["('Installing Picard tools 1.121 on %s' % node.alias)"], {}), "('Installing Picard tools 1.121 on %s' % node.alias)\n", (213, 265), False, 'from starcluster.logger import log\n')]
#!/usr/bin/env python3 import argparse import sys from fennec import __version__ as VERSION, __citation__ as CITATION if __name__ == "__main__": parser = argparse.ArgumentParser( prog="fennec", description="Fennec", formatter_class=argparse.ArgumentDefaultsHelpFormatter, ) parser...
[ "argparse.ArgumentParser", "sys.exit" ]
[((162, 282), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""fennec"""', 'description': '"""Fennec"""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), "(prog='fennec', description='Fennec',\n formatter_class=argparse.ArgumentDefaultsHelpFormatter)\n", (185, 282), False, 'impo...
# Generated by Django 2.0.2 on 2018-03-03 02:54 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('Contacts', '0002_auto_20180303_0253'), ] operations = [ migrations.RenameModel( old_name='Contacts', new_name='Contact', ...
[ "django.db.migrations.RenameModel" ]
[((228, 291), 'django.db.migrations.RenameModel', 'migrations.RenameModel', ([], {'old_name': '"""Contacts"""', 'new_name': '"""Contact"""'}), "(old_name='Contacts', new_name='Contact')\n", (250, 291), False, 'from django.db import migrations\n')]
# coding: utf-8 ''' <NAME>ard corpus magnitude check. ''' import io import os def main(): count = 0 for filename in os.listdir('./data/bc_hansard'): with io.open('./data/bc_hansard/%s'%filename, encoding='utf-8') as text_file: count += len(text_file.read().split()) print(count) if __name__ == '__main__': mai...
[ "os.listdir", "io.open" ]
[((119, 150), 'os.listdir', 'os.listdir', (['"""./data/bc_hansard"""'], {}), "('./data/bc_hansard')\n", (129, 150), False, 'import os\n'), ((159, 219), 'io.open', 'io.open', (["('./data/bc_hansard/%s' % filename)"], {'encoding': '"""utf-8"""'}), "('./data/bc_hansard/%s' % filename, encoding='utf-8')\n", (166, 219), Fal...
from PIL import Image, ImageDraw, ImageFont class _Image: @staticmethod def draw_picture_with_text(image_file, text, size, x, y): image = Image.open(image_file) draw = ImageDraw.Draw(image) width_image, height_image = image.size font = ImageFont.truetype("arial.ttf", size=size)...
[ "PIL.ImageDraw.Draw", "PIL.ImageFont.truetype", "PIL.Image.open" ]
[((156, 178), 'PIL.Image.open', 'Image.open', (['image_file'], {}), '(image_file)\n', (166, 178), False, 'from PIL import Image, ImageDraw, ImageFont\n'), ((194, 215), 'PIL.ImageDraw.Draw', 'ImageDraw.Draw', (['image'], {}), '(image)\n', (208, 215), False, 'from PIL import Image, ImageDraw, ImageFont\n'), ((278, 320), ...
# Module file for conductance measurements with the # SR830. Implementing the good ideas of <NAME> from typing import Union, Optional from time import sleep import numpy as np import qcodes as qc from qcodes.instrument.parameter import Parameter from qdev_wrappers.sweep_functions import _do_measurement from qcodes.ins...
[ "qcodes.Task", "qdev_wrappers.sweep_functions._do_measurement", "numpy.linspace", "time.sleep" ]
[((3995, 4011), 'qcodes.Task', 'qc.Task', (['trigger'], {}), '(trigger)\n', (4002, 4011), True, 'import qcodes as qc\n'), ((4029, 4050), 'qcodes.Task', 'qc.Task', (['reset_buffer'], {}), '(reset_buffer)\n', (4036, 4050), True, 'import qcodes as qc\n'), ((4068, 4089), 'qcodes.Task', 'qc.Task', (['start_buffer'], {}), '(...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Role' db.create_table('pta_role', ( ('id', se...
[ "south.db.db.delete_table", "south.db.db.send_create_signal" ]
[((577, 615), 'south.db.db.send_create_signal', 'db.send_create_signal', (['"""pta"""', "['Role']"], {}), "('pta', ['Role'])\n", (598, 615), False, 'from south.db import db\n'), ((1172, 1211), 'south.db.db.send_create_signal', 'db.send_create_signal', (['"""pta"""', "['Staff']"], {}), "('pta', ['Staff'])\n", (1193, 121...
import re from locustio.common_utils import init_logger, confluence_measure logger = init_logger(app_type='confluence') @confluence_measure def app_specific_action(locust): r = locust.client.get('/plugin/report') # navigate to page content = r.content.decode('utf-8') # parse page content token_patter...
[ "locustio.common_utils.init_logger", "re.findall" ]
[((86, 120), 'locustio.common_utils.init_logger', 'init_logger', ([], {'app_type': '"""confluence"""'}), "(app_type='confluence')\n", (97, 120), False, 'from locustio.common_utils import init_logger, confluence_measure\n'), ((402, 444), 're.findall', 're.findall', (['token_pattern_example', 'content'], {}), '(token_pat...
# imports - module imports from ezros.exception import ( EzrosError ) # imports - test imports import pytest def test_ezros_error(): with pytest.raises(EzrosError): raise EzrosError
[ "pytest.raises" ]
[((150, 175), 'pytest.raises', 'pytest.raises', (['EzrosError'], {}), '(EzrosError)\n', (163, 175), False, 'import pytest\n')]
import MySQLdb ''' 数据库实例目前部署一台就可以了,然后通过这个脚本进行数据的同步操作 插入测试数据 每次开发完成新的模块 使用这个脚本 动态的添加数据 ''' # 重新创建模式 为 create 追加数据使用 append 删除并且重新添加 为 refresh DB_OP_MODE = "append" # 数据库链接用户名 MYSQL_CONN_NAME = "mysqlname" #数据库远程链接地址 MYSQL_CONN_ADDR = "mysqllinkpath" #数据库登录密码 MYSQL_CONN_PASSWORD = "<PASSWORD>" #数据库默认的链接编码...
[ "MySQLdb.connect" ]
[((1332, 1426), 'MySQLdb.connect', 'MySQLdb.connect', (['MYSQL_CONN_ADDR', 'MYSQL_CONN_NAME', 'MYSQL_CONN_PASSWORD', 'MYSQL_CONN_CHARSET'], {}), '(MYSQL_CONN_ADDR, MYSQL_CONN_NAME, MYSQL_CONN_PASSWORD,\n MYSQL_CONN_CHARSET)\n', (1347, 1426), False, 'import MySQLdb\n')]
from django.conf.urls import url from alipay.create_direct_pay_by_user.dpn import views urlpatterns = [ url(r'^$', views.dpn, {'item_check_callable': None}, name='alipay-dpn'), ]
[ "django.conf.urls.url" ]
[((110, 180), 'django.conf.urls.url', 'url', (['"""^$"""', 'views.dpn', "{'item_check_callable': None}"], {'name': '"""alipay-dpn"""'}), "('^$', views.dpn, {'item_check_callable': None}, name='alipay-dpn')\n", (113, 180), False, 'from django.conf.urls import url\n')]
from django.shortcuts import render # Create your views here. from rest_framework.viewsets import ReadOnlyModelViewSet from rest_framework_extensions.cache.mixins import CacheResponseMixin from areas.models import Area from areas.serializers import AreaSerializer, SubAreaSerializer class AreasViewSet(CacheResponseM...
[ "areas.models.Area.objects.all", "areas.models.Area.objects.filter" ]
[((704, 736), 'areas.models.Area.objects.filter', 'Area.objects.filter', ([], {'parent': 'None'}), '(parent=None)\n', (723, 736), False, 'from areas.models import Area\n'), ((770, 788), 'areas.models.Area.objects.all', 'Area.objects.all', ([], {}), '()\n', (786, 788), False, 'from areas.models import Area\n')]
""" This module is a wrapper for lxu.command.BasicCommand. It improves and simplifies command implementations including popups, sPresetText fields, and Form Command Lists. This is based on Adam O'Hern Commander code but is vastly enhanced. https://github.com/adamohern/commander """ import time impor...
[ "lx.out", "lx.object.Item", "run.run", "time.clock", "item.ItemUtils.autoFocusItemListOnSelection", "lx.bless", "message.Message", "lx.service.NotifySys", "setup.SetupMode", "modo.Scene", "lxu.command.BasicCommand.__init__", "lx.notimpl", "modo.Item", "traceback.format_exc", "xfrm.Transf...
[((650, 685), 'lx.bless', 'lx.bless', (['commandClass', 'commandName'], {}), '(commandClass, commandName)\n', (658, 685), False, 'import lx, lxu, lxifc\n'), ((14311, 14323), 'message.Message', 'Message', (['msg'], {}), '(msg)\n', (14318, 14323), False, 'from message import Message\n'), ((17836, 17848), 'modo.Scene', 'm...
# Copyright 2017 MDSLAB - University of Messina # 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 # # U...
[ "oslo_log.log.getLogger", "iotronic.wamp.wampmessage.deserialize", "iotronic.conductor.rpcapi.ConductorAPI", "iotronic.objects.SessionWP", "iotronic.objects.SessionWP.get", "iotronic.objects.Board.get_by_uuid", "iotronic.objects.Request.get_by_uuid", "iotronic.wamp.wampmessage.WampError", "iotronic....
[((914, 937), 'oslo_log.log.getLogger', 'log.getLogger', (['__name__'], {}), '(__name__)\n', (927, 937), False, 'from oslo_log import log\n'), ((981, 995), 'iotronic.common.rpc.init', 'rpc.init', (['CONF'], {}), '(CONF)\n', (989, 995), False, 'from iotronic.common import rpc\n'), ((1038, 1064), 'iotronic.conductor.rpca...
r""" .. _ref_ex_composite: Creating a Composite Section ---------------------------- Create a section of mixed materials. The following example demonstrates how to create a composite cross-section by assigning different material properties to various regions of the mesh. A steel 310UB40.4 is modelled with a 50Dx600W...
[ "sectionproperties.pre.pre.Material", "sectionproperties.pre.library.steel_sections.i_section", "sectionproperties.pre.geometry.CompoundGeometry", "sectionproperties.pre.library.primitive_sections.rectangular_section", "sectionproperties.analysis.section.Section" ]
[((1163, 1287), 'sectionproperties.pre.pre.Material', 'Material', ([], {'name': '"""Steel"""', 'elastic_modulus': '(200000.0)', 'poissons_ratio': '(0.3)', 'yield_strength': '(500)', 'density': '(8.05e-06)', 'color': '"""grey"""'}), "(name='Steel', elastic_modulus=200000.0, poissons_ratio=0.3,\n yield_strength=500, d...
# Copyright (c) 2015 Canonical Ltd # # 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 ...
[ "pylxd.api.API" ]
[((912, 921), 'pylxd.api.API', 'api.API', ([], {}), '()\n', (919, 921), False, 'from pylxd import api\n'), ((933, 975), 'pylxd.api.API', 'api.API', ([], {'host': '"""images.linuxcontainers.org"""'}), "(host='images.linuxcontainers.org')\n", (940, 975), False, 'from pylxd import api\n'), ((1266, 1275), 'pylxd.api.API', ...
"""create_words_and_results_tables Revision ID: 71d46639309e Revises: Create Date: 2022-03-29 15:45:02.382574 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "71d46639309e" down_revision = None branch_labels = None depends_on = None def upgrade(): # ### co...
[ "alembic.op.drop_table", "sqlalchemy.DateTime", "alembic.op.f", "sqlalchemy.Boolean", "sqlalchemy.String", "sqlalchemy.Integer" ]
[((1517, 1541), 'alembic.op.drop_table', 'op.drop_table', (['"""results"""'], {}), "('results')\n", (1530, 1541), False, 'from alembic import op\n'), ((1546, 1568), 'alembic.op.drop_table', 'op.drop_table', (['"""words"""'], {}), "('words')\n", (1559, 1568), False, 'from alembic import op\n'), ((436, 448), 'sqlalchemy....
# -*- coding: utf-8 -*- ''' Code based on the python-oletools package by <NAME> 2012-10-18 http://www.decalage.info/python/oletools ''' import os import tempfile from viper.common.abstracts import Module from viper.core.session import __sessions__ try: from oletools.rtfobj import RtfObjParser from oletools ...
[ "tempfile.NamedTemporaryFile", "viper.core.session.__sessions__.new", "viper.core.session.__sessions__.is_set", "os.path.splitext", "oletools.rtfobj.RtfObjParser" ]
[((1175, 1193), 'oletools.rtfobj.RtfObjParser', 'RtfObjParser', (['data'], {}), '(data)\n', (1187, 1193), False, 'from oletools.rtfobj import RtfObjParser\n'), ((4512, 4530), 'oletools.rtfobj.RtfObjParser', 'RtfObjParser', (['data'], {}), '(data)\n', (4524, 4530), False, 'from oletools.rtfobj import RtfObjParser\n'), (...
# 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 use ...
[ "os.pathsep.join" ]
[((1750, 1771), 'os.pathsep.join', 'os.pathsep.join', (['args'], {}), '(args)\n', (1765, 1771), False, 'import os\n')]
import sys PRINT_BEEJ = 1 HALT = 2 PRINT_NUM = 3 SAVE = 4 PRINT_REGISTER = 5 ADD = 6 ''' SAVE takes 2 arguments saves value in [ARG1] to register [ARG2] ''' register = [0] * 8 memory = [0] * 128 # 128 bytes of RAM def load_memory(filename): try: address = 0 ...
[ "sys.exit" ]
[((926, 937), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (934, 937), False, 'import sys\n'), ((827, 838), 'sys.exit', 'sys.exit', (['(2)'], {}), '(2)\n', (835, 838), False, 'import sys\n'), ((1641, 1652), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (1649, 1652), False, 'import sys\n')]
from __future__ import unicode_literals from frappe import _ def get_data(): return [ { "label":_("Juggling Management"), "items": [ { "type": "doctype", "name": "Jugglingtrick_juggling_management", "label": _("Juggl...
[ "frappe._" ]
[((115, 139), 'frappe._', '_', (['"""Juggling Management"""'], {}), "('Juggling Management')\n", (116, 139), False, 'from frappe import _\n'), ((312, 330), 'frappe._', '_', (['"""Jugglingtrick"""'], {}), "('Jugglingtrick')\n", (313, 330), False, 'from frappe import _\n'), ((361, 395), 'frappe._', '_', (['"""Description...
import pytest from protean import Domain from protean.adapters.event_store.message_db import MessageDBStore from protean.exceptions import ConfigurationError @pytest.mark.message_db class TestMessageDBEventStore: def test_retrieving_message_store_from_domain(self, test_domain): assert test_domain.event_s...
[ "pytest.raises", "protean.Domain" ]
[((540, 548), 'protean.Domain', 'Domain', ([], {}), '()\n', (546, 548), False, 'from protean import Domain\n'), ((820, 853), 'pytest.raises', 'pytest.raises', (['ConfigurationError'], {}), '(ConfigurationError)\n', (833, 853), False, 'import pytest\n')]
# -*- test-case-name: pymeta.test.test_grammar -*- """ The definition of PyMeta's language is itself a PyMeta grammar, but something has to be able to read that. Most of the code in this module is generated from that grammar (in future versions, it will hopefully all be generated). """ import string from pymeta.runtime...
[ "pymeta.runtime.expected", "pymeta.runtime.OMetaBase.__init__" ]
[((601, 632), 'pymeta.runtime.OMetaBase.__init__', 'OMetaBase.__init__', (['self', 'input'], {}), '(self, input)\n', (619, 632), False, 'from pymeta.runtime import OMetaBase, ParseError, EOFError, expected\n'), ((1698, 1727), 'pymeta.runtime.expected', 'expected', (['"""python expression"""'], {}), "('python expression...
import frappe def after_submit(self,method): if self.picklist_reference: frappe.db.set_value("Nanak Pick List", self.picklist_reference, "sales_invoice", self.name) frappe.db.set_value("Nanak Pick List", self.picklist_reference, "sales_invoice_status", "Created")
[ "frappe.db.set_value" ]
[((90, 185), 'frappe.db.set_value', 'frappe.db.set_value', (['"""Nanak Pick List"""', 'self.picklist_reference', '"""sales_invoice"""', 'self.name'], {}), "('Nanak Pick List', self.picklist_reference,\n 'sales_invoice', self.name)\n", (109, 185), False, 'import frappe\n'), ((191, 293), 'frappe.db.set_value', 'frappe...
import json from pathlib import Path from typing import Dict from countdata import CountData from drawingdata import DrawingDataList class TransectData: """ Manages transect save data in a primitive data state, such that it can be easily serialized. """ def __init__(self, transectData: Dict[...
[ "json.dump", "json.load", "countdata.CountData.fromDict", "json.dumps", "drawingdata.DrawingDataList.load" ]
[((1467, 1509), 'json.dump', 'json.dump', (['self._transectData', 'f'], {'indent': '(4)'}), '(self._transectData, f, indent=4)\n', (1476, 1509), False, 'import json\n'), ((3235, 3288), 'json.dumps', 'json.dumps', (["self._transectData[imageName]['drawings']"], {}), "(self._transectData[imageName]['drawings'])\n", (3245...