code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
"""This module contains PlainFrame and PlainColumn tests.
"""
import collections
import datetime
import pytest
import numpy as np
import pandas as pd
from numpy.testing import assert_equal as np_assert_equal
from pywrangler.util.testing.plainframe import (
NULL,
ConverterFromPandas,
NaN,
PlainColumn... | [
"pandas.api.types.is_float_dtype",
"pywrangler.util.testing.plainframe.ConverterFromPandas",
"pandas.api.types.LongType",
"pandas.api.types.is_object_dtype",
"pandas.api.types.is_datetime64_dtype",
"pandas.api.types.is_bool_dtype",
"pywrangler.util.testing.plainframe.PlainFrame.from_pandas",
"pandas.D... | [((573, 632), 'pywrangler.util.testing.plainframe.PlainFrame.from_plain', 'PlainFrame.from_plain', ([], {'data': 'data', 'dtypes': 'cols', 'columns': 'cols'}), '(data=data, dtypes=cols, columns=cols)\n', (594, 632), False, 'from pywrangler.util.testing.plainframe import NULL, ConverterFromPandas, NaN, PlainColumn, Plai... |
from __future__ import absolute_import, unicode_literals
import gzip
import json
import logging
import os
import tempfile
from mopidy import models
from mopidy.internal import encoding
logger = logging.getLogger(__name__)
def load(path):
"""
Deserialize data from file.
:param path: full path to import... | [
"tempfile.NamedTemporaryFile",
"json.dump",
"json.load",
"gzip.open",
"os.remove",
"os.rename",
"os.path.exists",
"mopidy.internal.encoding.locale_decode",
"os.path.isfile",
"gzip.GzipFile",
"os.path.split",
"logging.getLogger"
] | [((197, 224), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (214, 224), False, 'import logging\n'), ((1079, 1098), 'os.path.split', 'os.path.split', (['path'], {}), '(path)\n', (1092, 1098), False, 'import os\n'), ((1158, 1237), 'tempfile.NamedTemporaryFile', 'tempfile.NamedTemporaryFile... |
import os
import numpy as np
from PIL import Image
from skimage.util import img_as_float
from skimage.color import rgb2grey
from skimage.io import imread
from scipy.io import loadmat
class BSDSDataset (object):
"""
BSDS dataset wrapper
Given the path to the root of the BSDS dataset, this class provides
... | [
"scipy.io.loadmat",
"PIL.Image.open",
"os.path.splitext",
"os.path.split",
"os.path.join",
"skimage.io.imread"
] | [((1050, 1092), 'os.path.join', 'os.path.join', (['bsds_path', '"""BSDS500"""', '"""data"""'], {}), "(bsds_path, 'BSDS500', 'data')\n", (1062, 1092), False, 'import os\n'), ((1120, 1158), 'os.path.join', 'os.path.join', (['self.data_path', '"""images"""'], {}), "(self.data_path, 'images')\n", (1132, 1158), False, 'impo... |
import logging
from server.auth import user_mediacloud_client
logger = logging.getLogger(__name__)
MAX_SOURCES = 40
def media_search(search_str, tags_id=None, **kwargs):
mc = user_mediacloud_client()
return mc.mediaList(name_like=search_str, tags_id=tags_id, rows=MAX_SOURCES, sort="num_stories", **kwargs)
... | [
"server.auth.user_mediacloud_client",
"logging.getLogger"
] | [((73, 100), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (90, 100), False, 'import logging\n'), ((184, 208), 'server.auth.user_mediacloud_client', 'user_mediacloud_client', ([], {}), '()\n', (206, 208), False, 'from server.auth import user_mediacloud_client\n'), ((402, 426), 'server.au... |
#!/usr/bin/env python3
"""Ask user to resolve a vdirsyncer sync conflict interactively.
Needs a way to ask the user.
The use of https://apps.kde.org/kdialog/ for GNU/Linix is hardcoded.
Depends on python>3.5 and KDialog.
Usage:
Ensure the file executable and use it in the vdirsyncer.conf file, e.g.
conflict_res... | [
"sys.stdout.write",
"pathlib.Path",
"re.search",
"re.compile"
] | [((691, 733), 're.compile', 're.compile', (['"""^(SUMMARY:.*)$"""', 're.MULTILINE'], {}), "('^(SUMMARY:.*)$', re.MULTILINE)\n", (701, 733), False, 'import re\n'), ((902, 944), 're.search', 're.search', (['SUMMARY_PATTERN', 'icalendar_text'], {}), '(SUMMARY_PATTERN, icalendar_text)\n', (911, 944), False, 'import re\n'),... |
from youtube.face_evoLVe_PyTorch.align.YTPredictor import YTPredictor
import os
import cv2
current_dir = os.path.abspath(os.path.join(os.path.dirname(__file__)))
absPath_to_youtube = os.path.abspath(os.path.join(current_dir, 'youtube'))
## create the object
## absPath_to_youtube : please pass the absolute path to th... | [
"os.path.dirname",
"os.path.join",
"youtube.face_evoLVe_PyTorch.align.YTPredictor.YTPredictor"
] | [((794, 921), 'youtube.face_evoLVe_PyTorch.align.YTPredictor.YTPredictor', 'YTPredictor', ([], {'absPath_to_youtube': 'absPath_to_youtube', 'cast_length': '(8)', 'compress_width': '(400)', 'skip_frames': '(12)', 'frame_range': '[0, 400]'}), '(absPath_to_youtube=absPath_to_youtube, cast_length=8,\n compress_width=400... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from glob import glob
import os
from math import cos, pi
import pickle
import scipy.stats as stats
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix, classification_report
from sklearn.preprocessing ... | [
"sklearn.preprocessing.StandardScaler",
"os.makedirs",
"scipy.stats.stats.mode",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.preprocessing.OneHotEncoder",
"os.listdir"
] | [((456, 476), 'os.listdir', 'os.listdir', (['dir_path'], {}), '(dir_path)\n', (466, 476), False, 'import os\n'), ((1920, 1942), 'pandas.read_csv', 'pd.read_csv', (['file_path'], {}), '(file_path)\n', (1931, 1942), True, 'import pandas as pd\n'), ((1993, 2033), 'os.makedirs', 'os.makedirs', (['"""model_info"""'], {'exis... |
import os
import logging
import threading
import subprocess
from flask_cors import CORS
from flask_redoc import Redoc
from routes.rpi_routes import rpi
from flask import Flask, request, jsonify
from helpers.ssh_helpers import rasp_start, valid_os
from helpers.config_helpers import *
app = Flask(__name__)
CORS(app)
app... | [
"threading.Thread",
"subprocess.Popen",
"flask_cors.CORS",
"helpers.ssh_helpers.valid_os",
"flask.Flask",
"logging.StreamHandler",
"helpers.ssh_helpers.rasp_start",
"flask_redoc.Redoc",
"flask.jsonify",
"logging.getLogger"
] | [((291, 306), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (296, 306), False, 'from flask import Flask, request, jsonify\n'), ((307, 316), 'flask_cors.CORS', 'CORS', (['app'], {}), '(app)\n', (311, 316), False, 'from flask_cors import CORS\n'), ((353, 374), 'flask_redoc.Redoc', 'Redoc', (['app', '"""doc.... |
"""
isort:skip_file
See: https://github.com/ambv/black/issues/250
"""
import unittest
from flipper.conditions.operators.less_than_or_equal_to_operator import (
LessThanOrEqualToOperator
)
class TestCompare(unittest.TestCase):
def test_returns_true_when_expected_is_less_than_actual(self):
operat... | [
"flipper.conditions.operators.less_than_or_equal_to_operator.LessThanOrEqualToOperator"
] | [((325, 352), 'flipper.conditions.operators.less_than_or_equal_to_operator.LessThanOrEqualToOperator', 'LessThanOrEqualToOperator', ([], {}), '()\n', (350, 352), False, 'from flipper.conditions.operators.less_than_or_equal_to_operator import LessThanOrEqualToOperator\n'), ((493, 520), 'flipper.conditions.operators.less... |
# -*- coding: utf-8 -*-
"""
@date: 2020/11/21 下午7:24
@file: test_tsn_head.py
@author: zj
@description:
"""
import torch
from tsn.model.heads.tsn_head import TSNHead
from tsn.config import cfg
def test_resnet_head():
data = torch.randn(1, 2048, 7, 7)
feature_dims = 2048
num_classes = 1000
cfg.MODE... | [
"tsn.model.heads.tsn_head.TSNHead",
"torch.randn"
] | [((233, 259), 'torch.randn', 'torch.randn', (['(1)', '(2048)', '(7)', '(7)'], {}), '(1, 2048, 7, 7)\n', (244, 259), False, 'import torch\n'), ((443, 455), 'tsn.model.heads.tsn_head.TSNHead', 'TSNHead', (['cfg'], {}), '(cfg)\n', (450, 455), False, 'from tsn.model.heads.tsn_head import TSNHead\n')] |
# -*- coding: utf-8 -*-
from common.models.pay.PayOrder import PayOrder
from common.libs.Helper import get_format_date
from common.libs.pay.PayService import PayService
import datetime
from application import app,db
'''
python manager.py runjob -m pay/index
'''
class JobTask():
def __init__(self):
pass
def run(se... | [
"common.libs.pay.PayService.PayService",
"datetime.timedelta",
"common.models.pay.PayOrder.PayOrder.query.filter_by",
"common.libs.Helper.get_format_date",
"application.app.logger.info",
"datetime.datetime.now"
] | [((340, 363), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (361, 363), False, 'import datetime\n'), ((636, 648), 'common.libs.pay.PayService.PayService', 'PayService', ([], {}), '()\n', (646, 648), False, 'from common.libs.pay.PayService import PayService\n'), ((721, 751), 'application.app.logger... |
from flask import Flask
from chatpy.api import API
from chatpy.auth import TokenAuthHandler
app = Flask(__name__)
app.config.from_object('config')
chatwork = API(auth_handler=TokenAuthHandler(app.config['CHATWORK_TOKEN']))
from app.endpoint import *
| [
"chatpy.auth.TokenAuthHandler",
"flask.Flask"
] | [((99, 114), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (104, 114), False, 'from flask import Flask\n'), ((177, 223), 'chatpy.auth.TokenAuthHandler', 'TokenAuthHandler', (["app.config['CHATWORK_TOKEN']"], {}), "(app.config['CHATWORK_TOKEN'])\n", (193, 223), False, 'from chatpy.auth import TokenAuthHand... |
"""Functions for estimaing a discrete mixture of regressions.
"""
import LinearResponseVariationalBayes.ExponentialFamilies as ef
import autograd
import autograd.numpy as np
import autograd.scipy as sp
import paragami
from copy import deepcopy
import json_tricks
import json
import scipy as osp
from sklearn.cluster... | [
"autograd.numpy.sum",
"paragami.PatternDict",
"paragami.OptimizationObjective",
"autograd.numpy.squeeze",
"json.dumps",
"autograd.numpy.zeros",
"paragami.PSDSymmetricMatrixPattern",
"autograd.numpy.log",
"scipy.optimize.minimize",
"paragami.simplex_patterns.logsumexp",
"json.loads",
"paragami.... | [((700, 722), 'paragami.PatternDict', 'paragami.PatternDict', ([], {}), '()\n', (720, 722), False, 'import paragami\n'), ((771, 826), 'paragami.NumericArrayPattern', 'paragami.NumericArrayPattern', (['(num_components, obs_dim)'], {}), '((num_components, obs_dim))\n', (799, 826), False, 'import paragami\n'), ((871, 946)... |
""" Utils to provide additional functionality to dispatch exe commands together with the gin configuration library """
# requirements: gin
import argparse
import logging
import os
import sys
from contextlib import contextmanager
from typing import Callable, Dict, List, TextIO, Optional
import gin
from src import CON... | [
"os.mkdir",
"gin.bind_parameter",
"argparse.ArgumentParser",
"gin.config._CONFIG.items",
"os.path.exists",
"os.environ.get",
"gin.parse_config_file",
"os.path.join",
"logging.getLogger"
] | [((368, 395), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (385, 395), False, 'import logging\n'), ((436, 482), 'gin.parse_config_file', 'gin.parse_config_file', (['path'], {'skip_unknown': '(True)'}), '(path, skip_unknown=True)\n', (457, 482), False, 'import gin\n'), ((1420, 1446), 'gi... |
# Copyright (c) 2016 <NAME> <<EMAIL>>
"""Astroid hooks for understanding functools library module."""
import astroid
from astroid import BoundMethod
from astroid import extract_node
from astroid import helpers
from astroid.interpreter import objectmodel
from astroid import MANAGER
LRU_CACHE = 'functools.lru_cache'
... | [
"astroid.extract_node",
"astroid.MANAGER.register_transform",
"astroid.helpers.safe_infer"
] | [((2183, 2279), 'astroid.MANAGER.register_transform', 'MANAGER.register_transform', (['astroid.FunctionDef', '_transform_lru_cache', '_looks_like_lru_cache'], {}), '(astroid.FunctionDef, _transform_lru_cache,\n _looks_like_lru_cache)\n', (2209, 2279), False, 'from astroid import MANAGER\n'), ((699, 810), 'astroid.ex... |
#!/usr/bin/env python3
from enum import Enum, auto, unique
@unique
class GlobalState(Enum):
Uninitialized = auto()
WaitingForActionOne = auto()
WaitingForActionEvery = auto()
class ServerState:
def __init__(self, global_state : GlobalState, **args):
self.state = global_state
self.args... | [
"enum.auto"
] | [((114, 120), 'enum.auto', 'auto', ([], {}), '()\n', (118, 120), False, 'from enum import Enum, auto, unique\n'), ((147, 153), 'enum.auto', 'auto', ([], {}), '()\n', (151, 153), False, 'from enum import Enum, auto, unique\n'), ((182, 188), 'enum.auto', 'auto', ([], {}), '()\n', (186, 188), False, 'from enum import Enum... |
from pytest import raises
def test_space_can_access_user_namespace_references(ip):
ip.run_cell(raw_cell="x = 100")
ip.run_cell_magic(magic_name="space", line="tomato", cell="x")
def test_space_references_prioritized_over_user_namespace_references(ip):
ip.run_cell(raw_cell="x = 100")
ip.run_cell_magi... | [
"pytest.raises"
] | [((1180, 1197), 'pytest.raises', 'raises', (['NameError'], {}), '(NameError)\n', (1186, 1197), False, 'from pytest import raises\n'), ((1435, 1452), 'pytest.raises', 'raises', (['NameError'], {}), '(NameError)\n', (1441, 1452), False, 'from pytest import raises\n'), ((2382, 2399), 'pytest.raises', 'raises', (['NameErro... |
import numpy as np
import pickle as pk
import matplotlib.pyplot as pl
size = [2, 4, 8, 16, 32, 64, 128, 256, 512, 1024]
aveheight = []
# Obtain average height
f_file = open('T2e_aveheight.pickle', 'rb')
aveheight = pk.load(f_file)
f_file.close()
# Linear fit - find a crude estimate for a_0
para, var =... | [
"matplotlib.pyplot.loglog",
"pickle.dump",
"numpy.log",
"matplotlib.pyplot.plot",
"numpy.polyfit",
"numpy.logspace",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"pickle.load",
"numpy.array",
"numpy.linspace",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.p... | [((228, 243), 'pickle.load', 'pk.load', (['f_file'], {}), '(f_file)\n', (235, 243), True, 'import pickle as pk\n'), ((321, 361), 'numpy.polyfit', 'np.polyfit', (['size', 'aveheight', '(1)'], {'cov': '(True)'}), '(size, aveheight, 1, cov=True)\n', (331, 361), True, 'import numpy as np\n'), ((372, 398), 'numpy.linspace',... |
'''
atlas.py: part of pybraincompare package
Functions to integrate atlases in image comparison
'''
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from builtins import str
from builtins import range
from past.utils import old_div
from builtins import objec... | [
"past.utils.old_div",
"numpy.shape",
"numpy.rot90",
"scipy.spatial.distance.pdist",
"cairo.SVGSurface",
"nilearn.plotting.plot_roi",
"numpy.unique",
"skimage.segmentation.find_boundaries",
"numpy.equal",
"builtins.str",
"re.compile",
"nibabel.load",
"cairo.Context",
"xml.dom.minidom.parse"... | [((1293, 1317), 'nibabel.load', 'nibabel.load', (['atlas_file'], {}), '(atlas_file)\n', (1305, 1317), False, 'import nibabel\n'), ((1653, 1677), 'xml.dom.minidom.parse', 'minidom.parse', (['atlas_xml'], {}), '(atlas_xml)\n', (1666, 1677), False, 'from xml.dom import minidom\n'), ((2841, 2858), 'pybraincompare.template.... |
# -*- coding: utf-8 -*-
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__version__ = "1.0.0"
import os
import sys
import yaml
ROS_CV = '/opt/ros/kinetic/lib/python2.7/dist-packages'
if ROS_CV in sys.path: sys.path.remove(ROS_CV)
import cv2
import numpy as np
import matplotlib.pyplot as plt
from transformations import ... | [
"yaml.load",
"sys.path.remove",
"cv2.getPerspectiveTransform",
"cv2.warpAffine",
"numpy.mean",
"cv2.imshow",
"cv2.getRotationMatrix2D",
"cv2.warpPerspective",
"matplotlib.pyplot.imshow",
"transformations.euler_matrix",
"cv2.setMouseCallback",
"cv2.destroyAllWindows",
"cv2.resize",
"numpy.r... | [((205, 228), 'sys.path.remove', 'sys.path.remove', (['ROS_CV'], {}), '(ROS_CV)\n', (220, 228), False, 'import sys\n'), ((6351, 6376), 'cv2.namedWindow', 'cv2.namedWindow', (['win_name'], {}), '(win_name)\n', (6366, 6376), False, 'import cv2\n'), ((6381, 6424), 'cv2.setMouseCallback', 'cv2.setMouseCallback', (['win_nam... |
# This is a slightly modified version of https://github.com/microsoft/vscode-python/blob/main/pythonFiles/install_debugpy.py
import argparse
import io
import json
import os
import urllib.request as url_lib
import zipfile
# if this import fails, run PreBuild.ps1, which will pip install packaging
from packaging.version... | [
"os.getcwd",
"io.BytesIO",
"argparse.ArgumentParser",
"urllib.request.urlopen"
] | [((2269, 2294), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2292, 2294), False, 'import argparse\n'), ((902, 927), 'urllib.request.urlopen', 'url_lib.urlopen', (['json_uri'], {}), '(json_uri)\n', (917, 927), True, 'import urllib.request as url_lib\n'), ((1411, 1422), 'os.getcwd', 'os.getcwd... |
from functools import lru_cache
class Solution:
def canCross(self, stones: List[int]) -> bool:
@lru_cache(None)
def helper(pos, k):
n = len(stones)
for i in range(pos + 1, n):
gap = stones[i] - stones[pos]
if gap < k - 1:
co... | [
"functools.lru_cache"
] | [((108, 123), 'functools.lru_cache', 'lru_cache', (['None'], {}), '(None)\n', (117, 123), False, 'from functools import lru_cache\n')] |
import calendar
from datetime import time
from typing import Dict, Iterable, Iterator, Optional, cast
from datetime_matcher.model_types import DfregexToken, SupportedDatetimeFormatCodeType
class RegexGenerator:
format_code_to_regex_map: Dict[SupportedDatetimeFormatCodeType, str]
def __init__(self):
... | [
"typing.cast",
"datetime.time"
] | [((3717, 3771), 'typing.cast', 'cast', (['SupportedDatetimeFormatCodeType', 'token.value[1:]'], {}), '(SupportedDatetimeFormatCodeType, token.value[1:])\n', (3721, 3771), False, 'from typing import Dict, Iterable, Iterator, Optional, cast\n'), ((939, 947), 'datetime.time', 'time', (['(10)'], {}), '(10)\n', (943, 947), ... |
import numpy as np
from time import sleep
import serial
########## Prepare Arduino code for data output ##################
#
# remove the /* and */ around the print commands in functions.ino
#
# /*
# Serial.print(dt); Serial.print("\t");
# Serial.print(pitch); Serial.print("\t");
# Serial.print(gyroYrate); Seri... | [
"serial.Serial",
"numpy.savetxt",
"numpy.array",
"time.sleep"
] | [((683, 691), 'time.sleep', 'sleep', (['(2)'], {}), '(2)\n', (688, 691), False, 'from time import sleep\n'), ((994, 1034), 'numpy.savetxt', 'np.savetxt', (['"""T-Bot_FilteredData.dat"""', 'v1'], {}), "('T-Bot_FilteredData.dat', v1)\n", (1004, 1034), True, 'import numpy as np\n'), ((586, 622), 'serial.Serial', 'serial.S... |
# This file is part of the Reproducible and Reusable Data Analysis Workflow
# Server (flowServ).
#
# Copyright (C) 2019-2021 NYU.
#
# flowServ is free software; you can redistribute it and/or modify it under the
# terms of the MIT License; see LICENSE file for more details.
"""This module contains the ranking manager ... | [
"dateutil.parser.isoparse"
] | [((2135, 2161), 'dateutil.parser.isoparse', 'isoparse', (['self.finished_at'], {}), '(self.finished_at)\n', (2143, 2161), False, 'from dateutil.parser import isoparse\n'), ((2164, 2189), 'dateutil.parser.isoparse', 'isoparse', (['self.started_at'], {}), '(self.started_at)\n', (2172, 2189), False, 'from dateutil.parser ... |
from torch.utils.data import Dataset
import tqdm
import json
import torch
import random
import numpy as np
from sklearn.utils import shuffle
class BERTDataset(Dataset):
def __init__(self, corpus_path, word2idx_path, seq_len, hidden_dim=384, on_memory=True):
# hidden dimension for positional encoding
... | [
"tqdm.tqdm",
"json.load",
"random.random",
"numpy.random.randint",
"torch.tensor"
] | [((942, 954), 'json.load', 'json.load', (['f'], {}), '(f)\n', (951, 954), False, 'import json\n'), ((2559, 2583), 'torch.tensor', 'torch.tensor', (['bert_input'], {}), '(bert_input)\n', (2571, 2583), False, 'import torch\n'), ((2617, 2641), 'torch.tensor', 'torch.tensor', (['bert_label'], {}), '(bert_label)\n', (2629, ... |
# python imports
import os
# django imports
from django import template
from django.conf import settings
from django.core.cache import cache
from django.template.loader import render_to_string
# resources imports
from resources.utils import get_cached_object
from resources.config import CSS
from resources.config impo... | [
"resources.models.MergedResource.objects.filter",
"django.template.Library",
"django.core.cache.cache.set",
"django.template.loader.render_to_string",
"django.core.cache.cache.get",
"resources.models.Resource.objects.filter"
] | [((469, 487), 'django.template.Library', 'template.Library', ([], {}), '()\n', (485, 487), False, 'from django import template\n'), ((860, 880), 'django.core.cache.cache.get', 'cache.get', (['cache_key'], {}), '(cache_key)\n', (869, 880), False, 'from django.core.cache import cache\n'), ((1549, 1569), 'django.core.cach... |
# -*- coding: utf-8 -*-
# pylint: disable=unsubscriptable-object,ungrouped-imports,line-too-long
"""URL Utilities
===================
The :class:`~darc.link.Link` class is the key data structure
of the :mod:`darc` project, it contains all information
required to identify a URL's proxy type, hostname, path prefix
when ... | [
"urllib.parse.unquote",
"re.fullmatch",
"urllib.parse.urljoin",
"urllib.parse.ParseResult",
"contextlib.suppress",
"pathlib.PurePosixPath",
"urllib.parse.SplitResult",
"urllib.parse.quote",
"urllib.parse.urlsplit",
"os.path.relpath",
"os.path.join",
"urllib.parse.urlparse"
] | [((677, 697), 'pathlib.PurePosixPath', 'PosixPath', (['os.curdir'], {}), '(os.curdir)\n', (686, 697), True, 'from pathlib import PurePosixPath as PosixPath\n'), ((3645, 3743), 'urllib.parse.ParseResult', 'urllib_parse.ParseResult', ([], {'scheme': 'scheme', 'netloc': '""""""', 'path': 'url', 'params': '""""""', 'query'... |
"""
OpenID Connect relying party (RP) app config
============================================
This module contains the application configuration class - available in the Django app registry.
For more information on this file, see https://docs.djangoproject.com/en/dev/ref/applications/
"""
from django... | [
"django.utils.translation.ugettext_lazy"
] | [((525, 569), 'django.utils.translation.ugettext_lazy', '_', (['"""JumpServer OpenID Connect relying party"""'], {}), "('JumpServer OpenID Connect relying party')\n", (526, 569), True, 'from django.utils.translation import ugettext_lazy as _\n')] |
import gfapy
class Alignment:
"""Factory for instances of classes which represent alignments in GFA fields.
Args:
initializer (string, list): the alignment field content
version (str): GFA version, either ``'gfa1'`` or ``'gfa2'`` (default: ``'gfa2'``)
valid (bool): if ``True``, validation is skipped, ... | [
"gfapy.CIGAR",
"gfapy.Trace._from_string",
"gfapy.CIGAR._from_string",
"gfapy.is_placeholder",
"gfapy.Trace",
"gfapy.AlignmentPlaceholder"
] | [((1603, 1632), 'gfapy.is_placeholder', 'gfapy.is_placeholder', (['args[0]'], {}), '(args[0])\n', (1623, 1632), False, 'import gfapy\n'), ((1647, 1675), 'gfapy.AlignmentPlaceholder', 'gfapy.AlignmentPlaceholder', ([], {}), '()\n', (1673, 1675), False, 'import gfapy\n'), ((4889, 4917), 'gfapy.AlignmentPlaceholder', 'gfa... |
import argparse
import time
import cv2
import torch
from threading import Thread
import os
from mmdet.apis import inference_detector, init_detector, show_result
from sort import *
import warnings
warnings.filterwarnings("ignore")
def parse_args():
parser = argparse.ArgumentParser(description='MMDetection webc... | [
"threading.Thread",
"argparse.ArgumentParser",
"warnings.filterwarnings",
"cv2.waitKey",
"mmdet.apis.inference_detector",
"time.time",
"cv2.VideoCapture",
"time.sleep",
"cv2.rectangle",
"mmdet.apis.show_result",
"torch.device"
] | [((200, 233), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (223, 233), False, 'import warnings\n'), ((267, 329), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""MMDetection webcam demo"""'}), "(description='MMDetection webcam demo')\n", (29... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
# Register your models here.
from finder.models import Student,Hostels,Status
class StudentAdmin(admin.ModelAdmin) :
list_display = ["__unicode__"]
class Meta:
model = Student
class HostelsAdmin(admin.ModelAdmin) :
... | [
"django.contrib.admin.site.register"
] | [((485, 527), 'django.contrib.admin.site.register', 'admin.site.register', (['Student', 'StudentAdmin'], {}), '(Student, StudentAdmin)\n', (504, 527), False, 'from django.contrib import admin\n'), ((527, 569), 'django.contrib.admin.site.register', 'admin.site.register', (['Hostels', 'HostelsAdmin'], {}), '(Hostels, Hos... |
import sys
import threading
from os.path import abspath
from os import system
from math import floor, ceil
from time import sleep
from itertools import zip_longest
import pygame
from pygame.display import init
from pygame.locals import *
from grid import Grid
from pygame_textinput import TextInput
if system("python -... | [
"pygame.draw.line",
"pygame.event.get",
"pygame.display.update",
"pygame.font.Font",
"pygame.mouse.get_pos",
"os.path.abspath",
"pygame.display.set_mode",
"itertools.zip_longest",
"pygame.display.set_caption",
"pygame.quit",
"threading.Thread",
"math.ceil",
"os.system",
"pygame.init",
"t... | [((676, 689), 'pygame.init', 'pygame.init', ([], {}), '()\n', (687, 689), False, 'import pygame\n'), ((825, 844), 'pygame.time.Clock', 'pygame.time.Clock', ([], {}), '()\n', (842, 844), False, 'import pygame\n'), ((864, 911), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(100, 100)', 'FULLSCREEN'], {}), '((1... |
from pathlib import PurePath
import seaborn as sns
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
filenames = snakemake.input
plt.figure(figsize=(10, 10))
dfs = [pd.read_pickle(filename) for filename in filenames]
xmax = min(df["x"].max() for df in dfs)
f... | [
"matplotlib.pyplot.title",
"seaborn.lineplot",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.figure",
"matplotlib.use",
"pandas.read_pickle",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"pandas.concat",
"matplotlib.pyplot.savefig"
] | [((69, 90), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (83, 90), False, 'import matplotlib\n'), ((191, 219), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(10, 10)'}), '(figsize=(10, 10))\n', (201, 219), True, 'import matplotlib.pyplot as plt\n'), ((430, 444), 'pandas.concat', '... |
# !/usr/bin/env python
# _*_ coding:utf-8 _*_
import jieba
from HyperParameter import HyperParameter
import numpy as np
import random
zero_pad = np.zeros(768,float)
padToken, unknownToken, goToken, eosToken = 0, 1, 2, 3
class Batch:
def __init__(self):
self.encoder_inputs = []
self.encoder_input... | [
"HyperParameter.HyperParameter",
"numpy.zeros"
] | [((147, 167), 'numpy.zeros', 'np.zeros', (['(768)', 'float'], {}), '(768, float)\n', (155, 167), True, 'import numpy as np\n'), ((847, 863), 'HyperParameter.HyperParameter', 'HyperParameter', ([], {}), '()\n', (861, 863), False, 'from HyperParameter import HyperParameter\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# IkaLog
# ======
# Copyright (C) 2015 <NAME>
#
# 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/LI... | [
"ikalog.utils.config_loader.config",
"argparse.ArgumentParser",
"ikalog.utils.Localization.print_language_settings",
"ikalog.utils.IkaUtils.dprint",
"signal.signal"
] | [((704, 742), 'ikalog.utils.Localization.print_language_settings', 'Localization.print_language_settings', ([], {}), '()\n', (740, 742), False, 'from ikalog.utils import Localization, IkaUtils\n'), ((937, 983), 'ikalog.utils.IkaUtils.dprint', 'IkaUtils.dprint', (["('IkaLog: got signal %d' % num)"], {}), "('IkaLog: got ... |
# -*- coding: utf-8 -*-
from copy import deepcopy
from pathlib import Path
def validate_passport_keys( raw_data ):
valid_passports = [ ]
passport = { }
for i, rd in enumerate( raw_data ):
for x in rd.split( ' ' ):
if ':' in x:
kv = x.split( ':' )
pass... | [
"copy.deepcopy",
"pathlib.Path.cwd"
] | [((543, 561), 'copy.deepcopy', 'deepcopy', (['passport'], {}), '(passport)\n', (551, 561), False, 'from copy import deepcopy\n'), ((2310, 2320), 'pathlib.Path.cwd', 'Path.cwd', ([], {}), '()\n', (2318, 2320), False, 'from pathlib import Path\n')] |
import json
import re
import semver
from ..base_request import BaseRequest
from ..settings import Settings
from .. import exceptions
NETWORK_WIFI = 'wifi'
NETWORK_ETHERNET = 'ethernet'
NETWORK_TYPES = [
NETWORK_WIFI,
NETWORK_ETHERNET
]
ARCH_COMPATIBILITY_MAP = {
'aarch64': ['armv7hf', 'rpi'],
'armv... | [
"semver.parse",
"re.sub",
"re.search"
] | [((5511, 5561), 're.sub', 're.sub', (['"""(\\\\.[0-9]+)\\\\.rev"""', '"""\\\\1+rev"""', 'os_version'], {}), "('(\\\\.[0-9]+)\\\\.rev', '\\\\1+rev', os_version)\n", (5517, 5561), False, 'import re\n'), ((5659, 5728), 're.sub', 're.sub', (['"""([0-9]+\\\\.[0-9]+\\\\.[0-9]+)\\\\.(dev|prod)"""', '"""\\\\1+\\\\2"""', 'versi... |
import openpyxl
class ExelWorker:
def __init__(self, file_path):
self.wb = openpyxl.load_workbook(file_path)
self.ws = self.wb.active
def get_data(self):
return self.sorting(list(self.ws.values))
def sorting(self, data: list) -> list: #Ранжирование по году рождения
for i... | [
"openpyxl.load_workbook"
] | [((90, 123), 'openpyxl.load_workbook', 'openpyxl.load_workbook', (['file_path'], {}), '(file_path)\n', (112, 123), False, 'import openpyxl\n')] |
#!/usr/bin/python3
# 文件名:pickle.py
import pprint,pickle
# pickle实现基本数据序列和反序列化
# 使用pickle模块从文件中重构python
pkl_file = open('data.pkl','rb')
data = pickle.load(pkl_file)
pprint.pprint(data)
selfref_list = pickle.load(pkl_file)
pprint.pprint(selfref_list)
pkl_file.close()
#print(data)
#print(selfref_list)
print('dict ... | [
"pickle.load",
"pprint.pprint"
] | [((147, 168), 'pickle.load', 'pickle.load', (['pkl_file'], {}), '(pkl_file)\n', (158, 168), False, 'import pprint, pickle\n'), ((169, 188), 'pprint.pprint', 'pprint.pprint', (['data'], {}), '(data)\n', (182, 188), False, 'import pprint, pickle\n'), ((205, 226), 'pickle.load', 'pickle.load', (['pkl_file'], {}), '(pkl_fi... |
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Argo, test #12. (10C, 5PSU)
"""
import logging
import numpy as np
from numpy import ma
from .qctests import QCCheckVar
from .rate_of_change import rate_of_change
module_logger = logging.getLogger(__name__)
class Dig... | [
"numpy.ma.absolute",
"numpy.size",
"numpy.ma.getmaskarray",
"numpy.isfinite",
"numpy.shape",
"numpy.atleast_1d",
"logging.getLogger"
] | [((281, 308), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (298, 308), False, 'import logging\n'), ((908, 952), 'numpy.ma.absolute', 'ma.absolute', (["self.features['rate_of_change']"], {}), "(self.features['rate_of_change'])\n", (919, 952), False, 'from numpy import ma\n'), ((1139, 117... |
import unittest
from cryptogram.cypher import Cypher
from cryptogram.encode import Encode
from cryptogram.transform import Transform
class TestCryptogram(unittest.TestCase):
def setUp(self) -> None:
self.message = "Hello World"
self.enc_obj = Encode()
self.trf_obj = Transform()
se... | [
"cryptogram.encode.Encode",
"cryptogram.cypher.Cypher",
"cryptogram.transform.Transform"
] | [((266, 274), 'cryptogram.encode.Encode', 'Encode', ([], {}), '()\n', (272, 274), False, 'from cryptogram.encode import Encode\n'), ((298, 309), 'cryptogram.transform.Transform', 'Transform', ([], {}), '()\n', (307, 309), False, 'from cryptogram.transform import Transform\n'), ((333, 341), 'cryptogram.cypher.Cypher', '... |
# coding: utf-8
"""
ASR documentation
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 1.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
impor... | [
"cloud_client.cloud_api_client.CloudApiClient",
"six.iteritems"
] | [((2717, 2748), 'six.iteritems', 'six.iteritems', (["params['kwargs']"], {}), "(params['kwargs'])\n", (2730, 2748), False, 'import six\n'), ((6676, 6707), 'six.iteritems', 'six.iteritems', (["params['kwargs']"], {}), "(params['kwargs'])\n", (6689, 6707), False, 'import six\n'), ((10983, 11014), 'six.iteritems', 'six.it... |
import numpy as np
import time
import torch
import torch.nn.functional as F
import torchvision
from torchvision import models
import argparse
from PIL import Image
from utility import *
from network import Network
parser = argparse.ArgumentParser()
parser.add_argument('data_directory')
parser.add_argument('--save_dir'... | [
"torch.save",
"argparse.ArgumentParser",
"network.Network"
] | [((224, 249), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (247, 249), False, 'import argparse\n'), ((1459, 1480), 'network.Network', 'Network', (['architecture'], {}), '(architecture)\n', (1466, 1480), False, 'from network import Network\n'), ((1900, 1958), 'torch.save', 'torch.save', (['che... |
import email, os, sys, argparse, re, operator, codecs, base64, glob
from datetime import datetime, timezone
from bs4 import BeautifulSoup
from mako.template import Template
args = None
attr_whitelist = ["src", "alt", "height", "width", "type", "title", "summary", "href", "rel"] # "value"
done = {}
class Note... | [
"datetime.datetime.strftime",
"os.mkdir",
"argparse.ArgumentParser",
"codecs.open",
"os.path.basename",
"os.path.dirname",
"operator.attrgetter",
"datetime.datetime.strptime",
"mako.template.Template",
"bs4.BeautifulSoup",
"os.path.join"
] | [((3576, 3610), 'bs4.BeautifulSoup', 'BeautifulSoup', (['html', '"""html.parser"""'], {}), "(html, 'html.parser')\n", (3589, 3610), False, 'from bs4 import BeautifulSoup\n'), ((5708, 5738), 'os.path.dirname', 'os.path.dirname', (['mht_file_path'], {}), '(mht_file_path)\n', (5723, 5738), False, 'import email, os, sys, a... |
from tempfile import mkdtemp
import os
import sys
import subprocess
import shutil
import time
class Mounter:
def __init__(self, src_path, mount_root="."):
self.src_path = src_path
self.mount_root = os.path.abspath(mount_root)
mount_name = os.path.splitext(os.path.split(self.src_path)[1])[0... | [
"subprocess.run",
"os.path.abspath",
"os.path.exists",
"time.sleep",
"tempfile.mkdtemp",
"shutil.rmtree",
"os.path.split",
"os.path.join"
] | [((220, 247), 'os.path.abspath', 'os.path.abspath', (['mount_root'], {}), '(mount_root)\n', (235, 247), False, 'import os\n'), ((349, 390), 'os.path.join', 'os.path.join', (['self.mount_root', 'mount_name'], {}), '(self.mount_root, mount_name)\n', (361, 390), False, 'import os\n'), ((468, 477), 'tempfile.mkdtemp', 'mkd... |
import json
import os
from ocd_backend.items.ra_nijmegen import (
NijmegenGrintenItem, NijmegenDoornroosjeItem, NijmegenVierdaagseItem)
from . import ItemTestCase
class NijmegenGrintenItemTestCase(ItemTestCase):
def setUp(self):
super(NijmegenGrintenItemTestCase, self).setUp()
self.PWD = os.... | [
"json.load",
"ocd_backend.items.ra_nijmegen.NijmegenDoornroosjeItem",
"os.path.dirname",
"ocd_backend.items.ra_nijmegen.NijmegenGrintenItem",
"ocd_backend.items.ra_nijmegen.NijmegenVierdaagseItem",
"os.path.join"
] | [((317, 342), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (332, 342), False, 'import os\n'), ((1847, 1941), 'ocd_backend.items.ra_nijmegen.NijmegenGrintenItem', 'NijmegenGrintenItem', (['self.source_definition', '"""application/json"""', 'self.raw_item', 'self.item'], {}), "(self.source_de... |
import json
import logging
import warnings
logger = logging.getLogger(__name__)
class RawDatumSerializer:
"""A deterministic serializer for harvested data.
"""
def __init__(self, pretty):
self.pretty = pretty
def serialize(self, value):
raise NotImplementedError()
class DictSerial... | [
"logging.getLogger",
"json.dumps"
] | [((53, 80), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (70, 80), False, 'import logging\n'), ((394, 462), 'json.dumps', 'json.dumps', (['value'], {'sort_keys': '(True)', 'indent': '(4 if self.pretty else None)'}), '(value, sort_keys=True, indent=4 if self.pretty else None)\n', (404, 4... |
#!/usr/bin/enum_weights python
# -*- coding: utf-8 -*-
# Copyright (C) 2019 <NAME>, <NAME>, <NAME>
#
# All Rights Reserved.
#
# Authors: <NAME>, <NAME>, <NAME>
#
# Please cite:
#
# <NAME>, <NAME>, and <NAME>, "Quasi-Newton Methods for
# Deep Learning: Forget the Past, Just Sample." (2019). Lehigh University.
#... | [
"numpy.random.seed",
"numpy.sum",
"numpy.zeros",
"time.time",
"numpy.linalg.inv",
"numpy.matmul",
"numpy.squeeze",
"numpy.diag",
"collections.deque"
] | [((963, 983), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (977, 983), True, 'import numpy as np\n'), ((1363, 1374), 'time.time', 'time.time', ([], {}), '()\n', (1372, 1374), False, 'import time\n'), ((1597, 1626), 'collections.deque', 'collections.deque', ([], {'maxlen': 'mmr'}), '(maxlen=mmr)\n'... |
import requests
from urllib.parse import quote
lua = '''
function main(splash, args)
splash:go("https://www.geekdigging.com/")
return {
url = splash:url(),
jpeg = splash:jpeg(),
har = splash:har(),
cookies = splash:get_cookies()
}
end
'''
url = 'http://localhost:8050/e... | [
"urllib.parse.quote",
"requests.get"
] | [((365, 382), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (377, 382), False, 'import requests\n'), ((342, 352), 'urllib.parse.quote', 'quote', (['lua'], {}), '(lua)\n', (347, 352), False, 'from urllib.parse import quote\n')] |
from redis import StrictRedis as Redis
from data.maps_constants import *
import os
import _pickle as cPickle
import math
import numpy as np
import random
class FileScanner:
Pieces = 'MUS'
def __init__(self, maps_root_path, data_type, type_params = None):
self.mapsdb_root = maps_root_path
self... | [
"_pickle.loads",
"random.shuffle",
"os.path.isdir",
"_pickle.dumps",
"redis.StrictRedis",
"os.path.join",
"os.listdir"
] | [((424, 452), 'os.listdir', 'os.listdir', (['self.mapsdb_root'], {}), '(self.mapsdb_root)\n', (434, 452), False, 'import os\n'), ((1406, 1417), 'redis.StrictRedis', 'Redis', ([], {'db': '(1)'}), '(db=1)\n', (1411, 1417), True, 'from redis import StrictRedis as Redis\n'), ((478, 520), 'os.path.join', 'os.path.join', (['... |
# Generated by Django 3.2.6 on 2021-08-13 15:41
import django.db.models.deletion
from django.conf import settings
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MO... | [
"django.db.models.FileField",
"django.db.models.TextField",
"django.db.migrations.swappable_dependency",
"django.db.models.BigAutoField",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.DateTimeField"
] | [((267, 324), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (298, 324), False, 'from django.db import migrations\n'), ((499, 595), 'django.db.models.BigAutoField', 'models.BigAutoField', ([], {'auto_created': '(True)',... |
import os
import sys
# 在 [path] 路径下创建 <dir_name> 文件夹
# 返回文件夹绝对路径
def create_dir(dir_name, path=sys.path[0]):
try:
dir_path = os.path.join(path, dir_name)
# 路径不存在(存在同名文件时不会尝试创建,否则报错 "[WinError 183]")
if not os.path.exists(dir_path):
os.makedirs(dir_path)
else:# directory ... | [
"os.path.join",
"os.makedirs",
"os.path.exists"
] | [((138, 166), 'os.path.join', 'os.path.join', (['path', 'dir_name'], {}), '(path, dir_name)\n', (150, 166), False, 'import os\n'), ((592, 621), 'os.path.join', 'os.path.join', (['path', 'file_name'], {}), '(path, file_name)\n', (604, 621), False, 'import os\n'), ((235, 259), 'os.path.exists', 'os.path.exists', (['dir_p... |
from db_objects import Base
from db_session import engine
Base.metadata.create_all(engine)
| [
"db_objects.Base.metadata.create_all"
] | [((60, 92), 'db_objects.Base.metadata.create_all', 'Base.metadata.create_all', (['engine'], {}), '(engine)\n', (84, 92), False, 'from db_objects import Base\n')] |
from collections.abc import MutableMapping
import csv
from dataclasses import dataclass
from os import PathLike
import typing
from typing import Dict, Generator, List, Optional, Set, Union
from urllib.parse import urlparse
from . import file_utils
@dataclass(init=True, repr=True, eq=True, order=False,
uns... | [
"csv.DictReader",
"urllib.parse.urlparse",
"dataclasses.dataclass"
] | [((252, 341), 'dataclasses.dataclass', 'dataclass', ([], {'init': '(True)', 'repr': '(True)', 'eq': '(True)', 'order': '(False)', 'unsafe_hash': '(False)', 'frozen': '(True)'}), '(init=True, repr=True, eq=True, order=False, unsafe_hash=False,\n frozen=True)\n', (261, 341), False, 'from dataclasses import dataclass\n... |
'''
The MIT License (MIT)
Copyright (c) 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, publi... | [
"threading.Timer",
"logging.getLogger"
] | [((1298, 1325), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1315, 1325), False, 'import logging\n'), ((3245, 3303), 'threading.Timer', 'threading.Timer', (['self._interval', 'self._onInactivityTimeout'], {}), '(self._interval, self._onInactivityTimeout)\n', (3260, 3303), False, 'impor... |
import numpy as np
import pickle
import pika
import time
import uuid
class RpcClient(object):
def __init__(self):
self.connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost'))
self.channel = self.connection.channel()
result = self.channel.queue_declare(queue='', ex... | [
"pickle.loads",
"uuid.uuid4",
"pika.ConnectionParameters",
"time.sleep",
"pika.BasicProperties",
"pickle.dumps"
] | [((751, 768), 'pickle.dumps', 'pickle.dumps', (['arr'], {}), '(arr)\n', (763, 768), False, 'import pickle\n'), ((1215, 1242), 'pickle.loads', 'pickle.loads', (['self.response'], {}), '(self.response)\n', (1227, 1242), False, 'import pickle\n'), ((170, 213), 'pika.ConnectionParameters', 'pika.ConnectionParameters', ([],... |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Copyright 2013 California Institute of Technology. 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 th... | [
"isceobj.createOffsetImage",
"isceobj.Catalog.recordInputsAndOutputs",
"iscesys.ImageUtil.ImageUtil.ImageUtil.copyAttributes",
"isceobj.Catalog.createCatalog",
"os.path.split",
"os.path.join",
"logging.getLogger",
"stdproc.createResamp_image"
] | [((1609, 1659), 'logging.getLogger', 'logging.getLogger', (['"""isce.isceProc.runResamp_image"""'], {}), "('isce.isceProc.runResamp_image')\n", (1626, 1659), False, 'import logging\n'), ((3304, 3333), 'os.path.split', 'os.path.split', (['offsetFilename'], {}), '(offsetFilename)\n', (3317, 3333), False, 'import os\n'), ... |
# coding=utf-8
'''
Calculates PSF, jitter and telescope background and transmission
'''
import sys
import logging
import multiprocessing as mp
import signal
import time
import numpy as np
import scipy.constants as sp
from scipy.signal import fftconvolve
from src.config import *
from src.modules.create_psf import cr... | [
"numpy.zeros_like",
"numpy.sum",
"numpy.zeros",
"time.sleep",
"src.modules.create_psf.create_psf",
"logging.info",
"sys.stdout.flush",
"multiprocessing.Pool",
"scipy.signal.fftconvolve",
"signal.signal",
"src.modules.create_psf.define_psf"
] | [((451, 469), 'numpy.zeros', 'np.zeros', (['(px, py)'], {}), '((px, py))\n', (459, 469), True, 'import numpy as np\n'), ((503, 519), 'src.modules.create_psf.create_psf', 'create_psf', (['lamb'], {}), '(lamb)\n', (513, 519), False, 'from src.modules.create_psf import create_psf, define_psf\n'), ((1174, 1192), 'sys.stdou... |
# -*- coding: utf-8 -*-
# /usr/bin/python2
'''
By <NAME>. <EMAIL>.
https://www.github.com/kyubyong/neurobind.
'''
from __future__ import print_function
import os
import sys
from scipy.stats import spearmanr
from data_load import get_batch_data, load_vocab, load_data
from hyperparams import Hyperparams as hp
import ... | [
"os.mkdir",
"train.Graph",
"scipy.stats.spearmanr",
"os.path.exists",
"data_load.load_data",
"data_load.load_vocab",
"tensorflow.train.Supervisor",
"matplotlib.pyplot.figure",
"tensorflow.train.latest_checkpoint",
"numpy.array",
"tensorflow.ConfigProto",
"os.path.join"
] | [((451, 475), 'train.Graph', 'Graph', ([], {'is_training': '(False)'}), '(is_training=False)\n', (456, 475), False, 'from train import Graph\n'), ((527, 549), 'data_load.load_data', 'load_data', ([], {'mode': '"""test"""'}), "(mode='test')\n", (536, 549), False, 'from data_load import get_batch_data, load_vocab, load_d... |
# Copyright (c) 2021, <NAME>
# License: MIT License
import pytest
pytest.importorskip("PySide6")
from io import StringIO
import math
from ezdxf.lldxf.tags import Tags, DXFTag
from ezdxf.lldxf.loader import load_dxf_structure
from ezdxf.lldxf.tagger import ascii_tags_loader
from ezdxf.addons.browser import DXFTagsM... | [
"pytest.importorskip",
"math.isnan",
"io.StringIO",
"ezdxf.addons.browser.data.SearchIndex",
"ezdxf.lldxf.tags.DXFTag",
"pytest.fixture",
"pytest.main",
"ezdxf.lldxf.tags.Tags",
"ezdxf.addons.browser.DXFDocument",
"ezdxf.addons.browser.DXFStructureModel",
"ezdxf.addons.browser.data.EntityHistory... | [((69, 99), 'pytest.importorskip', 'pytest.importorskip', (['"""PySide6"""'], {}), "('PySide6')\n", (88, 99), False, 'import pytest\n'), ((1749, 1770), 'ezdxf.addons.browser.DXFDocument', 'DXFDocument', (['sections'], {}), '(sections)\n', (1760, 1770), False, 'from ezdxf.addons.browser import DXFTagsModel, DXFStructure... |
import logging
from flask import Flask
from flask_restful import Api
from flask_cors import CORS
from werkzeug.contrib.fixers import ProxyFix
from workshops_api.database import db
from workshops_api.config import config
config.load_config('.')
# Initialize app
app = Flask(__name__)
# Set up logging for gunicorn
if ... | [
"werkzeug.contrib.fixers.ProxyFix",
"flask_restful.Api",
"workshops_api.database.db.init_app",
"workshops_api.config.config.load_config",
"flask_cors.CORS",
"flask.Flask",
"logging.getLogger"
] | [((222, 245), 'workshops_api.config.config.load_config', 'config.load_config', (['"""."""'], {}), "('.')\n", (240, 245), False, 'from workshops_api.config import config\n'), ((270, 285), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (275, 285), False, 'from flask import Flask\n'), ((515, 572), 'flask_cors... |
import logging
from astropy.io import fits
logging.basicConfig(format='%(levelname)-4s '
'[%(module)s.%(funcName)s:%(lineno)d]'
' %(message)s',
)
LOG = logging.getLogger('fits_handler')
LOG.setLevel(logging.INFO)
class FitsHandler(object):
... | [
"astropy.io.fits.getheader",
"logging.getLogger",
"astropy.io.fits.open",
"logging.basicConfig"
] | [((45, 144), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(levelname)-4s [%(module)s.%(funcName)s:%(lineno)d] %(message)s"""'}), "(format=\n '%(levelname)-4s [%(module)s.%(funcName)s:%(lineno)d] %(message)s')\n", (64, 144), False, 'import logging\n'), ((228, 261), 'logging.getLogger', 'logging.... |
import json
import sys
from jinja2 import Template
def render_template(template_content, variables):
template = Template(template_content)
return template.render(variables)
def get_args():
json_data = json.loads(sys.argv[1])
variables = json_data.get('template_vars')
template_content = json_da... | [
"jinja2.Template",
"sys.stdout.write",
"json.loads"
] | [((120, 146), 'jinja2.Template', 'Template', (['template_content'], {}), '(template_content)\n', (128, 146), False, 'from jinja2 import Template\n'), ((219, 242), 'json.loads', 'json.loads', (['sys.argv[1]'], {}), '(sys.argv[1])\n', (229, 242), False, 'import json\n'), ((639, 663), 'sys.stdout.write', 'sys.stdout.write... |
#-*-coding:utf-8-*-
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="correiosws",
version="1.0.0",
author="Nykollas",
author_email="<EMAIL>",
description="Conjuneto de técnicas para acesso ao serviços da API do Correios",
long_descrip... | [
"setuptools.setup"
] | [((107, 661), 'setuptools.setup', 'setuptools.setup', ([], {'name': '"""correiosws"""', 'version': '"""1.0.0"""', 'author': '"""Nykollas"""', 'author_email': '"""<EMAIL>"""', 'description': '"""Conjuneto de técnicas para acesso ao serviços da API do Correios"""', 'long_description': 'long_description', 'long_descriptio... |
# As usual, a bit of setup
from __future__ import print_function
from nnlib.layers import *
from nnlib.fast_layers import conv_forward_fast
from nnlib.load_time_series import load_data
import time
from scipy import signal
import torch
import torch.nn.functional as F
def reshape(x):
return x.reshape(1, 1, x.s... | [
"time.gmtime",
"time.time",
"torch.cuda.is_available",
"torch.device",
"torch.from_numpy"
] | [((652, 679), 'torch.device', 'torch.device', (['"""conv1D_cuda"""'], {}), "('conv1D_cuda')\n", (664, 679), False, 'import torch\n'), ((1893, 1904), 'time.time', 'time.time', ([], {}), '()\n', (1902, 1904), False, 'import time\n'), ((1971, 1982), 'time.time', 'time.time', ([], {}), '()\n', (1980, 1982), False, 'import ... |
from google.appengine.ext import db
class ApplicationModel(db.Model):
app_name = db.StringProperty()
description = db.TextProperty()
app_key = db.StringProperty()
owner = db.IntegerProperty()
viewer = db.ListProperty(long, indexed=True, default=[])
create_time = db.DateTimeProperty(auto_now_ad... | [
"google.appengine.ext.db.DateTimeProperty",
"google.appengine.ext.db.StringProperty",
"google.appengine.ext.db.ListProperty",
"google.appengine.ext.db.TextProperty",
"google.appengine.ext.db.IntegerProperty"
] | [((87, 106), 'google.appengine.ext.db.StringProperty', 'db.StringProperty', ([], {}), '()\n', (104, 106), False, 'from google.appengine.ext import db\n'), ((125, 142), 'google.appengine.ext.db.TextProperty', 'db.TextProperty', ([], {}), '()\n', (140, 142), False, 'from google.appengine.ext import db\n'), ((157, 176), '... |
# Generated by Django 3.0.13 on 2021-05-22 09:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('categories', '0008_mptt'),
]
operations = [
migrations.AddField(
model_name='category',
name='product_name',
... | [
"django.db.models.CharField"
] | [((332, 405), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(255)', 'verbose_name': '"""Product name"""'}), "(blank=True, max_length=255, verbose_name='Product name')\n", (348, 405), False, 'from django.db import migrations, models\n'), ((536, 625), 'django.db.models.CharFiel... |
# encoding: utf-8
from __future__ import absolute_import, unicode_literals
import re
import logging
import os
__author__ = 'bluec0re'
log = logging.getLogger(__name__)
class Default(object):
def __repr__(self):
attrs = ', '.join(
'%s=%s' % (key, repr(getattr(self, key))) for key in ... | [
"re.escape",
"re.search",
"os.path.relpath",
"logging.getLogger"
] | [((143, 170), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (160, 170), False, 'import logging\n'), ((1000, 1028), 'os.path.relpath', 'os.path.relpath', (['path', 'start'], {}), '(path, start)\n', (1015, 1028), False, 'import os\n'), ((1083, 1131), 're.search', 're.search', (['"""\\\\.\\... |
# encoding: utf-8
# module WriteToCSV
# from ./WriteToCSV.py
# by written 2.00
# no doc
# imports
import csv
import re
# no Variables
# class
class WriteTiCSV:
"""
open_file_count_word() -> bool.
"""
# function
@staticmethod
def open_file_count_word(dict_words_quantity: dict) -> bool: #... | [
"csv.register_dialect",
"csv.writer"
] | [((649, 728), 'csv.register_dialect', 'csv.register_dialect', (['"""myDialect"""'], {'quoting': 'csv.QUOTE_ALL', 'skipinitialspace': '(True)'}), "('myDialect', quoting=csv.QUOTE_ALL, skipinitialspace=True)\n", (669, 728), False, 'import csv\n'), ((1588, 1667), 'csv.register_dialect', 'csv.register_dialect', (['"""myDia... |
import os
import sys
cmd = None
if len(sys.argv)>1:
cmd = sys.argv[1]
commands = {}
def run_script(func):
import importlib
mod = importlib.import_module("pySPM.tools."+func)
sys.argv = [sys.argv[0]]+[x for x in sys.argv[2:]]
mod.main()
cmds = {
'stability': dict(doc="Run a stabil... | [
"importlib.import_module"
] | [((151, 197), 'importlib.import_module', 'importlib.import_module', (["('pySPM.tools.' + func)"], {}), "('pySPM.tools.' + func)\n", (174, 197), False, 'import importlib\n')] |
#!/usr/bin/env python3
#Copyright (c) 2014, <NAME> <<EMAIL>>
#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 o... | [
"optparse.OptionParser",
"math.ceil",
"time.sleep",
"udp_pkg.udp_com",
"threading.Event",
"math.log",
"threading.Semaphore",
"utils.Image.import_img",
"sys.exit"
] | [((16962, 16976), 'optparse.OptionParser', 'OptionParser', ([], {}), '()\n', (16974, 16976), False, 'from optparse import OptionParser\n'), ((18378, 18391), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (18388, 18391), False, 'import time\n'), ((18742, 18753), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (1875... |
import torch.nn as nn
from torch.nn.modules.transformer import TransformerEncoder, TransformerEncoderLayer
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
import torch
import math
from torch import nn
class PositionalEncoding(nn.Module):
def __init__(self, d_model, dropout=0.1, max_len=10... | [
"torch.nn.Dropout",
"torch.nn.modules.transformer.TransformerEncoderLayer",
"torch.nn.modules.transformer.TransformerEncoder",
"torch.nn.Embedding",
"torch.cat",
"torch.cos",
"torch.arange",
"torch.nn.Linear",
"torch.zeros",
"math.log",
"torch.sin"
] | [((399, 420), 'torch.nn.Dropout', 'nn.Dropout', ([], {'p': 'dropout'}), '(p=dropout)\n', (409, 420), False, 'from torch import nn\n'), ((435, 464), 'torch.zeros', 'torch.zeros', (['max_len', 'd_model'], {}), '(max_len, d_model)\n', (446, 464), False, 'import torch\n'), ((662, 692), 'torch.sin', 'torch.sin', (['(positio... |
import functools
from typing import Dict
import numpy as np
from core.elements.strategy import create_strategy
from algo.ppo.elements.strategy import PPOTrainingLoop
from algo.mappo.elements.strategy import MAPPOStrategy
class MAPPO2Strategy(MAPPOStrategy):
def compute_value(self, value_inp: Dict[str, np.ndarray... | [
"functools.partial"
] | [((607, 709), 'functools.partial', 'functools.partial', (['create_strategy'], {'strategy_cls': 'MAPPO2Strategy', 'training_loop_cls': 'PPOTrainingLoop'}), '(create_strategy, strategy_cls=MAPPO2Strategy,\n training_loop_cls=PPOTrainingLoop)\n', (624, 709), False, 'import functools\n')] |
"""
Hooks for additional handlers used to mount other databases via FDW. These handlers become available
in the command line tool (via `sgr mount`) and in the Splitfile interpreter (via `FROM MOUNT`).
"""
import logging
from importlib import import_module
from typing import Callable, Dict, List, Optional, Union, TYPE_... | [
"splitgraph.exceptions.MountHandlerError",
"importlib.import_module",
"psycopg2.sql.SQL",
"psycopg2.sql.Identifier",
"logging.info",
"splitgraph.config.config.get_all_in_section",
"splitgraph.engine.get_engine"
] | [((4161, 4173), 'splitgraph.engine.get_engine', 'get_engine', ([], {}), '()\n', (4171, 4173), False, 'from splitgraph.engine import get_engine\n'), ((4178, 4230), 'logging.info', 'logging.info', (['"""Importing foreign Postgres schema..."""'], {}), "('Importing foreign Postgres schema...')\n", (4190, 4230), False, 'imp... |
from bricks_modeling.file_IO.model_writer import write_bricks_to_file_with_steps
from util.debugger import MyDebugger
import os
import csv
import solvers.brick_heads.bach_render_images as render
import solvers.brick_heads.part_selection as p_select
from bricks_modeling.file_IO.model_reader import read_bricks_from_file
... | [
"util.debugger.MyDebugger",
"os.path.exists",
"bricks_modeling.file_IO.model_reader.read_bricks_from_file",
"numpy.array",
"os.path.join"
] | [((404, 426), 'numpy.array', 'np.array', (['[150, 0, 70]'], {}), '([150, 0, 70])\n', (412, 426), True, 'import numpy as np\n'), ((449, 472), 'numpy.array', 'np.array', (['[-150, 0, 70]'], {}), '([-150, 0, 70])\n', (457, 472), True, 'import numpy as np\n'), ((2298, 2323), 'util.debugger.MyDebugger', 'MyDebugger', (['"""... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from xml.etree import ElementTree
xmlconst = """
<index>
<main str="Folder to display">
<locale lang="de">Anzuzeigender ordner</locale>
<locale lang="en">Folder to display</locale>
... | [
"xml.etree.ElementTree.parse",
"os.path.abspath",
"os.path.exists",
"xml.etree.ElementTree.fromstring"
] | [((781, 801), 'os.path.exists', 'os.path.exists', (['path'], {}), '(path)\n', (795, 801), False, 'import os\n'), ((982, 1020), 'xml.etree.ElementTree.fromstring', 'ElementTree.fromstring', (['self.xmlstring'], {}), '(self.xmlstring)\n', (1004, 1020), False, 'from xml.etree import ElementTree\n'), ((1053, 1085), 'xml.et... |
from datetime import datetime
from pathlib import PurePath
import mailparser
import pytest
from django.utils.timezone import utc
from datahub.interaction.email_processors.exceptions import (
BadCalendarInviteError,
MalformedEmailError,
NoContactsError,
SenderUnverifiedError,
UnconfirmedCalendarInv... | [
"datahub.interaction.email_processors.parsers.CalendarInteractionEmailParser",
"datahub.interaction.email_processors.exceptions.BadCalendarInviteError",
"mailparser.parse_from_file",
"datahub.interaction.email_processors.exceptions.SenderUnverifiedError",
"datahub.interaction.email_processors.exceptions.NoC... | [((720, 763), 'mailparser.parse_from_file', 'mailparser.parse_from_file', (['email_file_path'], {}), '(email_file_path)\n', (746, 763), False, 'import mailparser\n'), ((779, 818), 'datahub.interaction.email_processors.parsers.CalendarInteractionEmailParser', 'CalendarInteractionEmailParser', (['message'], {}), '(messag... |
import os
from math import ceil
from concurrent.futures import ProcessPoolExecutor
import pandas as pd
class FileUtils:
ALLOWED_EXTENSIONS = ['csv', 'xls', 'xlsx', 'zip']
@staticmethod
def read_parallel(paths, workers=4, concat=True, **read_options):
""" Concat the dataframes using multiple pro... | [
"os.listdir",
"pandas.read_csv",
"concurrent.futures.ProcessPoolExecutor",
"pandas.read_excel",
"pandas.concat"
] | [((2449, 2472), 'os.listdir', 'os.listdir', (['folder_path'], {}), '(folder_path)\n', (2459, 2472), False, 'import os\n'), ((476, 516), 'concurrent.futures.ProcessPoolExecutor', 'ProcessPoolExecutor', ([], {'max_workers': 'workers'}), '(max_workers=workers)\n', (495, 516), False, 'from concurrent.futures import Process... |
# -*- coding: utf-8 -*-
## @package ivf.cmds.sparse_interpolation.sparse_sampling
#
# ivf.cmds.sparse_interpolation.sparse_sampling utility package.
# @author tody
# @date 2016/02/03
import cv2
from ivf.cmds.base_cmds import BaseCommand
from ivf.core.sparse_interpolation.sparse_sampling import spars... | [
"ivf.core.sparse_interpolation.sparse_sampling.sparseSampling"
] | [((615, 636), 'ivf.core.sparse_interpolation.sparse_sampling.sparseSampling', 'sparseSampling', (['image'], {}), '(image)\n', (629, 636), False, 'from ivf.core.sparse_interpolation.sparse_sampling import sparseSampling\n')] |
from talon import Module
# --- App definitions ---
mod = Module()
mod.apps.keepass = """
os: windows
and app.name: KeePass
os: windows
and app.exe: KeePass.exe
"""
mod.apps.keepassx = """
os: windows
and app.name: KeePassX.exe
os: windows
and app.exe: KeePassX.exe
"""
mod.apps.keepassx = """
os: linux
app.name: /^keep... | [
"talon.Module"
] | [((58, 66), 'talon.Module', 'Module', ([], {}), '()\n', (64, 66), False, 'from talon import Module\n')] |
from django.urls import path, re_path, include
from rest_framework.urlpatterns import format_suffix_patterns
from django.contrib.auth.views import LoginView, LogoutView
from django.contrib.auth import views as auth_views
from .views import gamedetails, welcome, invite, acceptinvitation, gamedetail, makemove, AllGamesL... | [
"django.contrib.auth.views.LogoutView.as_view",
"django.urls.re_path",
"django.contrib.auth.views.LoginView.as_view",
"django.urls.path"
] | [((357, 410), 'django.urls.path', 'path', (['"""gamedetails/"""', 'gamedetails'], {'name': '"""gamedetails"""'}), "('gamedetails/', gamedetails, name='gamedetails')\n", (361, 410), False, 'from django.urls import path, re_path, include\n'), ((668, 706), 'django.urls.path', 'path', (['"""home/"""', 'welcome'], {'name': ... |
# Only about 74% accuratee
import tensorflow as tf
import nltk
import io
from nltk.tokenize import word_tokenize
from nltk.stem import WordNetLemmatizer # useful for finding roots of words
import numpy as np
import pickle
n_nodes_hl1 = 400 #these can be different and whatever you like
n_nodes_hl2 = 400
... | [
"tensorflow.nn.relu",
"tensorflow.train.Saver",
"nltk.stem.WordNetLemmatizer",
"tensorflow.global_variables_initializer",
"tensorflow.argmax",
"tensorflow.Session",
"tensorflow.constant",
"tensorflow.nn.softmax_cross_entropy_with_logits_v2",
"tensorflow.placeholder",
"tensorflow.matmul",
"tensor... | [((335, 354), 'nltk.stem.WordNetLemmatizer', 'WordNetLemmatizer', ([], {}), '()\n', (352, 354), False, 'from nltk.stem import WordNetLemmatizer\n'), ((451, 474), 'tensorflow.placeholder', 'tf.placeholder', (['"""float"""'], {}), "('float')\n", (465, 474), True, 'import tensorflow as tf\n'), ((530, 553), 'tensorflow.pla... |
import setting
import os
import time
from multiprocessing import Process
from signal import *
from datetime import datetime
from db import db
from flask import Flask, render_template, redirect, url_for, request
from pluginManager import pluginManager
#crons
def sync_cron():
while True:
print("[INFO] Starti... | [
"db.db",
"flask.request.args.get",
"flask.Flask",
"os.system",
"time.sleep",
"datetime.datetime.utcnow",
"os.path.isfile",
"datetime.datetime.strptime",
"flask.render_template",
"multiprocessing.Process",
"pluginManager.pluginManager",
"datetime.datetime.timestamp"
] | [((1215, 1230), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (1220, 1230), False, 'from flask import Flask, render_template, redirect, url_for, request\n'), ((1242, 1272), 'pluginManager.pluginManager', 'pluginManager', (['setting.plugins'], {}), '(setting.plugins)\n', (1255, 1272), False, 'from pluginMa... |
from repoman.backend import Backend
import os, json, hashlib
import ssl
import boto
from boto.s3.key import Key
class S3Backend(Backend):
"""
A storage backend which uses Amazon S3.
AWS IDs are read from environment variables.
"""
def __init__(self, bucket_name):
# monkey-patch for boto... | [
"os.path.basename",
"boto.connect_s3",
"os.path.dirname",
"json.dumps",
"boto.s3.key.Key"
] | [((774, 791), 'boto.connect_s3', 'boto.connect_s3', ([], {}), '()\n', (789, 791), False, 'import boto\n'), ((988, 1004), 'boto.s3.key.Key', 'Key', (['self.bucket'], {}), '(self.bucket)\n', (991, 1004), False, 'from boto.s3.key import Key\n'), ((1240, 1256), 'boto.s3.key.Key', 'Key', (['self.bucket'], {}), '(self.bucket... |
import dash_bootstrap_components as dbc
progress = dbc.Progress(value=50)
| [
"dash_bootstrap_components.Progress"
] | [((52, 74), 'dash_bootstrap_components.Progress', 'dbc.Progress', ([], {'value': '(50)'}), '(value=50)\n', (64, 74), True, 'import dash_bootstrap_components as dbc\n')] |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^blog/$', views.get_blogs),
url(r'^detail/(\d+)/$',views.get_details, name='blog_get_detail'),
] | [
"django.conf.urls.url"
] | [((78, 109), 'django.conf.urls.url', 'url', (['"""^blog/$"""', 'views.get_blogs'], {}), "('^blog/$', views.get_blogs)\n", (81, 109), False, 'from django.conf.urls import url\n'), ((117, 183), 'django.conf.urls.url', 'url', (['"""^detail/(\\\\d+)/$"""', 'views.get_details'], {'name': '"""blog_get_detail"""'}), "('^detai... |
# coding=utf-8
"""
Tests for deepreg/model/network/ddf_dvf.py
"""
import pytest
import tensorflow as tf
from deepreg.model.network.ddf_dvf import build_ddf_dvf_model, ddf_dvf_forward
from deepreg.model.network.util import build_backbone
def test_ddf_dvf_forward():
"""
Testing that ddf_dvf_forward function r... | [
"deepreg.model.network.ddf_dvf.build_ddf_dvf_model",
"tensorflow.ones",
"pytest.raises",
"deepreg.model.network.util.build_backbone"
] | [((471, 660), 'deepreg.model.network.util.build_backbone', 'build_backbone', ([], {'image_size': 'fixed_image_size', 'out_channels': '(3)', 'model_config': "{'backbone': 'local', 'local': {'num_channel_initial': 4, 'extract_levels':\n [1, 2, 3]}}", 'method_name': '"""ddf"""'}), "(image_size=fixed_image_size, out_cha... |
#!/usr/bin/env python
"""Tests for ais.compatibility.gpsd."""
import ais
import ais.compatibility.gpsd
import ais.stream
import unittest
import json
import os
import re
import subprocess
import six
from .. import testutils
known_problems = {
2: set(('turn', 'status_text')),
9: set(['speed']),
15: set(['... | [
"unittest.main",
"ais.stream.decode",
"os.unlink",
"json.loads",
"ais.compatibility.gpsd.Mangler",
"six.advance_iterator",
"ais.compatibility.gpsd.mangle",
"os.path.split",
"os.path.join",
"subprocess.check_call"
] | [((5624, 5639), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5637, 5639), False, 'import unittest\n'), ((609, 641), 'ais.compatibility.gpsd.Mangler', 'ais.compatibility.gpsd.Mangler', ([], {}), '()\n', (639, 641), False, 'import ais\n'), ((2409, 2447), 'os.path.join', 'os.path.join', (['self.dir', "(base + '.nm... |
"""
.. module:: SVM-OVA
:synopsis: Multiclass (One-vs-All) Linear Support Vector Machine
.. moduleauthor:: <NAME> <<EMAIL>>
"""
from secml.ml.classifiers import CClassifierSVM
from secml.ml.classifiers.multiclass import CClassifierMulticlassOVA
def svm_ova():
"""Multiclass (One-vs-All) Linear Support Vector ... | [
"secml.ml.classifiers.multiclass.CClassifierMulticlassOVA"
] | [((343, 383), 'secml.ml.classifiers.multiclass.CClassifierMulticlassOVA', 'CClassifierMulticlassOVA', (['CClassifierSVM'], {}), '(CClassifierSVM)\n', (367, 383), False, 'from secml.ml.classifiers.multiclass import CClassifierMulticlassOVA\n')] |
import asyncio
from datetime import date, datetime
import sys
import os
from aiokafka import AIOKafkaProducer
import ujson
from websocket import create_connection
import time
import aiohttp
import logging
import socket
KAFKA_BROKER_URL = os.environ.get("KAFKA_BROKER_URL")
TOPIC_NAME = os.environ.get("TOPI... | [
"asyncio.sleep",
"ujson.loads",
"time.sleep",
"os.environ.get",
"aiohttp.ClientSession",
"datetime.datetime.utcnow",
"asyncio.wait_for",
"ujson.dumps",
"sys.exit"
] | [((251, 285), 'os.environ.get', 'os.environ.get', (['"""KAFKA_BROKER_URL"""'], {}), "('KAFKA_BROKER_URL')\n", (265, 285), False, 'import os\n'), ((300, 328), 'os.environ.get', 'os.environ.get', (['"""TOPIC_NAME"""'], {}), "('TOPIC_NAME')\n", (314, 328), False, 'import os\n'), ((347, 379), 'os.environ.get', 'os.environ.... |
"""Leetcode 62. Unique Paths.
Medium
URL: https://leetcode.com/problems/unique-paths/
A robot is located at the top-left corner of a m x n grid
(marked 'Start' in the diagram below).
The robot can only move either down or right at any point in time.
The robot is trying to reach the bottom-right corner of the grid
... | [
"time.time"
] | [((2669, 2680), 'time.time', 'time.time', ([], {}), '()\n', (2678, 2680), False, 'import time\n'), ((2812, 2823), 'time.time', 'time.time', ([], {}), '()\n', (2821, 2823), False, 'import time\n'), ((2957, 2968), 'time.time', 'time.time', ([], {}), '()\n', (2966, 2968), False, 'import time\n'), ((3094, 3105), 'time.time... |
from concurrent.futures import ThreadPoolExecutor
import requests
from bs4 import BeautifulSoup
from scrape_expertise import scrape_staff
import string
url = 'https://www.swansea.ac.uk/staff/law'
def get_department_staff(soup, department):
section = soup.find('div',{'id':'{}-contents'.format(department)})
return {... | [
"bs4.BeautifulSoup",
"concurrent.futures.ThreadPoolExecutor",
"string.capwords",
"requests.get"
] | [((474, 491), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (486, 491), False, 'import requests\n'), ((500, 542), 'bs4.BeautifulSoup', 'BeautifulSoup', (['page.content', '"""html.parser"""'], {}), "(page.content, 'html.parser')\n", (513, 542), False, 'from bs4 import BeautifulSoup\n'), ((352, 379), 'string.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2017 <NAME> <<EMAIL>>
# Distributed under terms of the MIT license.
"""
Rename variants & do final cleanup after complex resolution
"""
import argparse
import sys
from collections import defaultdict
import pysam
def rename(vcf, fout, chrom=None, prefix='... | [
"collections.defaultdict",
"pysam.VariantFile",
"argparse.ArgumentParser"
] | [((349, 365), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (360, 365), False, 'from collections import defaultdict\n'), ((2006, 2109), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__', 'formatter_class': 'argparse.RawDescriptionHelpFormatter'}), '(description=_... |
import unittest
import circuitgraph as cg
from circuitgraph.utils import clog2, int_to_bin, lint
class TestUtils(unittest.TestCase):
def test_clog2(self):
self.assertEqual(clog2(13), 4)
self.assertEqual(clog2(16), 4)
self.assertRaises(ValueError, clog2, 0)
def test_int_to_bin(self):
... | [
"circuitgraph.Circuit",
"circuitgraph.utils.clog2",
"circuitgraph.utils.lint",
"circuitgraph.utils.int_to_bin"
] | [((563, 575), 'circuitgraph.Circuit', 'cg.Circuit', ([], {}), '()\n', (573, 575), True, 'import circuitgraph as cg\n'), ((807, 814), 'circuitgraph.utils.lint', 'lint', (['c'], {}), '(c)\n', (811, 814), False, 'from circuitgraph.utils import clog2, int_to_bin, lint\n'), ((187, 196), 'circuitgraph.utils.clog2', 'clog2', ... |
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
import matplotlib.transforms as transforms
from matplotlib import rcParams
from matplotlib.colors import LinearSegmentedColormap
from p3iv_utils_probability.distributions import (
BivariateNormalDistribution,
UnivariateNor... | [
"matplotlib.colors.LinearSegmentedColormap.from_list",
"numpy.rad2deg",
"numpy.max",
"numpy.min",
"numpy.linspace",
"numpy.random.choice",
"matplotlib.patches.Ellipse",
"numpy.round",
"matplotlib.transforms.Affine2D"
] | [((1169, 1198), 'numpy.random.choice', 'np.random.choice', (['self.colors'], {}), '(self.colors)\n', (1185, 1198), True, 'import numpy as np\n'), ((2366, 2444), 'matplotlib.colors.LinearSegmentedColormap.from_list', 'LinearSegmentedColormap.from_list', (["('alpha_gradient_color_map_' + color)", 'colors'], {}), "('alpha... |
# <NAME> and <NAME>
# Created: 5/23/2013
# Last Updated: 6/14/2013
# For JCAP
from PyQt4 import QtGui, QtCore
import datareader
import cPickle as pickle
""" widget to make profiles """
class ProfileCreator(QtGui.QWidget):
""" sets up the Widget """
def __init__(self):
super(ProfileCreator, self).__in... | [
"PyQt4.QtGui.QMessageBox.question",
"PyQt4.QtGui.QHBoxLayout",
"PyQt4.QtGui.QLabel",
"PyQt4.QtGui.QWidget",
"PyQt4.QtGui.QCheckBox",
"PyQt4.QtGui.QVBoxLayout",
"datareader.DATA_HEADINGS.values",
"cPickle.load",
"cPickle.dump",
"PyQt4.QtGui.QDialogButtonBox",
"PyQt4.QtGui.QInputDialog.getText"
] | [((567, 590), 'PyQt4.QtGui.QVBoxLayout', 'QtGui.QVBoxLayout', (['self'], {}), '(self)\n', (584, 590), False, 'from PyQt4 import QtGui, QtCore\n'), ((614, 628), 'PyQt4.QtGui.QLabel', 'QtGui.QLabel', ([], {}), '()\n', (626, 628), False, 'from PyQt4 import QtGui, QtCore\n'), ((848, 863), 'PyQt4.QtGui.QWidget', 'QtGui.QWid... |
from enum import unique, Enum
from uuid import uuid4
from sqlalchemy import Column, Enum as EnumType, UnicodeText, PrimaryKeyConstraint
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy_utils import Timestamp
from src.db.base import Base
@unique
class MessageStatus(Enum):
NEW = "new"
OK = "ok"... | [
"sqlalchemy.dialects.postgresql.UUID",
"sqlalchemy.Enum",
"sqlalchemy.Column",
"sqlalchemy.PrimaryKeyConstraint"
] | [((558, 593), 'sqlalchemy.Column', 'Column', (['UnicodeText'], {'nullable': '(False)'}), '(UnicodeText, nullable=False)\n', (564, 593), False, 'from sqlalchemy import Column, Enum as EnumType, UnicodeText, PrimaryKeyConstraint\n'), ((608, 643), 'sqlalchemy.Column', 'Column', (['UnicodeText'], {'nullable': '(False)'}), ... |
#!/usr/bin/env python3
'''
KLL Compiler
Keyboard Layout Langauge
'''
# Copyright (C) 2014-2016 by <NAME>
#
# This file is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | [
"funcparserlib.parser.oneplus",
"os.path.basename",
"funcparserlib.lexer.Token",
"os.getcwd",
"funcparserlib.lexer.make_tokenizer",
"funcparserlib.parser.skip",
"os.path.realpath",
"subprocess.check_output",
"os.path.isfile",
"funcparserlib.parser.maybe",
"funcparserlib.parser.many",
"os.chdir... | [((5347, 5368), 'funcparserlib.lexer.make_tokenizer', 'make_tokenizer', (['specs'], {}), '(specs)\n', (5361, 5368), False, 'from funcparserlib.lexer import make_tokenizer, Token, LexerError\n'), ((11383, 11406), 'funcparserlib.lexer.Token', 'Token', (['"""EndOfLine"""', '""";"""'], {}), "('EndOfLine', ';')\n", (11388, ... |
# todo: Implement Neural Network (or Logistic Regression) From Scratch</h2>
# todo: importing libraries
import numpy as np
from tensorflow import keras
import pandas as pd
from matplotlib import pyplot as plt
# todo: load dataSet
df = pd.read_csv("insurance_data.csv")
df.head()
# todo: Split train and test set
from ... | [
"math.exp",
"numpy.log",
"tensorflow.keras.layers.Dense",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"numpy.transpose",
"numpy.mean",
"numpy.array",
"numpy.exp"
] | [((237, 270), 'pandas.read_csv', 'pd.read_csv', (['"""insurance_data.csv"""'], {}), "('insurance_data.csv')\n", (248, 270), True, 'import pandas as pd\n'), ((404, 507), 'sklearn.model_selection.train_test_split', 'train_test_split', (["df[['age', 'affordibility']]", 'df.bought_insurance'], {'test_size': '(0.2)', 'rando... |