code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
"""
Range Query module.
"""
from progressivis.table.nary import NAry
from progressivis.core.utils import indices_len
from . import BaseTable
from ..core.bitmap import bitmap
from . import TableSelectedView
def _get_physical_table(t):
return t.base or t
class Intersection(NAry):
"Intersection Module"
pa... | [
"progressivis.core.utils.indices_len"
] | [((1952, 1972), 'progressivis.core.utils.indices_len', 'indices_len', (['created'], {}), '(created)\n', (1963, 1972), False, 'from progressivis.core.utils import indices_len\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import time
import sys
from src import InstaBot
import pandas as pd
df = pd.read_csv('acc.csv', header = 0)
media_id = 1753858169015406083
# media_id = sys.argv[1]
# run python unlike.py 1753858169015406083
for i, row in enumerate(df.values):
bot = InstaBot(... | [
"pandas.read_csv",
"src.InstaBot"
] | [((132, 164), 'pandas.read_csv', 'pd.read_csv', (['"""acc.csv"""'], {'header': '(0)'}), "('acc.csv', header=0)\n", (143, 164), True, 'import pandas as pd\n'), ((311, 351), 'src.InstaBot', 'InstaBot', (['df.iloc[i].ig', 'df.iloc[i].igpw'], {}), '(df.iloc[i].ig, df.iloc[i].igpw)\n', (319, 351), False, 'from src import In... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on 03.05.17 15:59
@author: pavel
"""
import logging
from gi.repository import Gtk
log = logging.getLogger(__name__)
from locale import gettext as _
class TextColumn(Gtk.TreeViewColumn):
def __init__(self, column_name, tooltip_text, model_index_txt,
... | [
"locale.gettext",
"gi.repository.Gtk.ListStore",
"logging.getLogger",
"gi.repository.Gtk.CellRendererToggle",
"gi.repository.Gtk.CellRendererText",
"gi.repository.Gtk.Label"
] | [((151, 178), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (168, 178), False, 'import logging\n'), ((2223, 2297), 'locale.gettext', '_', (['"""<b>{name}:</b> 127.0.0.1:{loc_port} <-> {serv_addr}:{serv_port}"""'], {}), "('<b>{name}:</b> 127.0.0.1:{loc_port} <-> {serv_addr}:{s... |
import torch
import torch.nn.functional as TF
from models.adaptive_layer import AdaptiveLayer
from models.resnet_blocks import ResBlock
class ResNet(torch.nn.Module):
def __init__(self, n_channels, n_classes, blocks, filters, image_size, adaptive_layer_type=None):
super(ResNet, self).__init__()
... | [
"torch.nn.ReLU",
"models.adaptive_layer.AdaptiveLayer",
"torch.nn.init.kaiming_normal_",
"torch.nn.ModuleList",
"torch.nn.Conv2d",
"models.resnet_blocks.ResBlock",
"torch.nn.BatchNorm2d",
"torch.nn.init.constant_",
"torch.nn.Linear",
"torch.nn.MaxPool2d"
] | [((1157, 1178), 'torch.nn.ModuleList', 'torch.nn.ModuleList', ([], {}), '()\n', (1176, 1178), False, 'import torch\n'), ((1760, 1799), 'torch.nn.Linear', 'torch.nn.Linear', (['filters[-1]', 'n_classes'], {}), '(filters[-1], n_classes)\n', (1775, 1799), False, 'import torch\n'), ((603, 681), 'models.adaptive_layer.Adapt... |
import logging
log = logging.getLogger('novnc2')
| [
"logging.getLogger"
] | [((21, 48), 'logging.getLogger', 'logging.getLogger', (['"""novnc2"""'], {}), "('novnc2')\n", (38, 48), False, 'import logging\n')] |
from .app.webserver.app import app
from .app.tgbot.server import run
import os
import time
import threading
import sys
print(r"""
__ ____
/ /___ __ __/ __ \__ __
__ / / __ `/ | / / /_/ / / / /
/ /_/ / /_/ /| |/ / ____/... | [
"threading.Thread",
"os.system",
"time.sleep"
] | [((785, 798), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (795, 798), False, 'import time\n'), ((882, 917), 'os.system', 'os.system', (['(\'start "" "\' + url + \'"\')'], {}), '(\'start "" "\' + url + \'"\')\n', (891, 917), False, 'import os\n'), ((964, 992), 'os.system', 'os.system', (["('xdg-open ' + url)"], ... |
import numpy as np
def get_1d_gauss_kernel(sigma, extent=3):
"""Build a 1-dimensional Gaussian kernel.
Parameters
----------
sigma : int or float
The standard deviation of the Gaussian function.
extent : int, optional
How many times sigma to consider on each side of the mean. 3 x... | [
"numpy.arange",
"numpy.sum",
"numpy.ceil",
"numpy.flip"
] | [((561, 584), 'numpy.ceil', 'np.ceil', (['(sigma * extent)'], {}), '(sigma * extent)\n', (568, 584), True, 'import numpy as np\n'), ((678, 692), 'numpy.sum', 'np.sum', (['kernel'], {}), '(kernel)\n', (684, 692), True, 'import numpy as np\n'), ((1998, 2012), 'numpy.sum', 'np.sum', (['kernel'], {}), '(kernel)\n', (2004, ... |
from datetime import datetime
from pykechain.enums import PropertyType, Category, Multiplicity
from pykechain.exceptions import NotFoundError, APIError, IllegalArgumentError
from pykechain.models import Property
from pykechain.models.validators import SingleReferenceValidator
from tests.classes import TestBetamax
cl... | [
"pykechain.models.Property.set_bulk_update",
"pykechain.models.validators.SingleReferenceValidator",
"pykechain.models.Property.update_values",
"datetime.datetime.now"
] | [((15501, 15531), 'pykechain.models.Property.set_bulk_update', 'Property.set_bulk_update', (['(True)'], {}), '(True)\n', (15525, 15531), False, 'from pykechain.models import Property\n'), ((15774, 15816), 'pykechain.models.Property.update_values', 'Property.update_values', ([], {'client': 'self.client'}), '(client=self... |
"""Plotting functions for visualizing distributions."""
from __future__ import division
import numpy as np
from scipy import stats
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import warnings
try:
import statsmodels.nonparametric.api as smnp
_has_statsmodels = True
except Import... | [
"numpy.meshgrid",
"numpy.zeros_like",
"matplotlib.colors.colorConverter.to_rgb",
"numpy.isscalar",
"numpy.asarray",
"scipy.stats.gaussian_kde",
"numpy.ndim",
"statsmodels.nonparametric.api.KDEMultivariate",
"numpy.mean",
"numpy.linspace",
"matplotlib.pyplot.gca",
"warnings.warn",
"statsmodel... | [((662, 675), 'numpy.asarray', 'np.asarray', (['a'], {}), '(a)\n', (672, 675), True, 'import numpy as np\n'), ((7970, 7994), 'statsmodels.nonparametric.api.KDEUnivariate', 'smnp.KDEUnivariate', (['data'], {}), '(data)\n', (7988, 7994), True, 'import statsmodels.nonparametric.api as smnp\n'), ((10549, 10587), 'statsmode... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This Python script creates a reference metagenome from all the individual reference
genomes of the microorganisms that make up a microbial community. The reference
metagenome is a multi-FASTA file and the individual reference genomes are also
found in multi-FASTA fi... | [
"os.chdir"
] | [((1340, 1360), 'os.chdir', 'os.chdir', (['directorio'], {}), '(directorio)\n', (1348, 1360), False, 'import os\n')] |
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 29 22:49:48 2020
@author: adwait
"""
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QGridLayout, QLabel,\
QComboBox,QLineEdit, QTextEdit, QCheckBox, QPushButton, QGroupBox
# from PyQt5.QtCore import Qt
from PyQt5.QtGui import QFont
import matplotlib
ma... | [
"numpy.random.seed",
"PyQt5.QtWidgets.QGridLayout",
"PyQt5.QtWidgets.QPushButton",
"PyQt5.QtWidgets.QVBoxLayout",
"numpy.random.normal",
"numpy.diag",
"PyQt5.QtWidgets.QLabel",
"matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg",
"PyQt5.QtWidgets.QCheckBox",
"matplotlib.figure.Figure",
"numpy... | [((318, 342), 'matplotlib.use', 'matplotlib.use', (['"""Qt5Agg"""'], {}), "('Qt5Agg')\n", (332, 342), False, 'import matplotlib\n'), ((919, 936), 'PyQt5.QtWidgets.QVBoxLayout', 'QVBoxLayout', (['self'], {}), '(self)\n', (930, 936), False, 'from PyQt5.QtWidgets import QWidget, QVBoxLayout, QGridLayout, QLabel, QComboBox... |
import numpy as np
import matplotlib.pyplot as plt
def estimate_pi(n, plot=False):
pts = np.random.random((n, 2))
norm = np.linalg.norm(pts, axis=-1)
frac_in_circle = np.average(norm <= 1)
pi_est = frac_in_circle * 4
if plot:
plt.plot(pts[:, 0], pts[:, 1], ',')
... | [
"numpy.average",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.axis",
"numpy.random.random",
"numpy.linalg.norm",
"numpy.linspace",
"matplotlib.pyplot.fill_between",
"matplotlib.pyplot.tight_layout",
"numpy.sqrt"
] | [((98, 122), 'numpy.random.random', 'np.random.random', (['(n, 2)'], {}), '((n, 2))\n', (114, 122), True, 'import numpy as np\n'), ((137, 165), 'numpy.linalg.norm', 'np.linalg.norm', (['pts'], {'axis': '(-1)'}), '(pts, axis=-1)\n', (151, 165), True, 'import numpy as np\n'), ((188, 209), 'numpy.average', 'np.average', (... |
import numpy
from sklearn.feature_extraction import DictVectorizer
from sklearn.pipeline import Pipeline
from newsgac.nlp_tools.transformers import ExtractSentimentFeatures
def test_sentiment_features():
text = 'Dit is een willekeurige tekst waar wat sentiment features uitgehaald worden. Dit is de tweede zin.'
... | [
"newsgac.nlp_tools.transformers.ExtractSentimentFeatures",
"numpy.array",
"sklearn.feature_extraction.DictVectorizer"
] | [((490, 531), 'numpy.array', 'numpy.array', (["['polarity', 'subjectivity']"], {}), "(['polarity', 'subjectivity'])\n", (501, 531), False, 'import numpy\n'), ((383, 409), 'newsgac.nlp_tools.transformers.ExtractSentimentFeatures', 'ExtractSentimentFeatures', ([], {}), '()\n', (407, 409), False, 'from newsgac.nlp_tools.t... |
#!/usr/bin/env python2.7
import os
import argparse
import subprocess as sp
import multiprocessing as mp
import shlex
import datetime
import re
import chisel
src = os.path.dirname(chisel.__file__)
from ..Utils import *
def parse_args():
description = "CHISEL command to re-run the inference of allele- and haplot... | [
"os.mkdir",
"argparse.ArgumentParser",
"os.path.isdir",
"os.path.dirname",
"os.path.isfile",
"os.path.join",
"os.chdir",
"multiprocessing.cpu_count"
] | [((166, 198), 'os.path.dirname', 'os.path.dirname', (['chisel.__file__'], {}), '(chisel.__file__)\n', (181, 198), False, 'import os\n'), ((440, 488), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'description'}), '(description=description)\n', (463, 488), False, 'import argparse\n'), ((3725... |
from . import unittest, numpy
from shapely.geometry import LineString, MultiLineString, asMultiLineString
from shapely.geometry.base import dump_coords
class MultiLineStringTestCase(unittest.TestCase):
def test_multipoint(self):
# From coordinate tuples
geom = MultiLineString((((1.0, 2.0), (3.0,... | [
"shapely.geometry.MultiLineString",
"shapely.geometry.asMultiLineString",
"shapely.geometry.base.dump_coords",
"shapely.geometry.LineString",
"numpy.array"
] | [((285, 329), 'shapely.geometry.MultiLineString', 'MultiLineString', (['(((1.0, 2.0), (3.0, 4.0)),)'], {}), '((((1.0, 2.0), (3.0, 4.0)),))\n', (300, 329), False, 'from shapely.geometry import LineString, MultiLineString, asMultiLineString\n'), ((534, 570), 'shapely.geometry.LineString', 'LineString', (['((1.0, 2.0), (3... |
from utils import bake_in_temp_dir
def test_bake_with_defaults(cookies):
with bake_in_temp_dir(cookies) as result:
assert result.project_path.is_dir()
assert result.exit_code == 0
assert result.exception is None
found_toplevel_files = [f.name for f in result.project_path.iterdir()... | [
"utils.bake_in_temp_dir"
] | [((84, 109), 'utils.bake_in_temp_dir', 'bake_in_temp_dir', (['cookies'], {}), '(cookies)\n', (100, 109), False, 'from utils import bake_in_temp_dir\n')] |
'''https://leetcode.com/problems/stock-price-fluctuation/
2034. Stock Price Fluctuation
Medium
174
16
Add to List
Share
You are given a stream of records about a particular stock. Each record contains a timestamp and the corresponding price of the stock at that timestamp.
Unfortunately due to the volatile nature o... | [
"sortedcontainers.SortedList",
"heapq.heappush",
"heapq.heapify",
"heapq.heappop"
] | [((2899, 2911), 'sortedcontainers.SortedList', 'SortedList', ([], {}), '()\n', (2909, 2911), False, 'from sortedcontainers import SortedList\n'), ((4437, 4488), 'heapq.heappush', 'heapq.heappush', (['self.__min_heap', '(price, timestamp)'], {}), '(self.__min_heap, (price, timestamp))\n', (4451, 4488), False, 'import he... |
from gz_reduce import *
from astropy.table import Table, join, vstack
from glob import glob
import os
import numpy as np
date='2017-12-10'
tree='sloan'
subjectset='sloan'
survey_id_field='sdss_id'
# For some reason the usual method crashes due to the large file size
# We therefore first split the file first
os.system... | [
"astropy.table.join",
"os.system",
"astropy.table.vstack",
"glob.glob",
"astropy.table.Table.read"
] | [((311, 449), 'os.system', 'os.system', (['"""mkdir sloan_tmp && cd sloan_tmp && split -l1000000 -a1 ../2017-12-10_galaxy_zoo_sloan_classifications.csv gz_sloan_"""'], {}), "(\n 'mkdir sloan_tmp && cd sloan_tmp && split -l1000000 -a1 ../2017-12-10_galaxy_zoo_sloan_classifications.csv gz_sloan_'\n )\n", (320, 449)... |
# -*- test-case-name: vumi.components.tests.test_session -*-
"""Session management utilities."""
import time
from twisted.internet import task
from twisted.internet.defer import inlineCallbacks, returnValue
class SessionManager(object):
"""A manager for sessions.
:param TxRedisManager redis:
Redis... | [
"vumi.persist.txredis_manager.TxRedisManager.from_config",
"twisted.internet.defer.returnValue",
"time.time"
] | [((1313, 1347), 'vumi.persist.txredis_manager.TxRedisManager.from_config', 'TxRedisManager.from_config', (['config'], {}), '(config)\n', (1339, 1347), False, 'from vumi.persist.txredis_manager import TxRedisManager\n'), ((2417, 2438), 'twisted.internet.defer.returnValue', 'returnValue', (['sessions'], {}), '(sessions)\... |
#! /usr/bin/env python
# -*- coding: iso-8859-15 -*-
##############################################################################
# Copyright 2003 & onward LASMEA UMR 6602 CNRS/Univ. Clermont II
# Copyright 2009 & onward LRI UMR 8623 CNRS/Univ Paris Sud XI
#
# Distributed under the Boost ... | [
"sys.path.pop",
"file_utils.read",
"os.path.join",
"os.path.realpath",
"re.search",
"mylogging.Mylogging.set_level",
"os.listdir"
] | [((2420, 2435), 'sys.path.pop', 'sys.path.pop', (['(0)'], {}), '(0)\n', (2432, 2435), False, 'import sys\n'), ((2292, 2323), 'mylogging.Mylogging.set_level', 'Mylogging.set_level', (['"""CRITICAL"""'], {}), "('CRITICAL')\n", (2311, 2323), False, 'from mylogging import Mylogging\n'), ((1919, 1941), 'os.listdir', 'os.lis... |
import base64
import hashlib
import logging
from cryptography.fernet import Fernet
from cryptography.fernet import InvalidToken
from cryptojwt.utils import as_bytes
from cryptojwt.utils import as_unicode
from oidcmsg.time_util import time_sans_frac
from oidcendpoint import rndstr
__author__ = '<NAME>'
logger = lo... | [
"cryptojwt.utils.as_bytes",
"cryptojwt.utils.as_unicode",
"oidcendpoint.rndstr",
"base64.b64decode",
"hashlib.new",
"cryptography.fernet.Fernet",
"oidcmsg.time_util.time_sans_frac",
"logging.getLogger"
] | [((318, 345), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (335, 345), False, 'import logging\n'), ((953, 969), 'oidcmsg.time_util.time_sans_frac', 'time_sans_frac', ([], {}), '()\n', (967, 969), False, 'from oidcmsg.time_util import time_sans_frac\n'), ((1188, 1204), 'cryptography.fern... |
from math import acos, cos, sqrt
from typing import List
from .rootfinding import Options
from .rootfinding import delta, horner
from .vector2 import vector2
from .lds import Vdcorput
PI = acos(-1.0)
def initial_autocorr(pa: List[float]) -> List[vector2]:
"""[summary]
Args:
pa (List[float]): [descr... | [
"math.acos",
"math.cos",
"math.sqrt"
] | [((191, 201), 'math.acos', 'acos', (['(-1.0)'], {}), '(-1.0)\n', (195, 201), False, 'from math import acos, cos, sqrt\n'), ((1245, 1255), 'math.cos', 'cos', (['(k * i)'], {}), '(k * i)\n', (1248, 1255), False, 'from math import acos, cos, sqrt\n'), ((5290, 5297), 'math.sqrt', 'sqrt', (['d'], {}), '(d)\n', (5294, 5297),... |
#!/usr/bin/env python
#
# Extract Jaccard features for MD5s.
#
import sys
import os
from optparse import OptionParser
from domainsandips import domainsandips
def pcappath(md5, md5dir, gametype, t):
return os.path.join(md5dir, '%s-%d-%s.pcap' % (md5, t, gametype))
def J(s1, s2):
try:
return float(len... | [
"os.path.join",
"optparse.OptionParser",
"domainsandips.domainsandips"
] | [((212, 270), 'os.path.join', 'os.path.join', (['md5dir', "('%s-%d-%s.pcap' % (md5, t, gametype))"], {}), "(md5dir, '%s-%d-%s.pcap' % (md5, t, gametype))\n", (224, 270), False, 'import os\n'), ((442, 465), 'domainsandips.domainsandips', 'domainsandips', (['pcappath'], {}), '(pcappath)\n', (455, 465), False, 'from domai... |
# encoding: utf-8
import os
import unittest
from . import (exceptions, loader, logger, parser, report, runner,
utils, validator)
class HttpRunner(object):
def __init__(self, **kwargs):
""" initialize HttpRunner.
Args:
kwargs (dict): key-value arguments used ... | [
"unittest.TextTestRunner",
"unittest.TestLoader",
"unittest.TestSuite"
] | [((1297, 1330), 'unittest.TextTestRunner', 'unittest.TextTestRunner', ([], {}), '(**kwargs)\n', (1320, 1330), False, 'import unittest\n'), ((1358, 1379), 'unittest.TestLoader', 'unittest.TestLoader', ([], {}), '()\n', (1377, 1379), False, 'import unittest\n'), ((2720, 2740), 'unittest.TestSuite', 'unittest.TestSuite', ... |
from logging.config import fileConfig
from alembic import context
from freenit.config import getConfig
config = getConfig()
fileConfig(context.config.config_file_name)
def run_migrations_offline():
context.configure(
url=config.dburl,
target_metadata=config.metadata,
literal_binds=True,
... | [
"freenit.config.getConfig",
"alembic.context.configure",
"alembic.context.run_migrations",
"logging.config.fileConfig",
"alembic.context.begin_transaction"
] | [((114, 125), 'freenit.config.getConfig', 'getConfig', ([], {}), '()\n', (123, 125), False, 'from freenit.config import getConfig\n'), ((126, 169), 'logging.config.fileConfig', 'fileConfig', (['context.config.config_file_name'], {}), '(context.config.config_file_name)\n', (136, 169), False, 'from logging.config import ... |
import datetime
from rest_framework import serializers, viewsets
from person.models import Person
from parliament.models import PoliticalParty
from document.models import Kamervraag, Kamerantwoord, Vraag, Antwoord
from document.models import Document, Submitter, FootNote
class KVPersonSerializer(serializers.ModelS... | [
"document.models.Kamervraag.objects.filter",
"datetime.date",
"document.models.Kamervraag.objects.all",
"document.models.Kamerantwoord.objects.all"
] | [((2503, 2527), 'document.models.Kamervraag.objects.all', 'Kamervraag.objects.all', ([], {}), '()\n', (2525, 2527), False, 'from document.models import Kamervraag, Kamerantwoord, Vraag, Antwoord\n'), ((3391, 3418), 'document.models.Kamerantwoord.objects.all', 'Kamerantwoord.objects.all', ([], {}), '()\n', (3416, 3418),... |
import sys
import os
import numpy as np
from typing import Union
from PIL import Image, ImageDraw, ImageFont
from weblogo import colorscheme
from weblogo.color import Color
from weblogo.seq import protein_alphabet
try:
import bokeh as bk
from bokeh.plotting import figure, show
from bokeh.core.properties i... | [
"PIL.Image.new",
"bokeh.io.output_notebook",
"numpy.meshgrid",
"bokeh.plotting.figure",
"PIL.ImageFont.load_default",
"weblogo.color.Color.from_string",
"os.path.dirname",
"bokeh.models.Range1d",
"weblogo.colorscheme.SymbolColor",
"PIL.ImageFont.truetype",
"numpy.arange",
"bokeh.plotting.show"... | [((423, 440), 'bokeh.io.output_notebook', 'output_notebook', ([], {}), '()\n', (438, 440), False, 'from bokeh.io import output_notebook\n'), ((7357, 7399), 'PIL.Image.new', 'Image.new', (['"""RGB"""', '(width, height)', '"""white"""'], {}), "('RGB', (width, height), 'white')\n", (7366, 7399), False, 'from PIL import Im... |
from math import floor, ceil
import numpy as np
import matplotlib.pyplot as plt
import datetime
import folium
import random
import seaborn as sns
import pandas as pd
import plotly.express as px
import geopandas as gpd
# import movingpandas as mpd
# from statistics import mean
from shapely.geometry import Polygon, Mult... | [
"seaborn.kdeplot",
"matplotlib.pyplot.suptitle",
"plotly.express.scatter_mapbox",
"matplotlib.pyplot.bar",
"geopandas.sjoin",
"pandas.read_csv",
"geopy.distance.great_circle",
"matplotlib.pyplot.figure",
"folium.Map",
"seaborn.pairplot",
"folium.Polygon",
"branca.colormap.linear.YlOrRd_09.scal... | [((1315, 1383), 'datetime.datetime.strptime', 'datetime.datetime.strptime', (['points.time.iloc[0]', '"""%Y-%m-%dT%H:%M:%S"""'], {}), "(points.time.iloc[0], '%Y-%m-%dT%H:%M:%S')\n", (1341, 1383), False, 'import datetime\n'), ((1578, 1590), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1588, 1590), True, ... |
import numpy as np
from deepobs.pytorch.runners import StandardRunner
from deepobs.tuner import GridSearch
from torch.optim import SGD
from probprec import Preconditioner
from sorunner import SORunner
optimizer_class = Preconditioner
hyperparams = {"lr": {"type": float},
"est_rank": {"type": int}}
# The d... | [
"numpy.logspace",
"deepobs.tuner.GridSearch"
] | [((542, 620), 'deepobs.tuner.GridSearch', 'GridSearch', (['optimizer_class', 'hyperparams', 'grid'], {'runner': 'SORunner', 'ressources': '(20)'}), '(optimizer_class, hyperparams, grid, runner=SORunner, ressources=20)\n', (552, 620), False, 'from deepobs.tuner import GridSearch\n'), ((374, 396), 'numpy.logspace', 'np.l... |
'''
Copyright 2013 <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, publish, distribute, sublicense,... | [
"fantastico.roa.resource_decorator.Resource",
"mock.Mock"
] | [((1791, 1878), 'fantastico.roa.resource_decorator.Resource', 'Resource', ([], {'name': 'expected_name', 'url': 'expected_url', 'subresources': 'expected_subresources'}), '(name=expected_name, url=expected_url, subresources=\n expected_subresources)\n', (1799, 1878), False, 'from fantastico.roa.resource_decorator im... |
import logging
import typhon
import netCDF4
import numpy as np
from scipy.interpolate import interp1d
from copy import copy
from konrad import constants
from konrad import utils
from konrad.component import Component
__all__ = [
'Atmosphere',
]
logger = logging.getLogger(__name__)
class Atmosphere(Component):... | [
"numpy.argmax",
"typhon.arts.types.GriddedField4",
"numpy.argmin",
"logging.getLogger",
"scipy.interpolate.interp1d",
"numpy.round",
"netCDF4.Dataset",
"numpy.zeros_like",
"typhon.arts.utils.get_arts_typename",
"numpy.cumsum",
"konrad.utils.standard_atmosphere",
"typhon.arts.xml.load",
"konr... | [((262, 289), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (279, 289), False, 'import logging\n'), ((1261, 1289), 'konrad.utils.plev_from_phlev', 'utils.plev_from_phlev', (['phlev'], {}), '(phlev)\n', (1282, 1289), False, 'from konrad import utils\n'), ((3065, 3094), 'typhon.arts.xml.lo... |
import setuptools
with open('README.md') as infile:
long_description = infile.read()
setuptools.setup(
name='ddlogger',
version='0.9b4',
author='<NAME>',
author_email='<EMAIL>',
description='Logs progress by printing dots',
long_description=long_description,
long_description_content_ty... | [
"setuptools.find_packages"
] | [((404, 430), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (428, 430), False, 'import setuptools\n')] |
# This file is part of the pyMOR project (http://www.pymor.org).
# Copyright Holders: <NAME>, <NAME>, <NAME>
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
from __future__ import absolute_import, division, print_function
from itertools import izip
import numpy as np
from pymor.core.in... | [
"pymor.operators.numpy.NumpyMatrixOperator",
"pymor.la.basic.induced_norm",
"pymor.la.numpyvectorarray.NumpyVectorArray",
"numpy.ones",
"pymor.reductors.basic.reduce_generic_rb",
"numpy.arange",
"itertools.izip",
"numpy.dot"
] | [((2949, 3023), 'pymor.reductors.basic.reduce_generic_rb', 'reduce_generic_rb', (['d', 'RB'], {'disable_caching': 'disable_caching', 'extends': 'extends'}), '(d, RB, disable_caching=disable_caching, extends=extends)\n', (2966, 3023), False, 'from pymor.reductors.basic import reduce_generic_rb\n'), ((5688, 5725), 'pymor... |
import os
import json
import shutil
import cv2
import sys
import math
# import tensorflow as tf
import numpy as np
# import align.detect_face
# import facenet
import requests
import tempfile
import _pickle as pickle
import urllib.request as request
from collections import namedtuple
from google_images_download import g... | [
"os.remove",
"os.makedirs",
"os.stat",
"os.path.exists",
"google_images_download.google_images_download.googleimagesdownload",
"cv2.imread",
"numpy.mean",
"tempfile.mkdtemp",
"collections.namedtuple",
"shutil.move",
"requests.get",
"numpy.array",
"shutil.rmtree",
"urllib.request.urlretriev... | [((616, 667), 'collections.namedtuple', 'namedtuple', (['"""BoundingBox"""', "['x1', 'x2', 'y1', 'y2']"], {}), "('BoundingBox', ['x1', 'x2', 'y1', 'y2'])\n", (626, 667), False, 'from collections import namedtuple\n'), ((420, 452), 'os.path.exists', 'os.path.exists', (['TMP_DOWNLOAD_DIR'], {}), '(TMP_DOWNLOAD_DIR)\n', (... |
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 17 17:54:31 2015
@author: JD
"""
from __future__ import print_function
# Simple service discovery implementation based on UDP broadcast packets:
# This class sends a UDP broadcast packet on port 1952 and then listens for replies on port 1952+1.
# Those replies do not con... | [
"select.select",
"socket.socket",
"time.clock",
"time.sleep"
] | [((1059, 1107), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_DGRAM'], {}), '(socket.AF_INET, socket.SOCK_DGRAM)\n', (1072, 1107), False, 'import socket\n'), ((1354, 1402), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_DGRAM'], {}), '(socket.AF_INET, socket.SOCK_DGRAM)\n', (136... |
import os, csv, pprint, threading, sys
def to_beats(time, tempo):
return round(int(time)/tempo)
def to_char(num):
return chr(int(num))
def run(file):
print(file)
with open(file, encoding="utf-8", errors="replace") as f:
reader = csv.reader(f)
music = []
playing = ""
... | [
"threading.Thread",
"csv.reader",
"csv.writer"
] | [((259, 272), 'csv.reader', 'csv.reader', (['f'], {}), '(f)\n', (269, 272), False, 'import os, csv, pprint, threading, sys\n'), ((1297, 1336), 'threading.Thread', 'threading.Thread', ([], {'target': 'run', 'args': '(i,)'}), '(target=run, args=(i,))\n', (1313, 1336), False, 'import os, csv, pprint, threading, sys\n'), (... |
import os
import re
import numpy as np
import pandas as pd
import ujson as json
import json as js
import sys
import argparse
class UCIDataset:
def __init__(self, window, source_dataset, output_json, imputing_columns):
self.read_dataset(source_dataset)
self.window = window
self.set_ids()
... | [
"pandas.DataFrame",
"json.dump",
"argparse.ArgumentParser",
"numpy.nan_to_num",
"pandas.read_csv",
"pandas.get_dummies",
"numpy.ones",
"numpy.isnan",
"numpy.array",
"ujson.dumps"
] | [((2823, 2839), 'numpy.array', 'np.array', (['deltas'], {}), '(deltas)\n', (2831, 2839), True, 'import numpy as np\n'), ((4918, 4933), 'ujson.dumps', 'json.dumps', (['rec'], {}), '(rec)\n', (4928, 4933), True, 'import ujson as json\n'), ((5005, 5030), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\... |
import ephem
import geosar
import geosar.settings as s
import pytest
@pytest.fixture
def mission(shared_datadir):
file = shared_datadir / 'VA.gpx'
return geosar.GPX(file)
def test_repr(mission):
for chunk in ['<geosar.GPX(', 'gpx_file=', 'VA.gpx', ')>']:
assert chunk in repr(mission)
def test_re... | [
"geosar.GPX"
] | [((164, 180), 'geosar.GPX', 'geosar.GPX', (['file'], {}), '(file)\n', (174, 180), False, 'import geosar\n')] |
import os
from collections import namedtuple
from unittest.mock import patch
import psycopg2
import pytest
from util.loader import smithsonian_unit_codes as si
POSTGRES_TEST_URI = os.getenv("AIRFLOW_CONN_POSTGRES_OPENLEDGER_TESTING")
POSTGRES_CONN_ID = os.getenv("TEST_CONN_ID")
SI_UNIT_CODE_TABLE = "test_unit_code_t... | [
"unittest.mock.patch.object",
"util.loader.smithsonian_unit_codes.alert_unit_codes_from_api",
"pytest.raises",
"collections.namedtuple",
"util.loader.smithsonian_unit_codes.get_new_and_outdated_unit_codes",
"os.getenv",
"psycopg2.connect"
] | [((183, 236), 'os.getenv', 'os.getenv', (['"""AIRFLOW_CONN_POSTGRES_OPENLEDGER_TESTING"""'], {}), "('AIRFLOW_CONN_POSTGRES_OPENLEDGER_TESTING')\n", (192, 236), False, 'import os\n'), ((256, 281), 'os.getenv', 'os.getenv', (['"""TEST_CONN_ID"""'], {}), "('TEST_CONN_ID')\n", (265, 281), False, 'import os\n'), ((574, 622)... |
# Copyright (c) 2021 Graphcore Ltd. All rights reserved.
import popart
import numpy as np
import test_util as tu
import re
@tu.requires_ipu_model
def test_groupHostSync():
builder = popart.Builder()
a = builder.addInputTensor(popart.TensorInfo("FLOAT16", [1]))
w = builder.addInitializedInputTensor(np.one... | [
"popart.Patterns",
"popart.Builder",
"numpy.ones",
"popart.AnchorReturnType",
"test_util.create_test_device",
"numpy.array",
"popart.PyStepIO",
"popart.TensorInfo",
"popart.SessionOptions",
"popart.DataFlow",
"re.search"
] | [((188, 204), 'popart.Builder', 'popart.Builder', ([], {}), '()\n', (202, 204), False, 'import popart\n'), ((551, 584), 'popart.DataFlow', 'popart.DataFlow', (['(1)', 'anchor_config'], {}), '(1, anchor_config)\n', (566, 584), False, 'import popart\n'), ((600, 623), 'popart.SessionOptions', 'popart.SessionOptions', ([],... |
import sys
from unittest import TestCase
from unittest.mock import ANY, Mock, create_autospec, patch
from robot.running.model import TestSuite
from oxygen.oxygen import OxygenCLI
from ..helpers import RESOURCES_PATH
class TestOxygenZapCLI(TestCase):
ZAP_XML = str(RESOURCES_PATH / "zap" / "zap.xml")
def setUp... | [
"unittest.mock.patch",
"unittest.mock.create_autospec",
"unittest.mock.Mock",
"oxygen.oxygen.OxygenCLI"
] | [((1062, 1099), 'unittest.mock.patch', 'patch', (['"""oxygen.oxygen.RobotInterface"""'], {}), "('oxygen.oxygen.RobotInterface')\n", (1067, 1099), False, 'from unittest.mock import ANY, Mock, create_autospec, patch\n'), ((1768, 1805), 'unittest.mock.patch', 'patch', (['"""oxygen.oxygen.RobotInterface"""'], {}), "('oxyge... |
import ipaddress
import re
import socket
from datetime import date
import requests
# rank_checker_response = requests.post("https://www.checkpagerank.net/index.php", {
# "name": "www.palvps.com"
# })
# print(rank_checker_response.text)
import sslcheck
# try:
# x = sslcheck.final_check_certificate("www.palvps.... | [
"whois.whois",
"re.findall",
"datetime.date.today",
"dateutil.parser.parse"
] | [((423, 452), 'whois.whois', 'whois.whois', (['"""www.palvps.com"""'], {}), "('www.palvps.com')\n", (434, 452), False, 'import whois\n'), ((1726, 1824), 're.findall', 're.findall', (['"""Registration Date:</div><div class="df-value">([^<]+)</div>"""', 'whois_response.text'], {}), '(\'Registration Date:</div><div class=... |
from math import ceil
import time
benchmarks = []
times = []
starts = time.time()
print("⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧")
print("⛧Welcome to 1D Coding Benchmark⛧")
print("⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧⛧")
sample_run = int(input("Enter sample run count(1-5): "))
details = False
command1 = input("Like to see... | [
"time.time"
] | [((74, 85), 'time.time', 'time.time', ([], {}), '()\n', (83, 85), False, 'import time\n'), ((793, 804), 'time.time', 'time.time', ([], {}), '()\n', (802, 804), False, 'import time\n'), ((439, 450), 'time.time', 'time.time', ([], {}), '()\n', (448, 450), False, 'import time\n'), ((654, 665), 'time.time', 'time.time', ([... |
from threading import Thread
from queue import Queue # Python 3 import
import Filter
import speech_recognition as sr
import ThreadMain
import Plugins
#PL = Utils.PluginLoader()
r = sr.Recognizer()
audio_queue = Queue()
# start a new thread to recognize audio, while this thread focuses on listening
recognize_thread... | [
"threading.Thread",
"queue.Queue",
"speech_recognition.Recognizer",
"speech_recognition.Microphone"
] | [((185, 200), 'speech_recognition.Recognizer', 'sr.Recognizer', ([], {}), '()\n', (198, 200), True, 'import speech_recognition as sr\n'), ((215, 222), 'queue.Queue', 'Queue', ([], {}), '()\n', (220, 222), False, 'from queue import Queue\n'), ((323, 400), 'threading.Thread', 'Thread', ([], {'target': 'ThreadMain.recogni... |
#!/usr/bin/env python3
# coding:utf-8
"""
cad library database model
"""
import json
import datetime
from sqlalchemy import Integer, Column, String, DateTime
from .base import Base, BaseModel
from config import CONFIG
BASE_TITLE = CONFIG.ENV_CAD.lower().replace("-", "_")
class BaseCADProject(object):
_keys = ["i... | [
"json.loads",
"json.dumps",
"datetime.datetime.now",
"datetime.datetime.utcnow",
"sqlalchemy.Column",
"sqlalchemy.String",
"config.CONFIG.ENV_CAD.lower"
] | [((477, 530), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)', 'autoincrement': '(True)'}), '(Integer, primary_key=True, autoincrement=True)\n', (483, 530), False, 'from sqlalchemy import Integer, Column, String, DateTime\n'), ((738, 788), 'sqlalchemy.Column', 'Column', (['DateTime'], {'default': ... |
# -*- coding: utf-8 -*-
"""
Utility for auditing IAM users and groups.
"""
import boto3
import click
import logging
from datetime import datetime
# configure Logger instance
logger = logging.getLogger()
f = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
fh = logging.FileHandler('logs.txt')
fh.setLev... | [
"logging.FileHandler",
"boto3.client",
"click.option",
"click.command",
"logging.Formatter",
"logging.getLogger"
] | [((187, 206), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (204, 206), False, 'import logging\n'), ((211, 273), 'logging.Formatter', 'logging.Formatter', (['"""%(asctime)s - %(levelname)s - %(message)s"""'], {}), "('%(asctime)s - %(levelname)s - %(message)s')\n", (228, 273), False, 'import logging\n'), (... |
import matplotlib.pyplot as plt
import torch
class Experiment:
"""General experiment wrapper.
For running an experiment with the usual setup of
data as input to the network, with ground truths (labels), and calculating accuracies,
the constructor would be something like:
experiment = Exp... | [
"matplotlib.pyplot.show",
"torch.eye",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((3802, 3818), 'matplotlib.pyplot.plot', 'plt.plot', (['xs', 'ys'], {}), '(xs, ys)\n', (3810, 3818), True, 'import matplotlib.pyplot as plt\n'), ((3827, 3845), 'matplotlib.pyplot.ylabel', 'plt.ylabel', (['ylabel'], {}), '(ylabel)\n', (3837, 3845), True, 'import matplotlib.pyplot as plt\n'), ((3854, 3872), 'matplotlib.... |
import abc
from django.contrib.auth.models import User
from django.db import models
from polymorphic.models import PolymorphicModel
DOCUMENT_CLASSIFICATION = 'DocumentClassification'
SEQUENCE_LABELING = 'SequenceLabeling'
SEQ2SEQ = 'Seq2seq'
SPEECH2TEXT = 'Speech2text'
IMAGE_CLASSIFICATION = 'ImageClassification'
INT... | [
"django.db.models.TextField",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.DateTimeField"
] | [((762, 794), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (778, 794), False, 'from django.db import models\n'), ((813, 841), 'django.db.models.TextField', 'models.TextField', ([], {'default': '""""""'}), "(default='')\n", (829, 841), False, 'from django.db impo... |
#!/usr/bin/python3
import pyrob.core as rob
from pyrob.tasks import check_filled_cells, find_cells_to_be_filled
class Task:
CHECKS = 5
def load_level(self, n):
m = 1 + 2*(n+2)
rob.set_field_size(m, m)
for i in range(m):
for j in range(m):
if i != j and... | [
"pyrob.core.set_field_size",
"pyrob.core.goto",
"pyrob.tasks.check_filled_cells",
"pyrob.core.is_parking_point",
"pyrob.core.set_cell_type",
"pyrob.tasks.find_cells_to_be_filled",
"pyrob.core.set_parking_cell"
] | [((206, 230), 'pyrob.core.set_field_size', 'rob.set_field_size', (['m', 'm'], {}), '(m, m)\n', (224, 230), True, 'import pyrob.core as rob\n'), ((435, 460), 'pyrob.tasks.find_cells_to_be_filled', 'find_cells_to_be_filled', ([], {}), '()\n', (458, 460), False, 'from pyrob.tasks import check_filled_cells, find_cells_to_b... |
#!/usr/bin/env python3
from pathlib import Path
import setuptools
import klap4
current_dir = Path(__file__).absolute().parent
# KLAP4 module short description.
short_description = "KMNR Music Library Interface"
try: # Try and read the README.md file for the long description.
with (current_dir.parent/"README.m... | [
"pathlib.Path",
"setuptools.find_packages"
] | [((671, 697), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (695, 697), False, 'import setuptools\n'), ((96, 110), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (100, 110), False, 'from pathlib import Path\n')] |
import cPickle
import functools
import os
import fuel
import numpy
from fuel.schemes import (
ConstantScheme, ShuffledExampleScheme, SequentialExampleScheme, IndexScheme)
from fuel.streams import DataStream, AbstractDataStream
from fuel.transformers import (
SortMapping, Padding, ForceFloatX, Batch, Mapping, U... | [
"fuel.transformers.Filter",
"cPickle.load",
"fuel.transformers.Padding",
"numpy.tile",
"os.path.join",
"picklable_itertools.iter_dispatch.iter_",
"numpy.random.RandomState",
"numpy.apply_along_axis",
"fuel.transformers.ForceFloatX",
"fuel.transformers.Merge",
"fuel.schemes.ShuffledExampleScheme"... | [((676, 703), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (693, 703), False, 'import logging\n'), ((3956, 4002), 'numpy.apply_along_axis', 'np.apply_along_axis', (['convert_single', '(1)', 'sample'], {}), '(convert_single, 1, sample)\n', (3975, 4002), True, 'import numpy as np\n'), ((1... |
import logging
import pickle
import time
import os
import tempfile
import multiprocessing
from .worker import Worker
_l = logging.getLogger(__name__)
_l.setLevel(logging.DEBUG)
class Server:
"""
Server implements the analysis server with a series of control interfaces exposed.
:ivar project: ... | [
"multiprocessing.Manager",
"multiprocessing.Value",
"time.sleep",
"tempfile.mkdtemp",
"logging.getLogger",
"multiprocessing.cpu_count"
] | [((126, 153), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (143, 153), False, 'import logging\n'), ((2401, 2438), 'multiprocessing.Value', 'multiprocessing.Value', (['"""i"""'], {'lock': '(True)'}), "('i', lock=True)\n", (2422, 2438), False, 'import multiprocessing\n'), ((1394, 1436), '... |
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 20 23:55:19 2021
@author: user
"""
#Correction for Boston Dataset - taken from a point in Ashland, and from a point on Nahant
import pandas as pd
df = pd.read_csv("boston_corrected.csv")
ini = df.iloc[0] #NAHANT
ash = df[df['CMEDV'] == 21.9][df['TOWN'] =='... | [
"pandas.read_csv"
] | [((211, 246), 'pandas.read_csv', 'pd.read_csv', (['"""boston_corrected.csv"""'], {}), "('boston_corrected.csv')\n", (222, 246), True, 'import pandas as pd\n')] |
import json
import os
import shutil
import sys
import boto3
def download_dir(prefix, local, bucket, client):
"""
params:
- prefix: pattern to match in s3
- local: local path to folder in which to place files
- bucket: s3 bucket with target contents
- client: initialized s3 client object
"... | [
"json.dump",
"json.load",
"boto3.Session",
"os.path.dirname",
"os.path.join",
"os.listdir"
] | [((1394, 1419), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1409, 1419), False, 'import os\n'), ((1436, 1460), 'os.path.dirname', 'os.path.dirname', (['CI_PATH'], {}), '(CI_PATH)\n', (1451, 1460), False, 'import os\n'), ((1479, 1530), 'os.path.join', 'os.path.join', (['ROOT_PATH', '""".py... |
#!/usr/bin/env python3
import sys
from PyQt5 import QtWidgets
from PyQt5 import QtCore
from PyQt5 import QtGui
def U_(s):
return s
def T_(s):
return s
def main( argv ):
app = App( argv )
app.main_window.show()
rc = app.exec_()
return rc
class App(QtWidgets.QApplication):
def __init__... | [
"PyQt5.QtCore.QModelIndex",
"PyQt5.QtWidgets.QWidget",
"PyQt5.QtGui.QColor",
"PyQt5.QtWidgets.QGridLayout",
"PyQt5.QtWidgets.QLineEdit",
"PyQt5.QtWidgets.QVBoxLayout",
"PyQt5.QtWidgets.QSplitter",
"PyQt5.QtWidgets.QApplication.__init__"
] | [((344, 396), 'PyQt5.QtWidgets.QApplication.__init__', 'QtWidgets.QApplication.__init__', (['self', '[sys.argv[0]]'], {}), '(self, [sys.argv[0]])\n', (375, 396), False, 'from PyQt5 import QtWidgets\n'), ((1004, 1025), 'PyQt5.QtWidgets.QLineEdit', 'QtWidgets.QLineEdit', ([], {}), '()\n', (1023, 1025), False, 'from PyQt5... |
import re
import hashlib
from abstract import Proxy
class PBAProxy(Proxy):
def get_order_status(self, order_id):
response = self.proxy.Execute({
'methodName': 'Execute',
'Server': 'BM',
'Method': 'GetOrder_API',
'Params': [order_id]
})
retu... | [
"re.search",
"re.match"
] | [((1406, 1449), 're.match', 're.match', (['"""\\\\d{,10}\\\\.\\\\d{1}$"""', 'order_total'], {}), "('\\\\d{,10}\\\\.\\\\d{1}$', order_total)\n", (1414, 1449), False, 'import re\n'), ((1256, 1280), 're.match', 're.match', (['currency', 'line'], {}), '(currency, line)\n', (1264, 1280), False, 'import re\n'), ((1614, 1655)... |
"""
add repository kind.
Revision ID: b4df55dea4b3
Revises: 7a525c68eb13
Create Date: 2017-03-19 12:59:41.484430
"""
# revision identifiers, used by Alembic.
revision = "b4df55dea4b3"
down_revision = "b8ae68ad3e52"
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
def upgrade(op, tables, tester):
o... | [
"sqlalchemy.String",
"sqlalchemy.Integer"
] | [((386, 398), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (396, 398), True, 'import sqlalchemy as sa\n'), ((443, 464), 'sqlalchemy.String', 'sa.String', ([], {'length': '(255)'}), '(length=255)\n', (452, 464), True, 'import sqlalchemy as sa\n'), ((830, 842), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n... |
"""
Copyright BOOSTRY Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distr... | [
"app.utils.cache_utils.DictCache",
"app.model.blockchain.IbetExchangeInterface",
"json.loads",
"decimal.Decimal",
"app.utils.contract_utils.ContractUtils.deploy_contract",
"app.utils.contract_utils.ContractUtils.call_function",
"json.dumps",
"app.exceptions.SendTransactionError",
"datetime.datetime.... | [((1388, 1404), 'app.log.get_logger', 'log.get_logger', ([], {}), '()\n', (1402, 1404), False, 'from app import log\n'), ((1413, 1426), 'app.utils.web3_utils.Web3Wrapper', 'Web3Wrapper', ([], {}), '()\n', (1424, 1426), False, 'from app.utils.web3_utils import Web3Wrapper\n'), ((5516, 5540), 'app.utils.cache_utils.DictC... |
"""
sentry.models.deploy
~~~~~~~~~~~~~~~~~~~~
"""
from __future__ import absolute_import
from django.db import models
from django.utils import timezone
from sentry.app import locks
from sentry.db.models import (BoundedPositiveIntegerField, FlexibleForeignKey, Model)
from sentry.utils.retries import TimedRetryPolicy
... | [
"django.db.models.URLField",
"django.db.models.NullBooleanField",
"sentry.models.Activity.objects.create",
"django.db.models.CharField",
"sentry.models.ReleaseCommit.objects.filter",
"sentry.models.ReleaseHeadCommit.objects.filter",
"sentry.db.models.BoundedPositiveIntegerField",
"sentry.utils.retries... | [((387, 429), 'sentry.db.models.BoundedPositiveIntegerField', 'BoundedPositiveIntegerField', ([], {'db_index': '(True)'}), '(db_index=True)\n', (414, 429), False, 'from sentry.db.models import BoundedPositiveIntegerField, FlexibleForeignKey, Model\n'), ((444, 480), 'sentry.db.models.FlexibleForeignKey', 'FlexibleForeig... |
import os
import numpy as np
from gensim.models import word2vec
from joblib import load
from flask import Flask, render_template, request
from text import clean_text
from word2vec import make_average_feature_vector, make_feature_vector
HOST = os.getenv("HOST", "0.0.0.0")
PORT = int(os.getenv("PORT", 5000))
vector =... | [
"flask.Flask",
"text.clean_text",
"flask.render_template",
"gensim.models.word2vec.Word2Vec.load",
"joblib.load",
"os.getenv"
] | [((246, 274), 'os.getenv', 'os.getenv', (['"""HOST"""', '"""0.0.0.0"""'], {}), "('HOST', '0.0.0.0')\n", (255, 274), False, 'import os\n'), ((321, 368), 'gensim.models.word2vec.Word2Vec.load', 'word2vec.Word2Vec.load', (['"""models/word2vec.model"""'], {}), "('models/word2vec.model')\n", (343, 368), False, 'from gensim.... |
# Generated by Django 2.2.5 on 2020-01-25 08:55
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('designs', '0029_delete_designforanalytics'),
]
operations = [
migrations.A... | [
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"django.db.migrations.AlterModelOptions"
] | [((308, 420), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""design"""', 'options': "{'verbose_name': 'デザイン', 'verbose_name_plural': 'デザイン'}"}), "(name='design', options={'verbose_name': 'デザイン',\n 'verbose_name_plural': 'デザイン'})\n", (336, 420), False, 'from django.db impo... |
import sys
sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages') # in order to import cv2 under python3
import cv2
import glob
import matplotlib.pyplot as plt
import pickle
import numpy as np
import matplotlib.image as mpimg
# """
# prepare object points, like (0,0,0), (1,0,0), (2,0,0) ....,(6,5,0)
objp = n... | [
"matplotlib.image.imread",
"sys.path.remove",
"matplotlib.pyplot.show",
"cv2.findChessboardCorners",
"cv2.cvtColor",
"numpy.zeros",
"cv2.imread",
"cv2.calibrateCamera",
"glob.glob",
"cv2.drawChessboardCorners",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"cv2.undistort"
] | [((11, 74), 'sys.path.remove', 'sys.path.remove', (['"""/opt/ros/kinetic/lib/python2.7/dist-packages"""'], {}), "('/opt/ros/kinetic/lib/python2.7/dist-packages')\n", (26, 74), False, 'import sys\n'), ((319, 351), 'numpy.zeros', 'np.zeros', (['(6 * 9, 3)', 'np.float32'], {}), '((6 * 9, 3), np.float32)\n', (327, 351), Tr... |
import time
from pathlib import Path
from vae_model import *
from datetime import datetime
from utils import vae_create_dirs
import logging
from dataloader import *
import argparse
from tqdm import tqdm
from vrae_model import VRAEEncoder, VRAEDecoder
""" Specify datatset name (mnist, fashion-mnist, cifar1... | [
"argparse.ArgumentParser",
"logging.StreamHandler",
"time.strftime",
"logging.info",
"pathlib.Path",
"utils.vae_create_dirs",
"datetime.datetime.now"
] | [((667, 776), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""VAE Model"""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), "(description='VAE Model', formatter_class=argparse.\n ArgumentDefaultsHelpFormatter)\n", (690, 776), False, 'import argparse\n'), ((2675, 2703), ... |
# I this file will take in the time_data.yml files and plot
import yaml
import matplotlib.pyplot as plt
import sys
import numpy as np
def read_yaml_file(filename):
with open(filename, 'r') as f:
data = yaml.load(f)
return(data)
def array_to_dist(array):
return(np.mean(array), np.std(array))
def ... | [
"numpy.std",
"yaml.load",
"numpy.mean"
] | [((216, 228), 'yaml.load', 'yaml.load', (['f'], {}), '(f)\n', (225, 228), False, 'import yaml\n'), ((284, 298), 'numpy.mean', 'np.mean', (['array'], {}), '(array)\n', (291, 298), True, 'import numpy as np\n'), ((300, 313), 'numpy.std', 'np.std', (['array'], {}), '(array)\n', (306, 313), True, 'import numpy as np\n')] |
import traceback
import uvicorn
from fastapi import FastAPI
from typing import (
List,
Dict,
)
from backend.api_helper import (
search_news,
get_news,
verify_attribute,
)
from pydantic import BaseModel
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI()
origins = ["http://localho... | [
"backend.api_helper.get_news",
"traceback.print_exc",
"uvicorn.run",
"backend.api_helper.search_news",
"fastapi.FastAPI"
] | [((284, 293), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (291, 293), False, 'from fastapi import FastAPI\n'), ((1473, 1537), 'uvicorn.run', 'uvicorn.run', (['"""api:app"""'], {'host': '"""localhost"""', 'port': '(8000)', 'reload': '(True)'}), "('api:app', host='localhost', port=8000, reload=True)\n", (1484, 1537),... |
from clustaar.webhook import Webhook, events
from clustaar.schemas.models import StepReachedResponse, ConversationSession
def handler(request, response, notification):
print(notification.topic)
session = ConversationSession(values={"name": "John"})
return StepReachedResponse(actions=[], session=session)
... | [
"clustaar.webhook.Webhook",
"clustaar.schemas.models.StepReachedResponse",
"clustaar.schemas.models.ConversationSession"
] | [((327, 336), 'clustaar.webhook.Webhook', 'Webhook', ([], {}), '()\n', (334, 336), False, 'from clustaar.webhook import Webhook, events\n'), ((214, 258), 'clustaar.schemas.models.ConversationSession', 'ConversationSession', ([], {'values': "{'name': 'John'}"}), "(values={'name': 'John'})\n", (233, 258), False, 'from cl... |
from dataclasses import dataclass
from typing import List
import xml.dom.minidom as mini
import xml.etree.ElementTree as ET
@dataclass(init=True, frozen=True)
class BaseService:
file_name: str
container_name: str
item_name: str
def __read(self) -> ET.Element:
return ET.parse(self.file_name).ge... | [
"xml.etree.ElementTree.parse",
"dataclasses.dataclass",
"xml.etree.ElementTree.tostring"
] | [((126, 159), 'dataclasses.dataclass', 'dataclass', ([], {'init': '(True)', 'frozen': '(True)'}), '(init=True, frozen=True)\n', (135, 159), False, 'from dataclasses import dataclass\n'), ((548, 565), 'xml.etree.ElementTree.tostring', 'ET.tostring', (['data'], {}), '(data)\n', (559, 565), True, 'import xml.etree.Element... |
import time
import requests
def wait_for_health_check(backend, timeout, delay):
start = time.time()
while True:
try:
response = requests.get(
backend + "/health"
)
assert response.status_code == 200
response_data = response.json()
# if all services are healthy
if all(response_data["services"]... | [
"time.sleep",
"requests.get",
"time.time"
] | [((90, 101), 'time.time', 'time.time', ([], {}), '()\n', (99, 101), False, 'import time\n'), ((770, 781), 'time.time', 'time.time', ([], {}), '()\n', (779, 781), False, 'import time\n'), ((136, 169), 'requests.get', 'requests.get', (["(backend + '/health')"], {}), "(backend + '/health')\n", (148, 169), False, 'import r... |
from __future__ import division
import torch
import torch.nn as nn
from .base import BaseDetector
from .test_mixins import RPNTestMixin
from .. import builder
from ..registry import DETECTORS
from mmdet.core import (assign_and_sample, bbox2roi, bbox2result, multi_apply,
merge_aug_masks)
impor... | [
"torch.nn.ReLU",
"torch.nn.ModuleList",
"mmdet.core.bbox2roi",
"numpy.float32",
"torch.cat",
"torch.mm",
"torch.transpose",
"torch.nn.Softmax",
"torch.nn.Linear",
"mmdet.core.bbox2result",
"mmdet.core.merge_aug_masks",
"torch.no_grad",
"mmdet.core.multi_apply",
"torch.from_numpy"
] | [((3959, 3974), 'torch.nn.ModuleList', 'nn.ModuleList', ([], {}), '()\n', (3972, 3974), True, 'import torch.nn as nn\n'), ((4356, 4423), 'torch.nn.Linear', 'nn.Linear', (["(bbox_head[0]['in_channels'] + 1)", 'self.graph_out_channels'], {}), "(bbox_head[0]['in_channels'] + 1, self.graph_out_channels)\n", (4365, 4423), T... |
"""Testing utilities for the MNE BIDS converter."""
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: BSD-3-Clause
import os.path as op
# This is here to handle mne-python <0.20
import warnings
from datetime import datetime
from pathlib import Path
import pytest
from nump... | [
"mne_bids.BIDSPath",
"mne_bids.utils._age_on_date",
"mne.io.read_raw_brainvision",
"mne_bids.utils._infer_eeg_placement_scheme",
"mne_bids.path._path_to_str",
"pathlib.Path",
"mne_bids.utils._handle_datatype",
"os.path.join",
"os.path.dirname",
"mne.io.read_raw_bti",
"numpy.random.RandomState",
... | [((971, 1060), 'mne_bids.BIDSPath', 'BIDSPath', ([], {'subject': 'subject_id', 'session': 'session_id', 'run': 'run', 'acquisition': 'acq', 'task': 'task'}), '(subject=subject_id, session=session_id, run=run, acquisition=acq,\n task=task)\n', (979, 1060), False, 'from mne_bids import BIDSPath\n'), ((362, 387), 'warn... |
# This file stores check whether the altitude and control scheduled are being
# stored correctly for every eval_QoI
import os
import numpy as np
import cmath
import chaospy as cp
from pystatreduce.new_stochastic_collocation import StochasticCollocation2
from pystatreduce.stochastic_collocation import StochasticColloca... | [
"numpy.array",
"numpy.diag",
"numpy.zeros",
"pystatreduce.examples.supersonic_interceptor.interceptor_rdo2.DymosInterceptorGlue"
] | [((1362, 1382), 'numpy.zeros', 'np.zeros', (['systemsize'], {}), '(systemsize)\n', (1370, 1382), True, 'import numpy as np\n'), ((1394, 1981), 'numpy.array', 'np.array', (['[0.1659134, 0.1659134, 0.16313925, 0.16080975, 0.14363596, 0.09014088, \n 0.06906912, 0.03601839, 0.0153984, 0.01194864, 0.00705978, 0.0073889, ... |
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core.management import call_command
from django.utils import six
from djblets.siteconfig.models import SiteConfiguration
from djblets.testing.decorators import add_fixtures
from ... | [
"reviewboard.admin.siteconfig.load_site_config",
"reviewboard.reviews.models.ReviewRequestDraft.create",
"djblets.siteconfig.models.SiteConfiguration.objects.get_current",
"django.contrib.auth.models.User.objects.get",
"django.utils.six.text_type",
"django.contrib.sites.models.Site.objects.get_current",
... | [((3329, 3360), 'djblets.testing.decorators.add_fixtures', 'add_fixtures', (["['test_scmtools']"], {}), "(['test_scmtools'])\n", (3341, 3360), False, 'from djblets.testing.decorators import add_fixtures\n'), ((4126, 4157), 'djblets.testing.decorators.add_fixtures', 'add_fixtures', (["['test_scmtools']"], {}), "(['test_... |
"""Functions to analyze model performance."""
import pytest
import unittest.mock as mock
import deepchem
import numpy as np
import cytoxnet.models.analyze
import cytoxnet.models.models
def test_pair_predict():
"""Plot of predictions vs true values."""
# set up a mock model to use
model = mock.MagicMock... | [
"unittest.mock.MagicMock",
"unittest.mock.patch",
"pytest.raises",
"numpy.random.random",
"numpy.array"
] | [((306, 358), 'unittest.mock.MagicMock', 'mock.MagicMock', ([], {'spec': 'cytoxnet.models.models.ToxModel'}), '(spec=cytoxnet.models.models.ToxModel)\n', (320, 358), True, 'import unittest.mock as mock\n'), ((625, 641), 'unittest.mock.MagicMock', 'mock.MagicMock', ([], {}), '()\n', (639, 641), True, 'import unittest.mo... |
'''
This code is part of QuTIpy.
(c) Copyright <NAME>, 2021
This code is licensed under the Apache License, Version 2.0. You may
obtain a copy of this license in the LICENSE.txt file in the root directory
of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
Any modifications or derivative works of t... | [
"qutipy.general_functions.eye",
"numpy.sqrt",
"qutipy.general_functions.ket"
] | [((1082, 1088), 'qutipy.general_functions.eye', 'eye', (['d'], {}), '(d)\n', (1085, 1088), False, 'from qutipy.general_functions import dag, ket, eye\n'), ((1394, 1403), 'qutipy.general_functions.ket', 'ket', (['d', 'j'], {}), '(d, j)\n', (1397, 1403), False, 'from qutipy.general_functions import dag, ket, eye\n'), ((1... |
from django.template import Library
register = Library()
@register.filter
def get_value(dictionary, key):
return dictionary.get(key)
| [
"django.template.Library"
] | [((48, 57), 'django.template.Library', 'Library', ([], {}), '()\n', (55, 57), False, 'from django.template import Library\n')] |
from base64 import b64encode
from itertools import cycle
from copy import deepcopy
from factory import (
Factory,
SubFactory,
lazy_attribute,
fuzzy,
Iterator,
post_generation,
)
import yaml
import pytz
from .fake import fake
from .core import MetadataFactory, ReasonFactory, MetricRefFactory
fro... | [
"krake.data.core.ResourceRef",
"krake.data.constraints.NotInConstraint",
"copy.deepcopy",
"krake.data.constraints.EqualConstraint",
"factory.SubFactory",
"krake.data.constraints.InConstraint",
"krake.data.kubernetes.ApplicationState.__members__.values",
"factory.fuzzy.FuzzyChoice",
"yaml.safe_load_a... | [((1486, 1523), 'factory.SubFactory', 'SubFactory', (['ClusterConstraintsFactory'], {}), '(ClusterConstraintsFactory)\n', (1496, 1523), False, 'from factory import Factory, SubFactory, lazy_attribute, fuzzy, Iterator, post_generation\n'), ((4684, 4913), 'yaml.safe_load_all', 'yaml.safe_load_all', (['"""---\napiVersion:... |
"""
Main module
"""
from app import Application
if __name__ == "__main__":
Application()
| [
"app.Application"
] | [((83, 96), 'app.Application', 'Application', ([], {}), '()\n', (94, 96), False, 'from app import Application\n')] |
# Copyright 2021 SAP SE
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | [
"networking_ccloud.common.config.config_driver.DriverConfig",
"networking_ccloud.common.config.config_driver.SwitchGroup",
"networking_ccloud.common.config.config_driver.SwitchPort",
"argparse.ArgumentParser",
"yaml.safe_dump",
"networking_ccloud.common.config.config_driver.HostGroup",
"requests.Session... | [((896, 923), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (913, 923), False, 'import logging\n'), ((13364, 13389), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (13387, 13389), False, 'import argparse\n'), ((13975, 13986), 'pprint.pprint', 'pprint', (['cfg'], ... |
#!/usr/local/bin/python3
"""Task
Your local library needs your help! Given the expected and actual return dates for a library book, create a program that calculates the fine (if any). The fee structure is as follows:
- If the book is returned on or before the expected return date, no fine will be charged (i.e.: fin... | [
"datetime.date"
] | [((946, 1022), 'datetime.date', 'datetime.date', ([], {'day': 'return_date[0]', 'month': 'return_date[1]', 'year': 'return_date[2]'}), '(day=return_date[0], month=return_date[1], year=return_date[2])\n', (959, 1022), False, 'import datetime\n'), ((1037, 1124), 'datetime.date', 'datetime.date', ([], {'day': 'expected_da... |
"""
Plot the results from the evaluations on artificial data.
"""
# TODO: Get these from somewhere else?
import numpy as np
import matplotlib.pyplot as plt
import scipy.optimize as op
import pickle
from collections import OrderedDict
from glob import glob
search_strategies = OrderedDict([
("BayesStepper", dict... | [
"numpy.log",
"numpy.ones",
"numpy.argsort",
"numpy.product",
"pickle.load",
"numpy.array",
"numpy.max",
"matplotlib.pyplot.subplots"
] | [((1338, 1376), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', 'L'], {'figsize': '(4 * L, 4)'}), '(1, L, figsize=(4 * L, 4))\n', (1350, 1376), True, 'import matplotlib.pyplot as plt\n'), ((1183, 1215), 'numpy.array', 'np.array', (['times[search_strategy]'], {}), '(times[search_strategy])\n', (1191, 1215), True,... |
# BSD 3-Clause License; see https://github.com/jpivarski/awkward-1.0/blob/master/LICENSE
"""
Source and Resource for a memory mapped file, which is never multithreaded.
"""
from __future__ import absolute_import
import numpy
import uproot4.source.chunk
import uproot4.source.futures
import uproot4._util
class Memm... | [
"numpy.memmap"
] | [((744, 802), 'numpy.memmap', 'numpy.memmap', (['self._file_path'], {'dtype': 'self._dtype', 'mode': '"""r"""'}), "(self._file_path, dtype=self._dtype, mode='r')\n", (756, 802), False, 'import numpy\n')] |
import setuptools
with open('README.md', 'r') as fh:
long_description = fh.read()
setuptools.setup(
name = 'findpy',
version = '0.0.1',
author = '<NAME>',
author_email = '<EMAIL>',
description = 'Find folders and files, find string in files, txt, etc..',
long_description = long_description... | [
"setuptools.find_packages"
] | [((443, 469), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (467, 469), False, 'import setuptools\n')] |
import json
from transformers import T5Tokenizer, T5ForConditionalGeneration
import torch
def prepare_recolr():
dev=open('val.json')
result_dev=[json.loads(jline) for jline in dev]
train=open('train.json')
result_train=[json.loads(jline) for jline in train]
dev_data,tr... | [
"json.loads",
"torch.load",
"torch.save",
"transformers.T5ForConditionalGeneration.from_pretrained",
"transformers.T5Tokenizer.from_pretrained"
] | [((1144, 1182), 'transformers.T5Tokenizer.from_pretrained', 'T5Tokenizer.from_pretrained', (['"""t5-base"""'], {}), "('t5-base')\n", (1171, 1182), False, 'from transformers import T5Tokenizer, T5ForConditionalGeneration\n'), ((1189, 1260), 'transformers.T5ForConditionalGeneration.from_pretrained', 'T5ForConditionalGene... |
import os
import ctypes
import gevent
FILE_DIR = os.path.dirname(os.path.abspath(__file__))
class Ring(ctypes.Structure):
pass
class BandwidthController():
SRC_PORT = 20135
DST_PORT = 20130
PACKET_RX_RING = 5
PACKET_TX_RING = 13
def __init__(self, host_ctrl_map):
self.host_ctrl_map... | [
"os.path.abspath",
"gevent.joinall",
"gevent.spawn",
"ctypes.CDLL",
"ctypes.POINTER"
] | [((66, 91), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (81, 91), False, 'import os\n'), ((2660, 2683), 'gevent.joinall', 'gevent.joinall', (['threads'], {}), '(threads)\n', (2674, 2683), False, 'import gevent\n'), ((554, 597), 'ctypes.CDLL', 'ctypes.CDLL', (["(FILE_DIR + '/libbw_control.s... |
#need to point to classes inorder to import
import time
import sys
import rospy
sys.path.append('../include/blackboard')
from std_msgs.msg import String
from RosCommunication import Talker, Listener
lis = Listener('topic1','topic2','topic3','listener')
| [
"sys.path.append",
"RosCommunication.Listener"
] | [((80, 120), 'sys.path.append', 'sys.path.append', (['"""../include/blackboard"""'], {}), "('../include/blackboard')\n", (95, 120), False, 'import sys\n'), ((208, 258), 'RosCommunication.Listener', 'Listener', (['"""topic1"""', '"""topic2"""', '"""topic3"""', '"""listener"""'], {}), "('topic1', 'topic2', 'topic3', 'lis... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: image_embedding.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection a... | [
"google.protobuf.symbol_database.Default",
"google.protobuf.descriptor.FieldDescriptor",
"google.protobuf.descriptor.Descriptor",
"google.protobuf.descriptor.MethodDescriptor"
] | [((488, 514), 'google.protobuf.symbol_database.Default', '_symbol_database.Default', ([], {}), '()\n', (512, 514), True, 'from google.protobuf import symbol_database as _symbol_database\n'), ((2104, 2427), 'google.protobuf.descriptor.Descriptor', '_descriptor.Descriptor', ([], {'name': '"""Empty"""', 'full_name': '"""i... |
import math
import random
import os
import numpy as np
import torch
from torch import nn, autograd, optim
from torch.nn import functional as F
from torch.utils import data
import torch.distributed as dist
from torchvision import transforms
from torchvision.utils import save_image
from tqdm import tqdm
from args import... | [
"numpy.random.seed",
"torch.manual_seed",
"torch.load",
"utils.mkdir",
"torch.randn",
"torch.save",
"model.Generator",
"torchvision.utils.save_image",
"args.args.input.strip",
"model.MultiScaleTextureGenerator",
"torch.no_grad",
"os.path.join",
"args.args.load_ckpt.strip",
"utils.deprocess... | [((1039, 1064), 'numpy.random.seed', 'np.random.seed', (['args.seed'], {}), '(args.seed)\n', (1053, 1064), True, 'import numpy as np\n'), ((1069, 1097), 'torch.manual_seed', 'torch.manual_seed', (['args.seed'], {}), '(args.seed)\n', (1086, 1097), False, 'import torch\n'), ((505, 520), 'torch.no_grad', 'torch.no_grad', ... |
# Generated by Django 3.1.8 on 2021-04-22 18:59
import ckeditor.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import django_resized.forms
import leram.events.models
import model_utils.fields
class Migration(migrations.Mi... | [
"django.db.migrations.swappable_dependency",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.SlugField",
"django.db.models.AutoField",
"django.db.models.BooleanField",
"django.db.models.DecimalField",
"django.db.models.DateField",
"django.db.models.DateTimeField"
] | [((380, 437), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (411, 437), False, 'from django.db import migrations, models\n'), ((567, 660), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)... |
from datetime import date
from mock import patch
from nose.tools import eq_
from flicks.base.carousel import get_slides, ScheduleItem
from flicks.base.tests import TestCase
mock_schedule = (
ScheduleItem(date(2013, 4, 5), date(2013, 4, 22), ['test1.html', 'test2.html']),
ScheduleItem(date(2013, 4, 26), date... | [
"datetime.date",
"mock.patch",
"flicks.base.carousel.get_slides"
] | [((456, 515), 'mock.patch', 'patch', (['"""flicks.base.carousel.slide_schedule"""', 'mock_schedule'], {}), "('flicks.base.carousel.slide_schedule', mock_schedule)\n", (461, 515), False, 'from mock import patch\n'), ((553, 587), 'mock.patch', 'patch', (['"""flicks.base.carousel.date"""'], {}), "('flicks.base.carousel.da... |
# Generated by Django 3.1.3 on 2020-12-27 19:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('employee', '0018_auto_20201227_1213'),
]
operations = [
migrations.AlterField(
model_name='employee',
name='image',
... | [
"django.db.models.ImageField"
] | [((338, 388), 'django.db.models.ImageField', 'models.ImageField', ([], {'null': '(True)', 'upload_to': '"""profpics"""'}), "(null=True, upload_to='profpics')\n", (355, 388), False, 'from django.db import migrations, models\n')] |
import pytest
from crime_data.common.base import ExplorerOffenseMapping
from crime_data.common.cdemodels import OffenseCargoTheftCountView
class TestOffenseCargoTheftCountView:
"""Test the OffenseCargoTheftCountView"""
def test_count_for_a_state(self, app):
v = OffenseCargoTheftCountView('prop_desc_n... | [
"crime_data.common.cdemodels.OffenseCargoTheftCountView",
"pytest.mark.parametrize",
"crime_data.common.base.ExplorerOffenseMapping.NIBRS_OFFENSE_MAPPING.keys"
] | [((666, 711), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""year"""', '[2014, None]'], {}), "('year', [2014, None])\n", (689, 711), False, 'import pytest\n'), ((717, 764), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""state_id"""', '[44, None]'], {}), "('state_id', [44, None])\n", (740, 764)... |
from gql import gql, Client
from gql.transport.requests import RequestsHTTPTransport
from ..configuration import Configuration
import urllib3
urllib3.disable_warnings()
class GQLClient():
"""Client to execute the GQL query from the api endpoint."""
def __init__(self, args):
"""Initialize the GQL clie... | [
"gql.Client",
"gql.gql",
"urllib3.disable_warnings"
] | [((143, 169), 'urllib3.disable_warnings', 'urllib3.disable_warnings', ([], {}), '()\n', (167, 169), False, 'import urllib3\n'), ((1366, 1445), 'gql.Client', 'Client', ([], {'retries': '(3)', 'transport': 'self._transport', 'fetch_schema_from_transport': '(False)'}), '(retries=3, transport=self._transport, fetch_schema_... |
# Modules
import os
import sys
# Determines the system type when posting Images and Videos
if sys.platform == "linux": cwdmain = os.getenv('PWD')
elif sys.platform == "win32": cwdmain = os.getcwd()
| [
"os.getcwd",
"os.getenv"
] | [((132, 148), 'os.getenv', 'os.getenv', (['"""PWD"""'], {}), "('PWD')\n", (141, 148), False, 'import os\n'), ((189, 200), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (198, 200), False, 'import os\n')] |
from faker import Faker
import pandas as pd
fake = Faker()
Faker.seed(0)
N_EXAMPLES = 1000
texts = fake.sentences(N_EXAMPLES)
clusters = [fake.random_int(0, 20) for _ in range(N_EXAMPLES)]
demo_df = pd.DataFrame(dict(texts=texts, clusters=clusters))
| [
"faker.Faker",
"faker.Faker.seed"
] | [((52, 59), 'faker.Faker', 'Faker', ([], {}), '()\n', (57, 59), False, 'from faker import Faker\n'), ((60, 73), 'faker.Faker.seed', 'Faker.seed', (['(0)'], {}), '(0)\n', (70, 73), False, 'from faker import Faker\n')] |
# -----------------------------------------------------------------------------
# Matplotlib cheat sheet
# Released under the BSD License
# -----------------------------------------------------------------------------
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
fig = plt.figure(figsize... | [
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.Rectangle",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig"
] | [((302, 328), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(4, 4)'}), '(figsize=(4, 4))\n', (312, 328), True, 'import matplotlib.pyplot as plt\n'), ((1663, 1709), 'matplotlib.pyplot.savefig', 'plt.savefig', (['"""../figures/legend-placement.pdf"""'], {}), "('../figures/legend-placement.pdf')\n", (1674, 1... |
#!/Users/sushpubmatic/OneDrive/Code/lwc/bin/python
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| [
"django.core.management.execute_from_command_line"
] | [((118, 156), 'django.core.management.execute_from_command_line', 'management.execute_from_command_line', ([], {}), '()\n', (154, 156), False, 'from django.core import management\n')] |
"""A Python Module for FHIR Search"""
import warnings
from phc.base_client import BaseClient
from phc import ApiResponse
class Fhir(BaseClient):
"""Provides bindings to the LifeOmic FHIR Service APIs"""
def dsl(self, project: str, data: dict, scroll=""):
"""Executes a LifeOmic FHIR Service DSL requ... | [
"warnings.warn"
] | [((2735, 2798), 'warnings.warn', 'warnings.warn', (['"""Use the sql method instead"""', 'DeprecationWarning'], {}), "('Use the sql method instead', DeprecationWarning)\n", (2748, 2798), False, 'import warnings\n'), ((3471, 3534), 'warnings.warn', 'warnings.warn', (['"""Use the dsl method instead"""', 'DeprecationWarnin... |
"""
remove_rigid_body_motion
========================
"""
from ansys.dpf.core.dpf_operator import Operator
from ansys.dpf.core.inputs import Input, _Inputs
from ansys.dpf.core.outputs import Output, _Outputs, _modify_output_spec_with_one_type
from ansys.dpf.core.operators.specification import PinSpecification, Specific... | [
"ansys.dpf.core.dpf_operator.Operator.default_config",
"ansys.dpf.core.operators.specification.PinSpecification"
] | [((3220, 3274), 'ansys.dpf.core.dpf_operator.Operator.default_config', 'Operator.default_config', ([], {'name': '"""ExtractRigidBodyMotion"""'}), "(name='ExtractRigidBodyMotion')\n", (3243, 3274), False, 'from ansys.dpf.core.dpf_operator import Operator\n'), ((2447, 2614), 'ansys.dpf.core.operators.specification.PinSpe... |
from sqlalchemy import create_engine
from sqlalchemy.exc import OperationalError
from sqlalchemy.orm import declarative_base, Session
from sqlalchemy.orm import sessionmaker
from src.core.settings import DB_URI
Model = declarative_base()
class Database:
engine = create_engine(DB_URI, echo=True)
session_loca... | [
"sqlalchemy.create_engine",
"sqlalchemy.orm.sessionmaker",
"sqlalchemy.orm.declarative_base"
] | [((221, 239), 'sqlalchemy.orm.declarative_base', 'declarative_base', ([], {}), '()\n', (237, 239), False, 'from sqlalchemy.orm import declarative_base, Session\n'), ((271, 303), 'sqlalchemy.create_engine', 'create_engine', (['DB_URI'], {'echo': '(True)'}), '(DB_URI, echo=True)\n', (284, 303), False, 'from sqlalchemy im... |
import boto3
import logging
import json
import sys
from botocore.exceptions import ClientError
#setup simple logging for INFO
logger = logging.getLogger()
logger.setLevel(logging.INFO)
#define the connection
ec2 = boto3.resource('ec2')
client = boto3.client('ec2',region_name='us-west-2') #Add your region
def put_cp... | [
"boto3.resource",
"json.dumps",
"logging.getLogger",
"boto3.client"
] | [((136, 155), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (153, 155), False, 'import logging\n'), ((216, 237), 'boto3.resource', 'boto3.resource', (['"""ec2"""'], {}), "('ec2')\n", (230, 237), False, 'import boto3\n'), ((248, 292), 'boto3.client', 'boto3.client', (['"""ec2"""'], {'region_name': '"""us-w... |