code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
"""
:mod:`pyfrost.viz.dot` - Visualize Pyfrost graph using Dot
==========================================================
"""
from __future__ import annotations
from typing import TYPE_CHECKING
import pydot
if TYPE_CHECKING:
from pyfrost.graph import BifrostDiGraph
from IPython.display import Image
def to... | [
"pydot.Dot"
] | [((688, 737), 'pydot.Dot', 'pydot.Dot', (['""""""'], {'graph_type': '"""digraph"""', 'rankdir': '"""LR"""'}), "('', graph_type='digraph', rankdir='LR')\n", (697, 737), False, 'import pydot\n')] |
import sys
import moderngl
import numpy as np
from pyrr import Matrix44
from shadevolution import models, fresnel, shader, plot
class Evaluator:
"""
An evaluator that runs a genetic algorithm using OpenGL for the fitness evaluation.
"""
gl_version = (4, 1)
def __init__(self, window, size=(2048,... | [
"numpy.mean",
"numpy.frombuffer",
"shadevolution.shader.diff",
"pyrr.Matrix44.perspective_projection",
"shadevolution.models.load_crate",
"pyrr.Matrix44.from_eulers",
"numpy.linalg.norm",
"shadevolution.fresnel.create_program",
"shadevolution.shader.write",
"pyrr.Matrix44.from_translation",
"pyr... | [((766, 798), 'shadevolution.fresnel.create_program', 'fresnel.create_program', (['self.ctx'], {}), '(self.ctx)\n', (788, 798), False, 'from shadevolution import models, fresnel, shader, plot\n'), ((874, 893), 'shadevolution.models.load_crate', 'models.load_crate', ([], {}), '()\n', (891, 893), False, 'from shadevoluti... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-04-16 09:25
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cms', '0002_person'),
]
operations = [
migrations.AlterField(
m... | [
"django.db.models.CharField"
] | [((384, 428), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(100)'}), '(blank=True, max_length=100)\n', (400, 428), False, 'from django.db import migrations, models\n')] |
# Generated by Django 2.1.15 on 2020-12-07 18:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0018_auto_20201207_1614'),
]
operations = [
migrations.CreateModel(
name='WahSubmitforcontractor',
fields=[
... | [
"django.db.models.TextField",
"django.db.models.IntegerField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((343, 436), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (359, 436), False, 'from django.db import migrations, models\... |
import operator
from collections import deque
from functools import reduce
from advent.grid import cardinal_neighbors
from advent.load import read_input
Point = tuple[int, int]
Grid = dict[Point, int]
def make_grid(lines: str) -> Grid:
out = {}
for y, line in enumerate(lines):
for x, c in enumerate... | [
"advent.load.read_input",
"collections.deque",
"advent.grid.cardinal_neighbors"
] | [((617, 631), 'collections.deque', 'deque', (['[point]'], {}), '([point])\n', (622, 631), False, 'from collections import deque\n'), ((1020, 1032), 'advent.load.read_input', 'read_input', ([], {}), '()\n', (1030, 1032), False, 'from advent.load import read_input\n'), ((497, 522), 'advent.grid.cardinal_neighbors', 'card... |
import numpy as np
import matplotlib.pyplot as plt
def generate_water_stats():
cov = np.array([[1.2, 1], [1, 1]])
mean = np.array([3.2, 3.5])
values = np.random.multivariate_normal(mean=mean, cov=cov, size=100)
return values[:, 0]*5, values[:, 1]
def plot_stats_without_lobf(x, y):
plt.scatt... | [
"matplotlib.pyplot.ylabel",
"numpy.random.multivariate_normal",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.array",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show"
] | [((91, 119), 'numpy.array', 'np.array', (['[[1.2, 1], [1, 1]]'], {}), '([[1.2, 1], [1, 1]])\n', (99, 119), True, 'import numpy as np\n'), ((131, 151), 'numpy.array', 'np.array', (['[3.2, 3.5]'], {}), '([3.2, 3.5])\n', (139, 151), True, 'import numpy as np\n'), ((166, 225), 'numpy.random.multivariate_normal', 'np.random... |
import json
import os
from yunionclient.common import base
from yunionclient.common import exceptions
from yunionclient.common import utils
from yunionclient.common.utils import url_unquote, url_quote
class Image(base.ResourceBase):
def _normalize_attribute_dict(self, attr_dict):
props = attr_dict.get('... | [
"os.path.exists",
"os.path.getsize",
"json.loads",
"yunionclient.common.exceptions.Conflict",
"yunionclient.common.utils.url_quote",
"yunionclient.common.utils.urlencode",
"yunionclient.common.utils.url_unquote",
"yunionclient.common.exceptions.NotFound"
] | [((3940, 4001), 'yunionclient.common.exceptions.NotFound', 'exceptions.NotFound', (['(404)'], {'details': "('Image %s not found' % name)"}), "(404, details='Image %s not found' % name)\n", (3959, 4001), False, 'from yunionclient.common import exceptions\n'), ((3424, 3438), 'yunionclient.common.utils.url_unquote', 'url_... |
import unittest
import logging
import numpy as np
import pandas as pd
import scipy.stats as stats
from batchglm.api.models.glm_nb import Simulator
import diffxpy.api as de
class TestExtremeValues(unittest.TestCase):
def test_t_test_zero_variance(self, n_cells: int = 2000, n_genes: int = 100):
"""
... | [
"logging.getLogger",
"batchglm.api.models.glm_nb.Simulator",
"diffxpy.api.test.t_test",
"scipy.stats.kstest",
"numpy.exp",
"numpy.random.randint",
"unittest.main"
] | [((1825, 1840), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1838, 1840), False, 'import unittest\n'), ((977, 1034), 'batchglm.api.models.glm_nb.Simulator', 'Simulator', ([], {'num_observations': 'n_cells', 'num_features': 'n_genes'}), '(num_observations=n_cells, num_features=n_genes)\n', (986, 1034), False, 'f... |
from torch import nn
import torch
class FactorList(nn.Module):
def __init__(self, parameters=None):
super().__init__()
self.keys = []
self.counter = 0
if parameters is not None:
self.extend(parameters)
def _unique_key(self):
"""Creates a new unique key""... | [
"torch.typename"
] | [((2101, 2118), 'torch.typename', 'torch.typename', (['p'], {}), '(p)\n', (2115, 2118), False, 'import torch\n'), ((4168, 4185), 'torch.typename', 'torch.typename', (['p'], {}), '(p)\n', (4182, 4185), False, 'import torch\n')] |
from flask import redirect, render_template, flash, g, session, url_for, request, jsonify
from flask.ext.login import current_user, login_required
from . import main
from .forms import TodoForm
from .. import db
from ..models import User, Todo
from collections import Counter
@main.app_errorhandler(404)
def page_not_f... | [
"flask.render_template",
"flask.ext.login.current_user.todo.all",
"flask.ext.login.current_user.is_authenticated",
"flask.url_for",
"collections.Counter",
"flask.redirect",
"flask.ext.login.current_user.todo.filter_by",
"flask.jsonify"
] | [((528, 559), 'flask.ext.login.current_user.is_authenticated', 'current_user.is_authenticated', ([], {}), '()\n', (557, 559), False, 'from flask.ext.login import current_user, login_required\n'), ((639, 668), 'flask.render_template', 'render_template', (['"""index.html"""'], {}), "('index.html')\n", (654, 668), False, ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Initialization for Plot Twist Tools
"""
from __future__ import print_function, division, absolute_import
__author__ = "<NAME>"
__license__ = "MIT"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
import maya.cmds as cmds # Do not remove
def init():
prin... | [
"traceback.format_exc",
"maya.cmds.evalDeferred"
] | [((1148, 1180), 'maya.cmds.evalDeferred', 'cmds.evalDeferred', (['init'], {'lp': '(True)'}), '(init, lp=True)\n', (1165, 1180), True, 'import maya.cmds as cmds\n'), ((1032, 1054), 'traceback.format_exc', 'traceback.format_exc', ([], {}), '()\n', (1052, 1054), False, 'import traceback\n')] |
# Copyright 2017 The Forseti Security Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | [
"google.cloud.forseti.scanner.audit.location_rules_engine.LocationRulesEngine",
"tempfile.NamedTemporaryFile",
"unittest.main",
"tests.scanner.test_data.fake_location_scanner_data.build_violations",
"mock.MagicMock"
] | [((5668, 5683), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5681, 5683), False, 'import unittest\n'), ((1491, 1534), 'tempfile.NamedTemporaryFile', 'tempfile.NamedTemporaryFile', ([], {'suffix': '""".yaml"""'}), "(suffix='.yaml')\n", (1518, 1534), False, 'import tempfile\n'), ((1604, 1669), 'google.cloud.forse... |
import sys
from unittest import TestCase, main
from mock import patch, Mock
from pymongo.errors import ConnectionFailure
import ming
from ming import Session
from ming import mim
from ming import create_datastore, create_engine
from ming.datastore import Engine
from ming.exc import MingConfigError
class DummyConnec... | [
"ming.mim.Connection.get",
"ming.datastore.Engine",
"mock.patch",
"ming.create_engine",
"ming.configure",
"mock.patch.dict",
"pymongo.errors.ConnectionFailure",
"ming.Session.by_name",
"unittest.main",
"ming.create_datastore"
] | [((427, 473), 'mock.patch', 'patch', (['"""ming.datastore.MongoClient"""'], {'spec': '(True)'}), "('ming.datastore.MongoClient', spec=True)\n", (432, 473), False, 'from mock import patch, Mock\n'), ((681, 727), 'mock.patch', 'patch', (['"""ming.datastore.MongoClient"""'], {'spec': '(True)'}), "('ming.datastore.MongoCli... |
import inspect
import json
import os
from pytube import YouTube, Playlist
from pytube.exceptions import RegexMatchError, PytubeError
CONFIGURATIONS = {'destination_path': '', 'video_quality': '',
'audio_quality': '', 'when_unavailable': ''}
CONFIGS_FILE = 'configs.json'
def create_config_file():
... | [
"os.path.exists",
"inspect.stack",
"pytube.Playlist",
"os.rename",
"json.dumps",
"pytube.YouTube",
"os.path.isfile",
"os.path.dirname",
"json.load",
"os.system",
"json.dump"
] | [((975, 1003), 'os.path.exists', 'os.path.exists', (['CONFIGS_FILE'], {}), '(CONFIGS_FILE)\n', (989, 1003), False, 'import os\n'), ((2485, 2513), 'pytube.YouTube', 'YouTube', (['download_source_url'], {}), '(download_source_url)\n', (2492, 2513), False, 'from pytube import YouTube, Playlist\n'), ((5760, 5815), 'os.path... |
import numpy as np
import torch
import torch.nn as nn
class ConditionalGenerator(nn.Module):
def __init__(self, n_classes, latent_dim, img_shape):
super(ConditionalGenerator, self).__init__()
self.img_shape = img_shape
self.label_emb = nn.Embedding(n_classes, n_classes)
def block(... | [
"torch.nn.Sigmoid",
"numpy.prod",
"torch.nn.Dropout",
"torch.nn.Tanh",
"torch.nn.LeakyReLU",
"torch.nn.BatchNorm1d",
"torch.nn.Linear",
"torch.nn.Embedding"
] | [((266, 300), 'torch.nn.Embedding', 'nn.Embedding', (['n_classes', 'n_classes'], {}), '(n_classes, n_classes)\n', (278, 300), True, 'import torch.nn as nn\n'), ((1319, 1353), 'torch.nn.Embedding', 'nn.Embedding', (['n_classes', 'n_classes'], {}), '(n_classes, n_classes)\n', (1331, 1353), True, 'import torch.nn as nn\n'... |
from sevenbridges.meta.fields import IntegerField, DateTimeField
from sevenbridges.meta.resource import Resource
class Rate(Resource):
"""
Rate resource.
"""
limit = IntegerField(read_only=True)
remaining = IntegerField(read_only=True)
reset = DateTimeField(read_only=True)
def __str__(sel... | [
"sevenbridges.meta.fields.IntegerField",
"sevenbridges.meta.fields.DateTimeField"
] | [((184, 212), 'sevenbridges.meta.fields.IntegerField', 'IntegerField', ([], {'read_only': '(True)'}), '(read_only=True)\n', (196, 212), False, 'from sevenbridges.meta.fields import IntegerField, DateTimeField\n'), ((229, 257), 'sevenbridges.meta.fields.IntegerField', 'IntegerField', ([], {'read_only': '(True)'}), '(rea... |
import pandas as pd
from bokeh.models import ColumnDataSource, HoverTool, LinearInterpolator, CategoricalColorMapper, Paragraph
from bokeh.plotting import figure
from bokeh.palettes import Category20b_20
from bokeh.layouts import column, row
from bokeh.io import show, curdoc
def load_data(path_to_file, index,... | [
"bokeh.layouts.column.split",
"bokeh.models.CategoricalColorMapper",
"bokeh.plotting.figure",
"bokeh.models.ColumnDataSource",
"pandas.read_excel",
"pandas.concat",
"bokeh.models.HoverTool"
] | [((1090, 1152), 'pandas.read_excel', 'pd.read_excel', (['path_to_file'], {'index_col': 'index', 'sheet_name': 'sheet'}), '(path_to_file, index_col=index, sheet_name=sheet)\n', (1103, 1152), True, 'import pandas as pd\n'), ((1883, 1904), 'pandas.concat', 'pd.concat', (['dataFrames'], {}), '(dataFrames)\n', (1892, 1904),... |
from django.apps import AppConfig
from django.db.models.signals import post_migrate
from django.utils.translation import gettext_lazy as _
class ServicesConfig(AppConfig):
name = 'src.services'
verbose_name = _("Modulo de Servicios") | [
"django.utils.translation.gettext_lazy"
] | [((220, 244), 'django.utils.translation.gettext_lazy', '_', (['"""Modulo de Servicios"""'], {}), "('Modulo de Servicios')\n", (221, 244), True, 'from django.utils.translation import gettext_lazy as _\n')] |
from ferris.tests.lib import WithTestBed
from app.models.reclamo import Reclamo
class ProbarReclamo(WithTestBed):
def testQueries(self):
# log in user one
self.loginUser('<EMAIL>')
# create two posts
post1 = Reclamo(titulo='Titulo 1',contenido="Contenido1")
post1.put()
... | [
"app.models.reclamo.Reclamo",
"app.models.reclamo.Reclamo.todos_reclamos",
"app.models.reclamo.Reclamo.todos_reclamos_por_usuario"
] | [((248, 298), 'app.models.reclamo.Reclamo', 'Reclamo', ([], {'titulo': '"""Titulo 1"""', 'contenido': '"""Contenido1"""'}), "(titulo='Titulo 1', contenido='Contenido1')\n", (255, 298), False, 'from app.models.reclamo import Reclamo\n'), ((335, 385), 'app.models.reclamo.Reclamo', 'Reclamo', ([], {'titulo': '"""Titulo 2"... |
from django.conf import settings
from rest_framework import serializers
from account.models import Contact
from account.tasks import send_email_async
class ContactSerializer(serializers.ModelSerializer):
class Meta:
model = Contact
fields = (
'id',
'created',
... | [
"account.tasks.send_email_async.delay"
] | [((427, 555), 'account.tasks.send_email_async.delay', 'send_email_async.delay', (["validated_data['title']", "validated_data['body']", 'settings.EMAIL_HOST_USER', "[validated_data['email']]"], {}), "(validated_data['title'], validated_data['body'],\n settings.EMAIL_HOST_USER, [validated_data['email']])\n", (449, 555... |
# adapted from https://github.com/open-mmlab/mmcv
import copy
import inspect
import torch
from vedacore.misc import build_from_cfg, registry
def register_torch_optimizers():
torch_optimizers = []
for module_name in dir(torch.optim):
if module_name.startswith('__'):
continue
_optim... | [
"inspect.isclass",
"vedacore.misc.build_from_cfg",
"vedacore.misc.registry.register_module",
"copy.deepcopy"
] | [((705, 755), 'vedacore.misc.build_from_cfg', 'build_from_cfg', (['cfg', 'registry', '"""optimizer_builder"""'], {}), "(cfg, registry, 'optimizer_builder')\n", (719, 755), False, 'from vedacore.misc import build_from_cfg, registry\n'), ((811, 829), 'copy.deepcopy', 'copy.deepcopy', (['cfg'], {}), '(cfg)\n', (824, 829),... |
from unittest import TestCase
import numpy as np
import pandas as pd
from copulas.univariate.gaussian import GaussianUnivariate
class TestGaussianUnivariate(TestCase):
def test___init__(self):
"""On init, default values are set on instance."""
# Setup / Run
copula = GaussianUnivariate(... | [
"pandas.Series",
"copulas.univariate.gaussian.GaussianUnivariate",
"numpy.mean",
"copulas.univariate.gaussian.GaussianUnivariate.from_dict",
"numpy.std"
] | [((301, 321), 'copulas.univariate.gaussian.GaussianUnivariate', 'GaussianUnivariate', ([], {}), '()\n', (319, 321), False, 'from copulas.univariate.gaussian import GaussianUnivariate\n'), ((547, 567), 'copulas.univariate.gaussian.GaussianUnivariate', 'GaussianUnivariate', ([], {}), '()\n', (565, 567), False, 'from copu... |
import numpy as np
class MF():
'''
Matrix Factorisation alogrithm based on <NAME>'s method
Key input is the sparse user-item ratings array, with user ratings in an array with
a row per user, and a column per item. Values are the users known rating, or zero if
no rating is available.
The output is a user-item ... | [
"numpy.random.rand",
"numpy.subtract",
"numpy.sum",
"numpy.array",
"numpy.matmul"
] | [((2603, 2681), 'numpy.array', 'np.array', (['[[1, 0, 0, 4, 5], [2, 5, 1, 5, 5], [1, 4, 1, 5, 4], [4, 1, 4, 0, 3]]'], {}), '([[1, 0, 0, 4, 5], [2, 5, 1, 5, 5], [1, 4, 1, 5, 4], [4, 1, 4, 0, 3]])\n', (2611, 2681), True, 'import numpy as np\n'), ((847, 895), 'numpy.random.rand', 'np.random.rand', (['self.users', 'self.la... |
'''
test=# select min(l_shipdate), max(l_shipdate) from lineitem;
min | max
------------+------------
1992-01-02 | 1998-12-01
(1 row)
'''
import psycopg2
import time
conn = psycopg2.connect("dbname=test user=postgres")
cur = conn.cursor()
cur.execute('set search_path to tpch50g')
cur.execute("set work... | [
"psycopg2.connect",
"time.time"
] | [((191, 236), 'psycopg2.connect', 'psycopg2.connect', (['"""dbname=test user=postgres"""'], {}), "('dbname=test user=postgres')\n", (207, 236), False, 'import psycopg2\n'), ((1070, 1081), 'time.time', 'time.time', ([], {}), '()\n', (1079, 1081), False, 'import time\n'), ((1153, 1164), 'time.time', 'time.time', ([], {})... |
import numpy as np
from sklearn import preprocessing
from sklearn.naive_bayes import GaussianNB
from flask import Flask
from flask_restful import reqparse, abort, Api, Resource
# Initialise Flask App
app = Flask(__name__)
api = Api(app)
# For labelling the dataset
le = preprocessing.LabelEncoder()
# Creating a Gauss... | [
"sklearn.preprocessing.LabelEncoder",
"flask_restful.reqparse.RequestParser",
"flask_restful.Api",
"flask.Flask",
"sklearn.naive_bayes.GaussianNB",
"numpy.float32"
] | [((207, 222), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (212, 222), False, 'from flask import Flask\n'), ((229, 237), 'flask_restful.Api', 'Api', (['app'], {}), '(app)\n', (232, 237), False, 'from flask_restful import reqparse, abort, Api, Resource\n'), ((272, 300), 'sklearn.preprocessing.LabelEncoder... |
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import matplotlib as mpl
import matplotlib.animation
import json
import nibabel as nib
from scipy.ndimage.interpolation import zoom
def save_history(filename, trainer):
"""Save the history from a torchsample trainer to file."""
with open(f... | [
"matplotlib.pyplot.grid",
"matplotlib.pyplot.ylabel",
"nibabel.load",
"scipy.ndimage.interpolation.zoom",
"scipy.ndimage.zoom",
"numpy.arange",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.asarray",
"matplotlib.colors.ListedColormap",
"numpy.take",
"numpy.linspace",
"matplotl... | [((2194, 2212), 'numpy.zeros', 'np.zeros', (['(256, 4)'], {}), '((256, 4))\n', (2202, 2212), True, 'import numpy as np\n'), ((2270, 2292), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', '(256)'], {}), '(0, 1, 256)\n', (2281, 2292), True, 'import numpy as np\n'), ((2343, 2387), 'matplotlib.colors.ListedColormap', 'mpl... |
from flask import make_response, jsonify
def responder(msg, status, pbdb_id=None):
"""Format a JSON response."""
if pbdb_id:
return make_response(jsonify({'message': msg,
'status': status,
'pbdb_id': pbdb_id}), status)
els... | [
"configparser.ConfigParser",
"flask.jsonify",
"subprocess.Popen",
"MySQLdb.connect",
"email.mime.text.MIMEText"
] | [((567, 594), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (592, 594), False, 'import configparser\n'), ((1918, 1969), 'MySQLdb.connect', 'MySQLdb.connect', ([], {'read_default_file': '"""./settings.cnf"""'}), "(read_default_file='./settings.cnf')\n", (1933, 1969), False, 'import MySQLdb\... |
import csv
with open('employee_data1.csv') as csvfile:
csv_reader = csv.reader(csvfile, quotechar='"', quoting=csv.QUOTE_MINIMAL)
line_count = 0
for row in csv_reader:
if line_count == 0:
print(f"Columns are {', '.join(row)}")
line_count += 1
else:
print(f"\t{row[0]} works in the {row[1]} department, a... | [
"csv.reader"
] | [((70, 131), 'csv.reader', 'csv.reader', (['csvfile'], {'quotechar': '"""\\""""', 'quoting': 'csv.QUOTE_MINIMAL'}), '(csvfile, quotechar=\'"\', quoting=csv.QUOTE_MINIMAL)\n', (80, 131), False, 'import csv\n')] |
#!/usr/bin/env python
"""
Example of a confirmation prompt.
"""
import quo
if __name__ == "__main__":
answer = quo.confirm("Should we do that?")
print("You said: %s" % answer)
| [
"quo.confirm"
] | [((116, 149), 'quo.confirm', 'quo.confirm', (['"""Should we do that?"""'], {}), "('Should we do that?')\n", (127, 149), False, 'import quo\n')] |
#!/usr/bin/env python
"""Unique Crater Distribution Functions
Functions for extracting craters from model target predictions and filtering
out duplicates.
"""
from __future__ import absolute_import, division, print_function
from PIL import Image
import matplotlib
import cv2
import matplotlib.pyplot as plt
import numpy... | [
"numpy.column_stack",
"numpy.sin",
"pandas.HDFStore",
"utils.template_match_target.template_match_t",
"numpy.save",
"os.path.exists",
"utils.processing.get_id",
"numpy.where",
"numpy.asarray",
"os.mkdir",
"numpy.vstack",
"numpy.concatenate",
"numpy.abs",
"h5py.File",
"numpy.cos",
"util... | [((960, 990), 'h5py.File', 'h5py.File', (["CP['dir_data']", '"""r"""'], {}), "(CP['dir_data'], 'r')\n", (969, 990), False, 'import h5py\n'), ((1162, 1183), 'utils.processing.preprocess', 'proc.preprocess', (['Data'], {}), '(Data)\n', (1177, 1183), True, 'import utils.processing as proc\n'), ((1197, 1224), 'keras.models... |
"""
Django views for interacting with Build objects
"""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils.translation import ugettext as _
from django.core.exceptions import ValidationError
from django.views.generic import DetailView, ListView, UpdateView
from django.forms import Hidde... | [
"django.forms.HiddenInput",
"stock.models.StockLocation.objects.get",
"part.models.Part.objects.get",
"InvenTree.helpers.ExtractSerialNumbers",
"django.utils.translation.ugettext",
"stock.models.StockItem.objects.all",
"stock.models.StockItem.objects.get",
"stock.models.StockItem.objects.filter"
] | [((1790, 1807), 'django.utils.translation.ugettext', '_', (['"""Cancel Build"""'], {}), "('Cancel Build')\n", (1791, 1807), True, 'from django.utils.translation import ugettext as _\n'), ((2907, 2926), 'django.utils.translation.ugettext', '_', (['"""Allocate Stock"""'], {}), "('Allocate Stock')\n", (2908, 2926), True, ... |
# Pylint doesn't play well with fixtures and dependency injection from pytest
# pylint: disable=redefined-outer-name
import os
import pytest
from buildstream.exceptions import ErrorDomain, LoadErrorReason
from buildstream.testing.runcli import cli # pylint: disable=unused-import
# Project directory
DATA_DIR = os.pat... | [
"os.path.realpath",
"pytest.mark.parametrize",
"buildstream.testing.runcli.cli.run",
"pytest.mark.datafiles"
] | [((391, 422), 'pytest.mark.datafiles', 'pytest.mark.datafiles', (['DATA_DIR'], {}), '(DATA_DIR)\n', (412, 422), False, 'import pytest\n'), ((424, 618), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (["('element', 'location')", "[('no-path-specified.bst', 'line 4 column 4'), ('optional-source.bst',\n 'line 6 ... |
from flask import Blueprint, jsonify
from ..model import Dentist, User
from dps_api import db, auth
bp = Blueprint("dentist", __name__, url_prefix="/dentist")
@bp.route("/hi")
@auth.login_required
def hi():
# user = User("testuser1", "<EMAIL>", "123")
# db.session.add(user)
# db.session.commit()
re... | [
"flask.Blueprint"
] | [((106, 159), 'flask.Blueprint', 'Blueprint', (['"""dentist"""', '__name__'], {'url_prefix': '"""/dentist"""'}), "('dentist', __name__, url_prefix='/dentist')\n", (115, 159), False, 'from flask import Blueprint, jsonify\n')] |
import os
class Config(object):
SECRET_KEY = os.urandom(32)
BOOTSTRAP_SERVE_LOCAL = True
SQLALCHEMY_DATABASE_URI = "sqlite:///app.db"
SQLALCHEMY_TRACK_MODIFICATIONS = False
| [
"os.urandom"
] | [((51, 65), 'os.urandom', 'os.urandom', (['(32)'], {}), '(32)\n', (61, 65), False, 'import os\n')] |
import calendar
import json
from json.decoder import JSONDecodeError
from django.contrib import auth
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist
from dja... | [
"django.contrib.contenttypes.models.ContentType.objects.get",
"django.db.models.IntegerField",
"oauth2_provider.models.get_access_token_model",
"django.contrib.auth.models.Permission.objects.get_or_create",
"rest_framework.decorators.action",
"django.shortcuts.render",
"django.contrib.auth.get_user_mode... | [((4358, 4404), 'django.utils.decorators.method_decorator', 'method_decorator', (['csrf_exempt'], {'name': '"""dispatch"""'}), "(csrf_exempt, name='dispatch')\n", (4374, 4404), False, 'from django.utils.decorators import method_decorator\n'), ((9923, 9960), 'rest_framework.decorators.action', 'action', ([], {'detail': ... |
import itertools
import numpy as np
from ..sequences import Genome
def in_silico_mutagenesis_sequences(sequence,
mutate_n_bases=1,
reference_sequence=Genome,
start_position=0,
... | [
"numpy.copy",
"itertools.product"
] | [((5634, 5651), 'numpy.copy', 'np.copy', (['encoding'], {}), '(encoding)\n', (5641, 5651), True, 'import numpy as np\n'), ((4506, 4539), 'itertools.product', 'itertools.product', (['*pos_mutations'], {}), '(*pos_mutations)\n', (4523, 4539), False, 'import itertools\n')] |
# -*- coding: utf-8 -*-
from app.modules.ia_config_reader import IaConfig
# note that these tests rely on the IA.zebra.json file, which if changed, might invalidate tests.
TEST_CONFIG_NAME = 'zebra'
def test_ia_config_creation(flask_app_client):
config_name = TEST_CONFIG_NAME
ia_config_reader = IaConfig(TES... | [
"app.modules.ia_config_reader.IaConfig"
] | [((308, 334), 'app.modules.ia_config_reader.IaConfig', 'IaConfig', (['TEST_CONFIG_NAME'], {}), '(TEST_CONFIG_NAME)\n', (316, 334), False, 'from app.modules.ia_config_reader import IaConfig\n'), ((560, 586), 'app.modules.ia_config_reader.IaConfig', 'IaConfig', (['TEST_CONFIG_NAME'], {}), '(TEST_CONFIG_NAME)\n', (568, 58... |
"""
Area calculations
-----------------
Calculates the area of pixels for a give grid input.
"""
def earth_radius(lat):
"""Calculate the radius of the earth for a given latitude
Args:
lat (array, float): latitude value (-90 : 90)
Returns:
array: radius in metres
"""
from numpy i... | [
"numpy.deg2rad",
"numpy.cos",
"numpy.sin",
"numpy.meshgrid",
"numpy.gradient"
] | [((355, 367), 'numpy.deg2rad', 'deg2rad', (['lat'], {}), '(lat)\n', (362, 367), False, 'from numpy import cos, deg2rad, gradient, meshgrid\n'), ((1135, 1153), 'numpy.meshgrid', 'meshgrid', (['lat', 'lon'], {}), '(lat, lon)\n', (1143, 1153), False, 'from numpy import cos, deg2rad, gradient, meshgrid\n'), ((1201, 1223), ... |
from django.test import TestCase
from django.core.urlresolvers import reverse
class ViewsTestCase(TestCase):
def test_about_view(self):
response = self.client.get(reverse('about'))
self.assertEqual(response.status_code, 200)
self.assertContains(response, "About")
def test_contact_page... | [
"django.core.urlresolvers.reverse"
] | [((177, 193), 'django.core.urlresolvers.reverse', 'reverse', (['"""about"""'], {}), "('about')\n", (184, 193), False, 'from django.core.urlresolvers import reverse\n'), ((363, 381), 'django.core.urlresolvers.reverse', 'reverse', (['"""contact"""'], {}), "('contact')\n", (370, 381), False, 'from django.core.urlresolvers... |
# -*- coding: utf-8 -*-
from abc import ABC, abstractmethod
import numpy as np
import pandas as pd
class ExogenousBaseModel(ABC):
"""
Exogenous Abstract Base Class.
"""
model = None
@abstractmethod
def __init__(self):
self.fitted = None
pass
def __s... | [
"numpy.append",
"pandas.Series"
] | [((1523, 1564), 'numpy.append', 'np.append', (['self.fitted', 'exo_object.fitted'], {}), '(self.fitted, exo_object.fitted)\n', (1532, 1564), True, 'import numpy as np\n'), ((1616, 1632), 'pandas.Series', 'pd.Series', (['array'], {}), '(array)\n', (1625, 1632), True, 'import pandas as pd\n')] |
#
# Author: <NAME> <<EMAIL>
#
import gi
gi.require_version('AppIndicator3', '0.1')
gi.require_version('Gtk', '3.0')
from gi.repository import AppIndicator3, Gtk
from .windows import MainWindow
from . import _
class WacomManagerIndicator(AppIndicator3.Indicator):
def __init__(self, app, quiet):
self._i... | [
"gi.repository.Gtk.SeparatorMenuItem",
"gi.require_version",
"gi.repository.Gtk.Menu",
"gi.repository.AppIndicator3.Indicator.new",
"gi.repository.Gtk.MenuItem"
] | [((42, 84), 'gi.require_version', 'gi.require_version', (['"""AppIndicator3"""', '"""0.1"""'], {}), "('AppIndicator3', '0.1')\n", (60, 84), False, 'import gi\n'), ((85, 117), 'gi.require_version', 'gi.require_version', (['"""Gtk"""', '"""3.0"""'], {}), "('Gtk', '3.0')\n", (103, 117), False, 'import gi\n'), ((331, 448),... |
from __future__ import division
from builtins import str
import numpy as np
import os
import pickle as Pickle
from flarestack.core.results import ResultsHandler
from flarestack.data.icecube.ps_tracks.ps_v002_p01 import ps_v002_p01
from flarestack.shared import plot_output_dir, flux_to_k, analysis_dir
from flarestack.ut... | [
"pickle.dump",
"os.makedirs",
"flarestack.core.results.ResultsHandler",
"flarestack.shared.plot_output_dir",
"builtins.str",
"matplotlib.pyplot.close",
"numpy.linspace",
"matplotlib.pyplot.figure",
"flarestack.icecube_utils.reference_sensitivity.reference_sensitivity",
"matplotlib.pyplot.tight_lay... | [((1046, 1071), 'numpy.linspace', 'np.linspace', (['(0.5)', '(-0.5)', '(3)'], {}), '(0.5, -0.5, 3)\n', (1057, 1071), True, 'import numpy as np\n'), ((1101, 1126), 'numpy.linspace', 'np.linspace', (['(-90.0)', '(90)', '(7)'], {}), '(-90.0, 90, 7)\n', (1112, 1126), True, 'import numpy as np\n'), ((2911, 2923), 'matplotli... |
"""
*******
parfive
*******
A parallel file downloader using asyncio.
* Documentation: https://parfive.readthedocs.io/en/stable/
* Source code: https://github.com/Cadair/parfive
"""
import logging as _logging
from .downloader import Downloader
from .results import Results
__all__ = ['Downloader', 'Results', 'log',... | [
"logging.getLogger"
] | [((504, 533), 'logging.getLogger', '_logging.getLogger', (['"""parfive"""'], {}), "('parfive')\n", (522, 533), True, 'import logging as _logging\n')] |
import streamlit as st
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import altair as alt
from requests import get
import re
import os
from bs4 import BeautifulSoup
from urllib.request import Request, urlopen
import datetime
import time
import matplotlib.pyplo... | [
"streamlit.table",
"pandas.read_csv",
"urllib.request.Request",
"time.sleep",
"datetime.timedelta",
"streamlit.header",
"pandas.date_range",
"pandas.to_datetime",
"pandas.unique",
"datetime.date",
"numpy.datetime64",
"streamlit.set_page_config",
"pandas.DataFrame",
"urllib.request.urlopen"... | [((449, 484), 'geopy.geocoders.Nominatim', 'Nominatim', ([], {'user_agent': '"""myuseragent"""'}), "(user_agent='myuseragent')\n", (458, 484), False, 'from geopy.geocoders import Nominatim\n'), ((669, 768), 'streamlit.set_page_config', 'st.set_page_config', ([], {'page_title': '"""O/U Hockey Analytics"""', 'page_icon':... |
"""Cornershop class.
"""
from typing import List, Union
import requests
from .models import (
Branch,
Country,
Group,
Result
)
class Cornershop:
"""Object to access Cornershop's API.
Parameters
----------
locality : str | int
ZIP Code.
country : str
Two-letter... | [
"requests.get"
] | [((1763, 1780), 'requests.get', 'requests.get', (['URL'], {}), '(URL)\n', (1775, 1780), False, 'import requests\n'), ((2587, 2604), 'requests.get', 'requests.get', (['URL'], {}), '(URL)\n', (2599, 2604), False, 'import requests\n'), ((2873, 2890), 'requests.get', 'requests.get', (['URL'], {}), '(URL)\n', (2885, 2890), ... |
#!/usr/bin/env python
# from SignalChecker import SignalChecker
from ROOT import *
from rootUtil import waitRootCmdX
from array import array
from sigproc import SigProc
def getChain(fname, treename='tree1'):
ch1 = TChain(treename)
ch1.Add(fname)
ch1.SetMarkerStyle(7)
return ch1
def test1():
ch1... | [
"sigproc.SigProc",
"rootUtil.waitRootCmdX"
] | [((918, 932), 'rootUtil.waitRootCmdX', 'waitRootCmdX', ([], {}), '()\n', (930, 932), False, 'from rootUtil import waitRootCmdX\n'), ((976, 1039), 'sigproc.SigProc', 'SigProc', ([], {'nSamples': '(16384)', 'nAdcCh': '(20)', 'nSdmCh': '(19)', 'adcSdmCycRatio': '(5)'}), '(nSamples=16384, nAdcCh=20, nSdmCh=19, adcSdmCycRat... |
import numpy as np
from math import floor, ceil
import torch
from torch import nn
import torch.nn.functional as F
import utils.loggers as lg
class Residual_CNN(nn.Module):
def __init__(self, learning_rate, input_dim, output_dim, hidden_layers, device):
super().__init__()
self._device = device
... | [
"torch.tanh",
"torch.nn.BatchNorm2d",
"math.ceil",
"torch.nn.CrossEntropyLoss",
"torch.nn.LeakyReLU",
"math.floor",
"numpy.reshape",
"torch.from_numpy",
"torch.nn.Conv2d",
"torch.nn.MSELoss",
"torch.nn.Linear"
] | [((560, 577), 'torch.nn.LeakyReLU', 'nn.LeakyReLU', (['(0.3)'], {}), '(0.3)\n', (572, 577), False, 'from torch import nn\n'), ((748, 791), 'torch.nn.BatchNorm2d', 'nn.BatchNorm2d', (["hidden_layers[0]['filters']"], {}), "(hidden_layers[0]['filters'])\n", (762, 791), False, 'from torch import nn\n'), ((1727, 1744), 'tor... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
try:
import __builtin__ as builtins
except ImportError:
import builtins
from storm import Storm
from storm.parsers.ssh_uri_parser import parse
from storm.utils import (get_formatted_message, colored)
from storm.kommandr import *... | [
"storm.web.run",
"storm.Storm",
"storm.utils.get_formatted_message",
"storm.defaults.get_default",
"sys.exit",
"storm.utils.colored"
] | [((456, 474), 'storm.Storm', 'Storm', (['config_file'], {}), '(config_file)\n', (461, 474), False, 'from storm import Storm\n'), ((9375, 9415), 'storm.web.run', '_web.run', (['port', 'debug', 'theme', 'ssh_config'], {}), '(port, debug, theme, ssh_config)\n', (9383, 9415), True, 'from storm import web as _web\n'), ((145... |
"""
Representations of template-with-slots-like patterns over token strings.
"""
from typing import List, Mapping, Optional, Tuple, Union
from more_itertools import quantify
from adam.language import TokenSequenceLinguisticDescription
from adam.language_specific.english import ENGLISH_DETERMINERS
from adam.learner.lan... | [
"attr.attrs",
"adam.semantics.SyntaxSemanticsVariable",
"immutablecollections.immutableset",
"vistautils.span.Span",
"attr.attrib",
"attr.validators.instance_of"
] | [((746, 776), 'attr.attrs', 'attrs', ([], {'frozen': '(True)', 'slots': '(True)'}), '(frozen=True, slots=True)\n', (751, 776), False, 'from attr import attrib, attrs\n'), ((10360, 10378), 'attr.attrs', 'attrs', ([], {'frozen': '(True)'}), '(frozen=True)\n', (10365, 10378), False, 'from attr import attrib, attrs\n'), ((... |
from django.db import models
class Paymentscheme(models.Model):
month = models.CharField(max_length = 70 , null = True)
year = models.IntegerField(null = True)
pf = models.IntegerField(null = True)
name = models.CharField(max_length = 70)
designation = models.CharField(max_length = 50)
... | [
"django.db.models.DateField",
"django.db.models.IntegerField",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.CharField"
] | [((84, 126), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(70)', 'null': '(True)'}), '(max_length=70, null=True)\n', (100, 126), False, 'from django.db import models\n'), ((144, 174), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'null': '(True)'}), '(null=True)\n', (163, 174),... |
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
# csv paths
colorCSV = pd.read_csv('../input/style-classifier/Multi_Label_dataset/Tasks/color.csv')
dofCSV = pd.read_csv('../input/style-classifier/Multi_Label_dataset/Tasks/dof.csv')
paletteCSV = pd.read_csv('../input/style-classifier/Multi_Label_... | [
"matplotlib.pyplot.savefig",
"pandas.read_csv",
"numpy.array",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((95, 171), 'pandas.read_csv', 'pd.read_csv', (['"""../input/style-classifier/Multi_Label_dataset/Tasks/color.csv"""'], {}), "('../input/style-classifier/Multi_Label_dataset/Tasks/color.csv')\n", (106, 171), True, 'import pandas as pd\n'), ((181, 255), 'pandas.read_csv', 'pd.read_csv', (['"""../input/style-classifier/... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# encoding: utf-8
from flask import Flask
# from api import *
import os
from flask_graphql import GraphQLView
from schema import graphqlSchema
app = Flask(__name__)
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
app.add_url_rule('/graphql', view_func=GraphQLView.as_view('graph... | [
"flask_graphql.GraphQLView.as_view",
"flask.Flask"
] | [((198, 213), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (203, 213), False, 'from flask import Flask\n'), ((294, 361), 'flask_graphql.GraphQLView.as_view', 'GraphQLView.as_view', (['"""graphql"""'], {'schema': 'graphqlSchema', 'graphiql': '(True)'}), "('graphql', schema=graphqlSchema, graphiql=True)\n"... |
import json
import logging
from dataclasses import dataclass
from typing import Dict, Iterable, Optional, Union
import pyorient
from pyorient import OrientRecord
from datahub.configuration.common import ConfigModel
from datahub.ingestion.api.common import PipelineContext
from datahub.ingestion.api.source import Sourc... | [
"logging.getLogger",
"datahub.metadata.schema_classes.BooleanTypeClass",
"json.loads",
"datahub.metadata.schema_classes.SchemalessClass",
"datahub.ingestion.api.workunit.MetadataWorkUnit",
"datahub.metadata.schema_classes.SchemaFieldDataTypeClass",
"datahub.metadata.com.linkedin.pegasus2avro.mxe.Metadat... | [((854, 881), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (871, 881), False, 'import logging\n'), ((2887, 2912), 'json.loads', 'json.loads', (['table.columns'], {}), '(table.columns)\n', (2897, 2912), False, 'import json\n'), ((3359, 3405), 'datahub.metadata.com.linkedin.pegasus2avro.m... |
import json
import sys
from easyprocess import EasyProcess
python = sys.executable
def pass_env(e):
prog = "import os,json;print(json.dumps(dict(os.environ)))"
s = EasyProcess([python, "-c", prog], env=e).call().stdout
return json.loads(s)
def test_env():
assert len(pass_env(None)) > 0
e = pas... | [
"easyprocess.EasyProcess",
"json.loads"
] | [((242, 255), 'json.loads', 'json.loads', (['s'], {}), '(s)\n', (252, 255), False, 'import json\n'), ((176, 216), 'easyprocess.EasyProcess', 'EasyProcess', (["[python, '-c', prog]"], {'env': 'e'}), "([python, '-c', prog], env=e)\n", (187, 216), False, 'from easyprocess import EasyProcess\n')] |
import pprint
from loguru import logger
DEFAULT_START = 0
DEFAULT_END = 1000000000
DEFAULT_num = 10
# Paginate response in SearpApi
class Pagination:
def __init__(self, client, start=DEFAULT_START, end=DEFAULT_END, num=DEFAULT_num):
# serp api client
self.client = client
# range
se... | [
"loguru.logger.debug"
] | [((1309, 1451), 'loguru.logger.debug', 'logger.debug', (['f"""Initialise pagination from __iter__ with self.start ={self.start!r}, self.end ={self.end!r}, self.num ={self.num!r}"""'], {}), "(\n f'Initialise pagination from __iter__ with self.start ={self.start!r}, self.end ={self.end!r}, self.num ={self.num!r}'\n ... |
import vcs, numpy, cdms2, MV2, os, sys, vcs.testing.regression as regression
x = regression.init()
data = MV2.array([4,5,6,7,1,3,7,9,])+230.
p = cdms2.createAxis([2,5,100,200,500,800,850,1000])
data.setAxis(0,p)
data.id="jim"
gm=x.create1d()
gm.linewidth=0
gm.datawc_x1=1000
gm.datawc_x2=0
gm.markersize=30
x.plot(data... | [
"vcs.testing.regression.init",
"cdms2.createAxis",
"os.path.split",
"MV2.array",
"vcs.testing.regression.run"
] | [((83, 100), 'vcs.testing.regression.init', 'regression.init', ([], {}), '()\n', (98, 100), True, 'import vcs, numpy, cdms2, MV2, os, sys, vcs.testing.regression as regression\n'), ((147, 202), 'cdms2.createAxis', 'cdms2.createAxis', (['[2, 5, 100, 200, 500, 800, 850, 1000]'], {}), '([2, 5, 100, 200, 500, 800, 850, 100... |
import frappe
from erpnext.compliance.utils import get_default_license
from frappe.modules.utils import sync_customizations
def execute():
sync_customizations("bloomstack_core")
compliance_info = frappe.get_all('Compliance Info', fields=['name'])
if not compliance_info:
return
sales_orders = frappe.get_all("S... | [
"frappe.get_all",
"frappe.modules.utils.sync_customizations",
"erpnext.compliance.utils.get_default_license",
"frappe.db.set_value"
] | [((142, 180), 'frappe.modules.utils.sync_customizations', 'sync_customizations', (['"""bloomstack_core"""'], {}), "('bloomstack_core')\n", (161, 180), False, 'from frappe.modules.utils import sync_customizations\n'), ((201, 251), 'frappe.get_all', 'frappe.get_all', (['"""Compliance Info"""'], {'fields': "['name']"}), "... |
# Generated by Django 2.0.4 on 2018-05-01 13:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('schemes', '0008_auto_20180501_1234'),
]
operations = [
migrations.AlterField(
model_name='comment',
name='content',
... | [
"django.db.models.TextField"
] | [((338, 371), 'django.db.models.TextField', 'models.TextField', ([], {'max_length': '(5000)'}), '(max_length=5000)\n', (354, 371), False, 'from django.db import migrations, models\n'), ((493, 526), 'django.db.models.TextField', 'models.TextField', ([], {'max_length': '(5000)'}), '(max_length=5000)\n', (509, 526), False... |
from django.db import models
class Tag(models.Model):
title = models.CharField(max_length=100)
body = models.TextField()
def __str__(self):
return self.title
class Post(models.Model):
title = models.CharField(max_length=100)
status = models.CharField(
choices=[('non_status', 'No s... | [
"django.db.models.TextField",
"django.db.models.ManyToManyField",
"django.db.models.CharField"
] | [((67, 99), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (83, 99), False, 'from django.db import models\n'), ((111, 129), 'django.db.models.TextField', 'models.TextField', ([], {}), '()\n', (127, 129), False, 'from django.db import models\n'), ((219, 251), 'djan... |
from __future__ import unicode_literals
from datetime import timedelta
import django
from django.test import TestCase
from error.test import utils as error_test_utils
from job.configuration.data.job_data import JobData
from job.messages.cancel_jobs_bulk import CancelJobsBulk
from job.test import utils as job_test_ut... | [
"job.test.utils.create_job_type",
"django.setup",
"job.messages.cancel_jobs_bulk.CancelJobsBulk.from_json",
"job.configuration.data.job_data.JobData",
"error.test.utils.create_error",
"job.test.utils.create_job",
"datetime.timedelta",
"job.messages.cancel_jobs_bulk.CancelJobsBulk"
] | [((392, 406), 'django.setup', 'django.setup', ([], {}), '()\n', (404, 406), False, 'import django\n'), ((524, 572), 'error.test.utils.create_error', 'error_test_utils.create_error', ([], {'category': '"""SYSTEM"""'}), "(category='SYSTEM')\n", (553, 572), True, 'from error.test import utils as error_test_utils\n'), ((58... |
# Django Models
from typing import List
from django.db import models
# Abstract User for Custom User Model
from django.contrib.auth.models import AbstractUser
class TTUser(AbstractUser):
"""
CFP Custom User Model
"""
class Meta:
# A human-readable name for the object.
verbose_name = v... | [
"django.db.models.CharField"
] | [((487, 559), 'django.db.models.CharField', 'models.CharField', ([], {'verbose_name': '"""Postal Code"""', 'max_length': '(255)', 'blank': '(True)'}), "(verbose_name='Postal Code', max_length=255, blank=True)\n", (503, 559), False, 'from django.db import models\n'), ((606, 650), 'django.db.models.CharField', 'models.Ch... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import shutil
import tempfile
import unittest
from sjkscan.utils import files, move, remove, is_scan_name, version
from sjkscan.config import load_config
from sjkscan import __version__
class TestFiles(unittest.TestCase):
def setUp(self):
self.temp... | [
"sjkscan.config.load_config",
"os.path.exists",
"sjkscan.utils.remove",
"sjkscan.utils.move",
"os.path.join",
"sjkscan.utils.files",
"sjkscan.utils.is_scan_name",
"tempfile.mkdtemp",
"os.mkdir",
"shutil.rmtree",
"unittest.main",
"sjkscan.utils.version"
] | [((3005, 3020), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3018, 3020), False, 'import unittest\n'), ((327, 345), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {}), '()\n', (343, 345), False, 'import tempfile\n'), ((645, 672), 'sjkscan.utils.files', 'files', (['self.temp_dir', '"""pnm"""'], {}), "(self.temp_di... |
""" 为了能够现实下列代码的执行效果,请在安装PyTorch之后,在Python交互命令行界面,
即在系统命令行下输入python这个命令回车后,在>>>提示符后执行下列代码
(#号及其后面内容为注释,可以忽略)
"""
import torch
a = torch.randn(3,4) # 建立一个3×4的张量
b = torch.randn(4,3) # 建立一个4×3的张量
torch.mm(a,b) # 矩阵乘法,调用函数,返回3×3的矩阵乘积
a.mm(b) # 矩阵乘法,内置方法
a@b # 矩阵乘法,@运算符号
a = torch.randn(2,3,4) # 建立一个大小为2×3×4的张量
b ... | [
"torch.mm",
"torch.bmm",
"torch.randn"
] | [((139, 156), 'torch.randn', 'torch.randn', (['(3)', '(4)'], {}), '(3, 4)\n', (150, 156), False, 'import torch\n'), ((173, 190), 'torch.randn', 'torch.randn', (['(4)', '(3)'], {}), '(4, 3)\n', (184, 190), False, 'import torch\n'), ((203, 217), 'torch.mm', 'torch.mm', (['a', 'b'], {}), '(a, b)\n', (211, 217), False, 'im... |
"""
Usage: spooler SPOOLDIR [options]
Options:
-p --printer=DEVICE The device of the printer [Default: /dev/usb/lp-thermal]
--pdf For local development: don't print anything, but
show generated pdfs using okular
-h --help Show help
"""
# NOTE: by default we... | [
"logging.StreamHandler",
"server.config.ROOT.join",
"logging.Formatter",
"os.system",
"logging.root.addHandler",
"time.sleep",
"logging.exception",
"logging.root.setLevel",
"logging.error",
"py.path.local",
"logging.info",
"docopt.docopt"
] | [((556, 594), 'server.config.ROOT.join', 'config.ROOT.join', (['"""log"""', '"""spooler.log"""'], {}), "('log', 'spooler.log')\n", (572, 594), False, 'from server import config\n'), ((633, 729), 'logging.Formatter', 'logging.Formatter', (['"""[%(asctime)s] [%(levelname)s] %(message)s"""'], {'datefmt': '"""%m/%d/%Y %H:%... |
# Generated by Django 2.0.1 on 2018-02-17 12:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('orders', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='order',
name='user',
),
... | [
"django.db.models.EmailField",
"django.db.migrations.RemoveField",
"django.db.models.CharField"
] | [((223, 278), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""order"""', 'name': '"""user"""'}), "(model_name='order', name='user')\n", (245, 278), False, 'from django.db import migrations, models\n'), ((422, 490), 'django.db.models.CharField', 'models.CharField', ([], {'default': ... |
import torch
import numpy as np
import mmcv
import cv2
def get_mask_size(proposals_list, base_size, ratio_max):
ratio = 1.0
for proposals in proposals_list:
ratios = proposals[:, 2] / proposals[:, 3]
assert ratios.min() >= 1.0
ratio = max(ratio, ratios.ceil().max())
ratio = float(mi... | [
"cv2.warpAffine",
"mmcv.imresize",
"numpy.stack",
"numpy.zeros",
"cv2.getRotationMatrix2D",
"numpy.maximum",
"numpy.int",
"numpy.float32",
"torch.cat"
] | [((532, 577), 'numpy.zeros', 'np.zeros', (['(rows * 2, cols * 2)'], {'dtype': '"""uint8"""'}), "((rows * 2, cols * 2), dtype='uint8')\n", (540, 577), True, 'import numpy as np\n'), ((723, 809), 'cv2.getRotationMatrix2D', 'cv2.getRotationMatrix2D', (['(x + cols_start, y + rows_start)', '(theta * 180 / np.pi)', '(1)'], {... |
# Make SweetPea visible regardless of whether it's been installed.
import sys
sys.path.append("..")
from sweetpea.primitives import factor, derived_level, within_trial, transition
from sweetpea.constraints import no_more_than_k_in_a_row
from sweetpea import fully_cross_block, synthesize_trials_non_uniform, print_exper... | [
"sweetpea.primitives.factor",
"sweetpea.synthesize_trials_non_uniform",
"sweetpea.primitives.within_trial",
"sweetpea.primitives.transition",
"sweetpea.constraints.no_more_than_k_in_a_row",
"sweetpea.print_experiments",
"sweetpea.fully_cross_block",
"sys.path.append"
] | [((78, 99), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (93, 99), False, 'import sys\n'), ((908, 958), 'sweetpea.primitives.factor', 'factor', (['"""color"""', "['red', 'blue', 'green', 'brown']"], {}), "('color', ['red', 'blue', 'green', 'brown'])\n", (914, 958), False, 'from sweetpea.primiti... |
import pytest
from channels.testing import WebsocketCommunicator
from backend.groups.models import ChatGroup
pytestmark = [pytest.mark.asyncio, pytest.mark.django_db(transaction=True)]
@pytest.fixture
def request_data(group_with_one_member: ChatGroup) -> dict:
return {
"id": group_with_one_member.id,
... | [
"pytest.mark.django_db"
] | [((147, 186), 'pytest.mark.django_db', 'pytest.mark.django_db', ([], {'transaction': '(True)'}), '(transaction=True)\n', (168, 186), False, 'import pytest\n')] |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from sqlalchemy import (
Column, DateTime, ForeignKey, Integer, String, Table, func,
)
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from eve_sqlalchemy.config import DomainConfig, ResourceConfig
from... | [
"sqlalchemy.orm.relationship",
"sqlalchemy.func.now",
"sqlalchemy.ForeignKey",
"eve_sqlalchemy.config.ResourceConfig",
"sqlalchemy.String",
"sqlalchemy.ext.declarative.declarative_base",
"sqlalchemy.Column"
] | [((369, 387), 'sqlalchemy.ext.declarative.declarative_base', 'declarative_base', ([], {}), '()\n', (385, 387), False, 'from sqlalchemy.ext.declarative import declarative_base\n'), ((772, 799), 'sqlalchemy.Column', 'Column', (['"""quantity"""', 'Integer'], {}), "('quantity', Integer)\n", (778, 799), False, 'from sqlalch... |
# Generated by Django 2.1.7 on 2019-02-22 01:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('torrents', '0003_auto_20190222_0029'),
]
operations = [
migrations.AddField(
model_name='torrent',
name='download_lo... | [
"django.db.migrations.AlterUniqueTogether",
"django.db.models.CharField"
] | [((613, 705), 'django.db.migrations.AlterUniqueTogether', 'migrations.AlterUniqueTogether', ([], {'name': '"""torrent"""', 'unique_together': "{('realm', 'info_hash')}"}), "(name='torrent', unique_together={('realm',\n 'info_hash')})\n", (643, 705), False, 'from django.db import migrations, models\n'), ((746, 843), ... |
from model.contact import Contact
from model.group import Group
import random
def test_add_contact_to_group(app, db, orm):
if len(db.get_contact_list()) == 0:
app.contact.create(Contact(firstname="test"))
if len(db.get_group_list()) == 0:
app.group.create(Group(name="test"))
contacts = d... | [
"model.group.Group",
"random.choice",
"model.contact.Contact"
] | [((362, 385), 'random.choice', 'random.choice', (['contacts'], {}), '(contacts)\n', (375, 385), False, 'import random\n'), ((834, 871), 'random.choice', 'random.choice', (['groups_without_contact'], {}), '(groups_without_contact)\n', (847, 871), False, 'import random\n'), ((710, 733), 'random.choice', 'random.choice', ... |
"""
User credential and auth token module
See [README](../README.html) for more details.
Copyright 2020. Bloomberg Finance L.P.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, ... | [
"logging.getLogger",
"datetime.datetime.fromtimestamp",
"datetime.datetime.utcnow",
"urlparse.urlparse",
"io.open",
"uuid.uuid4",
"sys.stderr.write",
"sys.exit",
"json.load",
"datetime.timedelta",
"time.time",
"binascii.unhexlify",
"jwt.encode"
] | [((1473, 1500), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1490, 1500), False, 'import logging\n'), ((1549, 1587), 'datetime.timedelta', 'datetime.timedelta', ([], {'days': 'DAYS_IN_MONTH'}), '(days=DAYS_IN_MONTH)\n', (1567, 1587), False, 'import datetime\n'), ((1951, 2003), 'io.open... |
from tests.utils import W3CTestCase
class TestTtwfReftestFlexAlignContentCenter(W3CTestCase):
vars().update(W3CTestCase.find_tests(__file__, 'ttwf-reftest-flex-align-content-center'))
| [
"tests.utils.W3CTestCase.find_tests"
] | [((114, 188), 'tests.utils.W3CTestCase.find_tests', 'W3CTestCase.find_tests', (['__file__', '"""ttwf-reftest-flex-align-content-center"""'], {}), "(__file__, 'ttwf-reftest-flex-align-content-center')\n", (136, 188), False, 'from tests.utils import W3CTestCase\n')] |
"""Tests for the Meteo-France config flow."""
from meteofrance.model import Place
import pytest
from homeassistant import data_entry_flow
from homeassistant.components.meteo_france.const import (
CONF_CITY,
DOMAIN,
FORECAST_MODE_DAILY,
FORECAST_MODE_HOURLY,
)
from homeassistant.config_entries import SO... | [
"pytest.fixture",
"meteofrance.model.Place",
"tests.common.MockConfigEntry",
"tests.async_mock.patch"
] | [((729, 874), 'meteofrance.model.Place', 'Place', (["{'name': CITY_1_NAME, 'lat': CITY_1_LAT, 'lon': CITY_1_LON, 'country':\n CITY_1_COUNTRY, 'admin': CITY_1_ADMIN, 'admin2': CITY_1_ADMIN2}"], {}), "({'name': CITY_1_NAME, 'lat': CITY_1_LAT, 'lon': CITY_1_LON, 'country':\n CITY_1_COUNTRY, 'admin': CITY_1_ADMIN, 'a... |
from scipy import stats
import numpy as np
__all__ = ['chisquare', 'kolsmi']
def kolsmi(dist, fit_result, data):
"""Perform a Kolmogorow-Smirnow-Test for goodness of fit.
This tests the H0 hypothesis, if data is a sample of dist
Args:
dist: A mle.Distribution instance
fit_result... | [
"numpy.sum",
"numpy.histogram"
] | [((2053, 2105), 'numpy.histogram', 'np.histogram', (['data[var.name]'], {'bins': 'bins', 'range': 'range'}), '(data[var.name], bins=bins, range=range)\n', (2065, 2105), True, 'import numpy as np\n'), ((2470, 2482), 'numpy.sum', 'np.sum', (['mask'], {}), '(mask)\n', (2476, 2482), True, 'import numpy as np\n')] |
# pylint: disable=exec-used
"""
Sphinx extension for including live rendered GMT plots within sphinx documentation. For
example::
.. gmt-plot::
import gmt
fig = gmt.Figure()
fig.coast(region="g", projection="W0/10i", land="gray")
fig.show()
The *last statement* of the code-block s... | [
"contextlib.redirect_stdout",
"base64.encodebytes",
"sphinx.locale._",
"docutils.nodes.target",
"jinja2.Template",
"ast.Module",
"ast.Interactive",
"os.path.dirname",
"docutils.nodes.literal_block",
"os.path.basename",
"ast.parse",
"io.StringIO",
"os.path.relpath"
] | [((1229, 1963), 'jinja2.Template', 'jinja2.Template', (['"""\n<div class="gmtplot-output" id="{{ div_id }}">\n {% if stdout %}\n <div class="highlight">\n <pre>{{ stdout }}</pre>\n </div>\n {% endif %}\n {% if image or html %}\n {% set center_style="display: block; margin-left: ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-31 22:02
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('form', '0007_auto_20160531_2159'),
]
operations = [
migrations.AlterField(
... | [
"django.db.models.IntegerField"
] | [((418, 557), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'choices': '[(0, 0), (1, 1), (2, 2), (3, 3), (4, 4)]', 'default': '(-1)', 'verbose_name': '"""Which package has a better community?"""'}), "(choices=[(0, 0), (1, 1), (2, 2), (3, 3), (4, 4)],\n default=-1, verbose_name='Which package has a be... |
#!/usr/bin/env python3
"""
movezero.py
Move all zeroes to the end of an array.
Usage example:
chmod +x movezero.py
./movezero.py 0 2 0 4 0 6 0 8
Call ./movezero.py without arguments to run a default example.
"""
import random
import sys
def move_zeroes(array):
l = list(filter(( lambda x: x != '0'), array))
... | [
"random.randint"
] | [((435, 455), 'random.randint', 'random.randint', (['(0)', '(1)'], {}), '(0, 1)\n', (449, 455), False, 'import random\n')] |
from model import Model, Optimizer
import numpy as np
IMAGE_SIZE = 28
class ClientModel(Model):
def __init__(self, lr, num_classes, max_batch_size=None, seed=None, optimizer=None):
self.num_classes = num_classes
super(ClientModel, self).__init__(lr, seed, max_batch_size, optimizer=ErmOptimizer()... | [
"numpy.exp",
"numpy.dot",
"numpy.zeros",
"numpy.matmul",
"numpy.linalg.norm"
] | [((1583, 1595), 'numpy.zeros', 'np.zeros', (['(50)'], {}), '(50)\n', (1591, 1595), True, 'import numpy as np\n'), ((2920, 2944), 'numpy.matmul', 'np.matmul', (['image', 'self.w'], {}), '(image, self.w)\n', (2929, 2944), True, 'import numpy as np\n'), ((3198, 3220), 'numpy.zeros', 'np.zeros', (['self.w.shape'], {}), '(s... |
from pymongo import MongoClient, DESCENDING
import requests
import json
import datetime
def clear_domains():
# connect to MongoDB, change the << MONGODB URL >> to reflect your own connection string
client = MongoClient("mongodb://127.0.0.1:27017")
db = client.wolf
# Issue the serverStatus command and ... | [
"pymongo.MongoClient",
"requests.post",
"requests.get",
"datetime.datetime.utcnow"
] | [((217, 257), 'pymongo.MongoClient', 'MongoClient', (['"""mongodb://127.0.0.1:27017"""'], {}), "('mongodb://127.0.0.1:27017')\n", (228, 257), False, 'from pymongo import MongoClient, DESCENDING\n'), ((690, 782), 'requests.get', 'requests.get', (["('http:///mautic/api/contacts?search=email:%@' + domain_name)"], {'auth':... |
import functools as f
from foowise.channels import Index as Id
from foowise.channels import InfoPair as I
from foowise.math import Set as S
from foowise.math import LinAlg as Alg
from foowise.math import Dual as D
@D.dualizable(duals=[
('tok', 'typ'),
('get_tokens', 'get_types'),
('tokens_agree', 'types_... | [
"foowise.math.Dual.dualizable",
"foowise.channels.Index.Index",
"foowise.math.Set.Set.union",
"foowise.math.Set.Set.are_equal",
"foowise.math.Set.Set.product",
"foowise.math.LinAlg.Matrix"
] | [((218, 392), 'foowise.math.Dual.dualizable', 'D.dualizable', ([], {'duals': "[('tok', 'typ'), ('get_tokens', 'get_types'), ('tokens_agree',\n 'types_agree'), ('is_valid', 'is_valid_dual'), ('is_invalid',\n 'is_invalid_dual')]"}), "(duals=[('tok', 'typ'), ('get_tokens', 'get_types'), (\n 'tokens_agree', 'types... |
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
import tempfile
here = os.path.dirname(os.path.realpath(__file__))
repo_root = os.path.normpath(os.path.join(here, '..', '..', '..'))
... | [
"os.path.join",
"os.path.realpath",
"os.path.dirname",
"tempfile.NamedTemporaryFile",
"os.remove"
] | [((224, 250), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (240, 250), False, 'import os\n'), ((281, 317), 'os.path.join', 'os.path.join', (['here', '""".."""', '""".."""', '""".."""'], {}), "(here, '..', '..', '..')\n", (293, 317), False, 'import os\n'), ((2981, 3022), 'tempfile.NamedTem... |
"""
Draw a form diagram.
"""
from ghpythonlib.componentbase import executingcomponent as component
from compas_cem.ghpython import FormArtist
class FormArtistComponent(component):
def RunScript(self, form, node_keys, edge_keys, force_min, force_scale):
node_keys = node_keys or None
edge_keys = ed... | [
"compas_cem.ghpython.FormArtist"
] | [((451, 467), 'compas_cem.ghpython.FormArtist', 'FormArtist', (['form'], {}), '(form)\n', (461, 467), False, 'from compas_cem.ghpython import FormArtist\n')] |
#!/usr/bin/env python
"""
Setup testplan and dependencies.
"""
import ast
import sys
from pathlib import Path, PurePosixPath
from setuptools import setup, find_packages
REQUIRED = [
"sphinx<2",
"sphinx_rtd_theme",
"setuptools",
"pytest",
"py",
"psutil",
"schema",
"pytz",
"lxml",
... | [
"pathlib.PurePosixPath",
"setuptools.find_packages",
"pathlib.Path"
] | [((1894, 1931), 'setuptools.find_packages', 'find_packages', ([], {'include': "('testplan*',)"}), "(include=('testplan*',))\n", (1907, 1931), False, 'from setuptools import setup, find_packages\n'), ((824, 840), 'pathlib.PurePosixPath', 'PurePosixPath', (['p'], {}), '(p)\n', (837, 840), False, 'from pathlib import Path... |
#!python
# Copyright (c) 2022, Cisco Systems, Inc. and/or its affiliates.
# All rights reserved.
# See accompanying LICENSE file in apt2sbom distribution.
"""
Routines to generate lists of python modules installed.
"""
import re
import pip_api
from pip_api._call import call
# return an array of global packages.
def... | [
"re.split",
"pip_api.installed_distributions",
"pip_api._call.call"
] | [((418, 451), 'pip_api.installed_distributions', 'pip_api.installed_distributions', ([], {}), '()\n', (449, 451), False, 'import pip_api\n'), ((579, 590), 'pip_api._call.call', 'call', (['*args'], {}), '(*args)\n', (583, 590), False, 'from pip_api._call import call\n'), ((693, 713), 're.split', 're.split', (['""": """'... |
from .song import Song
from .album import Album
from .band import Band
import unittest
class SongTest(unittest.TestCase):
def test_song_init(self):
song = Song("A", 3.15, False)
message = song.get_info()
expected = "A - 3.15"
self.assertEqual(message, expected)
def test_album... | [
"unittest.main"
] | [((5610, 5625), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5623, 5625), False, 'import unittest\n')] |
import unittest
from ipynb.ecc import FiniteField
from ipynb.ecc import ECCPoint
from ipynb.ecc import sha256
from ipynb.ecc import ripemd160
from ipynb.ecc import G
SECP256K1_TEST_VECTOR = [
[
1,
0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798,
0x483ADA7726A3C4655DA4FBFC... | [
"ipynb.ecc.FiniteField",
"ipynb.ecc.sha256",
"ipynb.ecc.ECCPoint",
"ipynb.ecc.ripemd160"
] | [((18336, 18353), 'ipynb.ecc.FiniteField', 'FiniteField', (['(0)', 'p'], {}), '(0, p)\n', (18347, 18353), False, 'from ipynb.ecc import FiniteField\n'), ((18366, 18383), 'ipynb.ecc.FiniteField', 'FiniteField', (['(7)', 'p'], {}), '(7, p)\n', (18377, 18383), False, 'from ipynb.ecc import FiniteField\n'), ((18396, 18499)... |
from django.conf import settings
from django.db import models
class Episode(models.Model):
title = models.CharField(max_length=255, unique=True)
date = models.DateField()
#link_to_episode?? # only if public?
def __str__(self):
return "RBR: {}".format(self.title)
class Notes(models.Model):
... | [
"django.db.models.DateField",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.CharField"
] | [((105, 150), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(255)', 'unique': '(True)'}), '(max_length=255, unique=True)\n', (121, 150), False, 'from django.db import models\n'), ((162, 180), 'django.db.models.DateField', 'models.DateField', ([], {}), '()\n', (178, 180), False, 'from django.db ... |
from rts.core.task import Task
from rts.core.ts import TaskSet
from rts.gen.gen import Gen
import random
import math
class Egen(Gen):
def __init__(self, **kwargs):
super(type(self), self).__init__(**kwargs)
self.tot_util = kwargs.get('tot_util', 1.0)
self.ts = TaskSet()
self.last_... | [
"rts.core.task.Task",
"rts.core.ts.TaskSet",
"random.randint"
] | [((292, 301), 'rts.core.ts.TaskSet', 'TaskSet', ([], {}), '()\n', (299, 301), False, 'from rts.core.ts import TaskSet\n'), ((511, 559), 'random.randint', 'random.randint', (['self.min_period', 'self.max_period'], {}), '(self.min_period, self.max_period)\n', (525, 559), False, 'import random\n'), ((580, 634), 'random.ra... |
from allure import suite, parent_suite, title
from data import AUTH_DATA_ADMIN
@suite('Авторизация')
@parent_suite('[PYTHON][UI]')
class TestLoginPage:
@title('Проверка успешной авторизации в системе')
def test_login(self, login_page):
login_page.open()
login_page.check_title('Авторизация')
... | [
"allure.parent_suite",
"allure.title",
"allure.suite"
] | [((83, 103), 'allure.suite', 'suite', (['"""Авторизация"""'], {}), "('Авторизация')\n", (88, 103), False, 'from allure import suite, parent_suite, title\n'), ((105, 133), 'allure.parent_suite', 'parent_suite', (['"""[PYTHON][UI]"""'], {}), "('[PYTHON][UI]')\n", (117, 133), False, 'from allure import suite, parent_suite... |
#Wifi hacking using Aircrack-ng
import os
print("""
█░█░█ █ █▀▀ █ █░█ ▄▀█ █▀▀ █▄▀ █ █▄░█ █▀▀ ▄▀█ █░█ ▀█▀ █▀█
▀▄▀▄▀ █ █▀░ █ █▀█ █▀█ █▄▄ █░█ █ █░▀█ █▄█ █▀█ █▄█ ░█░ █▄█ BY YATHARTH\n
""")
print("#####################################DEVELOPER INFO#################################################")
print("\nfollow... | [
"os.system"
] | [((663, 684), 'os.system', 'os.system', (['"""iwconfig"""'], {}), "('iwconfig')\n", (672, 684), False, 'import os\n'), ((1290, 1306), 'os.system', 'os.system', (['code1'], {}), '(code1)\n', (1299, 1306), False, 'import os\n'), ((1584, 1600), 'os.system', 'os.system', (['code1'], {}), '(code1)\n', (1593, 1600), False, '... |
# -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
from pymongo import MongoClient
from mall_spider.spiders.jd_category import JdCategorySpider
from mall_spider.settings import ... | [
"pymongo.MongoClient"
] | [((572, 596), 'pymongo.MongoClient', 'MongoClient', (['MONGODB_URL'], {}), '(MONGODB_URL)\n', (583, 596), False, 'from pymongo import MongoClient\n'), ((1119, 1143), 'pymongo.MongoClient', 'MongoClient', (['MONGODB_URL'], {}), '(MONGODB_URL)\n', (1130, 1143), False, 'from pymongo import MongoClient\n')] |
import pygame, random, time
from pygame.locals import *
# cores para serem usadas durante o jogo
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
RED = (255, 0, 0)
YELLOW = (255, 255, 0)
# tamanho da tela
WIDTH = 640
HEIGHT = 480
# velocidade do jogador no eixo x
speed_player =... | [
"pygame.init",
"pygame.quit",
"pygame.mixer.music.set_volume",
"pygame.transform.scale",
"pygame.display.set_mode",
"pygame.display.flip",
"pygame.mixer.Sound",
"pygame.image.load",
"pygame.mixer.music.load",
"pygame.Rect",
"random.randint",
"pygame.sprite.spritecollide",
"pygame.sprite.Grou... | [((2526, 2539), 'pygame.init', 'pygame.init', ([], {}), '()\n', (2537, 2539), False, 'import pygame, random, time\n'), ((2588, 2609), 'pygame.sprite.Group', 'pygame.sprite.Group', ([], {}), '()\n', (2607, 2609), False, 'import pygame, random, time\n'), ((2671, 2692), 'pygame.sprite.Group', 'pygame.sprite.Group', ([], {... |
import argparse
from functools import partial
import optuna
# TODO: load data
def prep_data(path):
return X_train, X_val, y_train, y_val
#
def objective_lstm(trial: optuna.Trial, data):
# suggest params
params = {}
# instantiate model
# clf = LogisticRegression(**params)
X_train, X_val, ... | [
"argparse.ArgumentParser",
"functools.partial",
"optuna.create_study"
] | [((604, 638), 'functools.partial', 'partial', (['objective_lstm'], {'data': 'data'}), '(objective_lstm, data=data)\n', (611, 638), False, 'from functools import partial\n'), ((652, 704), 'optuna.create_study', 'optuna.create_study', ([], {'study_name': 'f"""tune_{args.model}"""'}), "(study_name=f'tune_{args.model}')\n"... |
from abc import abstractmethod
from math import ceil, log2
from ..util import SaveLoad, load
class Traversal(SaveLoad):
"""Base image traversal class.
Attributes
----------
classes : `dict`
Image traversal class group.
"""
classes = {}
@abstractmethod
def __call__(self, widt... | [
"math.log2"
] | [((11132, 11142), 'math.log2', 'log2', (['size'], {}), '(size)\n', (11136, 11142), False, 'from math import ceil, log2\n')] |
import random
import re
from typing import Match
from discord import Message
from MoMMI import master, always_command, MChannel
@always_command("based")
async def based(channel: MChannel, _match: Match, message: Message) -> None:
if not channel.server_config("based.enabled", True):
return
match = re.s... | [
"random.random",
"MoMMI.always_command",
"re.search"
] | [((130, 153), 'MoMMI.always_command', 'always_command', (['"""based"""'], {}), "('based')\n", (144, 153), False, 'from MoMMI import master, always_command, MChannel\n'), ((316, 387), 're.search', 're.search', (['"""\\\\S\\\\s+(based)[\\\\s*?.!)]*$"""', 'message.content', 're.IGNORECASE'], {}), "('\\\\S\\\\s+(based)[\\\... |
import json
from boxsdk.config import API
from boxsdk.object.metadata_template import MetadataTemplate, MetadataField, MetadataFieldType
def test_get(test_metadata_template, mock_box_session):
expected_url = '{0}/metadata_templates/{1}/{2}/schema'.format(
API.BASE_API_URL,
test_metadata_template.... | [
"json.dumps",
"boxsdk.object.metadata_template.MetadataField"
] | [((2346, 2393), 'boxsdk.object.metadata_template.MetadataField', 'MetadataField', (['MetadataFieldType.STRING', '"""Name"""'], {}), "(MetadataFieldType.STRING, 'Name')\n", (2359, 2393), False, 'from boxsdk.object.metadata_template import MetadataTemplate, MetadataField, MetadataFieldType\n'), ((2549, 2590), 'boxsdk.obj... |
from karton.core import Task
from karton.core.test import ConfigMock, KartonBackendMock, KartonTestCase
from .mock_helper import mock_classifier, mock_resource, mock_task
class TestClassifier(KartonTestCase):
def setUp(self):
self.config = ConfigMock()
self.backend = KartonBackendMock()
def ... | [
"karton.core.test.KartonBackendMock",
"karton.core.test.ConfigMock",
"karton.core.Task"
] | [((255, 267), 'karton.core.test.ConfigMock', 'ConfigMock', ([], {}), '()\n', (265, 267), False, 'from karton.core.test import ConfigMock, KartonBackendMock, KartonTestCase\n'), ((291, 310), 'karton.core.test.KartonBackendMock', 'KartonBackendMock', ([], {}), '()\n', (308, 310), False, 'from karton.core.test import Conf... |
#
# Copyright 2018 <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/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | [
"homekit.model.characteristics.AbstractCharacteristic.__init__"
] | [((1072, 1193), 'homekit.model.characteristics.AbstractCharacteristic.__init__', 'AbstractCharacteristic.__init__', (['self', 'iid', 'CharacteristicsTypes.HEATING_COOLING_TARGET', 'CharacteristicFormats.uint8'], {}), '(self, iid, CharacteristicsTypes.\n HEATING_COOLING_TARGET, CharacteristicFormats.uint8)\n', (1103,... |
from rest_framework import status
from core.tests.base import BaseTestCase
from django.contrib.auth.models import User
class UsersTests(BaseTestCase):
def setUp(self):
super().setUp()
self.seed_fake_users()
def test_get_users_list(self):
"""
Ensure we can create a new get all ... | [
"django.contrib.auth.models.User.objects.filter",
"django.contrib.auth.models.User.objects.count"
] | [((569, 589), 'django.contrib.auth.models.User.objects.count', 'User.objects.count', ([], {}), '()\n', (587, 589), False, 'from django.contrib.auth.models import User\n'), ((814, 851), 'django.contrib.auth.models.User.objects.filter', 'User.objects.filter', ([], {'username': '"""admin"""'}), "(username='admin')\n", (83... |