code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
#!/usr/bin/env python
# Example taken from:
# http://www.mathworks.com/access/helpdesk/help/techdoc/visualize/f5-3371.html
from scitools.easyviz import *
from time import sleep
from scipy import io
setp(interactive=False)
# Displaying an Isosurface:
mri = io.loadmat('mri_matlab_v6.mat')
D = mri['D']
#Ds = smooth3(D... | [
"scipy.io.loadmat"
] | [((260, 291), 'scipy.io.loadmat', 'io.loadmat', (['"""mri_matlab_v6.mat"""'], {}), "('mri_matlab_v6.mat')\n", (270, 291), False, 'from scipy import io\n')] |
"""Blueprint definitions for maDMP integration."""
from flask import Blueprint, jsonify, request
from invenio_db import db
from .convert import convert_dmp
from .models import DataManagementPlan
def _summarize_dmp(dmp: DataManagementPlan) -> dict:
"""Create a summary dictionary for the given DMP."""
res = {... | [
"flask.request.args.get",
"invenio_db.db.session.commit",
"invenio_db.db.session.add",
"flask.request.json.get",
"flask.Blueprint",
"flask.jsonify"
] | [((965, 1001), 'flask.Blueprint', 'Blueprint', (['"""invenio_madmp"""', '__name__'], {}), "('invenio_madmp', __name__)\n", (974, 1001), False, 'from flask import Blueprint, jsonify, request\n'), ((1312, 1324), 'flask.jsonify', 'jsonify', (['res'], {}), '(res)\n', (1319, 1324), False, 'from flask import Blueprint, jsoni... |
import sys
sys.path = ['', '..'] + sys.path[1:]
import daemon
from assistance_bot import core
from functionality.voice_processing import speaking, listening
from functionality.commands import *
if __name__ == '__main__':
speaking.setup_assistant_voice(core.ttsEngine, core.assistant)
while True:
# st... | [
"functionality.voice_processing.listening.get_listening_and_recognition_result",
"functionality.voice_processing.speaking.setup_assistant_voice"
] | [((229, 291), 'functionality.voice_processing.speaking.setup_assistant_voice', 'speaking.setup_assistant_voice', (['core.ttsEngine', 'core.assistant'], {}), '(core.ttsEngine, core.assistant)\n', (259, 291), False, 'from functionality.voice_processing import speaking, listening\n'), ((392, 477), 'functionality.voice_pro... |
import argparse
import multiprocessing
import os
import random
import numpy as np
from data_utils import DATAFILE_LIST, DATASET_LIST, prepare_data, RESULTS_DIR
from models import SumOfBetaEce
random.seed(2020)
num_cores = multiprocessing.cpu_count()
NUM_BINS = 10
NUM_RUNS = 100
N_list = [100, 200, 500, 1000, 2000, 5... | [
"data_utils.prepare_data",
"numpy.mean",
"random.shuffle",
"argparse.ArgumentParser",
"multiprocessing.cpu_count",
"random.seed",
"os.mkdir",
"numpy.savetxt",
"numpy.std",
"os.stat",
"models.SumOfBetaEce"
] | [((195, 212), 'random.seed', 'random.seed', (['(2020)'], {}), '(2020)\n', (206, 212), False, 'import random\n'), ((225, 252), 'multiprocessing.cpu_count', 'multiprocessing.cpu_count', ([], {}), '()\n', (250, 252), False, 'import multiprocessing\n'), ((517, 565), 'data_utils.prepare_data', 'prepare_data', (['DATAFILE_LI... |
from sigvisa.learn.train_coda_models import get_shape_training_data
import numpy as np
X, y, evids = get_shape_training_data(runid=4, site="AS12", chan="SHZ", band="freq_2.0_3.0", phases=["P",], target="amp_transfer", max_acost=np.float("inf"), min_amp=-2)
np.savetxt("X.txt", X)
np.savetxt("y.txt", y)
np.savetxt("evid... | [
"numpy.float",
"numpy.savetxt"
] | [((258, 280), 'numpy.savetxt', 'np.savetxt', (['"""X.txt"""', 'X'], {}), "('X.txt', X)\n", (268, 280), True, 'import numpy as np\n'), ((281, 303), 'numpy.savetxt', 'np.savetxt', (['"""y.txt"""', 'y'], {}), "('y.txt', y)\n", (291, 303), True, 'import numpy as np\n'), ((304, 334), 'numpy.savetxt', 'np.savetxt', (['"""evi... |
from ad9833 import AD9833
# DUMMY classes for testing without board
class SBI(object):
def __init__(self):
pass
def send(self, data):
print(data)
class Pin(object):
def __init__(self):
pass
def low(self):
print(" 0")
def high(self):
prin... | [
"ad9833.AD9833"
] | [((387, 405), 'ad9833.AD9833', 'AD9833', (['SBI1', 'PIN3'], {}), '(SBI1, PIN3)\n', (393, 405), False, 'from ad9833 import AD9833\n')] |
# Copyright (C) 2018 DataArt
#
# 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, ... | [
"six.moves.range"
] | [((6449, 6457), 'six.moves.range', 'range', (['(2)'], {}), '(2)\n', (6454, 6457), False, 'from six.moves import range\n'), ((9168, 9176), 'six.moves.range', 'range', (['(2)'], {}), '(2)\n', (9173, 9176), False, 'from six.moves import range\n'), ((12099, 12107), 'six.moves.range', 'range', (['(2)'], {}), '(2)\n', (12104... |
from __future__ import print_function
import os
import shutil
import hashlib
import requests
import click
from tempfile import NamedTemporaryFile
from hashlib import sha256
from os.path import expanduser, join, exists, basename
from .utils import HumanSize
from .tar import extract_layer
from . import trust
from . impor... | [
"os.path.exists",
"click.argument",
"hashlib.sha256",
"datetime.datetime.fromtimestamp",
"os.makedirs",
"shutil.move",
"click.option",
"os.path.join",
"requests.get",
"requests.head",
"os.path.basename",
"tempfile.NamedTemporaryFile",
"os.stat",
"click.command",
"os.path.expanduser"
] | [((4116, 4131), 'click.command', 'click.command', ([], {}), '()\n', (4129, 4131), False, 'import click\n'), ((4133, 4160), 'click.argument', 'click.argument', (['"""image_url"""'], {}), "('image_url')\n", (4147, 4160), False, 'import click\n'), ((4162, 4201), 'click.option', 'click.option', (['"""--as_root"""'], {'is_f... |
from DocTest.CompareImage import CompareImage
import pytest
from pathlib import Path
import numpy
def test_single_png(testdata_dir):
img = CompareImage(testdata_dir / 'text_big.png')
assert len(img.opencv_images)==1
assert type(img.opencv_images)==list
type(img.opencv_images[0])==numpy.ndarray
def tes... | [
"DocTest.CompareImage.CompareImage",
"pytest.raises"
] | [((144, 187), 'DocTest.CompareImage.CompareImage', 'CompareImage', (["(testdata_dir / 'text_big.png')"], {}), "(testdata_dir / 'text_big.png')\n", (156, 187), False, 'from DocTest.CompareImage import CompareImage\n'), ((604, 633), 'pytest.raises', 'pytest.raises', (['AssertionError'], {}), '(AssertionError)\n', (617, 6... |
import functools
import numpy as np
import math
import argparse
import ags_solver
import go_problems
import nlopt
import sys
from Simple import SimpleTuner
import itertools
from scipy.spatial import Delaunay
from scipy.optimize import differential_evolution
from scipy.optimize import basinhopping
from sdaopt import sda... | [
"benchmark_tools.core.solve_class",
"argparse.ArgumentParser",
"benchmark_tools.core.GrishClass",
"math.pow",
"benchmark_tools.stats.save_stats",
"benchmark_tools.stats.compute_stats",
"itertools.product",
"benchmark_tools.core.GKLSClass",
"numpy.array",
"functools.partial",
"shgo.shgo",
"pyOp... | [((13158, 13203), 'functools.partial', 'functools.partial', (['AGSWrapper'], {'mixedFast': '(True)'}), '(AGSWrapper, mixedFast=True)\n', (13175, 13203), False, 'import functools\n'), ((13224, 13284), 'functools.partial', 'functools.partial', (['NLOptWrapper'], {'method': 'nlopt.GN_ORIG_DIRECT'}), '(NLOptWrapper, method... |
import arcpy
import logging
import pathlib
import subprocess
import gdb
import cx_sde
class Fc(object):
def __init__(self
,gdb
,name):
# gdb object
self.gdb = gdb
# ex BUILDING
self.name = name.upper()
# esri tools usually expect this C:/s... | [
"arcpy.EnableEditorTracking_management",
"arcpy.RegisterAsVersioned_management",
"arcpy.ChangePrivileges_management",
"pathlib.Path",
"arcpy.Describe",
"arcpy.TestSchemaLock",
"arcpy.FeatureClassToFeatureClass_conversion",
"arcpy.RebuildIndexes_management",
"arcpy.Exists",
"arcpy.Analyze_managemen... | [((513, 546), 'arcpy.Describe', 'arcpy.Describe', (['self.featureclass'], {}), '(self.featureclass)\n', (527, 546), False, 'import arcpy\n'), ((749, 780), 'arcpy.Exists', 'arcpy.Exists', (['self.featureclass'], {}), '(self.featureclass)\n', (761, 780), False, 'import arcpy\n'), ((877, 910), 'arcpy.Describe', 'arcpy.Des... |
# Copyright 2020 The Tekton 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 wr... | [
"tekton_pipeline.configuration.Configuration",
"six.iteritems"
] | [((10862, 10895), 'six.iteritems', 'six.iteritems', (['self.openapi_types'], {}), '(self.openapi_types)\n', (10875, 10895), False, 'import six\n'), ((2520, 2535), 'tekton_pipeline.configuration.Configuration', 'Configuration', ([], {}), '()\n', (2533, 2535), False, 'from tekton_pipeline.configuration import Configurati... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-24 13:41
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('portal', '0006_auto_20170824_0950'),
]
operations = [
migrations.AddField(
... | [
"django.db.models.CharField",
"django.db.models.BooleanField",
"django.db.models.IntegerField"
] | [((431, 461), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'default': '(0)'}), '(default=0)\n', (450, 461), False, 'from django.db import migrations, models\n'), ((607, 637), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'default': '(0)'}), '(default=0)\n', (626, 637), False, 'from djan... |
from infoclientLib import InfoClient
ic = InfoClient('localhost', 15002, 'localhost', 15003)
ic.add('roi-weightedave', 'active')
ic.start()
| [
"infoclientLib.InfoClient"
] | [((43, 93), 'infoclientLib.InfoClient', 'InfoClient', (['"""localhost"""', '(15002)', '"""localhost"""', '(15003)'], {}), "('localhost', 15002, 'localhost', 15003)\n", (53, 93), False, 'from infoclientLib import InfoClient\n')] |
import json
from django.contrib.auth.models import User
from django.http import JsonResponse
from django.shortcuts import redirect, render
from .models import Game2048
# Create your views here.
# test_user
# 8!S#5RP!WVMACg
def game(request):
return render(request, 'game_2048/index.html')
def set_result(req... | [
"django.shortcuts.render",
"json.loads",
"django.http.JsonResponse",
"django.shortcuts.redirect",
"django.contrib.auth.models.User.objects.get"
] | [((260, 299), 'django.shortcuts.render', 'render', (['request', '"""game_2048/index.html"""'], {}), "(request, 'game_2048/index.html')\n", (266, 299), False, 'from django.shortcuts import redirect, render\n'), ((1086, 1114), 'django.http.JsonResponse', 'JsonResponse', (['""""""'], {'safe': '(False)'}), "('', safe=False... |
"""change admin to boolean
Revision ID: e86dd3bc539c
Revises: <KEY>
Create Date: 2020-11-11 22:32:00.707936
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e86dd3bc539c'
down_revision = '<KEY>'
branch_labels = None
depends_on = None
def upgrade():
# ### ... | [
"sqlalchemy.DateTime",
"sqlalchemy.Boolean",
"alembic.op.drop_column",
"sqlalchemy.Integer",
"sqlalchemy.String"
] | [((1221, 1261), 'alembic.op.drop_column', 'op.drop_column', (['"""user"""', '"""last_logged_in"""'], {}), "('user', 'last_logged_in')\n", (1235, 1261), False, 'from alembic import op\n'), ((1266, 1300), 'alembic.op.drop_column', 'op.drop_column', (['"""user"""', '"""is_admin"""'], {}), "('user', 'is_admin')\n", (1280, ... |
# Copyright (c) 2014 OpenStack Foundation
#
# 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 ... | [
"swift.common.middleware.s3api.subresource.User",
"mock.patch",
"hashlib.md5",
"swift.common.middleware.s3api.etree.fromstring",
"time.tzset",
"os.environ.get",
"datetime.datetime.now",
"swift.common.swob.Request.blank",
"swift.common.middleware.s3api.subresource.Owner",
"swift.common.middleware.s... | [((13899, 13921), 'test.unit.common.middleware.s3api.test_s3_acl.s3acl', 's3acl', ([], {'s3acl_only': '(True)'}), '(s3acl_only=True)\n', (13904, 13921), False, 'from test.unit.common.middleware.s3api.test_s3_acl import s3acl\n'), ((32337, 32359), 'test.unit.common.middleware.s3api.test_s3_acl.s3acl', 's3acl', ([], {'s3... |
"""
Eddsa Ed25519 key handling
From
https://github.com/n-y-z-o/nyzoVerifier/blob/b73bc25ba3094abe3470ec070ce306885ad9a18f/src/main/java/co/nyzo/verifier/KeyUtil.java
plus
https://github.com/n-y-z-o/nyzoVerifier/blob/17509f03a7f530c0431ce85377db9b35688c078e/src/main/java/co/nyzo/verifier/util/SignatureUtil.java
"""
# ... | [
"pynyzo.byteutil.ByteUtil.bytes_as_string_with_dashes",
"hashlib.sha256",
"ed25519.SigningKey",
"ed25519.create_keypair",
"ed25519.VerifyingKey"
] | [((582, 606), 'ed25519.create_keypair', 'ed25519.create_keypair', ([], {}), '()\n', (604, 606), False, 'import ed25519\n'), ((1512, 1539), 'ed25519.SigningKey', 'ed25519.SigningKey', (['keydata'], {}), '(keydata)\n', (1530, 1539), False, 'import ed25519\n'), ((2341, 2381), 'ed25519.SigningKey', 'ed25519.SigningKey', ([... |
from argparse import ArgumentParser
import os
import numpy as np
from joblib import dump
from mldftdat.workflow_utils import SAVE_ROOT
from mldftdat.models.gp import *
from mldftdat.data import load_descriptors, filter_descriptors
import yaml
def parse_settings(args):
fname = args.datasets_list[0]
if args.suff... | [
"numpy.mean",
"argparse.ArgumentParser",
"os.path.join",
"yaml.load",
"numpy.append",
"mldftdat.data.load_descriptors",
"mldftdat.data.filter_descriptors",
"numpy.random.seed",
"joblib.dump",
"numpy.arange",
"numpy.random.shuffle"
] | [((390, 480), 'os.path.join', 'os.path.join', (['SAVE_ROOT', '"""DATASETS"""', 'args.functional', 'args.basis', 'args.version', 'fname'], {}), "(SAVE_ROOT, 'DATASETS', args.functional, args.basis, args.\n version, fname)\n", (402, 480), False, 'import os\n'), ((1042, 1132), 'os.path.join', 'os.path.join', (['SAVE_RO... |
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
from typing import cast
from pants.core.util_rules.config_files import ConfigFilesRequest
from pants.core.util_rules.external_tool import TemplatedExte... | [
"typing.cast"
] | [((2848, 2877), 'typing.cast', 'cast', (['bool', 'self.options.skip'], {}), '(bool, self.options.skip)\n', (2852, 2877), False, 'from typing import cast\n'), ((3038, 3077), 'typing.cast', 'cast', (['"""str | None"""', 'self.options.config'], {}), "('str | None', self.options.config)\n", (3042, 3077), False, 'from typin... |
# coding: utf-8
"""
Trend Micro Deep Security API
Copyright 2018 - 2020 Trend Micro Incorporated.<br/>Get protected, stay secured, and keep informed with Trend Micro Deep Security's new RESTful API. Access system data and manage security configurations to automate your security workflows and integrate De... | [
"six.iteritems"
] | [((5314, 5347), 'six.iteritems', 'six.iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (5327, 5347), False, 'import six\n')] |
from __future__ import print_function # Python 2/3 compatibility
from gremlin_python import statics
from gremlin_python.structure.graph import Graph
from gremlin_python.process.graph_traversal import __
from gremlin_python.process.strategies import *
from gremlin_python.driver.driver_remote_connection import DriverR... | [
"gremlin_python.structure.graph.Graph",
"gremlin_python.driver.driver_remote_connection.DriverRemoteConnection"
] | [((376, 383), 'gremlin_python.structure.graph.Graph', 'Graph', ([], {}), '()\n', (381, 383), False, 'from gremlin_python.structure.graph import Graph\n'), ((435, 495), 'gremlin_python.driver.driver_remote_connection.DriverRemoteConnection', 'DriverRemoteConnection', (['"""wss://<endpoint>:8182/gremlin"""', '"""g"""'], ... |
#!/usr/bin/env python
# Copyright 2015 The Swarming Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0 that
# can be found in the LICENSE file.
import logging
import os
import subprocess
import sys
import tempfile
import shutil
import unittest
import re
THIS_FILE... | [
"logging.basicConfig",
"os.listdir",
"os.rename",
"os.environ.get",
"unittest.main",
"os.environ.copy",
"os.path.join",
"utils.logging_utils.CaptureLogs",
"os.path.dirname",
"utils.logging_utils.prepare_logging",
"re.match",
"tempfile.mkdtemp",
"subprocess.call",
"os.getpid",
"shutil.rmt... | [((323, 348), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (338, 348), False, 'import os\n'), ((543, 554), 'os.getpid', 'os.getpid', ([], {}), '()\n', (552, 554), False, 'import os\n'), ((721, 738), 'os.environ.copy', 'os.environ.copy', ([], {}), '()\n', (736, 738), False, 'import os\n'), (... |
from featur_selection import df,race,occupation,workclass,country
import pandas as pd
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import cross_val_score,KFold
from sklearn.linear_model import LogisticRegression
from imblearn.pipeline import Pipeline
from sklearn.compose import ColumnT... | [
"sklearn.svm.SVC",
"sklearn.ensemble.AdaBoostClassifier",
"sklearn.tree.DecisionTreeClassifier",
"sklearn.neighbors.KNeighborsClassifier",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.linear_model.LogisticRegression",
"seaborn.set_style",
"seaborn.lineplot",
"sklearn.preprocessing.StandardSca... | [((706, 715), 'featur_selection.df.copy', 'df.copy', ([], {}), '()\n', (713, 715), False, 'from featur_selection import df, race, occupation, workclass, country\n'), ((2143, 2190), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'nrows': '(2)', 'ncols': '(1)', 'figsize': '(15, 8)'}), '(nrows=2, ncols=1, figsize=(15... |
"""
********************************
* Created by mohammed-alaa *
********************************
Spatial Dataloader implementing sequence api from keras (defines how to load a single item)
this loads batches of images for each iteration it returns [batch_size, height, width ,3] ndarrays
"""
import copy
import ran... | [
"random.randint",
"random.shuffle",
"numpy.array",
"copy.deepcopy",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.subplots_adjust"
] | [((760, 787), 'copy.deepcopy', 'copy.deepcopy', (['data_to_load'], {}), '(data_to_load)\n', (773, 787), False, 'import copy\n'), ((890, 914), 'copy.deepcopy', 'copy.deepcopy', (['augmenter'], {}), '(augmenter)\n', (903, 914), False, 'import copy\n'), ((1705, 1798), 'numpy.array', 'np.array', (['self.labels[batch_start ... |
import os
dirs = [
'./PANDORA_files', './PANDORA_files/data', './PANDORA_files/data/csv_pkl_files',
'./PANDORA_files/data/csv_pkl_files/mhcseqs', './PANDORA_files/data/PDBs',
'./PANDORA_files/data/PDBs/pMHCI', './PANDORA_files/data/PDBs/pMHCII',
'./PANDORA_files/data/PDBs/Bad', './PANDO... | [
"os.mkdir"
] | [((675, 686), 'os.mkdir', 'os.mkdir', (['D'], {}), '(D)\n', (683, 686), False, 'import os\n')] |
import pickle
import warnings
import collections.abc
from math import isnan
from statistics import mean, median, stdev, mode
from abc import abstractmethod, ABC
from numbers import Number
from collections import defaultdict
from itertools import islice, chain
from typing import Hashable, Optional, Sequence, Union, Ite... | [
"itertools.chain",
"coba.environments.logged.primitives.LoggedInteraction",
"itertools.islice",
"statistics.mean",
"statistics.stdev",
"coba.pipes.Flatten",
"pickle.dumps",
"coba.exceptions.CobaException",
"coba.statistics.iqr",
"statistics.median",
"itertools.chain.from_iterable",
"coba.envir... | [((3136, 3159), 'collections.defaultdict', 'defaultdict', (['(lambda : 0)'], {}), '(lambda : 0)\n', (3147, 3159), False, 'from collections import defaultdict\n'), ((3203, 3226), 'collections.defaultdict', 'defaultdict', (['(lambda : 1)'], {}), '(lambda : 1)\n', (3214, 3226), False, 'from collections import defaultdict\... |
from pythonfuzz.main import PythonFuzz
from tinytag import TinyTag
import io
@PythonFuzz
def fuzz(buf):
try:
f = open('temp.mp4', "wb")
f.write(buf)
f.seek(0)
tag = TinyTag.get(f.name)
except UnicodeDecodeError:
pass
if __name__ == '__main__':
fuzz()
| [
"tinytag.TinyTag.get"
] | [((175, 194), 'tinytag.TinyTag.get', 'TinyTag.get', (['f.name'], {}), '(f.name)\n', (186, 194), False, 'from tinytag import TinyTag\n')] |
# Copyright 2022 The Matrix.org Foundation C.I.C.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | [
"synapse.http.servlet.parse_string",
"synapse.http.server.respond_with_html_bytes"
] | [((1465, 1517), 'synapse.http.servlet.parse_string', 'parse_string', (['request', '"""access_token"""'], {'required': '(True)'}), "(request, 'access_token', required=True)\n", (1477, 1517), False, 'from synapse.http.servlet import parse_string\n'), ((1535, 1581), 'synapse.http.servlet.parse_string', 'parse_string', (['... |
# ******************************************************
## Copyright 2019, PBL Netherlands Environmental Assessment Agency and Utrecht University.
## Reuse permitted under Gnu Public License, GPL v3.
# ******************************************************
from netCDF4 import Dataset
import numpy as np
import genera... | [
"ascraster.create_mask",
"numpy.zeros"
] | [((503, 576), 'ascraster.create_mask', 'ascraster.create_mask', (['mask_asc_fn', 'mask_id'], {'logical': 'logical', 'numtype': 'int'}), '(mask_asc_fn, mask_id, logical=logical, numtype=int)\n', (524, 576), False, 'import ascraster\n'), ((930, 982), 'numpy.zeros', 'np.zeros', (['(dum_asc.nrows, dum_asc.ncols)'], {'dtype... |
from io import TextIOWrapper
import math
from typing import TypeVar
import random
import os
from Settings import Settings
class Dataset:
DataT = TypeVar('DataT')
WIN_NL = "\r\n"
LINUX_NL = "\n"
def __init__(self, path:str, filename:str, newline:str = WIN_NL) -> None:
self.path_ = path
self.f... | [
"random.shuffle",
"math.floor",
"os.sep.join",
"Settings.Settings.Data",
"typing.TypeVar"
] | [((157, 173), 'typing.TypeVar', 'TypeVar', (['"""DataT"""'], {}), "('DataT')\n", (164, 173), False, 'from typing import TypeVar\n'), ((6860, 6886), 'random.shuffle', 'random.shuffle', (['self.data_'], {}), '(self.data_)\n', (6874, 6886), False, 'import random\n'), ((7037, 7052), 'Settings.Settings.Data', 'Settings.Data... |
# Copyright (c) OpenMMLab. All rights reserved.
import pytest
import torch
_USING_PARROTS = True
try:
from parrots.autograd import gradcheck
except ImportError:
from torch.autograd import gradcheck, gradgradcheck
_USING_PARROTS = False
class TestUpFirDn2d:
"""Unit test for UpFirDn2d.
Here, we ju... | [
"torch.tensor",
"torch.cuda.is_available",
"torch.randn"
] | [((550, 584), 'torch.tensor', 'torch.tensor', (['[1.0, 3.0, 3.0, 1.0]'], {}), '([1.0, 3.0, 3.0, 1.0])\n', (562, 584), False, 'import torch\n'), ((853, 898), 'torch.randn', 'torch.randn', (['(2, 3, 4, 4)'], {'requires_grad': '(True)'}), '((2, 3, 4, 4), requires_grad=True)\n', (864, 898), False, 'import torch\n'), ((928,... |
import pandas as pd
from tqdm import tqdm
data_list = []
def get_questions(row):
global data_list
random_samples = df.sample(n=num_choices - 1)
distractors = random_samples["description"].tolist()
data = {
"question": "What is " + row["label"] + "?",
"correct": row["description"],
... | [
"pandas.read_pickle",
"tqdm.tqdm.pandas",
"pandas.DataFrame"
] | [((495, 523), 'tqdm.tqdm.pandas', 'tqdm.pandas', ([], {'desc': '"""Progress"""'}), "(desc='Progress')\n", (506, 523), False, 'from tqdm import tqdm\n'), ((529, 599), 'pandas.read_pickle', 'pd.read_pickle', (['"""data/augmented_datasets/pickle/label_description.pkl"""'], {}), "('data/augmented_datasets/pickle/label_desc... |
import json
from threading import Semaphore
import ee
from flask import request
from google.auth import crypt
from google.oauth2 import service_account
from google.oauth2.credentials import Credentials
service_account_credentials = None
import logging
export_semaphore = Semaphore(5)
get_info_semaphore = Semaphore(2)... | [
"ee.data.getList",
"ee.InitializeThread",
"ee.data.getAssetRoots",
"json.loads",
"google.oauth2.credentials.Credentials",
"ee.data.deleteAsset",
"google.auth.crypt.RSASigner.from_string",
"threading.Semaphore",
"ee.data.create_assets",
"ee.data.getInfo",
"google.oauth2.service_account.Credential... | [((274, 286), 'threading.Semaphore', 'Semaphore', (['(5)'], {}), '(5)\n', (283, 286), False, 'from threading import Semaphore\n'), ((308, 320), 'threading.Semaphore', 'Semaphore', (['(2)'], {}), '(2)\n', (317, 320), False, 'from threading import Semaphore\n'), ((503, 540), 'google.auth.crypt.RSASigner.from_string', 'cr... |
from pedalboard import Reverb, Compressor, Gain, LowpassFilter, Pedalboard
import soundfile as sf
if __name__ == '__main__':
# replace by path of unprocessed piano file if necessar
fn_wav_source = 'live_grand_piano.wav'
# augmentation settings using Pedalboard library
settings = {'rev-': [Reverb(roo... | [
"pedalboard.LowpassFilter",
"pedalboard.Pedalboard",
"pedalboard.Reverb",
"soundfile.write",
"pedalboard.Compressor",
"pedalboard.Gain",
"soundfile.read"
] | [((883, 905), 'soundfile.read', 'sf.read', (['fn_wav_source'], {}), '(fn_wav_source)\n', (890, 905), True, 'import soundfile as sf\n'), ((958, 981), 'pedalboard.Pedalboard', 'Pedalboard', (['settings[s]'], {}), '(settings[s])\n', (968, 981), False, 'from pedalboard import Reverb, Compressor, Gain, LowpassFilter, Pedalb... |
"""add_request_system
Revision: <KEY>
Revises: 31b92bf6506d
Created: 2013-07-23 02:49:09.342814
"""
revision = '<KEY>'
down_revision = '31b92bf6506d'
from alembic import op
from spire.schema.fields import *
from spire.mesh import SurrogateType
from sqlalchemy import (Column, ForeignKey, ForeignKeyConstraint, Primary... | [
"sqlalchemy.ForeignKeyConstraint",
"alembic.op.drop_table",
"spire.mesh.SurrogateType",
"sqlalchemy.PrimaryKeyConstraint",
"sqlalchemy.UniqueConstraint"
] | [((2690, 2714), 'alembic.op.drop_table', 'op.drop_table', (['"""message"""'], {}), "('message')\n", (2703, 2714), False, 'from alembic import op\n'), ((2719, 2751), 'alembic.op.drop_table', 'op.drop_table', (['"""request_product"""'], {}), "('request_product')\n", (2732, 2751), False, 'from alembic import op\n'), ((275... |
# Copyright (C) 2021 Open Source Robotics Foundation
#
# 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... | [
"math.sqrt",
"ignition.math.Vector2d",
"ignition.math.Vector2d.ZERO.squared_length",
"unittest.main",
"ignition.math.Vector2d.ZERO.equal",
"ignition.math.Vector2d.ONE.length",
"ignition.math.Vector2d.ZERO.length",
"ignition.math.Vector2d.ONE.squared_length"
] | [((9317, 9332), 'unittest.main', 'unittest.main', ([], {}), '()\n', (9330, 9332), False, 'import unittest\n'), ((786, 796), 'ignition.math.Vector2d', 'Vector2d', ([], {}), '()\n', (794, 796), False, 'from ignition.math import Vector2d\n'), ((898, 912), 'ignition.math.Vector2d', 'Vector2d', (['(1)', '(0)'], {}), '(1, 0)... |
import pickle
import socket
import _thread
from scripts.multiplayer import game, board, tetriminos
server = "192.168.29.144"
port = 5555
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
s.bind((server, port))
except socket.error as e:
print(e)
s.listen()
print("Waiting for connection")
connected ... | [
"scripts.multiplayer.game.update",
"socket.socket",
"pickle.dumps",
"scripts.multiplayer.game.Game",
"_thread.start_new_thread"
] | [((143, 192), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (156, 192), False, 'import socket\n'), ((1335, 1396), '_thread.start_new_thread', '_thread.start_new_thread', (['threaded_client', '(conn, p, game_id)'], {}), '(threaded_client, (con... |
from fastapi import APIRouter, Depends, HTTPException
from sqlalchemy.orm import Session
from dispatch.database.core import get_db
from dispatch.database.service import common_parameters, search_filter_sort_paginate
from dispatch.auth.permissions import SensitiveProjectActionPermission, PermissionsDependency
from .mo... | [
"fastapi.HTTPException",
"fastapi.APIRouter",
"dispatch.auth.permissions.PermissionsDependency",
"dispatch.database.service.search_filter_sort_paginate",
"fastapi.Depends"
] | [((494, 505), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (503, 505), False, 'from fastapi import APIRouter, Depends, HTTPException\n'), ((604, 630), 'fastapi.Depends', 'Depends', (['common_parameters'], {}), '(common_parameters)\n', (611, 630), False, 'from fastapi import APIRouter, Depends, HTTPException\n'),... |
import os
from urllib.parse import urlparse, parse_qs
from builtins import str
from tests import PMGLiveServerTestCase
from pmg.models import db, Committee, CommitteeQuestion
from tests.fixtures import dbfixture, UserData, CommitteeData, MembershipData
from flask import escape
from io import BytesIO
class TestAdminCo... | [
"urllib.parse.urlparse",
"pmg.models.CommitteeQuestion.query.get",
"os.path.join",
"tests.fixtures.dbfixture.data",
"urllib.parse.parse_qs",
"os.path.dirname"
] | [((425, 449), 'tests.fixtures.dbfixture.data', 'dbfixture.data', (['UserData'], {}), '(UserData)\n', (439, 449), False, 'from tests.fixtures import dbfixture, UserData, CommitteeData, MembershipData\n'), ((1424, 1451), 'urllib.parse.urlparse', 'urlparse', (['response.location'], {}), '(response.location)\n', (1432, 145... |
from syloga.core.map_expression_args import map_expression_args
from syloga.utils.identity import identity
from syloga.ast.BooleanNot import BooleanNot
from syloga.ast.BooleanValue import BooleanValue
from syloga.ast.BooleanOr import BooleanOr
from syloga.ast.BooleanAnd import BooleanAnd
from syloga.ast.BooleanNand i... | [
"syloga.ast.BooleanNot.BooleanNot",
"syloga.ast.BooleanXor.BooleanXor",
"syloga.ast.BooleanOr.BooleanOr",
"syloga.ast.BooleanAnd.BooleanAnd",
"syloga.core.map_expression_args.map_expression_args",
"syloga.ast.BooleanValue.BooleanValue",
"syloga.ast.BreakOut.BreakOut"
] | [((1555, 1570), 'syloga.ast.BooleanNot.BooleanNot', 'BooleanNot', (['arg'], {}), '(arg)\n', (1565, 1570), False, 'from syloga.ast.BooleanNot import BooleanNot\n'), ((2036, 2054), 'syloga.ast.BooleanValue.BooleanValue', 'BooleanValue', (['(True)'], {}), '(True)\n', (2048, 2054), False, 'from syloga.ast.BooleanValue impo... |
from parameters import *
from library_time import *
from paths import *
import numpy as np
import pylab as plt
import matplotlib.pyplot as mplt
mplt.rc('text', usetex=True)
mplt.rcParams.update({'font.size': 16})
import logging, getopt, sys
import time
import os
#####################################################... | [
"os.path.exists",
"matplotlib.pyplot.savefig",
"os.makedirs",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.rcParams.update",
"numpy.linspace",
"numpy.zeros",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot... | [((145, 173), 'matplotlib.pyplot.rc', 'mplt.rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (152, 173), True, 'import matplotlib.pyplot as mplt\n'), ((174, 213), 'matplotlib.pyplot.rcParams.update', 'mplt.rcParams.update', (["{'font.size': 16}"], {}), "({'font.size': 16})\n", (194, 213), True, '... |
import sys, os
sys.path.append("C:/Users/Delgado/Documents/Research/rheology-data-toolkit/rheodata/extractors")
import h5py
import pandas as pd
from antonpaar import AntonPaarExtractor as APE
from ARES_G2 import ARES_G2Extractor
# %%
sys.path.append("C:/Users/Delgado/Documents/Research/rheology-data-toolkit/rheodata"... | [
"antonpaar.AntonPaarExtractor",
"os.path.splitext",
"h5py.File",
"data_converter.rheo_data_transformer",
"unittest.main",
"sys.path.append"
] | [((15, 121), 'sys.path.append', 'sys.path.append', (['"""C:/Users/Delgado/Documents/Research/rheology-data-toolkit/rheodata/extractors"""'], {}), "(\n 'C:/Users/Delgado/Documents/Research/rheology-data-toolkit/rheodata/extractors'\n )\n", (30, 121), False, 'import sys, os\n'), ((236, 326), 'sys.path.append', 'sys... |
from django.conf.urls.defaults import url, include, patterns
from corehq.apps.appstore.dispatcher import AppstoreDispatcher
store_urls = patterns('corehq.apps.appstore.views',
url(r'^$', 'appstore_default', name="appstore_interfaces_default"),
AppstoreDispatcher.url_pattern(),
)
urlpatterns = patterns('corehq... | [
"django.conf.urls.defaults.include",
"django.conf.urls.defaults.url",
"corehq.apps.appstore.dispatcher.AppstoreDispatcher.url_pattern"
] | [((181, 246), 'django.conf.urls.defaults.url', 'url', (['"""^$"""', '"""appstore_default"""'], {'name': '"""appstore_interfaces_default"""'}), "('^$', 'appstore_default', name='appstore_interfaces_default')\n", (184, 246), False, 'from django.conf.urls.defaults import url, include, patterns\n'), ((253, 285), 'corehq.ap... |
from __future__ import absolute_import
import torch
from torch.nn import functional
class FPN(torch.nn.Module):
def __init__(self, out_channels):
super(FPN, self).__init__()
self.out_channels = out_channels
self.P5 = torch.nn.MaxPool2d(kernel_size=1, stride=2, padding=0)
self.P4_c... | [
"torch.nn.MaxPool2d",
"torch.nn.functional.interpolate",
"torch.nn.Conv2d"
] | [((247, 301), 'torch.nn.MaxPool2d', 'torch.nn.MaxPool2d', ([], {'kernel_size': '(1)', 'stride': '(2)', 'padding': '(0)'}), '(kernel_size=1, stride=2, padding=0)\n', (265, 301), False, 'import torch\n'), ((327, 402), 'torch.nn.Conv2d', 'torch.nn.Conv2d', (['(512)', 'self.out_channels'], {'kernel_size': '(1)', 'stride': ... |
from distutils.core import setup
setup(
name="arweave-python-client",
packages = ['arweave'], # this must be the same as the name above
version="1.0.15.dev0",
description="Client interface for sending transactions on the Arweave permaweb",
author="<NAME>",
author_email="<EMAIL>",
url="https://github.com/... | [
"distutils.core.setup"
] | [((34, 687), 'distutils.core.setup', 'setup', ([], {'name': '"""arweave-python-client"""', 'packages': "['arweave']", 'version': '"""1.0.15.dev0"""', 'description': '"""Client interface for sending transactions on the Arweave permaweb"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '"""https://gi... |
"""
echopype data model that keeps tracks of echo data and
its connection to data files.
"""
import os
import warnings
import datetime as dt
from echopype.utils import uwa
import numpy as np
import xarray as xr
class ModelBase(object):
"""Class for manipulating echo data that is already converted to netCDF."""
... | [
"numpy.array",
"xarray.align",
"numpy.mod",
"numpy.arange",
"os.path.exists",
"xarray.merge",
"os.path.split",
"os.mkdir",
"numpy.round",
"numpy.ceil",
"os.path.splitext",
"os.path.dirname",
"xarray.open_dataset",
"numpy.unique",
"os.path.join",
"os.getcwd",
"datetime.datetime.now",
... | [((2910, 2929), 'os.path.basename', 'os.path.basename', (['p'], {}), '(p)\n', (2926, 2929), False, 'import os\n'), ((2947, 2967), 'os.path.splitext', 'os.path.splitext', (['pp'], {}), '(pp)\n', (2963, 2967), False, 'import os\n'), ((8945, 8977), 'os.path.join', 'os.path.join', (['save_dir', 'file_out'], {}), '(save_dir... |
import cv2
import numpy as np
import time
class CaptureManager(object):
def __init__(self, capture, preview_window_manager=None, should_mirror_preview = False):
self.preview_window_manager = preview_window_manager
self.should_mirror_preview = should_mirror_preview
self._capture = capture... | [
"cv2.destroyWindow",
"numpy.fliplr",
"cv2.imshow",
"cv2.waitKey",
"time.time",
"cv2.namedWindow"
] | [((2291, 2325), 'cv2.namedWindow', 'cv2.namedWindow', (['self._window_name'], {}), '(self._window_name)\n', (2306, 2325), False, 'import cv2\n'), ((2401, 2437), 'cv2.imshow', 'cv2.imshow', (['self._window_name', 'frame'], {}), '(self._window_name, frame)\n', (2411, 2437), False, 'import cv2\n'), ((2477, 2513), 'cv2.des... |
from PHPUnitKit.tests import unittest
from PHPUnitKit.plugin import is_valid_php_version_file_version
class TestIsValidPhpVersionFileVersion(unittest.TestCase):
def test_invalid_values(self):
self.assertFalse(is_valid_php_version_file_version(''))
self.assertFalse(is_valid_php_version_file_versi... | [
"PHPUnitKit.plugin.is_valid_php_version_file_version"
] | [((225, 262), 'PHPUnitKit.plugin.is_valid_php_version_file_version', 'is_valid_php_version_file_version', (['""""""'], {}), "('')\n", (258, 262), False, 'from PHPUnitKit.plugin import is_valid_php_version_file_version\n'), ((289, 327), 'PHPUnitKit.plugin.is_valid_php_version_file_version', 'is_valid_php_version_file_ve... |
#----------------
# 01_02 文本分类
#----------------
# TensorFlow and tf.keras
import tensorflow as tf
from tensorflow import keras
# Helper libraries
import numpy as np
import matplotlib.pyplot as plt
# TensorFlow's version : 1.12.0
print('TensorFlow\'s version : ', tf.__version__)
#----------------
# 1 下载 IMDB 数据集
#-... | [
"tensorflow.keras.preprocessing.sequence.pad_sequences",
"tensorflow.keras.Sequential",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.clf",
"tensorflow.keras.layers.Embedding",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.GlobalAver... | [((1257, 1371), 'tensorflow.keras.preprocessing.sequence.pad_sequences', 'keras.preprocessing.sequence.pad_sequences', (['train_data'], {'value': "word_index['<PAD>']", 'padding': '"""post"""', 'maxlen': '(256)'}), "(train_data, value=word_index[\n '<PAD>'], padding='post', maxlen=256)\n", (1299, 1371), False, 'from... |
# -*- coding: utf-8 -*-
from __future__ import division
from datetime import datetime, timedelta
import logging
import os
from guessit import guessit
logger = logging.getLogger(__name__)
#: Video extensions
VIDEO_EXTENSIONS = ('.3g2', '.3gp', '.3gp2', '.3gpp', '.60d', '.ajp', '.asf', '.asx', '.avchd', '.avi', '.bik'... | [
"logging.getLogger",
"os.path.exists",
"datetime.datetime.utcnow",
"os.path.getmtime",
"datetime.timedelta",
"guessit.guessit"
] | [((161, 188), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (178, 188), False, 'import logging\n'), ((2830, 2855), 'os.path.exists', 'os.path.exists', (['self.name'], {}), '(self.name)\n', (2844, 2855), False, 'import os\n'), ((3055, 3066), 'datetime.timedelta', 'timedelta', ([], {}), '(... |
# Copyright (c) 2020, NVIDIA CORPORATION. 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 appli... | [
"nemo.collections.nlp.modules.common.transformer.transformer.NeMoTransformerEncoderConfig",
"nemo.collections.nlp.modules.common.transformer.transformer.NeMoTransformerConfig",
"nemo.collections.nlp.data.machine_translation.machine_translation_dataset.TranslationDataConfig",
"nemo.collections.nlp.modules.comm... | [((2471, 2510), 'nemo.collections.nlp.modules.common.token_classifier.TokenClassifierConfig', 'TokenClassifierConfig', ([], {'log_softmax': '(True)'}), '(log_softmax=True)\n', (2492, 2510), False, 'from nemo.collections.nlp.modules.common.token_classifier import TokenClassifierConfig\n'), ((2589, 2745), 'nemo.collectio... |
"""
@author: tyrantlucifer
@contact: <EMAIL>
@blog: https://tyrantlucifer.com
@file: main.py
@time: 2021/2/18 21:36
@desc: shadowsocksr-cli入口函数
"""
import argparse
import traceback
from shadowsocksr_cli.functions import *
def get_parser():
parser = argparse.ArgumentParser(description=color.blue("The shadowsocks... | [
"traceback.format_exc"
] | [((5276, 5298), 'traceback.format_exc', 'traceback.format_exc', ([], {}), '()\n', (5296, 5298), False, 'import traceback\n')] |
import os
import sys
import pytest
from msl.qt import convert, Button, QtWidgets, QtCore, Qt
def test_text():
b = Button(text='hello')
assert b.text() == 'hello'
assert b.icon().isNull()
assert b.toolButtonStyle() == Qt.ToolButtonTextOnly
def test_icon():
path = os.path.dirname(__file__) + '/g... | [
"msl.qt.convert.to_qicon",
"os.path.dirname",
"msl.qt.QtCore.QSize",
"msl.qt.Button",
"pytest.raises"
] | [((122, 142), 'msl.qt.Button', 'Button', ([], {'text': '"""hello"""'}), "(text='hello')\n", (128, 142), False, 'from msl.qt import convert, Button, QtWidgets, QtCore, Qt\n'), ((347, 369), 'msl.qt.QtCore.QSize', 'QtCore.QSize', (['(191)', '(291)'], {}), '(191, 291)\n', (359, 369), False, 'from msl.qt import convert, But... |
from tkinter import*
import tkinter.font as font
import sqlite3
name2=''
regis2=''
branch2=''
def main():
inp=Tk()
inp.geometry("430x300")
inp.title("Enter The Details")
inp.iconbitmap("logo/spectrumlogo.ico")
f=font.Font(family='Bookman Old Style',size=15,weight='bold')
f1=f... | [
"tkinter.font.Font",
"subject.main",
"sqlite3.connect",
"welcome.main"
] | [((251, 312), 'tkinter.font.Font', 'font.Font', ([], {'family': '"""Bookman Old Style"""', 'size': '(15)', 'weight': '"""bold"""'}), "(family='Bookman Old Style', size=15, weight='bold')\n", (260, 312), True, 'import tkinter.font as font\n'), ((319, 380), 'tkinter.font.Font', 'font.Font', ([], {'family': '"""Bookman Ol... |
import sqlite3
from bottle import route, run,debug,template,request,redirect
@route('/todo')
def todo_list():
conn = sqlite3.connect('todo.db')
c = conn.cursor()
c.execute("SELECT id, task FROM todo WHERE status LIKE '1'")
result = c.fetchall()
c.close()
output = template('make_table', rows=res... | [
"bottle.template",
"bottle.request.GET.deletedata.strip",
"sqlite3.connect",
"bottle.request.GET.status.strip",
"bottle.route",
"bottle.request.GET.task.strip",
"bottle.debug",
"bottle.request.GET.editdata.strip",
"bottle.run",
"bottle.redirect"
] | [((79, 93), 'bottle.route', 'route', (['"""/todo"""'], {}), "('/todo')\n", (84, 93), False, 'from bottle import route, run, debug, template, request, redirect\n'), ((347, 374), 'bottle.route', 'route', (['"""/new"""'], {'method': '"""GET"""'}), "('/new', method='GET')\n", (352, 374), False, 'from bottle import route, r... |
from __future__ import print_function
"""
This example generates random data and plots a graph in the browser.
Run it using Gevent directly using:
$ python plot_graph.py
Or with an Gunicorn wrapper:
$ gunicorn -k "geventwebsocket.gunicorn.workers.GeventWebSocketWorker" \
plot_graph:resource
"""
impo... | [
"gevent.sleep",
"geventwebsocket.WebSocketServer",
"geventwebsocket._compat.range_type",
"random.random",
"geventwebsocket.Resource"
] | [((914, 976), 'geventwebsocket.Resource', 'Resource', (["[('/', static_wsgi_app), ('/data', PlotApplication)]"], {}), "([('/', static_wsgi_app), ('/data', PlotApplication)])\n", (922, 976), False, 'from geventwebsocket import WebSocketServer, WebSocketApplication, Resource\n'), ((1028, 1077), 'geventwebsocket.WebSocket... |
"""
Summary:
Utility Functions that could be helpful in any part of the API.
All functions that are likely to be called across a number of classes
and Functions in the API should be grouped here for convenience.
Author:
<NAME>
Created:
01 Apr 2016
Copyright:
... | [
"logging.getLogger",
"operator.itemgetter",
"os.path.splitext",
"os.path.split"
] | [((902, 929), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (919, 929), False, 'import logging\n'), ((3281, 3308), 'os.path.splitext', 'os.path.splitext', (['file_path'], {}), '(file_path)\n', (3297, 3308), False, 'import os\n'), ((7209, 7235), 'os.path.splitext', 'os.path.splitext', (['... |
# u28_cerr_cfg.py:
#
# Non-regression test configuration file for MessageLogger service:
# distinct threshold level for linked destination, where
#
import FWCore.ParameterSet.Config as cms
process = cms.Process("TEST")
import FWCore.Framework.test.cmsExceptionsFatal_cff
process.options = FWCore.Framework.test.cmsExc... | [
"FWCore.ParameterSet.Config.untracked.string",
"FWCore.ParameterSet.Config.Source",
"FWCore.ParameterSet.Config.untracked.int32",
"FWCore.ParameterSet.Config.Process",
"FWCore.ParameterSet.Config.untracked.vstring",
"FWCore.ParameterSet.Config.untracked.bool",
"FWCore.ParameterSet.Config.Path",
"FWCor... | [((201, 220), 'FWCore.ParameterSet.Config.Process', 'cms.Process', (['"""TEST"""'], {}), "('TEST')\n", (212, 220), True, 'import FWCore.ParameterSet.Config as cms\n'), ((1107, 1132), 'FWCore.ParameterSet.Config.Source', 'cms.Source', (['"""EmptySource"""'], {}), "('EmptySource')\n", (1117, 1132), True, 'import FWCore.P... |
"""
Authors: <NAME>, <NAME>
E-mail: <EMAIL>, <EMAIL>
Course: Mashinski vid, FEEIT, Spring 2021
Date: 09.03.2021
Description: function library
model operations: construction, loading, saving
Python version: 3.6
"""
# python imports
from keras.layers import Conv2D, Conv2DTranspose, MaxPool2D, UpSampling2D,... | [
"keras.layers.Conv2D",
"keras.layers.UpSampling2D",
"keras.layers.Concatenate",
"keras.models.model_from_json",
"keras.layers.Input",
"keras.models.Model",
"keras.layers.Conv2DTranspose",
"keras.layers.MaxPool2D"
] | [((871, 898), 'keras.models.model_from_json', 'model_from_json', (['model_json'], {}), '(model_json)\n', (886, 898), False, 'from keras.models import Model, model_from_json\n'), ((1273, 1297), 'keras.layers.Input', 'Input', ([], {'shape': 'input_shape'}), '(shape=input_shape)\n', (1278, 1297), False, 'from keras.layers... |
"""
Unit tests for SNIa truth catalog code.
"""
import os
import unittest
import sqlite3
import numpy as np
import pandas as pd
from desc.sims_truthcatalog import SNeTruthWriter, SNSynthPhotFactory
class SNSynthPhotFactoryTestCase(unittest.TestCase):
"""
Test case class for SNIa synthetic photometry factory c... | [
"numpy.testing.assert_equal",
"sqlite3.connect",
"desc.sims_truthcatalog.SNSynthPhotFactory",
"os.path.join",
"os.path.isfile",
"unittest.main",
"pandas.read_sql",
"desc.sims_truthcatalog.SNeTruthWriter",
"os.remove"
] | [((4369, 4384), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4382, 4384), False, 'import unittest\n'), ((524, 720), 'desc.sims_truthcatalog.SNSynthPhotFactory', 'SNSynthPhotFactory', ([], {'z': '(0.6322702169418335)', 't0': '(61719.9950436545)', 'x0': '(4.2832710977804034e-06)', 'x1': '(-1.207738485943195)', 'c... |
# Copyright (c) 2018, DjaoDjin inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and t... | [
"logging.getLogger",
"datetime.datetime",
"saas.models.Transaction.objects.new_subscription_order",
"saas.utils.datetime_or_now",
"datetime.datetime.utcnow",
"saas.managers.metrics.month_periods",
"datetime.datetime.strptime",
"saas.models.Organization.objects.filter",
"saas.models.ChargeItem.object... | [((1800, 1827), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1817, 1827), False, 'import datetime, logging, random\n'), ((4443, 4511), 'datetime.datetime', 'datetime.datetime', ([], {'year': 'from_date.year', 'month': 'from_date.month', 'day': '(1)'}), '(year=from_date.year, month=from... |
import os, sys, re
import json
import pandas as pd
import pymongo
from main.LOADERS.publication_loader import PublicationLoader
from main.MONGODB_PUSHERS.mongodb_pusher import MongoDbPusher
from main.NLP.PREPROCESSING.preprocessor import Preprocessor
class ScopusStringMatch_HAmodule():
def __ini... | [
"main.MONGODB_PUSHERS.mongodb_pusher.MongoDbPusher",
"main.LOADERS.publication_loader.PublicationLoader",
"main.NLP.PREPROCESSING.preprocessor.Preprocessor",
"sys.stdout.flush",
"json.dump",
"sys.stdout.write"
] | [((354, 373), 'main.LOADERS.publication_loader.PublicationLoader', 'PublicationLoader', ([], {}), '()\n', (371, 373), False, 'from main.LOADERS.publication_loader import PublicationLoader\n'), ((405, 420), 'main.MONGODB_PUSHERS.mongodb_pusher.MongoDbPusher', 'MongoDbPusher', ([], {}), '()\n', (418, 420), False, 'from m... |
from core.celery.config import ERIGONES_TASK_USER
from que.tasks import execute, get_task_logger
from vms.models import SnapshotDefine, Snapshot, BackupDefine, Backup, IPAddress
logger = get_task_logger(__name__)
def is_vm_missing(vm, msg):
"""
Check failed command output and return True if VM is not on comp... | [
"vms.models.SnapshotDefine.objects.filter",
"vms.models.Snapshot.objects.filter",
"api.utils.request.get_dummy_request",
"que.tasks.get_task_logger",
"vms.models.Backup.objects.filter",
"que.tasks.execute",
"api.utils.views.call_api_view",
"vms.models.Snapshot.get_real_disk_id",
"vms.models.BackupDe... | [((188, 213), 'que.tasks.get_task_logger', 'get_task_logger', (['__name__'], {}), '(__name__)\n', (203, 213), False, 'from que.tasks import execute, get_task_logger\n'), ((6278, 6447), 'que.tasks.execute', 'execute', (['ERIGONES_TASK_USER', 'None', 'cmd'], {'meta': 'meta', 'lock': 'lock', 'callback': 'callback', 'queue... |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 <NAME> <<EMAIL>>
# Copyright (C) 2014-2016 <NAME> <<EMAIL>>
# Copyright (C) 2014-2016 <NAME> <<EMAIL>>
# Copyright (C) 2014-2016 <NAME> <<EMAIL>>
# Copyright (C) 2014-2016 <NAME> <<EMAIL>>
# This program is free software: you can redistribute it and/or modify
# it under... | [
"collections.OrderedDict",
"taiga.base.utils.json.dumps",
"django.core.urlresolvers.reverse"
] | [((1402, 1449), 'django.core.urlresolvers.reverse', 'reverse', (['"""tasks-detail"""'], {'kwargs': "{'pk': task.pk}"}), "('tasks-detail', kwargs={'pk': task.pk})\n", (1409, 1449), False, 'from django.core.urlresolvers import reverse\n'), ((2547, 2594), 'django.core.urlresolvers.reverse', 'reverse', (['"""tasks-detail""... |
#!/usr/local/bin/python3
# -*- coding: utf-8 -*-
import os
import argparse
import logging
import numpy as np
from PIL import Image
import matplotlib
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
from torchvision import transforms
import cv2
import tqdm
from net.pspnet import PSPNet
models = {
... | [
"numpy.array",
"torch.cuda.is_available",
"os.path.exists",
"os.listdir",
"numpy.repeat",
"argparse.ArgumentParser",
"matplotlib.colors.ListedColormap",
"os.mkdir",
"torchvision.transforms.ToTensor",
"matplotlib.pyplot.savefig",
"numpy.argmax",
"torchvision.transforms.Normalize",
"torchvisio... | [((1113, 1181), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Pyramid Scene Parsing Network"""'}), "(description='Pyramid Scene Parsing Network')\n", (1136, 1181), False, 'import argparse\n'), ((1679, 1699), 'torch.nn.DataParallel', 'nn.DataParallel', (['net'], {}), '(net)\n', (1694, 16... |
from src.gridworld_mdp import GridWorld
class EquiprobableRandomPolicy:
def __init__(self):
self.world_model = GridWorld()
def get_prob(self, selected_action, state):
assert state in self.world_model.states
assert selected_action in self.world_model.actions
num_all_possible_a... | [
"src.gridworld_mdp.GridWorld"
] | [((125, 136), 'src.gridworld_mdp.GridWorld', 'GridWorld', ([], {}), '()\n', (134, 136), False, 'from src.gridworld_mdp import GridWorld\n')] |
import logging
from collections import namedtuple
logger = logging.getLogger("pybinsim.Pose")
class Orientation(namedtuple('Orientation', ['yaw', 'pitch', 'roll'])):
pass
class Position(namedtuple('Position', ['x', 'y', 'z'])):
pass
class Custom(namedtuple('CustomValues', ['a', 'b', 'c'])):
pass
cl... | [
"logging.getLogger",
"collections.namedtuple"
] | [((60, 94), 'logging.getLogger', 'logging.getLogger', (['"""pybinsim.Pose"""'], {}), "('pybinsim.Pose')\n", (77, 94), False, 'import logging\n'), ((115, 166), 'collections.namedtuple', 'namedtuple', (['"""Orientation"""', "['yaw', 'pitch', 'roll']"], {}), "('Orientation', ['yaw', 'pitch', 'roll'])\n", (125, 166), False... |
from __future__ import print_function
"""
Low-level serial communication for Trinamic TMCM-140-42-SE controller
(used internally for the Thorlabs MFC1)
"""
import serial, struct, time, collections
try:
# this is nicer because it provides deadlock debugging information
from acq4.util.Mutex import RecursiveMut... | [
"threading.RLock",
"struct.pack",
"os.path.dirname",
"struct.unpack",
"SerialDevice.SerialDevice.__init__"
] | [((4354, 4371), 'threading.RLock', 'RLock', ([], {'debug': '(True)'}), '(debug=True)\n', (4359, 4371), False, 'from threading import RLock\n'), ((4605, 4667), 'SerialDevice.SerialDevice.__init__', 'SerialDevice.__init__', (['self'], {'port': 'self.port', 'baudrate': 'baudrate'}), '(self, port=self.port, baudrate=baudra... |
import unittest
from signals.generators.ios.core_data import get_current_version, get_core_data_from_folder
class CoreDataTestCase(unittest.TestCase):
def test_get_current_version(self):
version_name = get_current_version('./tests/files/doubledummy.xcdatamodeld')
self.assertEqual(version_name, 'du... | [
"signals.generators.ios.core_data.get_current_version",
"signals.generators.ios.core_data.get_core_data_from_folder"
] | [((216, 277), 'signals.generators.ios.core_data.get_current_version', 'get_current_version', (['"""./tests/files/doubledummy.xcdatamodeld"""'], {}), "('./tests/files/doubledummy.xcdatamodeld')\n", (235, 277), False, 'from signals.generators.ios.core_data import get_current_version, get_core_data_from_folder\n'), ((363,... |
#!/usr/bin/python
import sys
import argparse
class main:
def __init__(self):
parser = argparse.ArgumentParser(
description='Python package for streaming, recording, and visualizing EEG data from the Muse 2016 headset.',
usage='''muselsl <command> [<args>]
Available commands:
... | [
"argparse.ArgumentParser"
] | [((98, 1950), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Python package for streaming, recording, and visualizing EEG data from the Muse 2016 headset."""', 'usage': '"""muselsl <command> [<args>]\n Available commands:\n list List available Muse devices.\n ... |
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Copyright 2021- QuOCS Team
#
# 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://ww... | [
"quocspyside2interface.gui.freegradients.StoppingCriteriaNM.StoppingCriteriaNM",
"quocspyside2interface.logic.OptimalAlgorithmDictionaries.NelderMeadDictionary.NelderMeadDictionary"
] | [((1557, 1610), 'quocspyside2interface.logic.OptimalAlgorithmDictionaries.NelderMeadDictionary.NelderMeadDictionary', 'NelderMeadDictionary', ([], {'loaded_dictionary': 'nm_dictionary'}), '(loaded_dictionary=nm_dictionary)\n', (1577, 1610), False, 'from quocspyside2interface.logic.OptimalAlgorithmDictionaries.NelderMea... |
import ipfsapi
c = ipfsapi.connect()
peer_id = c.key_list()['Keys'][1]['Id']
c.name_publish('QmYjYGKXqo36GDt6f6qvp9qKAsrc72R9y88mQSLvogu8Ub', key='another_key')
result = c.cat('/ipns/' + peer_id)
print(result)
| [
"ipfsapi.connect"
] | [((21, 38), 'ipfsapi.connect', 'ipfsapi.connect', ([], {}), '()\n', (36, 38), False, 'import ipfsapi\n')] |
import cv2
import os
import numpy as np
# This module contains all common functions that are called in tester.py file
# Given an image below function returns rectangle for face detected alongwith gray scale image
def faceDetection(test_img):
gray_img = cv2.cvtColor(test_img, cv2.COLOR_BGR2GRAY) # convert color... | [
"cv2.rectangle",
"os.path.join",
"cv2.face.LBPHFaceRecognizer_create",
"cv2.putText",
"numpy.array",
"os.path.basename",
"cv2.cvtColor",
"cv2.CascadeClassifier",
"cv2.imread",
"os.walk"
] | [((261, 303), 'cv2.cvtColor', 'cv2.cvtColor', (['test_img', 'cv2.COLOR_BGR2GRAY'], {}), '(test_img, cv2.COLOR_BGR2GRAY)\n', (273, 303), False, 'import cv2\n'), ((364, 436), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['"""HaarCascade/haarcascade_frontalface_default.xml"""'], {}), "('HaarCascade/haarcascade_front... |
from elasticsearch.client.utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH
class MlClient(NamespacedClient):
@query_params('from_', 'size')
def get_filters(self, filter_id=None, params=None):
"""
:arg filter_id: The ID of the filter to fetch
:arg from_: skips a num... | [
"elasticsearch.client.utils.query_params",
"elasticsearch.client.utils._make_path"
] | [((136, 165), 'elasticsearch.client.utils.query_params', 'query_params', (['"""from_"""', '"""size"""'], {}), "('from_', 'size')\n", (148, 165), False, 'from elasticsearch.client.utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH\n'), ((543, 557), 'elasticsearch.client.utils.query_params', 'query_par... |
import dask
import numpy as np
import pandas as pd
from epimargin.models import Age_SIRVD
from epimargin.utils import annually, normalize, percent, years
from studies.vaccine_allocation.commons import *
from tqdm import tqdm
import warnings
warnings.filterwarnings("error")
num_sims = 1000
simulation_range = 1... | [
"dask.config.set",
"dask.distributed.progress",
"numpy.tile",
"numpy.ones",
"pandas.read_csv",
"dask.distributed.get_task_stream",
"epimargin.utils.normalize",
"dask.distributed.Client",
"numpy.zeros",
"numpy.savez_compressed",
"warnings.filterwarnings"
] | [((242, 274), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""error"""'], {}), "('error')\n", (265, 274), False, 'import warnings\n'), ((937, 1076), 'numpy.savez_compressed', 'np.savez_compressed', (["(dst / f'{tag}.npz')"], {'dT': 'policy.dT_total', 'dD': 'policy.dD_total', 'pi': 'policy.pi', 'q0': 'policy... |
'''Every agent has an agent state, which is its local view of the world'''
import numpy as np
import itertools
class AgentState:
def __init__(self, name, agt, seed=1234):
self.name = name
self.prng = np.random.RandomState(seed)
# contains the variable assignment (exploreD) for this agent a... | [
"itertools.product",
"numpy.random.RandomState"
] | [((221, 248), 'numpy.random.RandomState', 'np.random.RandomState', (['seed'], {}), '(seed)\n', (242, 248), True, 'import numpy as np\n'), ((837, 864), 'itertools.product', 'itertools.product', (['*domains'], {}), '(*domains)\n', (854, 864), False, 'import itertools\n')] |
import configparser
c = configparser.ConfigParser()
c.read("production.ini")
config = {}
config['host'] = c['dboption']['chost']
config['port'] = int(c['dboption']['cport'])
config['user'] = c['dboption']['cuser']
config['pw'] = c['dboption']['cpw']
config['db'] = c['dboption']['cdb']
config['homepath'] = c['option'][... | [
"configparser.ConfigParser"
] | [((25, 52), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (50, 52), False, 'import configparser\n')] |
# MIT License
#
# Copyright (c) 2015-2020 <NAME>
#
# 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 rights
# to use, copy, modify, merge, ... | [
"selene.have.no.url_containing",
"os.path.dirname",
"selene.have.url_containing",
"pytest.raises",
"selene.have.url",
"selene.have.no.url"
] | [((1414, 1458), 'selene.have.url', 'have.url', (['session_browser.driver.current_url'], {}), '(session_browser.driver.current_url)\n', (1422, 1458), False, 'from selene import have\n'), ((1487, 1539), 'selene.have.no.url', 'have.no.url', (['session_browser.driver.current_url[:-1]'], {}), '(session_browser.driver.curren... |
#!/usr/bin/python
# Copyright 2013 Mellanox Technologies, 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 applicab... | [
"argparse.ArgumentParser",
"networking_mlnx.eswitchd.cli.conn_utils.ConnUtil",
"sys.stderr.write",
"sys.exit",
"sys.stdout.write"
] | [((752, 773), 'networking_mlnx.eswitchd.cli.conn_utils.ConnUtil', 'conn_utils.ConnUtil', ([], {}), '()\n', (771, 773), False, 'from networking_mlnx.eswitchd.cli import conn_utils\n'), ((1098, 1136), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""ebrctl"""'}), "(prog='ebrctl')\n", (1121, 1136), ... |
from typing import List, Union
import numpy as np
import pandas_datareader as pdr
import pandas as pd
import matplotlib.pyplot as plt
def rsi(symbol :str ,name :str, date :str) -> None :
"""
Calculates and visualises the Relative Stock Index on a Stock of the company.
Parameters:
symbol(str) : Sy... | [
"pandas_datareader.get_data_yahoo",
"numpy.max",
"pandas.concat",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((620, 652), 'pandas_datareader.get_data_yahoo', 'pdr.get_data_yahoo', (['symbol', 'date'], {}), '(symbol, date)\n', (638, 652), True, 'import pandas_datareader as pdr\n'), ((1072, 1087), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(2)'], {}), '(2)\n', (1084, 1087), True, 'import matplotlib.pyplot as plt\n'), ((1... |
from django.db import models
class Room(models.Model):
code = models.CharField('Code', max_length=128)
tab_url = models.CharField('Tab url', max_length=512, default='', blank=True)
def to_dict(self):
return {
'users': [u.to_dict() for u in self.users.all()],
'tabUrl': self... | [
"django.db.models.CharField",
"django.db.models.BooleanField",
"django.db.models.ForeignKey"
] | [((68, 108), 'django.db.models.CharField', 'models.CharField', (['"""Code"""'], {'max_length': '(128)'}), "('Code', max_length=128)\n", (84, 108), False, 'from django.db import models\n'), ((123, 190), 'django.db.models.CharField', 'models.CharField', (['"""Tab url"""'], {'max_length': '(512)', 'default': '""""""', 'bl... |
import torch
DEVICE = torch.device("cuda")
SAVED_CHECKPOINTS = [32*1000, 100*1000, 150*1000, 200*1000, 300*1000, 400*1000]
SAVED_CHECKPOINTS += [10*1000, 20*1000, 30*1000, 40*1000, 50*1000, 60*1000, 70*1000, 80*1000, 90*1000]
SAVED_CHECKPOINTS += [25*1000, 50*1000, 75*1000]
SAVED_CHECKPOINTS = set(SAVED_CHECKPOINTS)... | [
"torch.device"
] | [((23, 43), 'torch.device', 'torch.device', (['"""cuda"""'], {}), "('cuda')\n", (35, 43), False, 'import torch\n')] |
import os
from cs50 import SQL
from flask import Flask, flash, redirect, render_template, request, session
from flask_session import Session
from tempfile import mkdtemp
from werkzeug.exceptions import default_exceptions, HTTPException, InternalServerError
from werkzeug.security import check_password_hash, generate_pa... | [
"flask.render_template",
"flask.Flask",
"cs50.SQL",
"os.environ.get",
"flask_session.Session",
"werkzeug.exceptions.InternalServerError",
"flask.redirect",
"helpers.apology",
"flask.request.form.get",
"tempfile.mkdtemp",
"flask.session.clear"
] | [((421, 436), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (426, 436), False, 'from flask import Flask, flash, redirect, render_template, request, session\n'), ((932, 941), 'tempfile.mkdtemp', 'mkdtemp', ([], {}), '()\n', (939, 941), False, 'from tempfile import mkdtemp\n'), ((1024, 1036), 'flask_session... |
from telethon.sync import TelegramClient
from telethon.errors.rpcerrorlist import PhoneNumberBannedError
import pickle, os
from colorama import init, Fore
from time import sleep
init()
n = Fore.RESET
lg = Fore.LIGHTGREEN_EX
r = Fore.RED
w = Fore.WHITE
cy = Fore.CYAN
ye = Fore.YELLOW
colors = [lg, r, w, cy, ye]
try:
... | [
"random.choice",
"pickle.dump",
"pickle.load",
"time.sleep",
"requests.get",
"os.system",
"colorama.init",
"telethon.sync.TelegramClient"
] | [((179, 185), 'colorama.init', 'init', ([], {}), '()\n', (183, 185), False, 'from colorama import init, Fore\n'), ((421, 454), 'os.system', 'os.system', (['"""pip install requests"""'], {}), "('pip install requests')\n", (430, 454), False, 'import pickle, os\n'), ((1014, 1030), 'os.system', 'os.system', (['"""cls"""'],... |
# dkhomeleague.py
import json
import logging
import os
from string import ascii_uppercase
import pandas as pd
from requests_html import HTMLSession
import browser_cookie3
import pdsheet
class Scraper:
"""scrapes league results"""
def __init__(self, league_key=None, username=None):
"""Creates instan... | [
"logging.NullHandler",
"pdsheet.get_app",
"browser_cookie3.firefox",
"logging.getLogger",
"os.getenv",
"pdsheet.get_worksheet",
"requests_html.HTMLSession",
"pandas.DataFrame"
] | [((724, 737), 'requests_html.HTMLSession', 'HTMLSession', ([], {}), '()\n', (735, 737), False, 'from requests_html import HTMLSession\n'), ((1310, 1335), 'browser_cookie3.firefox', 'browser_cookie3.firefox', ([], {}), '()\n', (1333, 1335), False, 'import browser_cookie3\n'), ((4779, 4802), 'pandas.DataFrame', 'pd.DataF... |
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 21 08:47:08 2019
@author: dordoloy
"""
import os
import pika
import config
import getpass
def publish_fanout():
amqp_url=config.amqp_url
# Parse CLODUAMQP_URL (fallback to localhost)
url = os.environ.get('CLOUDAMQP_URL',amqp_url)
params = pika... | [
"pika.BasicProperties",
"pika.URLParameters",
"pika.BlockingConnection",
"os.environ.get"
] | [((262, 303), 'os.environ.get', 'os.environ.get', (['"""CLOUDAMQP_URL"""', 'amqp_url'], {}), "('CLOUDAMQP_URL', amqp_url)\n", (276, 303), False, 'import os\n'), ((316, 339), 'pika.URLParameters', 'pika.URLParameters', (['url'], {}), '(url)\n', (334, 339), False, 'import pika\n'), ((392, 423), 'pika.BlockingConnection',... |
from dataclasses import dataclass
from apischema import deserialize, deserializer
from apischema.json_schema import deserialization_schema
@dataclass
class Expression:
value: int
@deserializer
def evaluate_expression(expr: str) -> Expression:
return Expression(int(eval(expr)))
# Could be shorten into des... | [
"apischema.json_schema.deserialization_schema",
"apischema.deserialize"
] | [((478, 512), 'apischema.json_schema.deserialization_schema', 'deserialization_schema', (['Expression'], {}), '(Expression)\n', (500, 512), False, 'from apischema.json_schema import deserialization_schema\n'), ((625, 651), 'apischema.deserialize', 'deserialize', (['Expression', '(0)'], {}), '(Expression, 0)\n', (636, 6... |
"""
These classes are a collection of the needed tools to read external data.
The External type objects created by these classes are initialized before
the Stateful objects by functions.Model.initialize.
"""
import re
import os
import warnings
import pandas as pd # TODO move to openpyxl
import numpy as np
import xarr... | [
"numpy.all",
"re.compile",
"openpyxl.load_workbook",
"xarray.broadcast",
"os.path.join",
"os.path.splitext",
"numpy.diff",
"os.path.isfile",
"numpy.array",
"numpy.empty_like",
"numpy.isnan",
"pandas.to_numeric",
"pandas.read_excel",
"warnings.warn",
"numpy.interp",
"re.findall",
"num... | [((16001, 16015), 'numpy.isnan', 'np.isnan', (['data'], {}), '(data)\n', (16009, 16015), True, 'import numpy as np\n'), ((16902, 16931), 'numpy.empty_like', 'np.empty_like', (['x'], {'dtype': 'float'}), '(x, dtype=float)\n', (16915, 16931), True, 'import numpy as np\n'), ((19042, 19071), 're.findall', 're.findall', (['... |
# File: C (Python 2.4)
from direct.gui.DirectGui import *
from direct.interval.IntervalGlobal import *
from direct.fsm.FSM import FSM
from direct.showbase.PythonUtil import Functor
from pandac.PandaModules import *
from pirates.piratesbase import PiratesGlobals
from pirates.piratesbase import PLocalizer
from pirates.p... | [
"direct.fsm.FSM.FSM.__init__",
"pirates.piratesgui.TabBar.TabBar.stash",
"pirates.piratesbase.PiratesGlobals.getInterfaceFont",
"pirates.piratesgui.TabBar.TopTab.__init__",
"pirates.piratesgui.TabBar.TopTab.destroy"
] | [((803, 846), 'pirates.piratesgui.TabBar.TopTab.__init__', 'TopTab.__init__', (['self', 'tabBar', 'name'], {}), '(self, tabBar, name, **None)\n', (818, 846), False, 'from pirates.piratesgui.TabBar import TopTab, TabBar\n'), ((1500, 1520), 'pirates.piratesgui.TabBar.TopTab.destroy', 'TopTab.destroy', (['self'], {}), '(s... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | [
"astropy.units.Unit"
] | [((12455, 12469), 'astropy.units.Unit', 'Unit', (['"""micron"""'], {}), "('micron')\n", (12459, 12469), False, 'from astropy.units import Unit\n'), ((13037, 13047), 'astropy.units.Unit', 'Unit', (['"""sr"""'], {}), "('sr')\n", (13041, 13047), False, 'from astropy.units import Unit\n'), ((13050, 13065), 'astropy.units.U... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md')) as fin:
long_description = fin.read()
setup(
name='pylint-pytest',
version='1.0.3',
author='<NAME>',
... | [
"os.path.dirname",
"setuptools.find_packages",
"os.path.join"
] | [((133, 155), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (145, 155), False, 'from os import path\n'), ((167, 195), 'os.path.join', 'path.join', (['here', '"""README.md"""'], {}), "(here, 'README.md')\n", (176, 195), False, 'from os import path\n'), ((654, 697), 'setuptools.find_packages', 'f... |
# Reverse TCP Shell in Python For Offensive Security/Penetration Testing Assignments
# Connect on LinkedIn https://www.linkedin.com/in/lismore or Twitter @patricklismore
#=========================================================================================================================================
# Python... | [
"subprocess.Popen",
"socket.socket"
] | [((420, 469), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (433, 469), False, 'import socket\n'), ((1233, 1350), 'subprocess.Popen', 'subprocess.Popen', (['sentCommand'], {'shell': '(True)', 'stdout': 'subprocess.PIPE', 'stderr': 'subprocess... |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info >= (2, 7, 0):
def swig_im... | [
"_viso2.TrackVector_empty",
"_viso2.TrackVector_push_back",
"_viso2.TrackVector___delitem__",
"_viso2.MatchVector___getitem__",
"_viso2.MatchVector_pop_back",
"_viso2.SwigPyIterator_value",
"_viso2.Matrix_inv",
"_viso2.Point3dVector_clear",
"_viso2.new_MatchVector",
"_viso2.MatchVector_pop",
"_v... | [((26063, 26083), '_viso2.Matrix_eye', '_viso2.Matrix_eye', (['m'], {}), '(m)\n', (26080, 26083), False, 'import _viso2\n'), ((26151, 26172), '_viso2.Matrix_diag', '_viso2.Matrix_diag', (['M'], {}), '(M)\n', (26169, 26172), False, 'import _viso2\n'), ((26258, 26288), '_viso2.Matrix_reshape', '_viso2.Matrix_reshape', ([... |
# -*- coding: utf-8 -*-
import asyncio
import datetime
import json
import logging
import sys
from typing import Optional
import aiohttp
from aiohttp import ClientSession
from . import __version__
from .errors import (
BadGateway,
BadRequest,
Forbidden,
HTTPException,
InternalServerError,
NotFo... | [
"logging.getLogger",
"aiohttp.ClientSession",
"json.loads",
"json.dumps",
"datetime.datetime.now",
"asyncio.get_event_loop"
] | [((354, 381), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (371, 381), False, 'import logging\n'), ((4193, 4250), 'json.dumps', 'json.dumps', (['obj'], {'separators': "(',', ':')", 'ensure_ascii': '(True)'}), "(obj, separators=(',', ':'), ensure_ascii=True)\n", (4203, 4250), False, 'imp... |
from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import gettext as _
class CategoriesAppHook(CMSApp):
name = _("Categories")
def get_urls(self, page=None, language=None, **kwargs):
return ["apps.articles.urls"]
apphook_pool.register(CategoriesA... | [
"cms.apphook_pool.apphook_pool.register",
"django.utils.translation.gettext"
] | [((287, 327), 'cms.apphook_pool.apphook_pool.register', 'apphook_pool.register', (['CategoriesAppHook'], {}), '(CategoriesAppHook)\n', (308, 327), False, 'from cms.apphook_pool import apphook_pool\n'), ((170, 185), 'django.utils.translation.gettext', '_', (['"""Categories"""'], {}), "('Categories')\n", (171, 185), True... |
# Generated by Django 3.1 on 2020-08-22 17:48
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='BoardGame',
fields=[
('id', models.AutoField(... | [
"django.db.models.DateField",
"django.db.models.IntegerField",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.CharField"
] | [((303, 396), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (319, 396), False, 'from django.db import migrations, models\... |
import re
# regex for a user or channel mention at the beginning of a message
# example matches: " <@UJQ07L30Q> ", "<#C010P8N1ABB|interns>"
# interactive playground: https://regex101.com/r/2Z7eun/2
MENTION_PATTERN = r"(?:^\s?<@(.*?)>\s?)|(?:^\s?<#(.*?)\|.*?>\s?)"
def get_set_element(_set):
"""get the element fr... | [
"re.sub",
"re.search"
] | [((1683, 1718), 're.search', 're.search', (['MENTION_PATTERN', 'message'], {}), '(MENTION_PATTERN, message)\n', (1692, 1718), False, 'import re\n'), ((2135, 2180), 're.sub', 're.sub', (['MENTION_PATTERN', '""""""', 'message'], {'count': '(1)'}), "(MENTION_PATTERN, '', message, count=1)\n", (2141, 2180), False, 'import ... |
from django.contrib.auth.views import LoginView
from django.urls import path
from student import views
urlpatterns = [
path('studentclick', views.studentclick_view, name='student-click'),
path('studentlogin', LoginView.as_view(
template_name='student/studentlogin.html'), name='studentlogin'),
path... | [
"django.contrib.auth.views.LoginView.as_view",
"django.urls.path"
] | [((125, 192), 'django.urls.path', 'path', (['"""studentclick"""', 'views.studentclick_view'], {'name': '"""student-click"""'}), "('studentclick', views.studentclick_view, name='student-click')\n", (129, 192), False, 'from django.urls import path\n'), ((316, 386), 'django.urls.path', 'path', (['"""studentsignup"""', 'vi... |
import datetime
from pydantic import Field
from typing import (
ClassVar,
List,
Dict,
Optional,
)
from smaregipy.base_api import (
BaseServiceRecordApi,
BaseServiceCollectionApi,
)
from smaregipy.utils import NoData, DictUtil
class CustomerGroup(BaseServiceRecordApi):
RECORD_NAME = 'custo... | [
"smaregipy.utils.DictUtil.convert_key_to_snake",
"pydantic.Field"
] | [((499, 528), 'pydantic.Field', 'Field', ([], {'default_factory': 'NoData'}), '(default_factory=NoData)\n', (504, 528), False, 'from pydantic import Field\n'), ((576, 605), 'pydantic.Field', 'Field', ([], {'default_factory': 'NoData'}), '(default_factory=NoData)\n', (581, 605), False, 'from pydantic import Field\n'), (... |