code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
"""
Utililities
===========
This module holds all the core utility functions used throughout the library.
These functions are intended to simplify common tasks and to make their
output and functionality consistent where needed.
"""
import json
import os
from typing import Dict, List
import numpy as np # type: igno... | [
"os.remove",
"frewpy.models.exceptions.FrewError",
"os.path.exists",
"numpy.array",
"comtypes.client.CreateObject",
"frewpy.models.exceptions.NodeError"
] | [((7631, 7690), 'frewpy.models.exceptions.NodeError', 'NodeError', (['"""Number of nodes is not unique for every stage."""'], {}), "('Number of nodes is not unique for every stage.')\n", (7640, 7690), False, 'from frewpy.models.exceptions import FrewError, NodeError\n'), ((580, 619), 'frewpy.models.exceptions.FrewError... |
#!/usr/bin/env python
# Author: <NAME> (<EMAIL>)
##########################
# Plotting configuration
##########################
from XtDac.DivideAndConquer import matplotlibConfig
# Use a matplotlib backend which does not show plots to the user
# (they will be saved in files)
import matplotlib
matplotlib.use("Agg"... | [
"matplotlib.pyplot.savefig",
"argparse.ArgumentParser",
"XtDac.FixedBinSearch.Likelihood.PointSource",
"numpy.argsort",
"XtDac.DivideAndConquer.XMMWCS.XMMWCS",
"os.path.isfile",
"XtDac.DivideAndConquer.TimeIntervalConsolidator.TimeIntervalConsolidator",
"XtDac.DivideAndConquer.Results.Summary",
"XtD... | [((300, 321), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (314, 321), False, 'import matplotlib\n'), ((334, 362), 'XtDac.DivideAndConquer.matplotlibConfig.getConfig', 'matplotlibConfig.getConfig', ([], {}), '()\n', (360, 362), False, 'from XtDac.DivideAndConquer import matplotlibConfig\n'), ((... |
from flask import Flask
from flask import make_response
from flask import request
app = Flask(__name__)
@app.route('/')
def index():
user_id = request.cookies.get('user_id')
user_name = request.cookies.get('user_name')
return '%s --- %s' % (user_id, user_name)
@app.route('/login')
def login():
# 默认... | [
"flask.make_response",
"flask.Flask",
"flask.request.cookies.get"
] | [((89, 104), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (94, 104), False, 'from flask import Flask\n'), ((150, 180), 'flask.request.cookies.get', 'request.cookies.get', (['"""user_id"""'], {}), "('user_id')\n", (169, 180), False, 'from flask import request\n'), ((197, 229), 'flask.request.cookies.get',... |
import uuid
from sqlalchemy import Column
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.ext.declarative import as_declarative, declared_attr
@as_declarative()
class Base:
id: uuid.UUID = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
__name__: str
# Generate __tablena... | [
"sqlalchemy.ext.declarative.as_declarative",
"sqlalchemy.dialects.postgresql.UUID"
] | [((163, 179), 'sqlalchemy.ext.declarative.as_declarative', 'as_declarative', ([], {}), '()\n', (177, 179), False, 'from sqlalchemy.ext.declarative import as_declarative, declared_attr\n'), ((219, 237), 'sqlalchemy.dialects.postgresql.UUID', 'UUID', ([], {'as_uuid': '(True)'}), '(as_uuid=True)\n', (223, 237), False, 'fr... |
from numpy.core.numeric import outer
import torch
from torch import log, mean, nn
import torch.nn.functional as F
import numpy as np
class VGAE_Encoder(nn.Module):
def __init__(self, n_in, n_hid, n_out, adj=None):
super(VGAE_Encoder, self).__init__()
self.n_out = n_out
self.base_gcn = Gra... | [
"torch.nn.Parameter",
"torch.nn.Dropout",
"torch.nn.ReLU",
"torch.rand",
"torch.nn.Tanh",
"torch.nn.init.xavier_normal_",
"torch.mm",
"torch.spmm",
"torch.exp",
"torch.nn.ELU",
"torch.nn.functional.hardtanh",
"torch.nn.Linear",
"torch.nn.functional.relu",
"numpy.sqrt"
] | [((8286, 8325), 'numpy.sqrt', 'np.sqrt', (['(6.0 / (input_dim + output_dim))'], {}), '(6.0 / (input_dim + output_dim))\n', (8293, 8325), True, 'import numpy as np\n'), ((8409, 8430), 'torch.nn.Parameter', 'nn.Parameter', (['initial'], {}), '(initial)\n', (8421, 8430), False, 'from torch import log, mean, nn\n'), ((1170... |
#!/usr/bin/env python3
import matplotlib.pyplot as plt
from matplotlib import font_manager
from matplotlib import rc
from matplotlib import gridspec
import pandas as pd
import os
# 0. font
#font_name=font_manager.FontProperties(fname='/usr/share/fonts')
if __name__ == '__main__':
df=pd.read_csv(f'{os.getcwd()}/f... | [
"matplotlib.pyplot.subplot",
"os.getcwd",
"matplotlib.pyplot.close",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.gridspec.GridSpec",
"matplotlib.pyplot.savefig"
] | [((506, 532), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(5, 4)'}), '(figsize=(5, 4))\n', (516, 532), True, 'import matplotlib.pyplot as plt\n'), ((539, 597), 'matplotlib.gridspec.GridSpec', 'gridspec.GridSpec', ([], {'nrows': '(1)', 'ncols': '(1)', 'bottom': '(0.15)', 'top': '(0.92)'}), '(nrows=1, nco... |
""" Find a nearby root of the coupled radial/angular Teukolsky equations.
TODO Documentation.
"""
from __future__ import division, print_function, absolute_import
import logging
import numpy as np
from scipy import optimize
from .angular import sep_const_closest, C_and_sep_const_closest
from . import radial
# TOD... | [
"numpy.finfo",
"numpy.imag",
"numpy.array",
"numpy.real",
"numpy.prod"
] | [((3914, 3926), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (3922, 3926), True, 'import numpy as np\n'), ((4322, 4334), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (4330, 4334), True, 'import numpy as np\n'), ((5821, 5848), 'numpy.prod', 'np.prod', (['(omega - self.poles)'], {}), '(omega - self.poles)\n',... |
import sys
import palette
if len(sys.argv) != 3:
print("Usage: debug {debug-type} {onoff}")
sys.exit(1)
dtype = sys.argv[1]
onoff = sys.argv[2]
palette.palette_api("global.debug","\"debug\": \""+dtype+"\", \"onoff\": \""+onoff+"\"" )
| [
"sys.exit",
"palette.palette_api"
] | [((154, 247), 'palette.palette_api', 'palette.palette_api', (['"""global.debug"""', '(\'"debug": "\' + dtype + \'", "onoff": "\' + onoff + \'"\')'], {}), '(\'global.debug\', \'"debug": "\' + dtype + \'", "onoff": "\' +\n onoff + \'"\')\n', (173, 247), False, 'import palette\n'), ((101, 112), 'sys.exit', 'sys.exit', ... |
import os
class Scaner(object):
def __init__(self) -> None:
super().__init__()
self.current_work_dir = ""
self.all_filepath = []
def get_current_work_dir(self):
self.current_work_dir = os.path.dirname(__file__)
def get_all_filepath(self, dir_path: str, ignore_path_set: se... | [
"os.path.isdir",
"os.path.dirname",
"os.path.join",
"os.listdir"
] | [((228, 253), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (243, 253), False, 'import os\n'), ((433, 453), 'os.listdir', 'os.listdir', (['dir_path'], {}), '(dir_path)\n', (443, 453), False, 'import os\n'), ((479, 507), 'os.path.join', 'os.path.join', (['dir_path', 'file'], {}), '(dir_path, ... |
#!/usr/bin/env python
"""ML models for plant disease classification."""
from __future__ import absolute_import
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__copyright__ = "Copyright (c) 2020 <NAME>"
__license__ = "MIT License"
__version__ = "0.1.0"
__url__ = "https://github.com/abdullahselek/plant-disease-classifica... | [
"pkg_resources.resource_filename"
] | [((554, 602), 'pkg_resources.resource_filename', 'resource_filename', (['__name__', '"""models/model_1.pt"""'], {}), "(__name__, 'models/model_1.pt')\n", (571, 602), False, 'from pkg_resources import resource_filename\n')] |
# -*- coding: utf8 -*-
# @author: yinan
# @time: 18-8-28 下午2:53
# @filename: gevent_tornado.py.py
import gevent.pywsgi
from gevent import monkey
monkey.patch_all()
from logging.config import dictConfig
from flask_cors import CORS
from application import app, configs
from application.controllers.client_controller import... | [
"flask_cors.CORS",
"application.app.register_blueprint",
"logging.config.dictConfig",
"gevent.monkey.patch_all"
] | [((145, 163), 'gevent.monkey.patch_all', 'monkey.patch_all', ([], {}), '()\n', (161, 163), False, 'from gevent import monkey\n'), ((392, 403), 'flask_cors.CORS', 'CORS', (['admin'], {}), '(admin)\n', (396, 403), False, 'from flask_cors import CORS\n'), ((404, 416), 'flask_cors.CORS', 'CORS', (['client'], {}), '(client)... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
---------------------------------------------... | [
"datamanage.pro.exceptions.CorrectConfigNotExistError",
"common.decorators.params_valid",
"datamanage.pro.dataquality.config.CORRECT_SQL_DATA_TYPES_MAPPINGS.get",
"fastavro.reader",
"json.dumps",
"pyarrow.Table.from_pandas",
"rest_framework.response.Response",
"datamanage.utils.api.DataflowApi.interac... | [((3437, 3491), 'common.decorators.params_valid', 'params_valid', ([], {'serializer': 'CorrectConfigCreateSerializer'}), '(serializer=CorrectConfigCreateSerializer)\n', (3449, 3491), False, 'from common.decorators import list_route, params_valid\n'), ((13611, 13665), 'common.decorators.params_valid', 'params_valid', ([... |
from bush import color
from bush.aws.base import AWSBase
class RDS(AWSBase):
USAGE = """%prog rds <Command> [options]
Commands
* ls
"""
SUB_COMMANDS = ['ls']
def __init__(self, options):
super().__init__(options, 'rds')
def __get_instances_internal(self):
filter_name = ''
... | [
"bush.color.green",
"bush.color.yellow",
"bush.color.red"
] | [((1544, 1562), 'bush.color.green', 'color.green', (['state'], {}), '(state)\n', (1555, 1562), False, 'from bush import color\n'), ((1662, 1678), 'bush.color.red', 'color.red', (['state'], {}), '(state)\n', (1671, 1678), False, 'from bush import color\n'), ((1778, 1797), 'bush.color.yellow', 'color.yellow', (['state'],... |
import datetime
import flask
import markdown
from personal_site import constants, db
from personal_site.forum import utils
class PostFollow(db.Model):
__tablename__ = "post_follow"
id = db.Column(db.Integer, primary_key=True)
user_id = db.Column(db.Integer, db.ForeignKey("user.id"))
post_id = db.Col... | [
"personal_site.forum.utils.safe_html",
"personal_site.db.relationship",
"markdown.markdown",
"datetime.datetime.utcnow",
"flask.url_for",
"personal_site.db.ForeignKey",
"personal_site.db.Column",
"personal_site.db.String",
"datetime.datetime.now"
] | [((198, 237), 'personal_site.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_key=True)\n', (207, 237), False, 'from personal_site import constants, db\n'), ((395, 434), 'personal_site.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_... |
"""Platform Models."""
from marshmallow import fields, Schema
from marshmallow.validate import OneOf
from ..enums import *
from ..models.BaseSchema import BaseSchema
class OtherEntityData(BaseSchema):
# Configuration swagger.json
article_identifier = fields.Str(required=False)
| [
"marshmallow.fields.Str"
] | [((270, 296), 'marshmallow.fields.Str', 'fields.Str', ([], {'required': '(False)'}), '(required=False)\n', (280, 296), False, 'from marshmallow import fields, Schema\n')] |
#!/usr/bin/env python
"""
Subscribes to SourceDestination topic.
Uses MoveIt to compute a trajectory from the target to the destination.
Trajectory is then published to PickAndPlaceTrajectory topic.
"""
import rospy
import math
from builderbot_mycobot.msg import MyCobotMoveitJoints, EulerJoints
from moveit... | [
"rospy.spin",
"rospy.Publisher",
"rospy.init_node",
"rospy.get_caller_id"
] | [((459, 504), 'rospy.init_node', 'rospy.init_node', (['"""Trajectory"""'], {'anonymous': '(True)'}), "('Trajectory', anonymous=True)\n", (474, 504), False, 'import rospy\n'), ((509, 574), 'rospy.Publisher', 'rospy.Publisher', (['"""/mycobot_joints"""', 'MyCobotMoveitJoints', 'callback'], {}), "('/mycobot_joints', MyCob... |
import ast, astunparse, copy
from pprint import pprint
def test_change_callee(tree):
analyzer = Analyzer()
transformer = ChangeCallee("f1", "func1")
analyzer.visit(transformer.visit(tree))
analyzer.report()
def test_replace_var_linear(tree):
analyzer = Analyzer()
transformer = ReplaceVarLinear... | [
"copy.deepcopy",
"ast.Num",
"ast.Add",
"ast.arg",
"ast.Name",
"ast.NameConstant",
"ast.NotEq",
"ast.Expr",
"ast.Eq",
"astunparse.unparse"
] | [((2419, 2438), 'copy.deepcopy', 'copy.deepcopy', (['node'], {}), '(node)\n', (2432, 2438), False, 'import ast, astunparse, copy\n'), ((2456, 2480), 'copy.deepcopy', 'copy.deepcopy', (['node.test'], {}), '(node.test)\n', (2469, 2480), False, 'import ast, astunparse, copy\n'), ((2901, 2920), 'copy.deepcopy', 'copy.deepc... |
# Generated by Django 2.1.11 on 2019-10-07 09:35
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('analysis', '0003_auto_20190909_1400'),
]
operations = [
migrations.AlterUniqueTogether(
name='version',
unique_together={('... | [
"django.db.migrations.AlterUniqueTogether"
] | [((229, 341), 'django.db.migrations.AlterUniqueTogether', 'migrations.AlterUniqueTogether', ([], {'name': '"""version"""', 'unique_together': "{('dependency', 'major', 'minor', 'micro')}"}), "(name='version', unique_together={(\n 'dependency', 'major', 'minor', 'micro')})\n", (259, 341), False, 'from django.db impor... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 26 15:28:50 2021
Some of this code derives from this jupyter notebook
Source: https://gist.github.com/maduranga95/56c8a7c39a00746cec494b07d2886ad7
"""
from Bio import SeqIO
import csv
import hashlib
def debruijnize(k_mers):
nodes = set()
ed... | [
"Bio.SeqIO.parse",
"csv.writer"
] | [((855, 885), 'Bio.SeqIO.parse', 'SeqIO.parse', (['filename', '"""fasta"""'], {}), "(filename, 'fasta')\n", (866, 885), False, 'from Bio import SeqIO\n'), ((1414, 1427), 'csv.writer', 'csv.writer', (['f'], {}), '(f)\n', (1424, 1427), False, 'import csv\n'), ((1648, 1661), 'csv.writer', 'csv.writer', (['f'], {}), '(f)\n... |
import glob, os, pickle, datetime, time, re, pprint
import matplotlib.pyplot as plt
import numpy as np
from src import plotter, graphs
from src.mltoolbox.metrics import METRICS
from src.utils import *
from shutil import copyfile, rmtree
def main():
# SETUP BEGIN
"""
x01 : reg only uniform edges avg on 8 ... | [
"pickle.dump",
"numpy.sum",
"os.makedirs",
"numpy.savetxt",
"os.path.exists",
"re.match",
"time.time",
"src.graphs.generate_n_nodes_graphs_list",
"pprint.PrettyPrinter",
"pickle.load",
"glob.escape",
"numpy.loadtxt",
"shutil.rmtree",
"os.path.join",
"re.compile"
] | [((562, 578), 're.compile', 're.compile', (['""".*"""'], {}), "('.*')\n", (572, 578), False, 'import glob, os, pickle, datetime, time, re, pprint\n'), ((5525, 5604), 'src.graphs.generate_n_nodes_graphs_list', 'graphs.generate_n_nodes_graphs_list', (["setup['n']", 'new_ordered_setup_graphs_names'], {}), "(setup['n'], ne... |
from lib.game_agent import GameAgent
import lib.ocr
import lib.trigonometry
import lib.raycasting
import offshoot
import time
import json
import subprocess
from pprint import pprint
from .helpers.frame_processing import *
class SuperHexagonGameAgent(GameAgent):
def __init__(self, **kwargs):
super().... | [
"subprocess.call",
"pprint.pprint",
"json.dumps",
"time.sleep"
] | [((3251, 3269), 'time.sleep', 'time.sleep', (['(5 / 60)'], {}), '(5 / 60)\n', (3261, 3269), False, 'import time\n'), ((3533, 3552), 'time.sleep', 'time.sleep', (['(10 / 60)'], {}), '(10 / 60)\n', (3543, 3552), False, 'import time\n'), ((7168, 7194), 'subprocess.call', 'subprocess.call', (["['clear']"], {}), "(['clear']... |
import numpy as np
from skimage.metrics import structural_similarity, peak_signal_noise_ratio
import functools
# Data format: H W C
__all__ = [
'psnr',
'ssim',
'sam',
'ergas',
'mpsnr',
'mssim',
'mpsnr_max'
]
def psnr(output, target, data_range=1):
return peak_signal_noise_ratio(targe... | [
"numpy.sum",
"numpy.amax",
"skimage.metrics.structural_similarity",
"numpy.mean",
"numpy.real",
"functools.wraps",
"numpy.log10",
"skimage.metrics.peak_signal_noise_ratio",
"numpy.sqrt"
] | [((291, 353), 'skimage.metrics.peak_signal_noise_ratio', 'peak_signal_noise_ratio', (['target', 'output'], {'data_range': 'data_range'}), '(target, output, data_range=data_range)\n', (314, 353), False, 'from skimage.metrics import structural_similarity, peak_signal_noise_ratio\n'), ((399, 458), 'skimage.metrics.structu... |
# Generated by Django 1.9 on 2016-02-21 18:21
from django.db import migrations
def populate_course_types(apps, _schema_editor):
Course = apps.get_model('evaluation', 'Course')
CourseType = apps.get_model('evaluation', 'CourseType')
for course in Course.objects.all():
course.type = CourseType.obj... | [
"django.db.migrations.RunPython"
] | [((737, 814), 'django.db.migrations.RunPython', 'migrations.RunPython', (['populate_course_types'], {'reverse_code': 'revert_course_types'}), '(populate_course_types, reverse_code=revert_course_types)\n', (757, 814), False, 'from django.db import migrations\n')] |
# _*_ coding: utf-8 _*_
"""
-------------------------------------------------
File Name: fm.py
Description :
Author : ericdoug
date:2021/3/19
-------------------------------------------------
Change Activity:
2021/3/19: created
-------------------------------------------------
"""
from __futu... | [
"recommender.recommender.framework.tf2.layers.hash_layer.HashLayer",
"recommender.recommender.framework.tf2.layers.dense_to_sparsetensor.DenseToSparseTensor",
"tensorflow.random.truncated_normal",
"recommender.recommender.framework.tf2.layers.vocab_layer.VocabLayer",
"recommender.recommender.framework.tf2.l... | [((1501, 1601), 'collections.namedtuple', 'namedtuple', (['"""SparseFeat"""', "['name', 'voc_size', 'hash_size', 'share_embed', 'embed_dim', 'dtype']"], {}), "('SparseFeat', ['name', 'voc_size', 'hash_size', 'share_embed',\n 'embed_dim', 'dtype'])\n", (1511, 1601), False, 'from collections import namedtuple, Ordered... |
import argparse
import pprint
parser = argparse.ArgumentParser(description='argument parser')
# Misc
parser.add_argument('--ckpt_dir', type=str, default='./checkpoints/',
help='path for saving trained models')
parser.add_argument('--ckpt_path', type=str, default='./checkpoints/scacnn-model-10.... | [
"argparse.ArgumentParser"
] | [((40, 94), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""argument parser"""'}), "(description='argument parser')\n", (63, 94), False, 'import argparse\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on %(date)s
@author: <NAME>
"""
import pandas as pd
import numpy as np
from sklearn import preprocessing
from sklearn.model_selection import train_test_split
from sklearn.neural_network import MLPClassifier
from sklearn.metrics import mean_squared_error
# Po... | [
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"imblearn.over_sampling.RandomOverSampler",
"sklearn.preprocessing.normalize",
"sklearn.neural_network.MLPClassifier",
"sklearn.metrics.mean_squared_error",
"numpy.concatenate"
] | [((787, 839), 'pandas.read_csv', 'pd.read_csv', (['"""../../Data/WeatherOutagesAllJerry.csv"""'], {}), "('../../Data/WeatherOutagesAllJerry.csv')\n", (798, 839), True, 'import pandas as pd\n'), ((997, 1052), 'sklearn.model_selection.train_test_split', 'train_test_split', (['data'], {'test_size': '(0.1)', 'random_state'... |
# Generated by Django 2.1.2 on 2018-12-25 03:59
import backend.models.user
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
('conten... | [
"django.db.models.OneToOneField",
"django.db.models.ManyToManyField",
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.EmailField",
"django.db.models.IntegerField",
"django.db.models.DateTimeField",
"djang... | [((10624, 10736), 'django.db.migrations.AlterUniqueTogether', 'migrations.AlterUniqueTogether', ([], {'name': '"""awsenvironmentmodel"""', 'unique_together': "{('aws_account_id', 'deleted')}"}), "(name='awsenvironmentmodel', unique_together=\n {('aws_account_id', 'deleted')})\n", (10654, 10736), False, 'from django.... |
from pathlib import Path
from fhir.resources.codesystem import CodeSystem
from oops_fhir.utils import CodeSystemConcept
__all__ = ["StructureMapModelMode"]
_resource = CodeSystem.parse_file(Path(__file__).with_suffix(".json"))
class StructureMapModelMode:
"""
StructureMapModelMode
How the referenced... | [
"pathlib.Path",
"oops_fhir.utils.CodeSystemConcept"
] | [((474, 676), 'oops_fhir.utils.CodeSystemConcept', 'CodeSystemConcept', (["{'code': 'source', 'definition':\n 'This structure describes an instance passed to the mapping engine that is used a source of data.'\n , 'display': 'Source Structure Definition'}"], {}), "({'code': 'source', 'definition':\n 'This struc... |
from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template
from django.contrib import admin
from internets import urls as internets_urls
from django.conf import settings
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', 'django.views.generic.simple.direct_to_templat... | [
"django.contrib.admin.autodiscover"
] | [((210, 230), 'django.contrib.admin.autodiscover', 'admin.autodiscover', ([], {}), '()\n', (228, 230), False, 'from django.contrib import admin\n')] |
"""
Filename: count_words.py
Date: 2019-07-21
Author: <NAME>
E-mail: <EMAIL>
License:
The code is licensed under MIT License. Please read the LICENSE file in
this distribution for details regarding the licensing of this code.
Description:
Various visualizations by textual analysis of words.
"""
from col... | [
"pandas.read_csv",
"seaborn.barplot",
"matplotlib.pyplot.subplots",
"collections.Counter",
"seaborn.set"
] | [((3723, 3776), 'pandas.read_csv', 'pd.read_csv', (['filepath'], {'na_filter': '(False)', 'thousands': '""","""'}), "(filepath, na_filter=False, thousands=',')\n", (3734, 3776), True, 'import pandas as pd\n'), ((4740, 4793), 'pandas.read_csv', 'pd.read_csv', (['filepath'], {'na_filter': '(False)', 'thousands': '""","""... |
"""资源授权
"""
# -*- coding:utf-8 -*-
#import init_env
import time
from splinter import Browser
from customCompany.resource import Resource
from resourcePlatform.order import Order
from login_web import Loginzxy
class Grant:
"""资源授权
"""
def __init__(self):
self.browser = Browser("chrome")
def d... | [
"customCompany.resource.Resource",
"resourcePlatform.order.Order",
"time.sleep",
"login_web.Loginzxy",
"splinter.Browser"
] | [((292, 309), 'splinter.Browser', 'Browser', (['"""chrome"""'], {}), "('chrome')\n", (299, 309), False, 'from splinter import Browser\n'), ((883, 962), 'login_web.Loginzxy', 'Loginzxy', (['self.browser', '"""https://rastest9.zhixueyun.com"""', '"""admin"""', '"""<PASSWORD>"""'], {}), "(self.browser, 'https://rastest9.z... |
import simplejson as json
from datasets.packaged_modules.elasticsearch.elasticsearch import ElasticsearchBuilder
ca_file = "/Users/gdupont/src/github.com/bigscience-workshop/data-tooling/index_search/ca.cert"
with open(
"/Users/gdupont/src/github.com/bigscience-workshop/data-tooling/index_search/credentials.json"
... | [
"simplejson.load",
"datasets.packaged_modules.elasticsearch.elasticsearch.ElasticsearchBuilder"
] | [((754, 942), 'datasets.packaged_modules.elasticsearch.elasticsearch.ElasticsearchBuilder', 'ElasticsearchBuilder', ([], {'host': 'the_host', 'port': 'the_port', 'es_username': 'username', 'es_psw': 'psw', 'ca_file': 'ca_file', 'es_index_name': 'index_name', 'es_index_config': 'None', 'query': '"""mykje arbeid og slit"... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 26 19:03:06 2021
@author: leonl42
Unit test for testing if punctuation removal works correctly
"""
from scripts.preprocessing.punctuation_remover import PunctuationRemover
from scripts.util import COLUMN_TWEET
import unittest
import pandas as pd
... | [
"unittest.main",
"scripts.preprocessing.punctuation_remover.PunctuationRemover",
"pandas.DataFrame"
] | [((1006, 1021), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1019, 1021), False, 'import unittest\n'), ((460, 474), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (472, 474), True, 'import pandas as pd\n'), ((666, 686), 'scripts.preprocessing.punctuation_remover.PunctuationRemover', 'PunctuationRemover',... |
#!/usr/bin/python
from os import system, listdir
from webbrowser import open
def main():
try:
files = listdir(".")
for i in files:
if i == "manage.py":
system("python manage.py migrate")
system("python manage.py makemigrations salt")
system("python manage.py migrate")
open("http://localhost:200... | [
"webbrowser.open",
"os.system",
"os.listdir"
] | [((106, 118), 'os.listdir', 'listdir', (['"""."""'], {}), "('.')\n", (113, 118), False, 'from os import system, listdir\n'), ((393, 430), 'os.system', 'system', (['"""python ../manage.py migrate"""'], {}), "('python ../manage.py migrate')\n", (399, 430), False, 'from os import system, listdir\n'), ((433, 482), 'os.syst... |
#!/usr/bin/python
##########################################################################
#
# MTraceCheck
# Copyright 2017 The Regents of the University of Michigan
# <NAME> and <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licen... | [
"sys.stdout.write",
"argparse.ArgumentParser",
"parse_weight.parseWeights"
] | [((2386, 2453), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': "('Arguments for %s ' % __file__)"}), "(description='Arguments for %s ' % __file__)\n", (2409, 2453), False, 'import argparse\n'), ((4504, 4548), 'parse_weight.parseWeights', 'parse_weight.parseWeights', (['args.profile_file'], {... |
import os
from pre_push import run_checks
filepath = os.path.dirname(os.path.abspath(__file__))
project_root = os.path.join(filepath, "..")
if __name__ == "__main__":
run_checks(project_root, verbose=True)
| [
"os.path.abspath",
"os.path.join",
"pre_push.run_checks"
] | [((112, 140), 'os.path.join', 'os.path.join', (['filepath', '""".."""'], {}), "(filepath, '..')\n", (124, 140), False, 'import os\n'), ((70, 95), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (85, 95), False, 'import os\n'), ((173, 211), 'pre_push.run_checks', 'run_checks', (['project_root']... |
from typing import List, Tuple
import pytest
from reparsec import Parser
from reparsec.sequence import sym
a = sym("a")
b = sym("b")
c = sym("c")
d = sym("d")
e = sym("e")
f = sym("f")
g = sym("g")
h = sym("h")
comma = sym(",")
DATA_POSITIVE: List[
Tuple[Parser[str, Tuple[str, ...]], str, Tuple[str, ...]]
] = [... | [
"pytest.mark.parametrize",
"reparsec.sequence.sym"
] | [((114, 122), 'reparsec.sequence.sym', 'sym', (['"""a"""'], {}), "('a')\n", (117, 122), False, 'from reparsec.sequence import sym\n'), ((127, 135), 'reparsec.sequence.sym', 'sym', (['"""b"""'], {}), "('b')\n", (130, 135), False, 'from reparsec.sequence import sym\n'), ((140, 148), 'reparsec.sequence.sym', 'sym', (['"""... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'plotConfigTemplate.ui'
#
# Created: Sat Apr 21 14:42:02 2012
# by: PyQt4 UI code generator 4.8.5
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
exc... | [
"PyQt4.QtGui.QGroupBox",
"PyQt4.QtGui.QApplication.translate",
"PyQt4.QtGui.QSpinBox",
"PyQt4.QtGui.QCheckBox",
"PyQt4.QtGui.QGridLayout",
"PyQt4.QtGui.QLabel",
"PyQt4.QtGui.QHBoxLayout",
"PyQt4.QtGui.QSlider",
"PyQt4.QtCore.QMetaObject.connectSlotsByName",
"PyQt4.QtGui.QVBoxLayout",
"PyQt4.QtGu... | [((637, 658), 'PyQt4.QtGui.QGroupBox', 'QtGui.QGroupBox', (['Form'], {}), '(Form)\n', (652, 658), False, 'from PyQt4 import QtCore, QtGui\n'), ((1298, 1334), 'PyQt4.QtGui.QGridLayout', 'QtGui.QGridLayout', (['self.averageGroup'], {}), '(self.averageGroup)\n', (1315, 1334), False, 'from PyQt4 import QtCore, QtGui\n'), (... |
import uuid
from arjuna.interact.gui.gom.impl.namestore import GuiNameStore
from arjuna.interact.gui.gom.impl.gui import Gui
from arjuna.tpi.enums import ArjunaOption
class GuiHandlerManager:
def __init__(self, project_config):
self.__name_store = GuiNameStore()
self.__namespace_dir = project_conf... | [
"arjuna.interact.gui.gom.impl.gui.Gui",
"arjuna.interact.gui.gom.impl.namestore.GuiNameStore"
] | [((262, 276), 'arjuna.interact.gui.gom.impl.namestore.GuiNameStore', 'GuiNameStore', ([], {}), '()\n', (274, 276), False, 'from arjuna.interact.gui.gom.impl.namestore import GuiNameStore\n'), ((1292, 1385), 'arjuna.interact.gui.gom.impl.gui.Gui', 'Gui', (['self.__name_store', 'self.__namespace_dir', 'automator_handler.... |
import logging
import sys
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from profess.Http_commands import Http_commands
import os
from data_management.utils import Utils
from plotter.comparison import Comparison
logging.basicConfig(format='%(asctime)s %(levelname)s %(... | [
"seaborn.set_style",
"seaborn.lineplot",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.show",
"pandas.DataFrame.from_dict",
"logging.basicConfig",
"os.path.join",
"matplotlib.pyplot.legend",
"os.walk",
"data_management.utils.Utils",
"profess.Http_commands.Http_commands",
"matplotlib.pyplot.f... | [((264, 367), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s %(levelname)s %(name)s: %(message)s"""', 'level': 'logging.DEBUG'}), "(format=\n '%(asctime)s %(levelname)s %(name)s: %(message)s', level=logging.DEBUG)\n", (283, 367), False, 'import logging\n'), ((372, 399), 'logging.getLog... |
from swsscommon import swsscommon
import time
import os
def test_PortNotification(dvs):
dvs.runcmd("ifconfig Ethernet0 10.0.0.0/31 up") == 0
dvs.runcmd("ifconfig Ethernet4 10.0.0.2/31 up") == 0
dvs.servers[0].runcmd("ip link set down dev eth0") == 0
time.sleep(1)
db = swsscommon.DBConnector(0, ... | [
"swsscommon.swsscommon.DBConnector",
"swsscommon.swsscommon.Table",
"time.sleep"
] | [((270, 283), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (280, 283), False, 'import time\n'), ((294, 338), 'swsscommon.swsscommon.DBConnector', 'swsscommon.DBConnector', (['(0)', 'dvs.redis_sock', '(0)'], {}), '(0, dvs.redis_sock, 0)\n', (316, 338), False, 'from swsscommon import swsscommon\n'), ((350, 384), '... |
import os, sys
from PIL import Image
sizes = [1024, 180, 167, 152, 120, 87, 80, 76, 60, 58, 40, 29, 20]
def _get_out_path(in_path, dim):
directory, filename = os.path.split(in_path)
filenames = filename.split('_')
filename = "{0}_{1}.png".format(filenames[0], dim)
out_path = os.path.join(directory, filename)
ret... | [
"os.path.split",
"os.path.join",
"PIL.Image.open"
] | [((162, 184), 'os.path.split', 'os.path.split', (['in_path'], {}), '(in_path)\n', (175, 184), False, 'import os, sys\n'), ((282, 315), 'os.path.join', 'os.path.join', (['directory', 'filename'], {}), '(directory, filename)\n', (294, 315), False, 'import os, sys\n'), ((413, 432), 'PIL.Image.open', 'Image.open', (['in_pa... |
#!/usr/bin/env python3
import time
import unittest
import rostest
import rospy
import actionlib
import move_base_msgs.msg
from geometry_msgs.msg import PoseStamped
from araig_msgs.msg import BoolStamped
import concurrent.futures
class MockActionServer():
_feedback = move_base_msgs.msg.MoveBaseFeedback()
_resu... | [
"geometry_msgs.msg.PoseStamped",
"rospy.Subscriber",
"rospy.Time.now",
"rostest.rosrun",
"rospy.Publisher",
"rospy.sleep",
"time.sleep",
"rospy.get_param",
"araig_msgs.msg.BoolStamped",
"rospy.loginfo",
"rospy.init_node",
"actionlib.SimpleActionServer",
"rospy.has_param"
] | [((2901, 2947), 'rostest.rosrun', 'rostest.rosrun', (['pkg', 'name', 'TestGoalInterpreter'], {}), '(pkg, name, TestGoalInterpreter)\n', (2915, 2947), False, 'import rostest\n'), ((444, 577), 'actionlib.SimpleActionServer', 'actionlib.SimpleActionServer', (['self._action_name', 'move_base_msgs.msg.MoveBaseAction'], {'ex... |
from __future__ import print_function, absolute_import, division, unicode_literals
from pyanalyze.name_check_visitor import NameCheckVisitor
if __name__ == "__main__":
NameCheckVisitor.main()
| [
"pyanalyze.name_check_visitor.NameCheckVisitor.main"
] | [((174, 197), 'pyanalyze.name_check_visitor.NameCheckVisitor.main', 'NameCheckVisitor.main', ([], {}), '()\n', (195, 197), False, 'from pyanalyze.name_check_visitor import NameCheckVisitor\n')] |
import collections
import gevent
from gevent.pywsgi import ( # noqa: F401
WSGIServer,
)
from gevent import ( # noqa: F401
subprocess,
socket,
threading,
)
import pylru
from geventhttpclient import HTTPClient
from web3.utils.six import urlparse
_client_cache = pylru.lrucache(8)
sleep = gevent.s... | [
"geventhttpclient.HTTPClient",
"web3.utils.six.urlparse",
"pylru.lrucache",
"gevent.pywsgi.WSGIServer",
"gevent.sleep"
] | [((284, 301), 'pylru.lrucache', 'pylru.lrucache', (['(8)'], {}), '(8)\n', (298, 301), False, 'import pylru\n'), ((581, 635), 'gevent.pywsgi.WSGIServer', 'WSGIServer', (['(host, port)', 'application', '*args'], {}), '((host, port), application, *args, **kwargs)\n', (591, 635), False, 'from gevent.pywsgi import WSGIServe... |
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
#
# 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 us... | [
"numpy.random.randn",
"numpy.cross",
"numpy.sin",
"numpy.linalg.norm",
"numpy.array",
"numpy.cos",
"numpy.arccos"
] | [((1393, 1433), 'numpy.array', 'np.array', (['[each[0][0] for each in batch]'], {}), '([each[0][0] for each in batch])\n', (1401, 1433), True, 'import numpy as np\n'), ((1480, 1520), 'numpy.array', 'np.array', (['[each[0][1] for each in batch]'], {}), '([each[0][1] for each in batch])\n', (1488, 1520), True, 'import nu... |
# Copyright (c) 2021, Firsterp and contributors
# For license information, please see license.txt
import frappe
from frappe.utils import date_diff, add_months, today, getdate, add_days, flt, get_last_day, get_first_day, cint, get_link_to_form, rounded, add_to_date, get_first_day_of_week
from frappe import _ , scrub
fr... | [
"dateutil.relativedelta.MO",
"frappe.msgprint",
"frappe.utils.add_days",
"frappe.utils.get_first_day_of_week",
"frappe.utils.getdate",
"frappe.utils.add_to_date",
"frappe.utils.get_first_day",
"frappe.new_doc",
"frappe.publish_realtime",
"erpnext.accounts.utils.get_fiscal_year",
"frappe._"
] | [((2296, 2355), 'frappe.publish_realtime', 'frappe.publish_realtime', (['"""msgprint"""', '"""Starting long job..."""'], {}), "('msgprint', 'Starting long job...')\n", (2319, 2355), False, 'import frappe\n'), ((2358, 2387), 'frappe.msgprint', 'frappe.msgprint', (['"""Enqueing.."""'], {}), "('Enqueing..')\n", (2373, 238... |
import sys; sys.path.append('../..')
from utils.helpers import get_parsed_data, get_sampled_data, get_labelled_data, get_cleaned_labelled_data, find_folder, get_uploaded_batched_data, get_batched_sample_data
import pandas as pd
import numpy as np
import os
from datetime import datetime
import time
from random import ra... | [
"sys.path.append",
"pandas.DataFrame",
"os.mkdir",
"os.listdir",
"utils.helpers.find_folder",
"random.randint",
"os.path.isdir",
"time.strftime",
"datetime.datetime.now",
"datetime.datetime.strptime",
"utils.helpers.get_batched_sample_data",
"utils.helpers.get_labelled_data",
"utils.helpers.... | [((12, 36), 'sys.path.append', 'sys.path.append', (['"""../.."""'], {}), "('../..')\n", (27, 36), False, 'import sys\n'), ((419, 446), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (436, 446), False, 'import logging\n'), ((11067, 11247), 'utils.helpers.get_parsed_data', 'get_parsed_data'... |
import io
from typing import Iterator, Optional
from config import *
from utils import create_client_engine
class StringIteratorIO(io.TextIOBase):
def __init__(self, iter: Iterator[str]):
self._iter = iter
self._buff = ""
def readable(self) -> bool:
return True
def _read1(self, ... | [
"utils.create_client_engine"
] | [((1240, 1262), 'utils.create_client_engine', 'create_client_engine', ([], {}), '()\n', (1260, 1262), False, 'from utils import create_client_engine\n')] |
# coding=utf-8
# Copyright 2018 The DisentanglementLib 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
#
# Un... | [
"numpy.stack",
"cv2.circle",
"six.moves.range",
"numpy.float32",
"numpy.zeros",
"cv2.warpAffine",
"numpy.sin",
"numpy.arange",
"numpy.cos",
"gin.configurable",
"numpy.sqrt"
] | [((1125, 1156), 'gin.configurable', 'gin.configurable', (['"""translation"""'], {}), "('translation')\n", (1141, 1156), False, 'import gin\n'), ((1005, 1022), 'numpy.zeros', 'np.zeros', (['x.shape'], {}), '(x.shape)\n', (1013, 1022), True, 'import numpy as np\n'), ((1097, 1107), 'numpy.sqrt', 'np.sqrt', (['(3)'], {}), ... |
import PyQt5
import os
import imutils
import cv2
import numpy as np
from PIL import Image as im
from PyQt5 import QtWidgets, uic, QtGui
from PyQt5.QtGui import QGuiApplication
import sys
#Image augmentation GUI App
def contour_crop_no_resize(image,dim):
'''
Contour and crop the image (generally... | [
"cv2.GaussianBlur",
"os.walk",
"numpy.ones",
"PyQt5.uic.loadUi",
"cv2.warpAffine",
"PyQt5.QtWidgets.QApplication",
"cv2.erode",
"cv2.getRotationMatrix2D",
"cv2.subtract",
"cv2.filter2D",
"cv2.dilate",
"cv2.cvtColor",
"os.path.exists",
"cv2.resize",
"PyQt5.QtGui.QPixmap",
"imutils.grab_... | [((38929, 38961), 'PyQt5.QtWidgets.QApplication', 'QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (38951, 38961), False, 'from PyQt5 import QtWidgets, uic, QtGui\n'), ((422, 474), 'cv2.resize', 'cv2.resize', (['image', 'dim'], {'interpolation': 'cv2.INTER_AREA'}), '(image, dim, interpolation=cv2.INTER_ARE... |
import logging
import sys
from enum import Enum
class LogLevel(Enum):
DEBUG = 1
INFO = 2
WARNING = 3
ERROR = 4
FATAL = 5
logger = logging.getLogger("plenigo")
def log_message(log_level: LogLevel, message: str):
if log_level == LogLevel.DEBUG:
print(message, file=sys.stderr)
... | [
"logging.getLogger"
] | [((154, 182), 'logging.getLogger', 'logging.getLogger', (['"""plenigo"""'], {}), "('plenigo')\n", (171, 182), False, 'import logging\n')] |
#!/usr/bin/env python3
# flake8: noqa: E501
import os
from pathlib import Path
from subprocess import check_call
def call(command: str) -> int:
print(f'calling: "{command}"')
return check_call(command, shell=True)
def clone_or_update_git_repo(url: str, path: str) -> None:
if not Path(path).expanduser(... | [
"os.environ.get",
"pathlib.Path",
"pathlib.Path.home",
"subprocess.check_call"
] | [((194, 225), 'subprocess.check_call', 'check_call', (['command'], {'shell': '(True)'}), '(command, shell=True)\n', (204, 225), False, 'from subprocess import check_call\n'), ((564, 586), 'os.environ.get', 'os.environ.get', (['"""PASS"""'], {}), "('PASS')\n", (578, 586), False, 'import os\n'), ((2767, 2778), 'pathlib.P... |
# chemspi Local DB Class
import pandas as pd
from chemspipy import ChemSpider
class ChemspiLocalDB:
compound_name_column_label = 'Name'
def __init__(self, filename):
self.database = pd.read_excel(filename)
self.db_names = self.database.loc[:,self.compound_name_column_label].copy().str.lower().so... | [
"pandas.read_excel"
] | [((198, 221), 'pandas.read_excel', 'pd.read_excel', (['filename'], {}), '(filename)\n', (211, 221), True, 'import pandas as pd\n')] |
import torch
from torch.distributions import RelaxedOneHotCategorical, Categorical, kl_divergence, register_kl
@register_kl(RelaxedOneHotCategorical, RelaxedOneHotCategorical)
def kl_relaxed_one_hot_categorical(p, q):
p = Categorical(probs=p.probs)
q = Categorical(probs=q.probs)
return kl_divergence(p, q)
| [
"torch.distributions.register_kl",
"torch.distributions.Categorical",
"torch.distributions.kl_divergence"
] | [((113, 176), 'torch.distributions.register_kl', 'register_kl', (['RelaxedOneHotCategorical', 'RelaxedOneHotCategorical'], {}), '(RelaxedOneHotCategorical, RelaxedOneHotCategorical)\n', (124, 176), False, 'from torch.distributions import RelaxedOneHotCategorical, Categorical, kl_divergence, register_kl\n'), ((225, 251)... |
import sys
import xml.etree.ElementTree as ET
import re
import io
import os
import copy
import datetime
import zlib
import argparse
#import pdfkit
from shutil import copyfile
from mako.template import Template
import pkgutil
import polypacket
import subprocess
import yaml
sizeDict = {
"uint8" :... | [
"xml.etree.ElementTree.parse",
"yaml.load",
"io.StringIO",
"os.path.basename",
"copy.copy",
"os.path.splitext",
"re.search",
"zlib.crc32"
] | [((15727, 15744), 'xml.etree.ElementTree.parse', 'ET.parse', (['xmlfile'], {}), '(xmlfile)\n', (15735, 15744), True, 'import xml.etree.ElementTree as ET\n'), ((15910, 15935), 'os.path.basename', 'os.path.basename', (['xmlfile'], {}), '(xmlfile)\n', (15926, 15935), False, 'import os\n'), ((21255, 21294), 'yaml.load', 'y... |
"""Testing for Showalter Index only. While MetPy handles all five parameters,
the Showalter Index was contributed to MetPy by the GeoCAT team because of the
skewt_params function. Additionally, a discrepancy between NCL and MetPy
calculations of CAPE has been identified. After validating the CAPE value by
hand using th... | [
"metpy.calc.parcel_profile",
"xarray.open_dataset",
"geocat.datafiles.get",
"geocat.comp.showalter_index",
"geocat.comp.get_skewt_vars",
"numpy.testing.assert_equal",
"numpy.round"
] | [((1864, 1885), 'numpy.round', 'np.round', (["out['Shox']"], {}), "(out['Shox'])\n", (1872, 1885), True, 'import numpy as np\n'), ((1207, 1247), 'geocat.datafiles.get', 'gdf.get', (['"""ascii_files/sounding.testdata"""'], {}), "('ascii_files/sounding.testdata')\n", (1214, 1247), True, 'import geocat.datafiles as gdf\n'... |
"""
Module for dealing with combined features
"""
from __future__ import absolute_import
import pandas as pd
from . import correlation_convertion
from . import wavelet_classification
def load(segment_files, **kwargs):
"""Loads the multiple features from segment_files and concatenate them to a single dataframe. T... | [
"pandas.concat"
] | [((1017, 1046), 'pandas.concat', 'pd.concat', (['dataframes'], {'axis': '(1)'}), '(dataframes, axis=1)\n', (1026, 1046), True, 'import pandas as pd\n')] |
import argparse
import os
import shutil
import utils_bg
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"--fg_type",
"-fg_type",
default="frame",
choices=["frame", "logo"],
type=str,
help="frame or logo",
)
parser.add_ar... | [
"os.mkdir",
"argparse.ArgumentParser",
"os.path.isdir",
"shutil.rmtree",
"utils_bg.Synthesizer"
] | [((97, 122), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (120, 122), False, 'import argparse\n'), ((1104, 1135), 'os.path.isdir', 'os.path.isdir', (['args.save_bg_dir'], {}), '(args.save_bg_dir)\n', (1117, 1135), False, 'import os\n'), ((1206, 1232), 'os.mkdir', 'os.mkdir', (['args.save_bg_d... |
import calendar
import matplotlib.pyplot as plt
calendar.setfirstweekday(6) # Sunday is 1st day in US
w_days = 'Sun Mon Tue Wed Thu Fri Sat'.split()
m_names = 'January February March April May June July August September October November December'.split()
class MplCalendar(object):
def __init__(self, year, month):... | [
"calendar.monthcalendar",
"calendar.setfirstweekday",
"matplotlib.pyplot.show"
] | [((49, 76), 'calendar.setfirstweekday', 'calendar.setfirstweekday', (['(6)'], {}), '(6)\n', (73, 76), False, 'import calendar\n'), ((392, 427), 'calendar.monthcalendar', 'calendar.monthcalendar', (['year', 'month'], {}), '(year, month)\n', (414, 427), False, 'import calendar\n'), ((2385, 2395), 'matplotlib.pyplot.show'... |
# INCOMPLETE
# uncomment the evaluate script
# # read the log.txt and extract the rewards per episode
# script to run the models for eval for 1000 episodes
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
df = pd.read_csv('returns_MiniGrid-DistShift2-v0', header=None)
df = df.sort_values(by=0, ig... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.clf",
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.savefig"
] | [((233, 291), 'pandas.read_csv', 'pd.read_csv', (['"""returns_MiniGrid-DistShift2-v0"""'], {'header': 'None'}), "('returns_MiniGrid-DistShift2-v0', header=None)\n", (244, 291), True, 'import pandas as pd\n'), ((368, 377), 'matplotlib.pyplot.clf', 'plt.clf', ([], {}), '()\n', (375, 377), True, 'import matplotlib.pyplot ... |
"""
Collection of constants tuples
"""
__author__ = '<NAME>'
from types import MappingProxyType
# dicts:
EVENT_SERVICE_JOB_TYPES = MappingProxyType({
1: 'eventservice',
2: 'esmerge',
3: 'clone',
4: 'jumbo',
5: 'cojumbo',
})
# lists
JOB_STATES = (
'pending',
'defined',
'waiting',
... | [
"types.MappingProxyType"
] | [((134, 237), 'types.MappingProxyType', 'MappingProxyType', (["{(1): 'eventservice', (2): 'esmerge', (3): 'clone', (4): 'jumbo', (5):\n 'cojumbo'}"], {}), "({(1): 'eventservice', (2): 'esmerge', (3): 'clone', (4):\n 'jumbo', (5): 'cojumbo'})\n", (150, 237), False, 'from types import MappingProxyType\n')] |
import grblas
import numba
import numpy as np
from typing import Union, Tuple
from .container import Flat, Pivot
from .schema import SchemaMismatchError
from .oputils import jitted_op
class SizeMismatchError(Exception):
pass
# Sentinel to indicate the fill values come from the object to which we are aligning
_f... | [
"grblas.Vector.new",
"numpy.zeros",
"grblas.Matrix.new",
"grblas.dtypes.lookup_dtype",
"grblas.Matrix.from_values"
] | [((7765, 7834), 'grblas.Matrix.from_values', 'grblas.Matrix.from_values', (['index', 'index', 'vals'], {'nrows': 'size', 'ncols': 'size'}), '(index, index, vals, nrows=size, ncols=size)\n', (7790, 7834), False, 'import grblas\n'), ((9584, 9635), 'grblas.Matrix.new', 'grblas.Matrix.new', (['x.vector.dtype', 'x.vector.si... |
"""
Definice mapování URL na jednotlivá view.
"""
from django.conf import settings
from django.contrib.staticfiles.storage import staticfiles_storage
from django.urls import include, path, re_path
from django.views.generic import TemplateView
from django.views.generic.base import RedirectView
from rest_framework.schema... | [
"django.views.generic.TemplateView.as_view",
"rest_framework.schemas.get_schema_view",
"django.contrib.staticfiles.storage.staticfiles_storage.url",
"django.urls.include"
] | [((401, 420), 'django.urls.include', 'include', (['"""api.urls"""'], {}), "('api.urls')\n", (408, 420), False, 'from django.urls import include, path, re_path\n'), ((631, 806), 'rest_framework.schemas.get_schema_view', 'get_schema_view', ([], {'title': '"""ÚPadmin API"""', 'description': '"""Dokumentace *REST API* pro ... |
import torch
import librosa
import numpy as np
import mlflow.pytorch
import torch.nn.functional as F
import matplotlib.pyplot as plt
from librosa.feature import mfcc
def predict(model, x):
n_mfcc = 40
sample_rate = 22050
mel_coefficients = mfcc(x, sample_rate, n_mfcc=n_mfcc)
time_frames = mel_coeff... | [
"numpy.pad",
"numpy.stack",
"matplotlib.pyplot.show",
"numpy.ceil",
"torch.argmax",
"torch.FloatTensor",
"matplotlib.pyplot.subplots",
"numpy.split",
"torch.squeeze",
"librosa.load",
"torch.reshape",
"librosa.feature.mfcc"
] | [((257, 292), 'librosa.feature.mfcc', 'mfcc', (['x', 'sample_rate'], {'n_mfcc': 'n_mfcc'}), '(x, sample_rate, n_mfcc=n_mfcc)\n', (261, 292), False, 'from librosa.feature import mfcc\n'), ((443, 505), 'numpy.pad', 'np.pad', (['mel_coefficients', '((0, 0), (0, pad_size))'], {'mode': '"""wrap"""'}), "(mel_coefficients, ((... |
#!/usr/bin/env python
import os
import pprint
import xml.dom.minidom
_MIN_PROJECT_ID = 0
_MAX_PROJECT_ID = 255
_MIN_FEATURE_ID = 0
_MAX_FEATURE_ID = 255
_MIN_CLASS_ID = 0
_MAX_CLASS_ID = 255
_MIN_CMD_ID = 0
_MAX_CMD_ID = 65535
_FTR_GEN = 'generic'
#=================================================================... | [
"os.path.realpath",
"pprint.pformat",
"os.path.join",
"os.listdir"
] | [((40814, 40839), 'os.path.join', 'os.path.join', (['path', '"""xml"""'], {}), "(path, 'xml')\n", (40826, 40839), False, 'import os\n'), ((40775, 40801), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (40791, 40801), False, 'import os\n'), ((40889, 40922), 'os.path.join', 'os.path.join', ([... |
# Copyright (c) 2015 <NAME>
# See the file LICENSE for copying permission.
import re
from . import common
from ...systems import service
class InitctlListStdoutLog(common.Log):
# tty5 start/running, process 856
# passwd stop/waiting
# network-interface-security (networking) start/running
line_re = re.... | [
"re.compile"
] | [((317, 386), 're.compile', 're.compile', (['"""^(\\\\S+) (?:(\\\\S+) )?(\\\\S+)/(\\\\S+)(?:, process (\\\\d+))?$"""'], {}), "('^(\\\\S+) (?:(\\\\S+) )?(\\\\S+)/(\\\\S+)(?:, process (\\\\d+))?$')\n", (327, 386), False, 'import re\n'), ((430, 462), 're.compile', 're.compile', (['"""^\t\\\\S+ \\\\S+ \\\\d+$"""'], {}), "(... |
from pathlib import Path
import os
import pandas as pd
import numpy as np
def get_country_geolocation():
dir_path = os.path.dirname(os.path.realpath(__file__))
country_mapping = pd.read_csv(
dir_path + '/data_files/country_centroids_az8.csv', dtype=str)
country_mapping = country_mapping.iloc[:, [... | [
"pandas.read_csv",
"os.path.realpath",
"pandas.read_excel",
"pathlib.Path",
"pandas.melt",
"pandas.isna",
"os.path.join"
] | [((189, 263), 'pandas.read_csv', 'pd.read_csv', (["(dir_path + '/data_files/country_centroids_az8.csv')"], {'dtype': 'str'}), "(dir_path + '/data_files/country_centroids_az8.csv', dtype=str)\n", (200, 263), True, 'import pandas as pd\n'), ((749, 819), 'pandas.read_csv', 'pd.read_csv', (["(dir_path + '/data_files/countr... |
import numpy as np
from sklearn.preprocessing import Imputer, StandardScaler
from matplotlib import pyplot as plt
data = np.load('sample.npy')
# Plot raw data.
plt.figure(1)
plt.plot(data)
# Impute missing values.
imputer = Imputer()
data = imputer.fit_transform(data)
plt.figure(2)
plt.plot(data)
# Scale data.
sca... | [
"numpy.load",
"sklearn.preprocessing.StandardScaler",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"sklearn.preprocessing.Imputer",
"matplotlib.pyplot.figure"
] | [((122, 143), 'numpy.load', 'np.load', (['"""sample.npy"""'], {}), "('sample.npy')\n", (129, 143), True, 'import numpy as np\n'), ((162, 175), 'matplotlib.pyplot.figure', 'plt.figure', (['(1)'], {}), '(1)\n', (172, 175), True, 'from matplotlib import pyplot as plt\n'), ((176, 190), 'matplotlib.pyplot.plot', 'plt.plot',... |
# Copyright 2017-2019 typed_python Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
"typed_python.compiler.native_ast.Type.Void",
"typed_python.compiler.python_object_representation.pythonObjectRepresentation"
] | [((1081, 1103), 'typed_python.compiler.native_ast.Type.Void', 'native_ast.Type.Void', ([], {}), '()\n', (1101, 1103), True, 'import typed_python.compiler.native_ast as native_ast\n'), ((1536, 1558), 'typed_python.compiler.native_ast.Type.Void', 'native_ast.Type.Void', ([], {}), '()\n', (1556, 1558), True, 'import typed... |
#!/usr/bin/python3
import sys
import cgi
import cgitb
import json
import cgicommon
def send_error_reply(description):
reply = dict()
reply["success"] = False
reply["description"] = description
json.dump(reply, sys.stdout)
cgitb.enable()
cgicommon.writeln("Content-Type: application/json; charset=utf-... | [
"json.dump",
"cgitb.enable",
"cgi.FieldStorage",
"cgicommon.writeln",
"countdowntourney.tourney_open",
"cgicommon.set_module_path",
"sys.exit"
] | [((241, 255), 'cgitb.enable', 'cgitb.enable', ([], {}), '()\n', (253, 255), False, 'import cgitb\n'), ((257, 323), 'cgicommon.writeln', 'cgicommon.writeln', (['"""Content-Type: application/json; charset=utf-8"""'], {}), "('Content-Type: application/json; charset=utf-8')\n", (274, 323), False, 'import cgicommon\n'), ((3... |
import connexion
import psycopg2
import six
import os
from swagger_server.models.accident import Accident # noqa: E501
from swagger_server.models.api_response import ApiResponse # noqa: E501
from swagger_server import util
def accident_delete(body): # noqa: E501
"""Delete a record of an accident
# noqa:... | [
"swagger_server.models.api_response.ApiResponse",
"connexion.request.get_json",
"swagger_server.models.accident.Accident",
"psycopg2.connect"
] | [((1054, 1117), 'swagger_server.models.api_response.ApiResponse', 'ApiResponse', ([], {'code': '(200)', 'type': '"""Good"""', 'message': '"""Successful delete"""'}), "(code=200, type='Good', message='Successful delete')\n", (1065, 1117), False, 'from swagger_server.models.api_response import ApiResponse\n'), ((635, 679... |
# Generated by Django 2.1.4 on 2019-02-26 02:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('poll', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='IFrameEnabledSites',
fields=[
... | [
"django.db.models.CharField",
"django.db.models.AutoField",
"django.db.models.BooleanField",
"django.db.models.EmailField"
] | [((714, 775), 'django.db.models.EmailField', 'models.EmailField', ([], {'db_index': '(True)', 'max_length': '(100)', 'unique': '(True)'}), '(db_index=True, max_length=100, unique=True)\n', (731, 775), False, 'from django.db import migrations, models\n'), ((328, 421), 'django.db.models.AutoField', 'models.AutoField', ([... |
import json
import time
class Version:
def __init__(self, version: str, remote_path: str):
self.version = version
self.remote = remote_path
self.part_files = []
self.properties = {}
self.transforms = []
self.time = time.time()
def add_part_file(self, remote_pa... | [
"json.loads",
"json.dumps",
"time.time"
] | [((270, 281), 'time.time', 'time.time', ([], {}), '()\n', (279, 281), False, 'import time\n'), ((2529, 2567), 'json.dumps', 'json.dumps', (["{'versions': version_dict}"], {}), "({'versions': version_dict})\n", (2539, 2567), False, 'import json\n'), ((2665, 2685), 'json.loads', 'json.loads', (['json_str'], {}), '(json_s... |
import logging
from parse import Parse
if __name__ == '__main__':
logging.basicConfig(level="DEBUG",
filename="/var/log/dp_more.log",
format="%(asctime)s[%(levelname)s][%(filename)s.%(funcName)s]%(message)s")
Parse().parse_all_info()
| [
"parse.Parse",
"logging.basicConfig"
] | [((71, 218), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': '"""DEBUG"""', 'filename': '"""/var/log/dp_more.log"""', 'format': '"""%(asctime)s[%(levelname)s][%(filename)s.%(funcName)s]%(message)s"""'}), "(level='DEBUG', filename='/var/log/dp_more.log', format=\n '%(asctime)s[%(levelname)s][%(filename)s... |
from adventofcode.utils import open_input
def main():
data = open_input('adventofcode/_2015/day2/input.txt')
answer_1, answer_2 = get_answer(data)
print(answer_1, answer_2)
return answer_1, answer_2
def get_answer(data):
total_wrapping_paper_required = total_ribbon_required = 0
for packag... | [
"adventofcode.utils.open_input"
] | [((67, 114), 'adventofcode.utils.open_input', 'open_input', (['"""adventofcode/_2015/day2/input.txt"""'], {}), "('adventofcode/_2015/day2/input.txt')\n", (77, 114), False, 'from adventofcode.utils import open_input\n')] |
from behave import given, when, then, step
from kss.util import command
# MARK: Internal Utilities
def _find_file_match(pattern: str) -> str:
files = []
for line in command.process("find dist -name '%s'" % pattern):
files.append(line)
if len(files) == 0:
raise RuntimeError("Could not find ... | [
"kss.util.command.process",
"behave.when",
"behave.then"
] | [((664, 707), 'behave.when', 'when', (['u"""we build the installation packages"""'], {}), "(u'we build the installation packages')\n", (668, 707), False, 'from behave import given, when, then, step\n'), ((759, 820), 'behave.then', 'then', (['u"""the source distribution should include the resources"""'], {}), "(u'the so... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^join/$', views.join, name="players-join"),
url(r'^leave/([1-4])$', views.leave, name="players-leave"),
]
| [
"django.conf.urls.url"
] | [((75, 122), 'django.conf.urls.url', 'url', (['"""^join/$"""', 'views.join'], {'name': '"""players-join"""'}), "('^join/$', views.join, name='players-join')\n", (78, 122), False, 'from django.conf.urls import url\n'), ((129, 186), 'django.conf.urls.url', 'url', (['"""^leave/([1-4])$"""', 'views.leave'], {'name': '"""pl... |
# Copyright (c) 2021 <NAME>
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
import os
from pathlib import Path
import pytest
from rainbow.util import VID_FILE_EXT, load_nd2_imgs, load_std_imgs, save_video
from tests import IMG_SER_DIR, ND2_PATH
@pytest.fixture
def axs_con... | [
"os.walk",
"rainbow.util.load_nd2_imgs",
"pathlib.Path",
"rainbow.util.load_std_imgs",
"os.path.join"
] | [((487, 516), 'rainbow.util.load_std_imgs', 'load_std_imgs', (['IMG_SER_DIR', '(1)'], {}), '(IMG_SER_DIR, 1)\n', (500, 516), False, 'from rainbow.util import VID_FILE_EXT, load_nd2_imgs, load_std_imgs, save_video\n'), ((809, 844), 'rainbow.util.load_nd2_imgs', 'load_nd2_imgs', (['ND2_PATH', 'axs_config'], {}), '(ND2_PA... |
from fastapi import APIRouter, Depends, Header, HTTPException, status
from ..database import Models, crud
from app.database.conn import get_db
from sqlalchemy.orm import Session
from sqlalchemy.exc import SQLAlchemyError
from typing import List, Union
from ..util import convert_date, token_verification, create_api_toke... | [
"fastapi.HTTPException",
"fastapi.Header",
"fastapi.Depends",
"fastapi.APIRouter"
] | [((333, 394), 'fastapi.APIRouter', 'APIRouter', ([], {'prefix': '"""/record"""', 'tags': "['Record']", 'dependencies': '[]'}), "(prefix='/record', tags=['Record'], dependencies=[])\n", (342, 394), False, 'from fastapi import APIRouter, Depends, Header, HTTPException, status\n'), ((2057, 2072), 'fastapi.Depends', 'Depen... |
# 3rd party modules
import gym
import numpy as np
import subprocess
import os
from gym import spaces
from basilisk_env.simulators import opNavSimulator
class opNavEnv(gym.Env):
"""
OpNav scenario. The spacecraft must decide when to point at the ground (which generates a
reward) versus pointing at the su... | [
"numpy.random.seed",
"basilisk_env.simulators.opNavSimulator.scenario_OpNav",
"gym.spaces.Discrete",
"numpy.zeros",
"numpy.array",
"gym.spaces.Box",
"numpy.linalg.norm"
] | [((1050, 1085), 'gym.spaces.Box', 'spaces.Box', (['low', 'high'], {'shape': '(4, 1)'}), '(low, high, shape=(4, 1))\n', (1060, 1085), False, 'from gym import spaces\n'), ((1103, 1116), 'numpy.zeros', 'np.zeros', (['[4]'], {}), '([4])\n', (1111, 1116), True, 'import numpy as np\n'), ((1146, 1160), 'numpy.zeros', 'np.zero... |
import os
import random
import sys
import numpy as np
import pytest
sys.path.append(os.path.join(os.path.dirname(__file__)))
sys.path.append("\\".join(os.path.dirname(__file__).split("\\")[:-2]))
sys.path.append(os.path.join(os.path.dirname(__file__), "../../"))
from src.distributed_reflectors.reflector import Refl... | [
"src.distributed_reflectors.reflector.Reflector",
"numpy.random.randn",
"os.path.dirname",
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.testing.assert_equal",
"pytest.mark.parametrize",
"numpy.sqrt"
] | [((1387, 1600), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""particle_coordinates,length,reflector_coordinates,expected_collisions,expected_new_coordinates"""', '[straight_collision_and_clear_miss, barely_misses, near_misses_but_hit, hit]'], {}), "(\n 'particle_coordinates,length,reflector_coordinates... |
from helper import unittest, PillowTestCase, hopper
from PIL import Image
from PIL import SpiderImagePlugin
TEST_FILE = "Tests/images/hopper.spider"
class TestImageSpider(PillowTestCase):
def test_sanity(self):
im = Image.open(TEST_FILE)
im.load()
self.assertEqual(im.mode, "F")
... | [
"helper.unittest.main",
"PIL.SpiderImagePlugin.loadImageSeries",
"PIL.Image.open",
"PIL.SpiderImagePlugin.isSpiderImage",
"PIL.SpiderImagePlugin.isInt",
"helper.hopper"
] | [((1912, 1927), 'helper.unittest.main', 'unittest.main', ([], {}), '()\n', (1925, 1927), False, 'from helper import unittest, PillowTestCase, hopper\n'), ((233, 254), 'PIL.Image.open', 'Image.open', (['TEST_FILE'], {}), '(TEST_FILE)\n', (243, 254), False, 'from PIL import Image\n'), ((505, 513), 'helper.hopper', 'hoppe... |
import unittest
import requests
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry
adapter = HTTPAdapter(max_retries=Retry(total=5, backoff_factor=1))
http = requests.Session()
http.mount("https://", adapter)
http.mount("http://", adapter)
class ApiTests(unittest.TestCase):
def test_... | [
"requests.Session",
"urllib3.util.retry.Retry"
] | [((188, 206), 'requests.Session', 'requests.Session', ([], {}), '()\n', (204, 206), False, 'import requests\n'), ((147, 179), 'urllib3.util.retry.Retry', 'Retry', ([], {'total': '(5)', 'backoff_factor': '(1)'}), '(total=5, backoff_factor=1)\n', (152, 179), False, 'from urllib3.util.retry import Retry\n')] |
from pycocotools.coco import COCO
import matplotlib.pyplot as plt
import cv2
import os
import numpy as np
import random
import torch
import torchvision.transforms as transforms
from torch.utils.data import DataLoader,Dataset
from skimage import io,transform
import matplotlib.pyplot as plt
import os
import torch
from ... | [
"torch.ones_like",
"torch.zeros_like",
"torch.utils.data.DataLoader",
"torch.where",
"torchvision.transforms.ToPILImage",
"torch.rand_like",
"torch.Tensor",
"torch.max",
"torch.nn.functional.interpolate",
"torch.sum"
] | [((2956, 2985), 'torch.Tensor', 'torch.Tensor', (['segments_tensor'], {}), '(segments_tensor)\n', (2968, 2985), False, 'import torch\n'), ((3002, 3046), 'torch.Tensor', 'torch.Tensor', (['[0.1, 0.2, 0.3, 0.4, 0.5, 0.6]'], {}), '([0.1, 0.2, 0.3, 0.4, 0.5, 0.6])\n', (3014, 3046), False, 'import torch\n'), ((3170, 3217), ... |
import os
import sys
import subprocess
import platform
import tempfile
import logging
def fixdate():
date = None
_f = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
if platform.system() == "Linux":
try:
_f = 'date +"%m/%d/%y %I:%M:%S %p"'
date = subprocess.check_ou... | [
"logging.FileHandler",
"logging.basicConfig",
"subprocess.check_output",
"tempfile.gettempdir",
"platform.system",
"sys.exit",
"logging.getLogger"
] | [((528, 555), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (545, 555), False, 'import logging\n'), ((560, 624), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.WARNING', 'format': '"""%(message)s"""'}), "(level=logging.WARNING, format='%(message)s')\n", (579, 624),... |
# coding: utf-8
# app: incidencias
# module: urls.py
# date: miércoles, 06 de junio de 2018 - 11:30
# description: Patrones de ruta de cobertura.
# pylint: disable=W0613,R0201,R0903
from django.urls import path
from apps.incidencias.views import Portada, EventoDetail
app_name = 'incidencias'
urlp... | [
"apps.incidencias.views.Portada.as_view",
"apps.incidencias.views.EventoDetail.as_view"
] | [((345, 362), 'apps.incidencias.views.Portada.as_view', 'Portada.as_view', ([], {}), '()\n', (360, 362), False, 'from apps.incidencias.views import Portada, EventoDetail\n'), ((401, 423), 'apps.incidencias.views.EventoDetail.as_view', 'EventoDetail.as_view', ([], {}), '()\n', (421, 423), False, 'from apps.incidencias.v... |
from utime import sleep
from npxl import NeoPixel
from colors import *
strip = NeoPixel(4, 8)
strip.fill(BLACK)
while True:
strip[0] = YELLOW
strip.show()
sleep(1.0)
strip.fill(BLACK)
strip.show()
sleep(1.0)
| [
"npxl.NeoPixel",
"utime.sleep"
] | [((80, 94), 'npxl.NeoPixel', 'NeoPixel', (['(4)', '(8)'], {}), '(4, 8)\n', (88, 94), False, 'from npxl import NeoPixel\n'), ((169, 179), 'utime.sleep', 'sleep', (['(1.0)'], {}), '(1.0)\n', (174, 179), False, 'from utime import sleep\n'), ((223, 233), 'utime.sleep', 'sleep', (['(1.0)'], {}), '(1.0)\n', (228, 233), False... |
import ray
import wandb
from agent.workers.DreamerWorker import DreamerWorker
class DreamerServer:
def __init__(self, n_workers, env_config, controller_config, model):
ray.init()
self.workers = [DreamerWorker.remote(i, env_config, controller_config) for i in range(n_workers)]
self.tasks ... | [
"wandb.log",
"ray.init",
"ray.get",
"agent.workers.DreamerWorker.DreamerWorker.remote",
"ray.wait"
] | [((183, 193), 'ray.init', 'ray.init', ([], {}), '()\n', (191, 193), False, 'import ray\n'), ((521, 541), 'ray.wait', 'ray.wait', (['self.tasks'], {}), '(self.tasks)\n', (529, 541), False, 'import ray\n'), ((219, 273), 'agent.workers.DreamerWorker.DreamerWorker.remote', 'DreamerWorker.remote', (['i', 'env_config', 'cont... |
# Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your o... | [
"volatility.plugins.mac.pstasks.mac_tasks.__init__",
"volatility.obj.Object",
"volatility.obj.CType.is_valid",
"struct.unpack",
"struct.pack"
] | [((3485, 3509), 'struct.pack', 'struct.pack', (['"""<I"""', 'nsecs'], {}), "('<I', nsecs)\n", (3496, 3509), False, 'import struct, string\n'), ((3620, 3683), 'volatility.obj.Object', 'obj.Object', (['"""UnixTimeStamp"""'], {'offset': '(0)', 'vm': 'time_buf', 'is_utc': '(True)'}), "('UnixTimeStamp', offset=0, vm=time_bu... |
from jinja2 import Environment, FileSystemLoader
import webbrowser
import time
##################################################
## This is report module and responsible to generate report.
##################################################
__author__ = "<NAME>"
__copyright__ = "Copyright 2021, Project"
__credits__ =... | [
"jinja2.FileSystemLoader",
"webbrowser.open",
"time.strftime"
] | [((1709, 1729), 'webbrowser.open', 'webbrowser.open', (['url'], {}), '(url)\n', (1724, 1729), False, 'import webbrowser\n'), ((567, 595), 'jinja2.FileSystemLoader', 'FileSystemLoader', (['"""./report"""'], {}), "('./report')\n", (583, 595), False, 'from jinja2 import Environment, FileSystemLoader\n'), ((738, 768), 'tim... |
from typing import Any, Dict, List, Tuple
import urwid
from zulipterminal.config import is_command_key
class MenuButton(urwid.Button):
def __init__(self, caption: Any, email: str='') -> None:
self.caption = caption # str
self.email = email
super(MenuButton, self).__init__("")
se... | [
"urwid.SelectableIcon",
"zulipterminal.config.is_command_key",
"urwid.connect_signal"
] | [((703, 768), 'urwid.connect_signal', 'urwid.connect_signal', (['self', '"""click"""', 'controller.show_all_messages'], {}), "(self, 'click', controller.show_all_messages)\n", (723, 768), False, 'import urwid\n'), ((1237, 1265), 'zulipterminal.config.is_command_key', 'is_command_key', (['"""ENTER"""', 'key'], {}), "('E... |
import theano.tensor as T
import theano
from mozi.utils.utils import theano_unique
from mozi.utils.theano_utils import asfloatX
floatX = theano.config.floatX
if floatX == 'float64':
epsilon = 1.0e-8
else:
epsilon = 1.0e-6
def accuracy(y, y_pred):
L = T.eq(y_pred.argmax(axis=1), y.argmax(axis=1))
ret... | [
"theano.tensor.log",
"theano.tensor.sum",
"theano.tensor.abs_",
"theano.tensor.exp",
"theano.tensor.nnet.binary_crossentropy",
"theano.tensor.mean",
"theano.tensor.sqr",
"theano.tensor.max",
"theano.tensor.clip"
] | [((324, 333), 'theano.tensor.mean', 'T.mean', (['L'], {}), '(L)\n', (330, 333), True, 'import theano.tensor as T\n'), ((534, 572), 'theano.tensor.clip', 'T.clip', (['y_pred', 'epsilon', '(1.0 - epsilon)'], {}), '(y_pred, epsilon, 1.0 - epsilon)\n', (540, 572), True, 'import theano.tensor as T\n'), ((639, 648), 'theano.... |
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 17 13:14:28 2020
@author: derek.bickhart-adm
"""
import matplotlib
from matplotlib import pyplot as plt
matplotlib.use('Agg')
from matplotlib.collections import BrokenBarHCollection
from matplotlib import cm
from itertools import cycle
from collections import defaultdict... | [
"pandas.DataFrame",
"argparse.ArgumentParser",
"matplotlib.pyplot.get_cmap",
"pysam.AlignmentFile",
"collections.defaultdict",
"matplotlib.pyplot.figure",
"matplotlib.use",
"matplotlib.pyplot.savefig"
] | [((153, 174), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (167, 174), False, 'import matplotlib\n'), ((414, 542), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""A tool to plot bin and contig level read depth differences in strain assignment"""'}), "(description=... |
import unittest
import pytest
class TestLocalRegistry(unittest.TestCase):
@pytest.mark.xfail(reason="Not Implemented", run=False)
def test_get_base_image_exists(self):
assert False
@pytest.mark.xfail(reason="Not Implemented", run=False)
def test_get_base_image_download(self):
assert... | [
"pytest.mark.xfail"
] | [((83, 137), 'pytest.mark.xfail', 'pytest.mark.xfail', ([], {'reason': '"""Not Implemented"""', 'run': '(False)'}), "(reason='Not Implemented', run=False)\n", (100, 137), False, 'import pytest\n'), ((207, 261), 'pytest.mark.xfail', 'pytest.mark.xfail', ([], {'reason': '"""Not Implemented"""', 'run': '(False)'}), "(reas... |
from service.crawler import Crawler
if __name__ == '__main__':
crawler = Crawler()
crawler.run()
| [
"service.crawler.Crawler"
] | [((79, 88), 'service.crawler.Crawler', 'Crawler', ([], {}), '()\n', (86, 88), False, 'from service.crawler import Crawler\n')] |
import json
import requests
from scrapy.selector import Selector
def do_it():
r = requests.get("https://rusvectores.org/en/models/")
if r.status_code == 200:
body = r.content
out = {}
title = ''
data = Selector(text=body).css('h2, div > table')
for d in data:
... | [
"scrapy.selector.Selector",
"requests.get",
"json.dumps"
] | [((87, 137), 'requests.get', 'requests.get', (['"""https://rusvectores.org/en/models/"""'], {}), "('https://rusvectores.org/en/models/')\n", (99, 137), False, 'import requests\n'), ((244, 263), 'scrapy.selector.Selector', 'Selector', ([], {'text': 'body'}), '(text=body)\n', (252, 263), False, 'from scrapy.selector impo... |
from selenium.webdriver.support.ui import WebDriverWait
from time import sleep
from utilities.BasePage import BasePage
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
class WaitlistTagsPage(BasePage):
client_add_tags_css = "*[data-testid='components_client-top-panel_a... | [
"selenium.webdriver.support.ui.WebDriverWait",
"time.sleep"
] | [((2017, 2047), 'selenium.webdriver.support.ui.WebDriverWait', 'WebDriverWait', (['self.driver', '(10)'], {}), '(self.driver, 10)\n', (2030, 2047), False, 'from selenium.webdriver.support.ui import WebDriverWait\n'), ((7526, 7536), 'time.sleep', 'sleep', (['(0.5)'], {}), '(0.5)\n', (7531, 7536), False, 'from time impor... |
"""
AUTOR: Juanjo
FECHA DE CREACIÓN: 24/01/2019
"""
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, TextAreaField
from wtforms.validators import DataRequired, Length
class PostForm(FlaskForm):
title = StringField('Título', validators=[DataRequired(), Length(max=128)])
content... | [
"wtforms.SubmitField",
"wtforms.validators.DataRequired",
"wtforms.validators.Length",
"wtforms.TextAreaField"
] | [((323, 349), 'wtforms.TextAreaField', 'TextAreaField', (['"""Contenido"""'], {}), "('Contenido')\n", (336, 349), False, 'from wtforms import StringField, SubmitField, TextAreaField\n'), ((363, 384), 'wtforms.SubmitField', 'SubmitField', (['"""Enviar"""'], {}), "('Enviar')\n", (374, 384), False, 'from wtforms import St... |
import os
import flask
import flask_login
import lib.utils as utils
from lib.admin import account
from lib.admin.database import db
from lib.admin.bcrypt import bcrypt
from lib.admin import validity, const
from lib.admin.admin import admin, login_manager
from lib.eviltwin.eviltwin import eviltwin
from lib... | [
"lib.admin.bcrypt.bcrypt.init_app",
"os.makedirs",
"lib.interface.backend.InterfaceBackend.disable_interfaces",
"lib.admin.database.db.create_all",
"lib.admin.admin.login_manager.init_app",
"lib.utils.gen_admin_url_prefix",
"flask.Flask",
"lib.admin.database.db.init_app",
"os.path.exists",
"os.pat... | [((524, 545), 'flask.Flask', 'flask.Flask', (['__name__'], {}), '(__name__)\n', (535, 545), False, 'import flask\n'), ((706, 721), 'os.urandom', 'os.urandom', (['(512)'], {}), '(512)\n', (716, 721), False, 'import os\n'), ((807, 835), 'lib.utils.gen_admin_url_prefix', 'utils.gen_admin_url_prefix', ([], {}), '()\n', (83... |