code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from bottle import request, response, abort
from bottle import get, post
import os
import json
import sys
from log import *
from models import Route
response.headers['Content-Type'] = 'application/json'
@post('/api/routes/<id>')
def routes(id):
try:
description = request.params.decode().get('description'... | [
"json.dumps",
"bottle.post",
"bottle.request.params.decode",
"sys.exc_info",
"bottle.abort",
"models.Route.Route"
] | [((207, 231), 'bottle.post', 'post', (['"""/api/routes/<id>"""'], {}), "('/api/routes/<id>')\n", (211, 231), False, 'from bottle import get, post\n'), ((389, 402), 'models.Route.Route', 'Route.Route', ([], {}), '()\n', (400, 402), False, 'from models import Route\n'), ((473, 506), 'json.dumps', 'json.dumps', (["{'resul... |
# Python Program To Create A Regular Expression Using The match() Method
# To Search For String Starting With m And Having Total 3 Characters
'''
Function Name : Regular Expression To Search String Using match()
Function Date : 27 Sep 2020
Function Author : <NAME>
Input : String
Output ... | [
"re.match"
] | [((392, 416), 're.match', 're.match', (['"""m\\\\w\\\\w"""', 'str'], {}), "('m\\\\w\\\\w', str)\n", (400, 416), False, 'import re\n')] |
#!/usr/bin/python
#
# Script to clone Geppetto git repositories
# If a target directory is not passed as the
# first argument, the sourcesdir specified in
# config.json is used
# If config.json is used, org.geppetto.core,
# model, frontend and simulation are
# included automatically.
# The user can chose to select the ... | [
"xml.dom.minidom.parse",
"os.path.join",
"os.path.dirname",
"os.path.isdir",
"subprocess.call",
"os.path.abspath"
] | [((791, 816), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (806, 816), False, 'import os, sys, subprocess, json\n'), ((936, 950), 'xml.dom.minidom.parse', 'parse', (['pompath'], {}), '(pompath)\n', (941, 950), False, 'from xml.dom.minidom import parse, parseString\n'), ((2220, 2245), 'os.pa... |
"""
MDShrine demo
=============
.. seealso::
`Material Design spec, Shrine <https://material.io/design/material-studies/shrine.html#>`
Shrine is a retail app that uses Material Design components
and Material Theming to express branding for a variety of fashion and lifestyle items.
"""
import os
from kivy.lang i... | [
"os.listdir",
"kivy.lang.Builder.load_string",
"os.path.join",
"os.path.dirname",
"kivy.properties.StringProperty"
] | [((472, 899), 'kivy.lang.Builder.load_string', 'Builder.load_string', (['"""\n#:import FadeTransition kivy.uix.screenmanager.FadeTransition\n#:import ShrineRegisterScreen studies.shrine.baseclass.register_screen.ShrineRegisterScreen\n#:import ShrineRootScreen studies.shrine.baseclass.shrine_root_screen.ShrineRootScreen... |
"""
Optimal binning algorithm for continuous target.
"""
# <NAME> <<EMAIL>>
# Copyright (C) 2019
import numbers
import time
from sklearn.utils import check_array
import numpy as np
from ..information import solver_statistics
from ..logging import Logger
from .auto_monotonic import auto_monotonic_continuous
from .a... | [
"numpy.ceil",
"numpy.digitize",
"numpy.asarray",
"time.perf_counter",
"numpy.min",
"numpy.max",
"numpy.count_nonzero",
"numpy.sum",
"numpy.array",
"numpy.argsort",
"numpy.empty",
"sklearn.utils.check_array",
"numpy.std",
"numpy.full",
"numpy.round"
] | [((21227, 21246), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (21244, 21246), False, 'import time\n'), ((21733, 21752), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (21750, 21752), False, 'import time\n'), ((23696, 23715), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (23713... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/OperationOutcome) on 2020-02-03.
# 2020, SMART Health IT.
import sys
from dataclasses import dataclass, field
from typing import ClassVar, Optional, List
from .backboneelement import Backbo... | [
"dataclasses.field"
] | [((1212, 1239), 'dataclasses.field', 'field', ([], {'default_factory': 'list'}), '(default_factory=list)\n', (1217, 1239), False, 'from dataclasses import dataclass, field\n')] |
from numpy import exp, pi
from ....Classes.Arc1 import Arc1
from ....Classes.Arc3 import Arc3
from ....Functions.Geometry.merge_notch_list import merge_notch_list
def get_yoke_desc(self, sym=1, is_reversed=False, prop_dict=None):
"""This method returns an ordered description of the elements
that defines the ... | [
"numpy.exp"
] | [((2967, 3003), 'numpy.exp', 'exp', (["(1.0j * yoke_dict['begin_angle'])"], {}), "(1.0j * yoke_dict['begin_angle'])\n", (2970, 3003), False, 'from numpy import exp, pi\n'), ((3031, 3065), 'numpy.exp', 'exp', (["(1.0j * yoke_dict['end_angle'])"], {}), "(1.0j * yoke_dict['end_angle'])\n", (3034, 3065), False, 'from numpy... |
#!/usr/bin/env python
import base64
import logging
import os
from datetime import datetime
import pytz
from flask import (
Flask,
jsonify,
redirect,
render_template,
session,
url_for,
)
from flask_migrate import Migrate
from flask_oauthlib.client import OAuth
from flask_socketio import SocketIO... | [
"logging.getLogger",
"flask.render_template",
"flask_oauthlib.client.OAuth",
"flask.Flask",
"flask_socketio.SocketIO",
"sqlalchemy.desc",
"eventlet.monkey_patch",
"flask.session.pop",
"marshmallow.fields.Nested",
"marshmallow.fields.DateTime",
"os.urandom",
"marshmallow.fields.Bool",
"flask_... | [((429, 469), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (448, 469), False, 'import logging\n'), ((479, 506), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (496, 506), False, 'import logging\n'), ((514, 529), 'flask.Flask', ... |
# Naive bayes and XGBoost with Tfidf vectorization used as benchmarks
from utils import *
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.feature_extraction.text import CountVectorizer
from nltk import word_tokenize
from nltk.stem import WordNetLemmatizer
from nltk.corpus import wordnet
from n... | [
"sklearn.feature_extraction.text.CountVectorizer",
"numpy.array",
"sklearn.naive_bayes.MultinomialNB",
"sklearn.ensemble.GradientBoostingClassifier",
"time.time"
] | [((1950, 2005), 'numpy.array', 'np.array', (['[item[1] for item in train_ls]'], {'dtype': 'np.long'}), '([item[1] for item in train_ls], dtype=np.long)\n', (1958, 2005), True, 'import numpy as np\n'), ((2018, 2071), 'numpy.array', 'np.array', (['[item[1] for item in dev_ls]'], {'dtype': 'np.long'}), '([item[1] for item... |
# Copyright 2020 Google LLC
#
# 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 by applicable law or agreed to in writing, ... | [
"prometheus_client.Gauge",
"prometheus_client.Info",
"prometheus_client.Enum",
"prometheus_client.Counter",
"time.time"
] | [((2777, 2892), 'prometheus_client.Gauge', 'prometheus_client.Gauge', (['"""victron_updated"""', '"""Last time a block was received from the device"""'], {'labelnames': 'labels'}), "('victron_updated',\n 'Last time a block was received from the device', labelnames=labels)\n", (2800, 2892), False, 'import prometheus_... |
# lint-amnesty, pylint: disable=missing-module-docstring
from unittest import TestCase
from six.moves import range
from .symmath_check import symmath_check
class SymmathCheckTest(TestCase): # lint-amnesty, pylint: disable=missing-class-docstring
def test_symmath_check_integers(self):
number_list = [i f... | [
"six.moves.range"
] | [((328, 344), 'six.moves.range', 'range', (['(-100)', '(100)'], {}), '(-100, 100)\n', (333, 344), False, 'from six.moves import range\n'), ((537, 553), 'six.moves.range', 'range', (['(-100)', '(100)'], {}), '(-100, 100)\n', (542, 553), False, 'from six.moves import range\n')] |
'''
prep_dev_notebook:
pred_newshapes_dev: Runs against new_shapes
'''
import os
import sys
import random
import math
import re
import gc
import time
import numpy as np
import cv2
import matplotlib
import matplotlib.pyplot as plt
import tensorflow as tf
import keras
import keras.backend as KB
import mrcnn.model_mod ... | [
"mrcnn.new_shapes.NewShapesDataset",
"mrcnn.datagen.data_generator",
"mrcnn.new_shapes.NewShapesConfig",
"os.path.join",
"mrcnn.model_mod.MaskRCNN",
"os.getcwd",
"platform.system",
"mrcnn.shapes.ShapesConfig",
"mrcnn.shapes.ShapesDataset",
"pprint.PrettyPrinter",
"keras.backend.clear_session",
... | [((597, 614), 'platform.system', 'platform.system', ([], {}), '()\n', (612, 614), False, 'import platform\n'), ((2144, 2185), 'pprint.PrettyPrinter', 'pprint.PrettyPrinter', ([], {'indent': '(2)', 'width': '(100)'}), '(indent=2, width=100)\n', (2164, 2185), False, 'import pprint\n'), ((2186, 2264), 'numpy.set_printopti... |
import requests
import json
import random
from api_key import access_token
from keyboards import default_keyboard
access = access_token
id = 176863166
v = '8.92'
admins = [132513584]
def get_longpoll():
params={
'group_id': id,
'v': v,
'access_token': access
}
... | [
"json.loads",
"random.randint",
"requests.get"
] | [((327, 413), 'requests.get', 'requests.get', (['"""https://api.vk.com/method/groups.getLongPollServer"""'], {'params': 'params'}), "('https://api.vk.com/method/groups.getLongPollServer', params=\n params)\n", (339, 413), False, 'import requests\n'), ((420, 438), 'json.loads', 'json.loads', (['r.text'], {}), '(r.tex... |
from setuptools import setup, find_packages
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
except ImportError:
long_description = open('README.md').read()
__version__ = ""
exec(open('opentc/util/setting.py').read())
setup(
name='opentc-util',
version=__version__,
... | [
"pypandoc.convert",
"setuptools.find_packages"
] | [((93, 129), 'pypandoc.convert', 'pypandoc.convert', (['"""README.md"""', '"""rst"""'], {}), "('README.md', 'rst')\n", (109, 129), False, 'import pypandoc\n'), ((926, 944), 'setuptools.find_packages', 'find_packages', (['"""."""'], {}), "('.')\n", (939, 944), False, 'from setuptools import setup, find_packages\n')] |
from sqlalchemy import Column, Integer, String, ForeignKey
from sqlalchemy.orm import relationship
from app.models.base import Base
class Game(Base):
__tablename__ = 'game'
game_id = Column(Integer, primary_key = True)
game_name = Column(String(16), index=True, unique=True, nullable=False)
generation... | [
"sqlalchemy.orm.relationship",
"sqlalchemy.String",
"sqlalchemy.ForeignKey",
"sqlalchemy.Column"
] | [((194, 227), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)'}), '(Integer, primary_key=True)\n', (200, 227), False, 'from sqlalchemy import Column, Integer, String, ForeignKey\n'), ((424, 474), 'sqlalchemy.orm.relationship', 'relationship', (['"""Generation"""'], {'back_populates': '"""games"""'}... |
import torch
from torch_geometric.nn.conv import MessagePassing
from torch_geometric.utils import to_dense_adj, contains_self_loops, contains_isolated_nodes
from torch_cluster import knn_graph
import torch.nn as nn
from torch_geometric.nn.inits import reset
from torch.nn import Sequential as Seq, Linear as Lin, R... | [
"mgpool.mgpool",
"torch.nn.ReLU",
"torch.nn.Sequential",
"torch.stack",
"torch_geometric.utils.contains_self_loops",
"torch.pow",
"os.path.realpath",
"torch_cluster.knn_graph",
"torch.nn.BatchNorm1d",
"torch.cuda.is_available",
"torch.sum",
"torch.nn.Linear",
"torch_geometric.utils.contains_... | [((699, 721), 'os.path.realpath', 'osp.realpath', (['__file__'], {}), '(__file__)\n', (711, 721), True, 'import os.path as osp\n'), ((1645, 1673), 'torch.zeros_like', 'torch.zeros_like', (['edge_index'], {}), '(edge_index)\n', (1661, 1673), False, 'import torch\n'), ((2635, 2678), 'torch.stack', 'torch.stack', (['(sour... |
# -*- coding: utf-8 -*-
import csv, os, uuid
from datetime import datetime
from . import helpers
def run(filepath):
# Start time
run_start = datetime.now()
# Test and open filepath
file = csv.reader(open(filepath, 'r'))
filename = os.path.basename(filepath)
# Generate unique run id
run_... | [
"datetime.datetime.now",
"os.path.basename",
"uuid.uuid4"
] | [((152, 166), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (164, 166), False, 'from datetime import datetime\n'), ((255, 281), 'os.path.basename', 'os.path.basename', (['filepath'], {}), '(filepath)\n', (271, 281), False, 'import csv, os, uuid\n'), ((1798, 1812), 'datetime.datetime.now', 'datetime.now', (... |
import numpy as np
import datetime
from sklearn.ensemble import RandomForestClassifier
from sklearn.neighbors import KNeighborsClassifier
from sklearn.svm import SVC
from sklearn.neural_network import MLPClassifier
import sklearn.metrics
from ops import add_features, augment_data
from sklearn.model_selection import tra... | [
"numpy.diagonal",
"numpy.reshape",
"ops.augment_data",
"sklearn.neural_network.MLPClassifier",
"sklearn.model_selection.train_test_split",
"numpy.asarray",
"numpy.column_stack",
"ops.add_features",
"sklearn.preprocessing.StandardScaler",
"numpy.sum",
"numpy.zeros",
"datetime.datetime.now",
"... | [((463, 496), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (486, 496), False, 'import warnings\n'), ((497, 531), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'suppress': '(True)'}), '(suppress=True)\n', (516, 531), True, 'import numpy as np\n'), ((798, 814), 's... |
# Generated by Django 2.0.6 on 2018-10-11 19:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('misclientes', '0014_auto_20181011_1455'),
]
operations = [
migrations.AlterField(
model_name='cliente',
name='enterp... | [
"django.db.models.ForeignKey"
] | [((345, 435), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'null': '(True)', 'on_delete': '"""models.CASCADE"""', 'to': '"""misclientes.Enterprise"""'}), "(null=True, on_delete='models.CASCADE', to=\n 'misclientes.Enterprise')\n", (362, 435), False, 'from django.db import migrations, models\n')] |
#!/usr/bin/env python
# Copyright (c) 2019 Diamond Key Security, NFP
# 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,
#... | [
"select.select",
"socket.getfqdn",
"socket.socket",
"paramiko.Transport",
"time.sleep",
"paramiko.rsakey.RSAKey.generate",
"threading.Event",
"threading.Thread",
"traceback.print_exc"
] | [((3947, 3984), 'paramiko.rsakey.RSAKey.generate', 'paramiko.rsakey.RSAKey.generate', (['(2048)'], {}), '(2048)\n', (3978, 3984), False, 'import paramiko\n'), ((2043, 2060), 'threading.Event', 'threading.Event', ([], {}), '()\n', (2058, 2060), False, 'import threading\n'), ((4715, 4732), 'threading.Event', 'threading.E... |
"""
Production settings for the pythonsd project.
In keeping with the 12 Factor App (https://12factor.net),
production settings come from the environment.
"""
import os
import dj_database_url
from .base import * # noqa
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
DEBUG = False
SECRET... | [
"dj_database_url.config",
"os.environ.get"
] | [((621, 657), 'os.environ.get', 'os.environ.get', (['"""ADMIN_URL"""', '"""admin"""'], {}), "('ADMIN_URL', 'admin')\n", (635, 657), False, 'import os\n'), ((1481, 1514), 'os.environ.get', 'os.environ.get', (['"""SECURE_SSL_HOST"""'], {}), "('SECURE_SSL_HOST')\n", (1495, 1514), False, 'import os\n'), ((1981, 2017), 'os.... |
from product.models import Product
from .models import add_transaction
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from .forms import InventoryForm, InventoryUpdateForm
def sort_products(request):
label = request.GET.get('label')
sort = request.GET.get('sort')
# split t... | [
"product.models.Product.objects.get",
"product.models.Product.objects.all",
"product.models.Product.objects.filter",
"django.core.paginator.Paginator"
] | [((1354, 1380), 'django.core.paginator.Paginator', 'Paginator', (['product_list', '(5)'], {}), '(product_list, 5)\n', (1363, 1380), False, 'from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger\n'), ((2897, 2923), 'product.models.Product.objects.get', 'Product.objects.get', ([], {'id': 'id'}), '(id=i... |
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import patches
####################
# 8 custom methods #
####################
def plot_custom_bar_chart_with_error(input_data,
input_names=None,
fig_tag=1,
... | [
"matplotlib.pyplot.setp",
"numpy.mean",
"matplotlib.patches.Rectangle",
"numpy.round",
"matplotlib.pyplot.figure",
"numpy.around",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.subplot2grid",
"numpy.arange"
] | [((842, 928), 'matplotlib.pyplot.figure', 'plt.figure', (['fig_tag'], {'figsize': 'input_fig_size', 'dpi': '(100)', 'facecolor': '"""w"""', 'edgecolor': '"""k"""'}), "(fig_tag, figsize=input_fig_size, dpi=100, facecolor='w',\n edgecolor='k')\n", (852, 928), True, 'import matplotlib.pyplot as plt\n'), ((1062, 1116), ... |
from setuptools import setup
setup(name='evostrat',
version='0.1',
description='Implements ES algorithms for python3',
author='<NAME>',
packages=['evostrat'],
url='https://github.com/Nathaniel-Rodriguez/evostrat.git',
install_requires=[
'numpy',
'matplotlib',
... | [
"setuptools.setup"
] | [((30, 315), 'setuptools.setup', 'setup', ([], {'name': '"""evostrat"""', 'version': '"""0.1"""', 'description': '"""Implements ES algorithms for python3"""', 'author': '"""<NAME>"""', 'packages': "['evostrat']", 'url': '"""https://github.com/Nathaniel-Rodriguez/evostrat.git"""', 'install_requires': "['numpy', 'matplot... |
import json
import pytest
import os
from scan import scan_datasets
from lib import options
def setup_module(module):
options.project_base_dirs['c3s-cordex'] = '/group_workspaces/jasmin2/cp4cds1/data'
module.base_dir = options.project_base_dirs['c3s-cordex']
@pytest.mark.skip('This ds id no longer creates a... | [
"scan.scan_datasets",
"pytest.mark.skip",
"os.path.join"
] | [((272, 340), 'pytest.mark.skip', 'pytest.mark.skip', (['"""This ds id no longer creates a corrupt JSON file"""'], {}), "('This ds id no longer creates a corrupt JSON file')\n", (288, 340), False, 'import pytest\n'), ((582, 714), 'scan.scan_datasets', 'scan_datasets', ([], {'project': '"""c3s-cordex"""', 'ds_ids': 'ds_... |
"""
============
pyflexconfig
============
A simple and flexible app configuration data provider.
Please read the README, the docstrings here, the tests and the ``demos/`` directory of the source bundle for more
documentation.
"""
import logging
import os
import pathlib
import runpy
import types
import typing
import... | [
"logging.getLogger",
"os.getenv",
"pathlib.Path",
"runpy.run_path",
"pkg_resources.get_distribution"
] | [((358, 390), 'logging.getLogger', 'logging.getLogger', ([], {'name': '__name__'}), '(name=__name__)\n', (375, 390), False, 'import logging\n'), ((951, 978), 'runpy.run_path', 'runpy.run_path', (['source_path'], {}), '(source_path)\n', (965, 978), False, 'import runpy\n'), ((446, 492), 'pkg_resources.get_distribution',... |
import collections
import warnings
import jax
import jax.numpy as np
FixedPointSolution = collections.namedtuple(
"FixedPointSolution",
"value converged iterations previous_value"
)
def unrolled(i, init_x, func, num_iter, return_last_two=False):
"""Repeatedly apply a function using a regular python loop... | [
"jax.numpy.logical_not",
"collections.namedtuple",
"jax.numpy.arange",
"jax.lax.while_loop",
"warnings.warn"
] | [((92, 185), 'collections.namedtuple', 'collections.namedtuple', (['"""FixedPointSolution"""', '"""value converged iterations previous_value"""'], {}), "('FixedPointSolution',\n 'value converged iterations previous_value')\n", (114, 185), False, 'import collections\n'), ((4027, 4180), 'warnings.warn', 'warnings.warn... |
import argparse
parser = argparse.ArgumentParser()
parser.add_argument(
"--dataset_path",
default=None,
type=str,
required=True,
help="Path to the [dev, test] dataset",
)
parser.add_argument(
"--index_path",
default=None,
type=str,
required=True,
help="Path to the indexes of c... | [
"argparse.ArgumentParser"
] | [((26, 51), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (49, 51), False, 'import argparse\n')] |
from theia.color import tidy_color
from sklearn.cluster import KMeans
from collections import Counter
from PIL import Image, ImageDraw
import argparse
def main(args):
image = Image.open(args.input).convert("RGB")
# Find and sort dominant colours
clusters = KMeans(n_clusters=args.num).fit(image.getdata())... | [
"sklearn.cluster.KMeans",
"PIL.Image.open",
"argparse.ArgumentParser",
"PIL.Image.new",
"theia.color.tidy_color",
"collections.Counter",
"PIL.ImageDraw.Draw"
] | [((374, 399), 'collections.Counter', 'Counter', (['clusters.labels_'], {}), '(clusters.labels_)\n', (381, 399), False, 'from collections import Counter\n'), ((441, 541), 'PIL.Image.new', 'Image.new', (['"""RGB"""', '(image.size[0], image.size[1] + args.height + args.gap)'], {'color': '(255, 255, 255)'}), "('RGB', (imag... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# pyre-strict
from typing import Optional
from unittest.mock import MagicMock, patch
from click.testing import CliRun... | [
"openr.cli.tests.helpers.get_enter_thrift_magicmock",
"unittest.mock.patch",
"click.testing.CliRunner"
] | [((1084, 1129), 'unittest.mock.patch', 'patch', (['helpers.COMMANDS_GET_OPENR_CTRL_CLIENT'], {}), '(helpers.COMMANDS_GET_OPENR_CTRL_CLIENT)\n', (1089, 1129), False, 'from unittest.mock import MagicMock, patch\n'), ((816, 827), 'click.testing.CliRunner', 'CliRunner', ([], {}), '()\n', (825, 827), False, 'from click.test... |
from django.views.generic import FormView, UpdateView
from django.db import transaction
from django.contrib import messages
from django.shortcuts import get_object_or_404
from django.contrib.auth import get_user_model
from django.conf import settings
from django.shortcuts import resolve_url
from django.utils.functional... | [
"django.shortcuts.resolve_url",
"django.contrib.auth.get_user_model",
"django.shortcuts.get_object_or_404",
"django.utils.translation.ugettext"
] | [((616, 632), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (630, 632), False, 'from django.contrib.auth import get_user_model\n'), ((712, 752), 'django.shortcuts.resolve_url', 'resolve_url', (['settings.LOGIN_REDIRECT_URL'], {}), '(settings.LOGIN_REDIRECT_URL)\n', (723, 752), False, 'from d... |
import numpy as np
import os
import matplotlib.pyplot as plt
import glob
import re
import torch
import torch.nn as nn
import torch
import cv2
import torchvision
from torch.utils.data import Dataset, DataLoader, ConcatDataset
from torchvision import transforms
import tqdm
from PIL import Image
import albumentations a... | [
"src.display.display_inference_result",
"torch.argmax",
"albumentations.Normalize",
"albumentations.Resize",
"torch.nn.Linear",
"torch.utils.data.DataLoader",
"src.dataset.ClassificationDataset",
"torch.no_grad",
"torchvision.models.densenet121",
"glob.glob",
"torch.device"
] | [((852, 899), 'torchvision.models.densenet121', 'torchvision.models.densenet121', ([], {'pretrained': '(True)'}), '(pretrained=True)\n', (882, 899), False, 'import torchvision\n'), ((1466, 1517), 'glob.glob', 'glob.glob', (['"""/home/abhinavnayak11/Pictures/Webcam/*"""'], {}), "('/home/abhinavnayak11/Pictures/Webcam/*'... |
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from app.core.config import DATABASE_URL
engine = create_engine(DATABASE_URL) # database engine
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = decla... | [
"sqlalchemy.orm.sessionmaker",
"sqlalchemy.create_engine",
"sqlalchemy.ext.declarative.declarative_base"
] | [((184, 211), 'sqlalchemy.create_engine', 'create_engine', (['DATABASE_URL'], {}), '(DATABASE_URL)\n', (197, 211), False, 'from sqlalchemy import create_engine\n'), ((246, 306), 'sqlalchemy.orm.sessionmaker', 'sessionmaker', ([], {'autocommit': '(False)', 'autoflush': '(False)', 'bind': 'engine'}), '(autocommit=False, ... |
from galaxy_test.base.populators import DatasetPopulator
from ._framework import ApiTestCase
class GroupsApiTestCase(ApiTestCase):
def setUp(self):
super().setUp()
self.dataset_populator = DatasetPopulator(self.galaxy_interactor)
def test_create_valid(self, group_name: str = None):
pa... | [
"galaxy_test.base.populators.DatasetPopulator"
] | [((211, 251), 'galaxy_test.base.populators.DatasetPopulator', 'DatasetPopulator', (['self.galaxy_interactor'], {}), '(self.galaxy_interactor)\n', (227, 251), False, 'from galaxy_test.base.populators import DatasetPopulator\n')] |
# <NAME>, Nov 2018
#
# This script analyzes the data and makes predictions.
# It creates a decision tree classifier with ideal hyperparameters
# (maximum depth and minimum samples split). These hyperparameters
# are calculated over the 80% training data using 3-fold cross validation.
# The predictions are made on the 2... | [
"argparse.ArgumentParser",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.tree.DecisionTreeClassifier",
"numpy.argmax",
"numpy.linspace",
"numpy.vstack",
"sklearn.model_selection.cross_val_score"
] | [((900, 925), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (923, 925), False, 'import argparse\n'), ((1137, 1165), 'pandas.read_csv', 'pd.read_csv', (['args.input_file'], {}), '(args.input_file)\n', (1148, 1165), True, 'import pandas as pd\n'), ((1437, 1474), 'sklearn.model_selection.train_te... |
import numpy as np
def _sum_by_group_sorted(indices, *values):
"""
Auxiliary function to sum up values by some given indices (both as numpy arrays). Expects the
indices and values to already be sorted.
:param indices:
:type indices:
:param values:
:type values:
:return:
:rtype:
... | [
"numpy.argsort",
"numpy.cumsum"
] | [((1261, 1280), 'numpy.argsort', 'np.argsort', (['indices'], {}), '(indices)\n', (1271, 1280), True, 'import numpy as np\n'), ((830, 859), 'numpy.cumsum', 'np.cumsum', (['val[i]'], {'out': 'val[i]'}), '(val[i], out=val[i])\n', (839, 859), True, 'import numpy as np\n')] |
import argparse
import pdb
import laspy
import os
import shutil
import numpy as np
from tqdm import tqdm
from semantics_recovery import all_path, mkdir
def config_parser():
parser = argparse.ArgumentParser(
description='Semantic label recovery script.',
formatter_class=argparse.ArgumentDefaultsHel... | [
"os.path.exists",
"os.listdir",
"numpy.minimum",
"argparse.ArgumentParser",
"numpy.logical_and",
"numpy.unique",
"os.path.join",
"semantics_recovery.mkdir",
"numpy.logical_or",
"numpy.stack",
"numpy.zeros",
"shutil.copy",
"os.path.abspath",
"numpy.maximum",
"semantics_recovery.all_path",... | [((188, 318), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Semantic label recovery script."""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), "(description='Semantic label recovery script.',\n formatter_class=argparse.ArgumentDefaultsHelpFormatter)\n", (211, 318), F... |
"""util functions
# many old functions, need to clean up
# homography --> homography
# warping
# loss --> delete if useless
"""
import numpy as np
import torch
from pathlib import Path
import datetime
import datetime
from collections import OrderedDict
import torch.nn.functional as F
import torch.nn as nn
###### check... | [
"scipy.io.savemat",
"tensorflow.shape",
"numpy.random.rand",
"yaml.load",
"numpy.argsort",
"numpy.array",
"utils.utils.warp_points",
"torch.sum",
"torch.nn.functional.softmax",
"numpy.arange",
"torch.arange",
"matplotlib.pyplot.imshow",
"torch.nn.functional.grid_sample",
"os.listdir",
"n... | [((682, 736), 'numpy.concatenate', 'np.concatenate', (['(img_gray, img_gray, img_gray)'], {'axis': '(0)'}), '((img_gray, img_gray, img_gray), axis=0)\n', (696, 736), True, 'import numpy as np\n'), ((1100, 1109), 'pathlib.Path', 'Path', (['"""."""'], {}), "('.')\n", (1104, 1109), False, 'from pathlib import Path\n'), ((... |
# https://github.com/micropython/micropython-lib/blob/master/umqtt.simple/example_sub_led.py
#edited on march 22nd by <NAME>
from cmath import e
from network import WLAN # For operation of WiFi network
import time # Allows use of time.sleep() for delays
import pycom # Base libra... | [
"SI7006A20.SI7006A20",
"MPL3115A2.MPL3115A2",
"machine.unique_id",
"time.sleep",
"struct.pack",
"time.ticks_ms",
"umqtt.MQTTClient",
"network.WLAN",
"pycom.rgbled",
"machine.idle",
"pycoproc_1.Pycoproc",
"pycom.heartbeat"
] | [((1844, 1866), 'pycom.heartbeat', 'pycom.heartbeat', (['(False)'], {}), '(False)\n', (1859, 1866), False, 'import pycom\n'), ((1867, 1882), 'time.sleep', 'time.sleep', (['(0.1)'], {}), '(0.1)\n', (1877, 1882), False, 'import time\n'), ((2019, 2041), 'pycom.rgbled', 'pycom.rgbled', (['(16711680)'], {}), '(16711680)\n',... |
import conmato
import os
# Would you like to use the submission time to rank participants?
PENALTY=True
# A list of user usernames = ['abc', 'def']
USERNAMES=None # None to get all participants
contest_id = '256575'
conmato.get_standings_to_csv(contest_id, usernames=USERNAMES, penalty=PENALTY) | [
"conmato.get_standings_to_csv"
] | [((222, 300), 'conmato.get_standings_to_csv', 'conmato.get_standings_to_csv', (['contest_id'], {'usernames': 'USERNAMES', 'penalty': 'PENALTY'}), '(contest_id, usernames=USERNAMES, penalty=PENALTY)\n', (250, 300), False, 'import conmato\n')] |
import os
import sys
from datetime import datetime
sys.path.insert(0, os.path.abspath('..'))
import mupub
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.viewcode',
'sphinx.ext.intersphinx',
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
# the github project name
project... | [
"os.path.abspath",
"datetime.datetime.now",
"os.environ.get",
"mupub.__version__.split"
] | [((71, 92), 'os.path.abspath', 'os.path.abspath', (['""".."""'], {}), "('..')\n", (86, 92), False, 'import os\n'), ((339, 353), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (351, 353), False, 'from datetime import datetime\n'), ((896, 931), 'os.environ.get', 'os.environ.get', (['"""READTHEDOCS"""', 'None'... |
# Author: <NAME> (<EMAIL>) 05/31/2018
# Modified by <NAME> 07/12/2020
import bpy
import mathutils
import numpy as np
import os
import sys
import time
import pdb
import argparse
def setup_blender(width, height, focal_length, output_dir):
# camera
#bpy.ops.object.delete()
for m in bpy.data.meshes:
... | [
"bpy.data.meshes.remove",
"mathutils.Vector",
"os.makedirs",
"bpy.ops.transform.rotate",
"os.path.join",
"numpy.array",
"bpy.data.materials.remove",
"bpy.ops.import_scene.obj",
"numpy.loadtxt",
"numpy.arctan"
] | [((2388, 2414), 'numpy.loadtxt', 'np.loadtxt', (['viewspace_path'], {}), '(viewspace_path)\n', (2398, 2414), True, 'import numpy as np\n'), ((2434, 2465), 'numpy.loadtxt', 'np.loadtxt', (['test_predicted_path'], {}), '(test_predicted_path)\n', (2444, 2465), True, 'import numpy as np\n'), ((2614, 2682), 'numpy.array', '... |
"""
This is a setup.py script generated by py2applet
Usage:
python setup.py py2exe
"""
# experimental code for linkage mapper interface BHM 2011-09-04
import os
import py2exe
from distutils.core import setup
from csversion import CIRCUITSCAPE_VER, CIRCUITSCAPE_AUTHOR, CIRCUITSCAPE_EMAIL
#INCLUDES = []
INCLUDES ... | [
"distutils.core.setup"
] | [((540, 715), 'distutils.core.setup', 'setup', ([], {'console': "['cs_run.py']", 'data_files': 'DATA_FILES', 'options': "{'py2exe': OPTIONS}", 'version': 'CIRCUITSCAPE_VER', 'author': 'CIRCUITSCAPE_AUTHOR', 'author_email': 'CIRCUITSCAPE_EMAIL'}), "(console=['cs_run.py'], data_files=DATA_FILES, options={'py2exe':\n O... |
# -*- coding: utf-8 -*-
import logging
import time
from datetime import datetime
from mailtrigger.scheduler.scheduler import Scheduler, SchedulerException
def test_exception():
exception = SchedulerException('exception')
assert str(exception) == 'exception'
def test_add():
config = {
'debug': ... | [
"mailtrigger.scheduler.scheduler.SchedulerException",
"logging.getLogger",
"mailtrigger.scheduler.scheduler.Scheduler",
"time.sleep",
"datetime.datetime.now"
] | [((197, 228), 'mailtrigger.scheduler.scheduler.SchedulerException', 'SchedulerException', (['"""exception"""'], {}), "('exception')\n", (215, 228), False, 'from mailtrigger.scheduler.scheduler import Scheduler, SchedulerException\n'), ((368, 385), 'mailtrigger.scheduler.scheduler.Scheduler', 'Scheduler', (['config'], {... |
#!/usr/bin/env python3
####################################################################################################
#
# Project: Embedded Learning Library (ELL)
# File: profile_builder.py
# Authors: <NAME>
#
# Requires: Python 3.x
#
####################################################################... | [
"logger.setup",
"optimizer_util.ProfileOptions.parse_option_list_from_file",
"sys.exc_info",
"sys.exit",
"os.remove",
"os.listdir",
"argparse.ArgumentParser",
"optimizer_util.make_profiler_data",
"find_ell.add_ell_root_args",
"dask.delayed",
"dask.compute",
"wrap.ModuleBuilder",
"os.path.spl... | [((635, 649), 'logger.setup', 'logger.setup', ([], {}), '()\n', (647, 649), False, 'import logger\n'), ((516, 541), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (531, 541), False, 'import os\n'), ((559, 604), 'os.path.join', 'os.path.join', (['script_path', '""".."""', '""".."""', '"""wrap"... |
# -*- coding: utf-8 -*-
import time
import sys
from gamedb import COLORS
from gamedb import Weapon
from gamedb import WEAPONS
from gamedb import LEVEL_UP_MSG
from gamedb import NEWITEM_MSG
from gamedb import Party
from gamedb import party_weapons
from gamedb import equiped_weapons
import battle_system
fro... | [
"gamedb.Party.unequip_all",
"gamedb.Party.equiped_weapons_len",
"battle_system.main",
"gamedb.Party.equip_weapon",
"time.sleep",
"gamedb.Party.is_equiped",
"gamedb.Party.add_weapon",
"sys.exit",
"sys.stdout.flush"
] | [((3978, 4005), 'gamedb.Party.equiped_weapons_len', 'Party.equiped_weapons_len', ([], {}), '()\n', (4003, 4005), False, 'from gamedb import Party\n'), ((3307, 3326), 'gamedb.Party.add_weapon', 'Party.add_weapon', (['i'], {}), '(i)\n', (3323, 3326), False, 'from gamedb import Party\n'), ((3927, 3948), 'gamedb.Party.equi... |
from telegram.ext import Updater, CommandHandler, callbackcontext
from telegram import Update, ReplyKeyboardMarkup
from telegram.chataction import ChatAction
from telegram.ext import MessageHandler
from telegram.ext.filters import Filters
from currency import *
from coin_gold import *
from crypto import *
from stock im... | [
"data.date",
"telegram.ext.filters.Filters.regex",
"decouple.config",
"telegram.ext.Updater",
"telegram.ext.CommandHandler",
"telegram.ReplyKeyboardMarkup"
] | [((387, 402), 'decouple.config', 'config', (['"""TOKEN"""'], {}), "('TOKEN')\n", (393, 402), False, 'from decouple import config\n'), ((410, 416), 'data.date', 'date', ([], {}), '()\n', (414, 416), False, 'from data import date\n'), ((2946, 2978), 'telegram.ext.Updater', 'Updater', (['token'], {'use_context': '(True)'}... |
import discord
from discord.ext import commands
class Avatar(commands.Cog):
def __init__(self, client):
self.client = client
# Commands
@commands.command()
async def 아바타(self, ctx):
if (ctx.message.mentions.__len__() > 0):
for user in ctx.message.mentions:
... | [
"discord.Embed",
"discord.ext.commands.command"
] | [((160, 178), 'discord.ext.commands.command', 'commands.command', ([], {}), '()\n', (176, 178), False, 'from discord.ext import commands\n'), ((371, 481), 'discord.Embed', 'discord.Embed', ([], {'title': "('**' + user.name + '**님의 아바타')", 'description': "('[Link]' + '(' + pfp + ')')", 'color': '(16777215)'}), "(title='... |
import pytest
import os
import numpy as np
import dxx
@pytest.fixture(scope="module")
def mock_data_file() -> str:
mock_file_name = "mock.DSB"
sampling_freq = 48000
mock_data = np.arange(5 * sampling_freq, dtype=np.int16)
dxx.write(mock_file_name, mock_data)
yield mock_file_name
os.remove(mo... | [
"pytest.fixture",
"dxx.write",
"numpy.arange",
"os.remove"
] | [((59, 89), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (73, 89), False, 'import pytest\n'), ((193, 237), 'numpy.arange', 'np.arange', (['(5 * sampling_freq)'], {'dtype': 'np.int16'}), '(5 * sampling_freq, dtype=np.int16)\n', (202, 237), True, 'import numpy as np\n'), ((24... |
WTF_CSRF_ENABLED = True # activate cross-site request forgery
SECRET_KEY = 'you-will-never-guess' # cryptographic token when above line is enabled
import os
basedir = os.path.abspath(os.path.dirname(__file__))
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.db')
SQLALCHEMY_MIGRATE_REPO = os.path... | [
"os.path.dirname",
"os.path.join"
] | [((313, 351), 'os.path.join', 'os.path.join', (['basedir', '"""db_repository"""'], {}), "(basedir, 'db_repository')\n", (325, 351), False, 'import os\n'), ((186, 211), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (201, 211), False, 'import os\n'), ((255, 286), 'os.path.join', 'os.path.join'... |
import time, pytest, asyncio, logging
from ..src.devlprd.DaemonState import DaemonState
from ..src.devlprd import serif
from ..src.devlprd.config import BOARDS
from ..src.devlprd.daemon import shutdown
CURRENT_BOARD = BOARDS['DEVLPR']
logging.basicConfig(level=logging.INFO)
class TestSerial():
@pytest.mark.a... | [
"logging.basicConfig",
"logging.warning",
"time.sleep",
"pytest.main",
"asyncio.get_event_loop",
"time.time"
] | [((237, 276), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (256, 276), False, 'import time, pytest, asyncio, logging\n'), ((982, 995), 'pytest.main', 'pytest.main', ([], {}), '()\n', (993, 995), False, 'import time, pytest, asyncio, logging\n'), ((624, 635), '... |
"""
ckwg +31
Copyright 2016 by Kitware, 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:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the ... | [
"vital.types.EigenArray.c_ptr_type",
"vital.types.EigenArray.from_iterable",
"vital.types.EigenArray"
] | [((2635, 2680), 'vital.types.EigenArray.from_iterable', 'EigenArray.from_iterable', (['m', 'datatype', '(3, 3)'], {}), '(m, datatype, (3, 3))\n', (2659, 2680), False, 'from vital.types import EigenArray\n'), ((6711, 6767), 'vital.types.EigenArray', 'EigenArray', (['(3)', '(3)'], {'dtype': 'self._datatype', 'from_cptr':... |
#!/usr/bin/python
"""
(C) Copyright 2019 Intel Corporation.
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 ... | [
"os.path.join",
"ior_utils.IorCommand.log_metrics"
] | [((2125, 2173), 'os.path.join', 'os.path.join', (['self.prefix', '"""lib64"""', '"""libioil.so"""'], {}), "(self.prefix, 'lib64', 'libioil.so')\n", (2137, 2173), False, 'import os\n'), ((2282, 2383), 'ior_utils.IorCommand.log_metrics', 'IorCommand.log_metrics', (['self.log', "('5 clients - with ' + 'interception librar... |
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import six
from conductor.client.http.api_client import ApiClient
class MetadataResourceApi(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the cla... | [
"six.iteritems",
"conductor.client.http.api_client.ApiClient"
] | [((2227, 2258), 'six.iteritems', 'six.iteritems', (["params['kwargs']"], {}), "(params['kwargs'])\n", (2240, 2258), False, 'import six\n'), ((5698, 5729), 'six.iteritems', 'six.iteritems', (["params['kwargs']"], {}), "(params['kwargs'])\n", (5711, 5729), False, 'import six\n'), ((9128, 9159), 'six.iteritems', 'six.iter... |
# Copyright 2019 <NAME>. Subject to the Apache2 license.
import layer
import context
def test_layer_init():
assert layer.Layer(context.Context(), {"name":"value"}, ["otherName"])
def test_layer_with():
ctx = context.Context()
cur_fields = ctx.peek_layer()
assert len(cur_fields) == 0
with laye... | [
"context.Context",
"layer.Layer"
] | [((223, 240), 'context.Context', 'context.Context', ([], {}), '()\n', (238, 240), False, 'import context\n'), ((133, 150), 'context.Context', 'context.Context', ([], {}), '()\n', (148, 150), False, 'import context\n'), ((316, 376), 'layer.Layer', 'layer.Layer', (['ctx', "{'name1': 'value1', 'name2': 'value2'}", '[]'], ... |
import numpy as np
import argparse
import os
import random
from tensorflow.python.training.tracking.util import Checkpoint
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import time
import json
import tensorflow as tf
from tensorflow.keras import optimizers
from tensorflow.keras.layers import *
from tensorflow.keras.models ... | [
"train_tf.train_model",
"model_tf.TrajPreLocalAttnLong",
"train_tf.generate_input_history",
"model_tf.TrajPreAttnAvgLongUser",
"argparse.ArgumentParser",
"tensorflow.keras.callbacks.ReduceLROnPlateau",
"train_tf.markov",
"numpy.random.seed",
"random.sample",
"tensorflow.keras.losses.SparseCategori... | [((946, 1588), 'train_tf.RnnParameterData', 'RnnParameterData', ([], {'loc_emb_size': 'args.loc_emb_size', 'uid_emb_size': 'args.uid_emb_size', 'voc_emb_size': 'args.voc_emb_size', 'tim_emb_size': 'args.tim_emb_size', 'hidden_size': 'args.hidden_size', 'dropout_p': 'args.dropout_p', 'data_name': 'args.data_name', 'lr':... |
from collections import namedtuple
AsymptoticCovarianceParams = namedtuple(
'AsymptoticCovarianceParams',
(
'num_batch',
'num_presimulation_steps'
),
defaults=(
200, # num_batch
10000 # num_presimulation_steps
)
)
BigStepLayeredPolicyParams = namedtuple(
'Big... | [
"collections.namedtuple"
] | [((66, 175), 'collections.namedtuple', 'namedtuple', (['"""AsymptoticCovarianceParams"""', "('num_batch', 'num_presimulation_steps')"], {'defaults': '(200, 10000)'}), "('AsymptoticCovarianceParams', ('num_batch',\n 'num_presimulation_steps'), defaults=(200, 10000))\n", (76, 175), False, 'from collections import name... |
# encoding: UTF-8
#
# Copyright (c) 2015, Facility for Rare Isotope Beams
#
#
"""
Common utilities for the Tornado Web framework.
.. moduleauthor:: <NAME> <<EMAIL>>
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import re
import json
class WriteF... | [
"re.sub",
"json.dump"
] | [((486, 529), 're.sub', 're.sub', (['"""[^\\\\.\\\\-_\\\\(\\\\)\\\\w]"""', '""""""', 'filename'], {}), "('[^\\\\.\\\\-_\\\\(\\\\)\\\\w]', '', filename)\n", (492, 529), False, 'import re\n'), ((1965, 2000), 'json.dump', 'json.dump', (['obj', 'self'], {'indent': 'indent'}), '(obj, self, indent=indent)\n', (1974, 2000), F... |
from pathlib import Path
from tempfile import TemporaryDirectory
from unittest import TestCase
from zkviz import zkviz
class TestListZettels(TestCase):
def test_list_zettels_with_md_extension(self):
# Create a temporary folder and write files in it
with TemporaryDirectory() as tmpdirname:
... | [
"tempfile.TemporaryDirectory",
"zkviz.zkviz.parse_args",
"zkviz.zkviz.list_zettels"
] | [((2053, 2073), 'zkviz.zkviz.parse_args', 'zkviz.parse_args', (['""""""'], {}), "('')\n", (2069, 2073), False, 'from zkviz import zkviz\n'), ((2179, 2219), 'zkviz.zkviz.parse_args', 'zkviz.parse_args', (["['--pattern', '*.txt']"], {}), "(['--pattern', '*.txt'])\n", (2195, 2219), False, 'from zkviz import zkviz\n'), ((2... |
""" prefix_sums_data.py
Prefix sum related dataloaders
Collaboratively developed
by <NAME>, <NAME>,
<NAME>, and <NAME>.
Developed for DeepThinking project
October 2021
"""
import torch
from torch.utils import data
from easy_to_hard_data import PrefixSumDataset
# Ignore statemenst for pylint:... | [
"torch.utils.data.DataLoader",
"torch.Generator",
"easy_to_hard_data.PrefixSumDataset"
] | [((823, 877), 'easy_to_hard_data.PrefixSumDataset', 'PrefixSumDataset', (['"""../../../data"""'], {'num_bits': 'train_data'}), "('../../../data', num_bits=train_data)\n", (839, 877), False, 'from easy_to_hard_data import PrefixSumDataset\n'), ((892, 945), 'easy_to_hard_data.PrefixSumDataset', 'PrefixSumDataset', (['"""... |
import os
import numpy as np
import json
from detectron2.structures import BoxMode
import itertools
from detectron2.data import DatasetCatalog, MetadataCatalog
from detectron2.data.datasets import register_coco_instances, load_coco_json
from detectron2.data import detection_utils as utils
import detectron2.data.transf... | [
"detectron2.data.detection_utils.filter_empty_instances",
"detectron2.modeling.build_model",
"detectron2.config.get_cfg",
"cv2.imread",
"os.path.join",
"detectron2.data.DatasetMapper",
"detectron2.data.detection_utils.annotations_to_instances",
"detectron2.data.detection_utils.transform_instance_annot... | [((1570, 1597), 'copy.deepcopy', 'copy.deepcopy', (['dataset_list'], {}), '(dataset_list)\n', (1583, 1597), False, 'import copy\n'), ((1674, 1730), 'detectron2.data.detection_utils.read_image', 'utils.read_image', (["dataset_list['file_name']"], {'format': 'None'}), "(dataset_list['file_name'], format=None)\n", (1690, ... |
""" Launch MPKernelUnix """
from ipykernel.kernelapp import IPKernelApp
from .unix import MPKernelUnix
# Launch the unix port
IPKernelApp.launch_instance(kernel_class=MPKernelUnix)
| [
"ipykernel.kernelapp.IPKernelApp.launch_instance"
] | [((127, 181), 'ipykernel.kernelapp.IPKernelApp.launch_instance', 'IPKernelApp.launch_instance', ([], {'kernel_class': 'MPKernelUnix'}), '(kernel_class=MPKernelUnix)\n', (154, 181), False, 'from ipykernel.kernelapp import IPKernelApp\n')] |
# -*- coding: utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _
from util import filepath
from django.contrib.auth.models import User
__author__ = 'pobear'
class Season(models.Model):
name = models.CharField(_(u'标题'), max_length=16)
descr = models.TextField(_(u'描述... | [
"django.utils.translation.ugettext_lazy"
] | [((260, 268), 'django.utils.translation.ugettext_lazy', '_', (['u"""标题"""'], {}), "(u'标题')\n", (261, 268), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((314, 322), 'django.utils.translation.ugettext_lazy', '_', (['u"""描述"""'], {}), "(u'描述')\n", (315, 322), True, 'from django.utils.translation im... |
from tkinter import *
from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg, NavigationToolbar2Tk)
from matplotlib.backend_bases import key_press_handler
import numpy as np
#commandline
import argparse
#visualization
import matplotlib.pyplot as plt
#font
import matplotlib.font_manager as fm
# import pyglet
#... | [
"matplotlib.pyplot.text",
"matplotlib.backends.backend_tkagg.NavigationToolbar2Tk",
"importlib.import_module",
"argparse.ArgumentParser",
"matplotlib.font_manager.FontProperties",
"matplotlib.pyplot.gca",
"numpy.array",
"matplotlib.pyplot.annotate",
"sklearn.neighbors.DistanceMetric.get_metric",
"... | [((469, 507), 'sklearn.neighbors.DistanceMetric.get_metric', 'DistanceMetric.get_metric', (['"""euclidean"""'], {}), "('euclidean')\n", (494, 507), False, 'from sklearn.neighbors import DistanceMetric\n'), ((628, 669), 'importlib.import_module', 'importlib.import_module', (['PLUGIN_NAME', '"""."""'], {}), "(PLUGIN_NAME... |
import dataclasses
from types import MethodType
from typing import ( # type: ignore
Any,
Callable,
Dict,
List,
Optional,
Tuple,
Type,
_TypedDictMeta,
)
from dictdaora import DictDaora
from .decorator import jsondaora
from .exceptions import DeserializationError
class StringField(Dic... | [
"typing._TypedDictMeta",
"dataclasses.make_dataclass",
"types.MethodType"
] | [((7822, 7889), 'dataclasses.make_dataclass', 'dataclasses.make_dataclass', (['id_', 'extracted_annotations'], {'bases': 'bases'}), '(id_, extracted_annotations, bases=bases)\n', (7848, 7889), False, 'import dataclasses\n'), ((822, 858), 'types.MethodType', 'MethodType', (['validate_min_length', 'cls'], {}), '(validate... |
import tweepy
from config import *
#----------------------------------------------------------------------------------------------#
#Creator: ItsJustRubix
#Script: Sends a tweet to your account
#License: MIT
#Bot Version: v0.5
#*NOTE* This bot is still in early development, It will be updated frequently.
#-----... | [
"tweepy.API",
"tweepy.OAuthHandler"
] | [((434, 484), 'tweepy.OAuthHandler', 'tweepy.OAuthHandler', (['consumer_key', 'consumer_secret'], {}), '(consumer_key, consumer_secret)\n', (453, 484), False, 'import tweepy\n'), ((549, 565), 'tweepy.API', 'tweepy.API', (['auth'], {}), '(auth)\n', (559, 565), False, 'import tweepy\n')] |
#!/usr/bin/env python
from __future__ import print_function
import os
import sys
import glob
import argparse
import ninja_syntax
class Configuration:
def __init__(self, options):
self.root_dir = os.path.dirname(os.path.abspath(__file__))
self.source_dir = os.path.join(self.root_dir, "src")
... | [
"os.path.isabs",
"argparse.ArgumentParser",
"os.path.join",
"sys.platform.startswith",
"os.path.splitext",
"platform.release",
"os.path.basename",
"sys.exit",
"os.path.abspath",
"os.path.relpath"
] | [((6868, 6937), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""WebRunner configuration script"""'}), "(description='WebRunner configuration script')\n", (6891, 6937), False, 'import argparse\n'), ((280, 314), 'os.path.join', 'os.path.join', (['self.root_dir', '"""src"""'], {}), "(self.ro... |
""" Copyright (c) 2020 Cisco and/or its affiliates.
This software is licensed to you under the terms of the Cisco Sample
Code License, Version 1.1 (the "License"). You may obtain a copy of the
License at
https://developer.cisco.com/docs/licenses
All use of the material herein must be in accordance with the t... | [
"flask.render_template",
"flask.request.args.get",
"flask.Flask",
"time.sleep",
"meraki_api.list_network_obj",
"meraki_api.get_organizations",
"flask.request.form.get",
"firewall_helper.execute",
"policy_helper.read_csv",
"context_helper.Context",
"policy_helper.check_group_obj",
"flask.Respon... | [((969, 978), 'context_helper.Context', 'Context', ([], {}), '()\n', (976, 978), False, 'from context_helper import Context\n'), ((986, 1001), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (991, 1001), False, 'from flask import Flask, render_template, request, url_for, redirect, Response\n'), ((9259, 9283... |
import pPEG
print("Arith operatpr expression example....")
arith = pPEG.compile("""
exp = add
add = sub ('+' sub)*
sub = mul ('-' mul)*
mul = div ('*' div)*
div = pow ('/' pow)*
pow = val ('^' val)*
grp = '(' exp ')'
val = " " (sym / num / grp) " "
sym = [a-zA-Z]+
num = [0-9]+
""")
tests = [
... | [
"pPEG.compile"
] | [((69, 315), 'pPEG.compile', 'pPEG.compile', (['"""\n exp = add \n add = sub (\'+\' sub)*\n sub = mul (\'-\' mul)*\n mul = div (\'*\' div)*\n div = pow (\'/\' pow)*\n pow = val (\'^\' val)*\n grp = \'(\' exp \')\'\n val = " " (sym / num / grp) " "\n sym = [a-zA-Z]+\n num = [0-9]+\n"""'], {}), '(\n """\n e... |
import json
from .version import VERSION
from selenium import webdriver
from axe_selenium_python import Axe
from robot.libraries.BuiltIn import BuiltIn
from robot.api.deco import keyword
from robot.api import logger
class AxeLibrary():
ROBOT_LIBRARY_SCOPE = 'GLOBAL'
ROBOT_LIBRARY_VERSION = VERSION
def __... | [
"json.dumps",
"robot.api.logger.info",
"robot.api.deco.keyword",
"robot.libraries.BuiltIn.BuiltIn",
"axe_selenium_python.Axe"
] | [((401, 435), 'robot.api.deco.keyword', 'keyword', (['"""Run Accessibility Tests"""'], {}), "('Run Accessibility Tests')\n", (408, 435), False, 'from robot.api.deco import keyword\n'), ((2259, 2299), 'robot.api.deco.keyword', 'keyword', (['"""Get Json Accessibility Result"""'], {}), "('Get Json Accessibility Result')\n... |
#!/usr/bin/env python3
import logging
import os
import sys
from cryptojwt import KeyJar
# from cryptojwt.jwk import pems_to_x5c
from flask import Flask
from oidcop.utils import create_context
from oidcop.utils import lower_or_upper
from oidcrp.configure import Configuration
from oidcrp.configure import create_from_con... | [
"logging.getLogger",
"fedservice.op.signing_service.SigningService",
"logging.basicConfig",
"oidcop.utils.create_context",
"flask.Flask",
"logging.Formatter",
"os.path.join",
"os.path.realpath",
"os.path.isfile",
"cryptojwt.KeyJar",
"oidcop.utils.lower_or_upper",
"logging.FileHandler",
"oidc... | [((474, 495), 'logging.getLogger', 'logging.getLogger', (['""""""'], {}), "('')\n", (491, 495), False, 'import logging\n'), ((540, 573), 'logging.FileHandler', 'logging.FileHandler', (['LOGFILE_NAME'], {}), '(LOGFILE_NAME)\n', (559, 573), False, 'import logging\n'), ((591, 658), 'logging.Formatter', 'logging.Formatter'... |
import importlib
from os import path
from dagger import conf
from dagger.dag_creator.airflow.operator_creator import OperatorCreator
class AirflowOpCreator(OperatorCreator):
ref_name = "airflow_operator"
def __init__(self, task, dag):
super().__init__(task, dag)
def _create_operator(self, **kwa... | [
"os.path.splitext",
"os.path.join",
"importlib.import_module"
] | [((422, 464), 'importlib.import_module', 'importlib.import_module', (['self._task.module'], {}), '(self._task.module)\n', (445, 464), False, 'import importlib\n'), ((633, 692), 'os.path.join', 'path.join', (['self._task.pipeline.directory', 'self._task.python'], {}), '(self._task.pipeline.directory, self._task.python)\... |
__all__ = ['TokenCache']
from msal import SerializableTokenCache
class TokenCache():
def __init__(self, path):
self.file_path = path / 'token.json'
with self.file_path.open('r') as f:
token = f.read()
if not token:
raise Exception('No Token')
self.cache =... | [
"msal.SerializableTokenCache"
] | [((321, 345), 'msal.SerializableTokenCache', 'SerializableTokenCache', ([], {}), '()\n', (343, 345), False, 'from msal import SerializableTokenCache\n')] |
import multiprocessing
import LoadBar
from HashPasswords import pass_compare_with_pickle
def authenticate_login(pswd, sal, pep, file, email):
print('Creating login token...')
__name__ = "__main__"
if __name__ == "__main__":
manager = multiprocessing.Manager()
return_dict = manager.dict()
p1 = multip... | [
"multiprocessing.Manager",
"LoadBar.writeResult",
"multiprocessing.Process"
] | [((591, 618), 'LoadBar.writeResult', 'LoadBar.writeResult', (['status'], {}), '(status)\n', (610, 618), False, 'import LoadBar\n'), ((245, 270), 'multiprocessing.Manager', 'multiprocessing.Manager', ([], {}), '()\n', (268, 270), False, 'import multiprocessing\n'), ((314, 366), 'multiprocessing.Process', 'multiprocessin... |
import os
f = open('etc/txt.done.data.train')
for line in f:
id = line.split('\n')[0].split()[1]
fname = 'dur_feats/' + id + '.dur'
cmd = 'cp ' + fname + ' dur_feats/train'
os.system(cmd)
f = open('etc/txt.done.data.test')
for line in f:
id = line.split('\n')[0].split()[1]
fname = 'dur_feats... | [
"os.system"
] | [((191, 205), 'os.system', 'os.system', (['cmd'], {}), '(cmd)\n', (200, 205), False, 'import os\n'), ((385, 399), 'os.system', 'os.system', (['cmd'], {}), '(cmd)\n', (394, 399), False, 'import os\n')] |
from tensorflow.keras.layers import (
Convolution2D,
MaxPooling2D,
UpSampling2D,
BatchNormalization,
Concatenate,
LeakyReLU,
ReLU,
Activation,
Add
)
from tensorflow.keras.regularizers import l2
from tensorflow.keras import activations
from semantic_segmentation.convolutional_neural_... | [
"tensorflow.keras.layers.Convolution2D",
"tensorflow.keras.layers.Concatenate",
"tensorflow.keras.layers.UpSampling2D",
"tensorflow.keras.layers.MaxPooling2D",
"tensorflow.keras.layers.Add",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.keras.layers.Activation",
"semantic_segmentation.conv... | [((961, 981), 'tensorflow.keras.layers.BatchNormalization', 'BatchNormalization', ([], {}), '()\n', (979, 981), False, 'from tensorflow.keras.layers import Convolution2D, MaxPooling2D, UpSampling2D, BatchNormalization, Concatenate, LeakyReLU, ReLU, Activation, Add\n'), ((997, 1025), 'tensorflow.keras.layers.Activation'... |
# Generated by Django 2.0.7 on 2018-08-07 09:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('status', '0001_squashed_0019_auto_20180716_1420'),
]
operations = [
migrations.AddField(
model_name='progress',
name... | [
"django.db.models.CharField",
"django.db.models.SmallIntegerField"
] | [((353, 408), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(100)', 'null': '(True)'}), '(blank=True, max_length=100, null=True)\n', (369, 408), False, 'from django.db import migrations, models\n'), ((536, 655), 'django.db.models.SmallIntegerField', 'models.SmallIntegerField'... |
############################################################
# -*- coding: utf-8 -*-
#
# # # # # # #
# ## ## # ## # #
# # # # # # # # # # #
# # ## # ## ## ######
# # # # # # #
#
# Python-based Tool for interaction with the 10micron mounts
# GUI with PyQT5 fo... | [
"logging.getLogger",
"socket.socket",
"uuid.uuid4"
] | [((1637, 1664), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1654, 1664), False, 'import logging\n'), ((8266, 8315), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (8279, 8315), False, 'import socket\n'), ((49... |
# This adds credentials to the pool for the credential box
# Asks user for year and users to add
start_day = 1
start_month = 1
#start_year = 1904
#users_to_add = 100
users_to_add = int(input('how many users do you want to add?'))
print('Be aware a user can not have a duplicate credential with the same start date')
st... | [
"ahk.AHK",
"pygetwindow.getWindowsWithTitle",
"time.sleep",
"pyautogui.typewrite"
] | [((509, 514), 'ahk.AHK', 'AHK', ([], {}), '()\n', (512, 514), False, 'from ahk import AHK\n'), ((740, 753), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (750, 753), False, 'import time\n'), ((809, 824), 'time.sleep', 'time.sleep', (['(0.1)'], {}), '(0.1)\n', (819, 824), False, 'import time\n'), ((847, 862), 'tim... |
import discord
import asyncio
import youtube_dl
import string
class vidPlayer:
def __init__(self, bot):
self.bot = bot
self.list = []
self.voice = None
self.player = None
@asyncio.coroutine
def playAll(self, channel: discord.Channel=None):
if len(self.list) == 0:
... | [
"discord.compat.run_coroutine_threadsafe"
] | [((1482, 1544), 'discord.compat.run_coroutine_threadsafe', 'discord.compat.run_coroutine_threadsafe', (['coro', 'self.voice.loop'], {}), '(coro, self.voice.loop)\n', (1521, 1544), False, 'import discord\n'), ((1850, 1910), 'discord.compat.run_coroutine_threadsafe', 'discord.compat.run_coroutine_threadsafe', (['coro', '... |
from flask import current_app as app
@app.cli.command('sync-data')
def sync_data_cli():
from app.tasks import sync_data
print('Sync data was launched')
sync_data.apply_async()
| [
"app.tasks.sync_data.apply_async",
"flask.current_app.cli.command"
] | [((40, 68), 'flask.current_app.cli.command', 'app.cli.command', (['"""sync-data"""'], {}), "('sync-data')\n", (55, 68), True, 'from flask import current_app as app\n'), ((167, 190), 'app.tasks.sync_data.apply_async', 'sync_data.apply_async', ([], {}), '()\n', (188, 190), False, 'from app.tasks import sync_data\n')] |
from agegrader.agegrader import AgeGrader
import decimal
def get_activity_age_grade(athlete, elapsed_time, race, start_time):
age = get_athlete_age(athlete=athlete, date=start_time.date())
if not age:
return 0
age_grader = AgeGrader()
age_graded_performance_factor = age_grader.age_graded_perfo... | [
"agegrader.agegrader.AgeGrader",
"decimal.Decimal"
] | [((245, 256), 'agegrader.agegrader.AgeGrader', 'AgeGrader', ([], {}), '()\n', (254, 256), False, 'from agegrader.agegrader import AgeGrader\n'), ((847, 872), 'decimal.Decimal', 'decimal.Decimal', (['(1.609344)'], {}), '(1.609344)\n', (862, 872), False, 'import decimal\n')] |
#! /usr/bin/env python3
import os, sys, sqlite3, functools, configparser, textwrap
import os.path as op
from datetime import datetime, timezone
from . import cli_parser, utils, data_access, core
from .rainbow import ColoredStr, cstr
from .data_access import DataAccess
from .utils import (
DATA_DIR, DB_PATH, VERSION_... | [
"os.path.exists",
"configparser.ConfigParser",
"sqlite3.connect",
"datetime.datetime.strptime",
"os.environ.get",
"os.path.join",
"functools.partial",
"os.mkdir",
"textwrap.wrap",
"sys.exit"
] | [((1014, 1041), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (1039, 1041), False, 'import os, sys, sqlite3, functools, configparser, textwrap\n'), ((1463, 1522), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {'allow_no_value': '(True)', 'strict': '(True)'}), '(allow_no_va... |
# The MIT License (MIT)
#
# Copyright (c) 2021 <NAME> (github user cjdaly)
#
# 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 ... | [
"digitalio.DigitalInOut",
"neopixel.NeoPixel",
"busio.UART",
"time.sleep"
] | [((1196, 1233), 'neopixel.NeoPixel', 'neopixel.NeoPixel', (['board.NEOPIXEL', '(10)'], {}), '(board.NEOPIXEL, 10)\n', (1213, 1233), False, 'import board, busio, digitalio, neopixel, time\n'), ((1244, 1274), 'busio.UART', 'busio.UART', (['board.TX', 'board.RX'], {}), '(board.TX, board.RX)\n', (1254, 1274), False, 'impor... |
import csv, pickle, time
from collections import Counter
import matplotlib.pyplot as plt
from sklearn.manifold import TSNE
import warnings
warnings.filterwarnings(action='ignore', category=UserWarning, module='gensim')
from utils import GeneSeg
from gensim.models.word2vec import Word2Vec
learning_rate = 0.1
vocabular... | [
"gensim.models.word2vec.Word2Vec",
"csv.DictReader",
"matplotlib.pyplot.savefig",
"pickle.dump",
"matplotlib.pyplot.figtext",
"sklearn.manifold.TSNE",
"collections.Counter",
"matplotlib.pyplot.annotate",
"matplotlib.pyplot.figure",
"utils.GeneSeg",
"matplotlib.pyplot.scatter",
"time.time",
"... | [((140, 219), 'warnings.filterwarnings', 'warnings.filterwarnings', ([], {'action': '"""ignore"""', 'category': 'UserWarning', 'module': '"""gensim"""'}), "(action='ignore', category=UserWarning, module='gensim')\n", (163, 219), False, 'import warnings\n'), ((547, 558), 'time.time', 'time.time', ([], {}), '()\n', (556,... |
import numpy as np
a = np.arange(10) * 10
print(a)
# [ 0 10 20 30 40 50 60 70 80 90]
print(a[5])
# 50
print(a[8])
# 80
print(a[[5, 8]])
# [50 80]
print(a[[5, 4, 8, 0]])
# [50 40 80 0]
print(a[[5, 5, 5, 5]])
# [50 50 50 50]
idx = np.array([[5, 4], [8, 0]])
print(idx)
# [[5 4]
# [8 0]]
print(a[idx])
# [[50 40]
... | [
"numpy.array",
"numpy.ix_",
"numpy.arange"
] | [((237, 263), 'numpy.array', 'np.array', (['[[5, 4], [8, 0]]'], {}), '([[5, 4], [8, 0]])\n', (245, 263), True, 'import numpy as np\n'), ((1410, 1432), 'numpy.ix_', 'np.ix_', (['[0, 2]', '[1, 3]'], {}), '([0, 2], [1, 3])\n', (1416, 1432), True, 'import numpy as np\n'), ((24, 37), 'numpy.arange', 'np.arange', (['(10)'], ... |
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 16 23:46:04 2018
@author: <NAME>
"""
"""############################## in this code, we include Gender ########################"""
# imporing libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# importing dataset
dataset = pd.read_csv('So... | [
"sklearn.preprocessing.LabelEncoder",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.preprocessing.OneHotEncoder",
"sklearn.linear_model.LogisticRegression",
"sklearn.preprocessing.StandardScaler",
"os.path.abspath",
"accuracy.accuracy_on_cm",
"sklearn.metrics.confusion_matr... | [((305, 342), 'pandas.read_csv', 'pd.read_csv', (['"""Social_Network_Ads.csv"""'], {}), "('Social_Network_Ads.csv')\n", (316, 342), True, 'import pandas as pd\n'), ((492, 508), 'sklearn.preprocessing.StandardScaler', 'StandardScaler', ([], {}), '()\n', (506, 508), False, 'from sklearn.preprocessing import StandardScale... |
"""
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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
... | [
"os.path.exists",
"tinctest.lib.run_shell_command",
"os.makedirs",
"tinctest.logger.info",
"os.environ.get",
"tinctest.logger.debug",
"os.path.isfile",
"tinctest.logger.error",
"tinctest.lib.local_path",
"platform.machine"
] | [((916, 952), 'os.environ.get', 'os.environ.get', (['"""GPPKG_RC_URL"""', 'None'], {}), "('GPPKG_RC_URL', None)\n", (930, 952), False, 'import os, re\n'), ((1082, 1122), 'tinctest.lib.run_shell_command', 'run_shell_command', (['cmd', '"""run gppkg"""', 'res'], {}), "(cmd, 'run gppkg', res)\n", (1099, 1122), False, 'fro... |
from elasticsearch_dsl import Index, Document, Integer, Text, analyzer, Keyword, Double
from elasticsearch_dsl.connections import connections
from elasticsearch import Elasticsearch, helpers
from evaluation import get_relevance_label_df
from datetime import datetime
from tqdm import tqdm
import logging
import json
impo... | [
"evaluation.get_relevance_label_df",
"elasticsearch.helpers.bulk",
"elasticsearch_dsl.Text",
"tqdm.tqdm",
"datetime.datetime.now",
"elasticsearch_dsl.Index",
"elasticsearch_dsl.connections.connections.create_connection",
"elasticsearch_dsl.Integer",
"logging.error"
] | [((356, 365), 'elasticsearch_dsl.Integer', 'Integer', ([], {}), '()\n', (363, 365), False, 'from elasticsearch_dsl import Index, Document, Integer, Text, analyzer, Keyword, Double\n'), ((381, 387), 'elasticsearch_dsl.Text', 'Text', ([], {}), '()\n', (385, 387), False, 'from elasticsearch_dsl import Index, Document, Int... |
"""
__/\\\\\\\\\\\\______________________/\\\\\\\\\\\____/\\\________/\\\_
_\/\\\////////\\\__________________/\\\/////////\\\_\/\\\_______\/\\\_
_\/\\\______\//\\\________________\//\\\______\///__\/\\\_______\/\\\_
_\/\\\_______\/\\\_____/\\\\\______\////\\\_________\/\\\_______\/\\\_
_\/\\\_______\/\\\___/... | [
"datetime.datetime.today",
"argparse.ArgumentParser",
"sys.exit"
] | [((864, 912), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'description'}), '(description=description)\n', (887, 912), False, 'import argparse\n'), ((2346, 2357), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (2354, 2357), False, 'import sys\n'), ((2600, 2616), 'datetime.datetime.today',... |
#
# <NAME> <<EMAIL>>
#
# Copyright 2009 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2. This program is distributed in the hope that it
# will be useful, but WITHOUT A... | [
"gettext.ldgettext"
] | [((1114, 1149), 'gettext.ldgettext', 'gettext.ldgettext', (['"""pykickstart"""', 'x'], {}), "('pykickstart', x)\n", (1131, 1149), False, 'import gettext\n')] |
import os
import subprocess
import sys
import datetime
import boto3
sys.path.append(os.path.dirname(__file__))
import configuration
from ast import literal_eval
def run_command(cmd, type):
try:
if type == "check_output":
command = subprocess.check_output(cmd)
return literal_eval(c... | [
"subprocess.check_output",
"boto3.client",
"os.path.split",
"os.path.dirname",
"sys.exc_info",
"datetime.datetime.now",
"subprocess.call",
"configuration.get_aligo_configuration"
] | [((86, 111), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (101, 111), False, 'import os\n'), ((13917, 13956), 'configuration.get_aligo_configuration', 'configuration.get_aligo_configuration', ([], {}), '()\n', (13954, 13956), False, 'import configuration\n'), ((13974, 13993), 'boto3.client'... |
import time
import turtle
# DISCLAIMER: I never included special relativity, which means no magnetism.
# If you use this to simulate electrodynamics, your answer WILL be wrong.
wn = turtle.Screen()
class BasePhysicsBody(object):
"""Base Class for Physics Body."""
def __init__(self, x_0, v_0, m, color=None, s... | [
"turtle.Screen",
"turtle.Turtle"
] | [((184, 199), 'turtle.Screen', 'turtle.Screen', ([], {}), '()\n', (197, 199), False, 'import turtle\n'), ((358, 373), 'turtle.Turtle', 'turtle.Turtle', ([], {}), '()\n', (371, 373), False, 'import turtle\n'), ((1530, 1545), 'turtle.Turtle', 'turtle.Turtle', ([], {}), '()\n', (1543, 1545), False, 'import turtle\n')] |
import operator
from django.conf import settings
from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Board, Column, Project, Tag, Todo, Type
REPORTER_ATTR = getattr(settings, 'BUDGET_REPORTER_ATTR', 'is_staff')
EDITOR_ATTR = getattr(settings, 'BUDGET_EDITOR_ATTR', '... | [
"rest_framework.serializers.SlugField",
"django.contrib.auth.models.User.objects.all",
"rest_framework.serializers.SerializerMethodField",
"operator.attrgetter"
] | [((486, 521), 'rest_framework.serializers.SerializerMethodField', 'serializers.SerializerMethodField', ([], {}), '()\n', (519, 521), False, 'from rest_framework import serializers\n'), ((535, 570), 'rest_framework.serializers.SerializerMethodField', 'serializers.SerializerMethodField', ([], {}), '()\n', (568, 570), Fal... |
import os
import numpy as np
from PIL import Image
from eratosthenes.generic.mapping_io import read_geo_image
from eratosthenes.preprocessing.shadow_transforms import mat_to_gray, gamma_adjustment, log_adjustment
rgi_id = 'RGI60-01.19773' # Red Glacier
bbox = (4353, 5279, 9427, 10980) # 1000 m buffer
f2018 = "T05VM... | [
"numpy.uint8",
"numpy.dstack",
"PIL.Image.fromarray",
"os.path.join",
"eratosthenes.preprocessing.shadow_transforms.log_adjustment",
"eratosthenes.preprocessing.shadow_transforms.mat_to_gray"
] | [((1160, 1179), 'eratosthenes.preprocessing.shadow_transforms.mat_to_gray', 'mat_to_gray', (['I_18_r'], {}), '(I_18_r)\n', (1171, 1179), False, 'from eratosthenes.preprocessing.shadow_transforms import mat_to_gray, gamma_adjustment, log_adjustment\n'), ((1189, 1208), 'eratosthenes.preprocessing.shadow_transforms.mat_to... |
import blosc
import numpy as np
from meshparty.trimesh_io import Mesh
DEFAULT_VOXEL_RESOLUTION = [4, 4, 40]
class InputError(Exception):
def __init__(self, message):
self.message = message
def unique_column_name(base_name, suffix, df):
if base_name is not None:
col_name = f"{base_name}_{suf... | [
"blosc.decompress"
] | [((1480, 1501), 'blosc.decompress', 'blosc.decompress', (['znm'], {}), '(znm)\n', (1496, 1501), False, 'import blosc\n'), ((1253, 1274), 'blosc.decompress', 'blosc.decompress', (['zvs'], {}), '(zvs)\n', (1269, 1274), False, 'import blosc\n'), ((1330, 1351), 'blosc.decompress', 'blosc.decompress', (['zfs'], {}), '(zfs)\... |
# program to extract data from FITS files into files to
# represent a box of the stellar atmosphere
import numpy as np
import os.path
import os
import sys
import time
import glob
from astropy.io import fits
from tqdm import tqdm
import importlib
import phys
importlib.reload(phys)
def getdata(f):
hdulist = fit... | [
"numpy.swapaxes",
"numpy.exp",
"numpy.zeros",
"numpy.concatenate",
"importlib.reload",
"astropy.io.fits.open",
"numpy.loadtxt",
"numpy.broadcast_to",
"numpy.arange"
] | [((262, 284), 'importlib.reload', 'importlib.reload', (['phys'], {}), '(phys)\n', (278, 284), False, 'import importlib\n'), ((1051, 1087), 'numpy.loadtxt', 'np.loadtxt', (['"""dims.inp"""'], {'comments': '"""!"""'}), "('dims.inp', comments='!')\n", (1061, 1087), True, 'import numpy as np\n'), ((1488, 1533), 'numpy.broa... |
import unittest
from test_workflow.test_result.test_suite_results import TestSuiteResults
class TestTestResultsSuite(unittest.TestCase):
def setUp(self) -> None:
self.test_test_results_suite = TestSuiteResults()
def test_status(self) -> None:
test_failed = self.test_test_results_suite.failed... | [
"test_workflow.test_result.test_suite_results.TestSuiteResults"
] | [((208, 226), 'test_workflow.test_result.test_suite_results.TestSuiteResults', 'TestSuiteResults', ([], {}), '()\n', (224, 226), False, 'from test_workflow.test_result.test_suite_results import TestSuiteResults\n')] |
import os
from celery import Celery
from flask import Flask, request, redirect, render_template, url_for, jsonify
from flask_sqlalchemy import SQLAlchemy
from flask_mail import Mail
from flask.ext.login import login_required
from seq2seq.execute import give_suggestion
from models import Email
# The number of emails ... | [
"flask_mail.Mail",
"flask.render_template",
"flask.request.args.get",
"seq2seq.execute.give_suggestion",
"flask.Flask",
"celery.Celery",
"models.Email.model.query.filter_by",
"flask.request.form.get",
"flask.url_for",
"flask.request.form.to_dict",
"flask_sqlalchemy.SQLAlchemy",
"models.Email.q... | [((357, 372), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (362, 372), False, 'from flask import Flask, request, redirect, render_template, url_for, jsonify\n'), ((502, 517), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', (['app'], {}), '(app)\n', (512, 517), False, 'from flask_sqlalchemy import SQLAlchemy... |
from pathlib import Path
import pytest
import sys
import ssh2net
from ssh2net import SSH2Net
from ssh2net.exceptions import ValidationError, SetupTimeout
NET2_DIR = ssh2net.__file__
UNIT_TEST_DIR = f"{Path(NET2_DIR).parents[1]}/tests/unit/"
def test_init__shell():
test_host = {"setup_host": "my_device ", "aut... | [
"pathlib.Path",
"sys.platform.startswith",
"ssh2net.SSH2Net",
"pytest.raises"
] | [((381, 401), 'ssh2net.SSH2Net', 'SSH2Net', ([], {}), '(**test_host)\n', (388, 401), False, 'from ssh2net import SSH2Net\n'), ((575, 595), 'ssh2net.SSH2Net', 'SSH2Net', ([], {}), '(**test_host)\n', (582, 595), False, 'from ssh2net import SSH2Net\n'), ((840, 860), 'ssh2net.SSH2Net', 'SSH2Net', ([], {}), '(**test_host)\n... |