code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
"""urlconf for the base application"""
from account.views import ChangePasswordView, PasswordResetView, PasswordResetTokenView, LogoutView, DeleteView
from django.conf.urls import url
from .views import HomeView, Projects, ProjectPageView, TodosPage, ProjectSchedulePage, ProjectTodoItemView, \
CompleteTodoItem, \... | [
"account.views.PasswordResetView.as_view",
"account.views.LogoutView.as_view",
"account.views.ChangePasswordView.as_view",
"account.views.DeleteView.as_view",
"django.conf.urls.url",
"account.views.PasswordResetTokenView.as_view"
] | [((1686, 1726), 'django.conf.urls.url', 'url', (['"""^paddle/webhook/$"""', 'paddle_webhook'], {}), "('^paddle/webhook/$', paddle_webhook)\n", (1689, 1726), False, 'from django.conf.urls import url\n'), ((1733, 1765), 'django.conf.urls.url', 'url', (['"""^test/error/$"""', 'test_error'], {}), "('^test/error/$', test_er... |
# coding: utf-8
"""
MailMojo API
v1 of the MailMojo API # noqa: E501
OpenAPI spec version: 1.1.0
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import mailmojo_sdk
from mailmojo_sdk.api.list_api imp... | [
"unittest.main",
"mailmojo_sdk.api.list_api.ListApi"
] | [((2166, 2181), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2179, 2181), False, 'import unittest\n'), ((504, 539), 'mailmojo_sdk.api.list_api.ListApi', 'mailmojo_sdk.api.list_api.ListApi', ([], {}), '()\n', (537, 539), False, 'import mailmojo_sdk\n')] |
import argparse
def get_parser():
parser = argparse.ArgumentParser()
parser.add_argument('--env', default='single', choices=('single', 'pair', 'macro'))
parser.add_argument('--model', default='lstm', choices=('arima', 'lstm'))
parser.add_argument('--num_layers', default=2, type=int)
parser.add_ar... | [
"argparse.ArgumentParser"
] | [((49, 74), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (72, 74), False, 'import argparse\n')] |
# Copyright 2017 Google Inc.
#
# 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 ... | [
"tensorflow.einsum",
"numpy.sum",
"tensorflow.clip_by_value",
"tensorflow.cumsum",
"numpy.ones",
"utility.alrc",
"numpy.argsort",
"numpy.arange",
"utility.auto_name",
"numpy.exp",
"tensorflow.python.ops.array_ops.shape",
"tensorflow.stack",
"numpy.max",
"tensorflow.python.ops.array_ops.pad... | [((1402, 1475), 'tensorflow.flags.DEFINE_integer', 'tf.flags.DEFINE_integer', (['"""hidden_size"""', '(256)', '"""Size of LSTM hidden layer."""'], {}), "('hidden_size', 256, 'Size of LSTM hidden layer.')\n", (1425, 1475), True, 'import tensorflow as tf\n'), ((1477, 1550), 'tensorflow.flags.DEFINE_integer', 'tf.flags.DE... |
"""
To test runtime and AI logic
"""
import random
from player import AI
from board import Board
import timeit
Winner = ""
record = {
"won": 0,
"lose": 0,
"tie": 0
}
# driver method
# player1 goes first, player2 goes second
def play(board, player1, player2):
global Winner
while True:
tur... | [
"timeit.default_timer",
"board.Board",
"player.AI",
"random.choice"
] | [((1141, 1163), 'timeit.default_timer', 'timeit.default_timer', ([], {}), '()\n', (1161, 1163), False, 'import timeit\n'), ((1511, 1533), 'timeit.default_timer', 'timeit.default_timer', ([], {}), '()\n', (1531, 1533), False, 'import timeit\n'), ((1211, 1218), 'board.Board', 'Board', ([], {}), '()\n', (1216, 1218), Fals... |
from bricks_modeling.file_IO.model_reader import read_bricks_from_file
from bricks_modeling.connectivity_graph import ConnectivityGraph
from solvers.rigidity_solver.internal_structure import structure_sampling
import os
from os.path import dirname as dir
# a rigid triangle
def lego_models(file_name):
bricks = read... | [
"os.path.dirname",
"solvers.rigidity_solver.internal_structure.structure_sampling",
"bricks_modeling.connectivity_graph.ConnectivityGraph"
] | [((461, 486), 'bricks_modeling.connectivity_graph.ConnectivityGraph', 'ConnectivityGraph', (['bricks'], {}), '(bricks)\n', (478, 486), False, 'from bricks_modeling.connectivity_graph import ConnectivityGraph\n'), ((540, 575), 'solvers.rigidity_solver.internal_structure.structure_sampling', 'structure_sampling', (['stru... |
"""Decorators for adding dependency information to functions and objects."""
# Copyright 2011, 2012, 2013, 2014 <NAME>
# This file is part of codedep.
# See `License` for details of license and warranty.
import inspect
from codedep.hash import hashString
def _updateInfo(fnOrClassOrObj):
"""Sets any unset code... | [
"inspect.getsource"
] | [((1190, 1223), 'inspect.getsource', 'inspect.getsource', (['fnOrClassOrObj'], {}), '(fnOrClassOrObj)\n', (1207, 1223), False, 'import inspect\n')] |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-09-29 01:38
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('magic', '0006_auto_20170928_2... | [
"django.db.migrations.RemoveField",
"django.db.models.ForeignKey",
"django.db.migrations.DeleteModel",
"django.db.models.AutoField",
"django.db.models.SmallIntegerField",
"django.db.models.DateTimeField"
] | [((1253, 1311), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""votecard"""', 'name': '"""card"""'}), "(model_name='votecard', name='card')\n", (1275, 1311), False, 'from django.db import migrations, models\n'), ((1356, 1414), 'django.db.migrations.RemoveField', 'migrations.RemoveF... |
# vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | [
"unittest.main"
] | [((2031, 2046), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2044, 2046), False, 'import unittest\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from PANDORA.Pandora import Pandora
def run_model(args):
"""Runs one modelling job. Meant to be runned from Pandora.Wrapper
Args:
args (list): List of arguments. Should be containing the following, in
order.
target (Pandora.PMHC.PMHC.T... | [
"PANDORA.Pandora.Pandora.Pandora"
] | [((1027, 1092), 'PANDORA.Pandora.Pandora.Pandora', 'Pandora.Pandora', (['target'], {'template': 'template', 'output_dir': 'output_dir'}), '(target, template=template, output_dir=output_dir)\n', (1042, 1092), False, 'from PANDORA.Pandora import Pandora\n'), ((1147, 1189), 'PANDORA.Pandora.Pandora.Pandora', 'Pandora.Pand... |
import torch
import torch.nn as nn
from torch.autograd import Variable
from train_module import *
import torch.optim as optim
from torch.optim import lr_scheduler
import numpy as np
import torchvision
from torchvision import datasets, models, transforms
from torch.utils.data import Dataset, DataLoader
#import matplotl... | [
"sys.path.append",
"Model.loss.CrossEntropyLoss2d",
"os.mkdir",
"torch.optim.lr_scheduler.StepLR",
"Data.get_dataloader.get_dataloader",
"os.path.exists",
"Model.PatchCNN.PatchCNN",
"torch.device",
"torch.nn.DataParallel"
] | [((405, 427), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (420, 427), False, 'import sys\n'), ((1358, 1402), 'Model.PatchCNN.PatchCNN', 'PatchCNN', ([], {'layers': 'num_layers', 'dropout': 'dropout'}), '(layers=num_layers, dropout=dropout)\n', (1366, 1402), False, 'from Model.PatchCNN import... |
#!/usr/bin/env python3
"""
COOLR RAPL package
The intel_rapl kernel module is required.
"""
import os, sys, re, time, getopt
import clr_nodeinfo
class rapl_reader:
"""The rapl_reader class provides APIs for reading energy/power
consumption and controlling hardware power capping on Intel CPUs
with the ... | [
"getopt.getopt",
"os.path.exists",
"clr_nodeinfo.nodeconfig",
"time.sleep",
"time.time",
"re.findall",
"clr_nodeinfo.cputopology",
"os.access",
"re.search",
"os.listdir",
"sys.exit",
"re.compile"
] | [((1870, 1899), 're.compile', 're.compile', (['"""package-(\\\\d+)$"""'], {}), "('package-(\\\\d+)$')\n", (1880, 1899), False, 'import os, sys, re, time, getopt\n'), ((1921, 1957), 're.compile', 're.compile', (['"""package-(\\\\d+)(/\\\\S+)?"""'], {}), "('package-(\\\\d+)(/\\\\S+)?')\n", (1931, 1957), False, 'import os... |
"""
solution adventofcode day1
https://adventofcode.com/2019/day/1
author: pca
"""
import argparse
from pathlib import Path
from general.general import read_file_int
def fuel_requirement(module_mass):
"""
Fuel required to launch a given module is based on its mass. Specifically, to find the fuel required f... | [
"general.general.read_file_int",
"argparse.ArgumentParser"
] | [((555, 601), 'general.general.read_file_int', 'read_file_int', (['args.location', '"""input_day1.txt"""'], {}), "(args.location, 'input_day1.txt')\n", (568, 601), False, 'from general.general import read_file_int\n'), ((754, 800), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""puzzle.""... |
# encoding: utf8
from random import randrange
from PySide.QtCore import (QRect, QSize, QPoint)
from PySide.QtGui import QColor
BLOCK_RADIUS = 5
class Block(object):
def __init__(self, columns=[], size=QSize(100, 100),
bg_color=QColor(randrange(0, 255), randrange(0, 255), randrange(0, 255), 50),... | [
"PySide.QtCore.QRect",
"PySide.QtCore.QPoint",
"random.randrange",
"PySide.QtCore.QSize"
] | [((209, 224), 'PySide.QtCore.QSize', 'QSize', (['(100)', '(100)'], {}), '(100, 100)\n', (214, 224), False, 'from PySide.QtCore import QRect, QSize, QPoint\n'), ((259, 276), 'random.randrange', 'randrange', (['(0)', '(255)'], {}), '(0, 255)\n', (268, 276), False, 'from random import randrange\n'), ((278, 295), 'random.r... |
# coding: utf-8
#
# Copyright 2013 Google Inc. 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 ... | [
"core.domain.widget_domain.AnswerHandler",
"core.domain.widget_domain.Registry.get_widget_by_id"
] | [((990, 1019), 'core.domain.widget_domain.AnswerHandler', 'widget_domain.AnswerHandler', ([], {}), '()\n', (1017, 1019), False, 'from core.domain import widget_domain\n'), ((1153, 1215), 'core.domain.widget_domain.AnswerHandler', 'widget_domain.AnswerHandler', ([], {'input_type': 'objects.NonnegativeInt'}), '(input_typ... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.20.7
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
fr... | [
"kubernetes.client.configuration.Configuration",
"six.iteritems"
] | [((6105, 6138), 'six.iteritems', 'six.iteritems', (['self.openapi_types'], {}), '(self.openapi_types)\n', (6118, 6138), False, 'import six\n'), ((1589, 1604), 'kubernetes.client.configuration.Configuration', 'Configuration', ([], {}), '()\n', (1602, 1604), False, 'from kubernetes.client.configuration import Configurati... |
import pandas as pd
from math import isnan
import numpy as np
from train import GRUTree
from train import visualize
import os
import cPickle
from sklearn.model_selection import train_test_split
from sklearn.metrics import roc_auc_score, mean_squared_error, accuracy_score
def preprocess(dataset):
# complete missin... | [
"os.mkdir",
"pandas.read_csv",
"pandas.get_dummies",
"sklearn.model_selection.train_test_split",
"os.path.isdir",
"sklearn.metrics.roc_auc_score",
"cPickle.dump",
"numpy.swapaxes",
"train.visualize",
"train.GRUTree",
"numpy.round",
"sklearn.metrics.mean_squared_error"
] | [((2613, 2636), 'pandas.get_dummies', 'pd.get_dummies', (['dataset'], {}), '(dataset)\n', (2627, 2636), True, 'import pandas as pd\n'), ((2682, 2719), 'pandas.read_csv', 'pd.read_csv', (['"""titanic_data/train.csv"""'], {}), "('titanic_data/train.csv')\n", (2693, 2719), True, 'import pandas as pd\n'), ((2905, 2958), 's... |
"""Twitch.tv uses OAuth2 for authorization.
We use the Implicit Grant Workflow.
The user has to visit an authorization site, login, authorize
PyTwitcher. Once he allows PyTwitcher, twitch will redirect him to
:data:`pytwitcherapi.REDIRECT_URI`.
In the url fragment, there is the access token.
This module features a ser... | [
"pytwitcherapi.constants.REDIRECT_URI.replace",
"pkg_resources.resource_filename",
"BaseHTTPServer.HTTPServer.__init__",
"os.path.join",
"logging.getLogger"
] | [((825, 852), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (842, 852), False, 'import logging\n'), ((2457, 2487), 'os.path.join', 'os.path.join', (['"""html"""', 'filename'], {}), "('html', filename)\n", (2469, 2487), False, 'import os\n'), ((2507, 2565), 'pkg_resources.resource_filenam... |
r"""
Continued Fractions
Sage implements the field ``ContinuedFractionField`` (or ``CFF``
for short) of finite simple continued fractions. This is really
isomorphic to the field `\QQ` of rational numbers, but with different
printing and semantics. It should be possible to use this field in
most cases where one could... | [
"field.Field.__init__",
"arith.continued_fraction_list",
"real_mpfr.is_RealNumber",
"arith.convergent",
"arith.convergents",
"integer_ring.ZZ",
"sage.libs.pari.all.pari",
"sage.structure.element.FieldElement.__init__",
"rational_field.QQ.random_element"
] | [((3367, 3393), 'field.Field.__init__', 'Field.__init__', (['self', 'self'], {}), '(self, self)\n', (3381, 3393), False, 'from field import Field\n'), ((5496, 5512), 'real_mpfr.is_RealNumber', 'is_RealNumber', (['x'], {}), '(x)\n', (5509, 5512), False, 'from real_mpfr import is_RealNumber, RealField\n'), ((8718, 8723),... |
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
from . import views
urlpatterns = [
path('login', views.login, name='ngologin'),
path('register', views.register, name='ngoregister'),
path('logout', views.log... | [
"django.urls.path"
] | [((189, 232), 'django.urls.path', 'path', (['"""login"""', 'views.login'], {'name': '"""ngologin"""'}), "('login', views.login, name='ngologin')\n", (193, 232), False, 'from django.urls import path, include\n'), ((238, 290), 'django.urls.path', 'path', (['"""register"""', 'views.register'], {'name': '"""ngoregister"""'... |
from django.db import models
INSTRUMENT_SHORT_NAME_LEN = 4
INSTRUMENT_FULL_NAME_LEN = 20
INSTRUMENT_CURRENCY_LEN = 7
class Instrument(models.Model):
short_name = models.CharField(max_length=INSTRUMENT_SHORT_NAME_LEN)
full_name = models.CharField(max_length=INSTRUMENT_FULL_NAME_LEN)
price = models.FloatFi... | [
"django.db.models.CharField",
"django.db.models.FloatField"
] | [((169, 223), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': 'INSTRUMENT_SHORT_NAME_LEN'}), '(max_length=INSTRUMENT_SHORT_NAME_LEN)\n', (185, 223), False, 'from django.db import models\n'), ((240, 293), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': 'INSTRUMENT_FULL_NAME_LE... |
# Python modules
import os
import copy
# 3rd party modules
import wx
# Our modules
import vespa.simulation.auto_gui.manage_pulse_sequences as gui_manage_pulse_sequences
import vespa.simulation.dialog_pulse_sequence_info as dialog_pulse_sequence_info
import vespa.simulation.dialog_pulse_sequence_editor as dialog_puls... | [
"wx.Colour",
"copy.deepcopy",
"vespa.common.util.import_.PulseSequenceImporter",
"vespa.common.wx_gravy.common_dialogs.pickfile",
"vespa.common.wx_gravy.common_dialogs.message",
"vespa.common.wx_gravy.util.display_file",
"vespa.common.dialog_export.DialogExport",
"vespa.common.wx_gravy.util.is_select_... | [((2492, 2550), 'vespa.simulation.auto_gui.manage_pulse_sequences.MyDialog.__init__', 'gui_manage_pulse_sequences.MyDialog.__init__', (['self', 'parent'], {}), '(self, parent)\n', (2536, 2550), True, 'import vespa.simulation.auto_gui.manage_pulse_sequences as gui_manage_pulse_sequences\n'), ((4468, 4496), 'vespa.common... |
from django.contrib.auth.models import AbstractUser
from django.db import models
from common.models import BaseModel
class User(AbstractUser):
user_type = models.CharField(null=True, max_length=255)
email = models.CharField(blank=True, max_length=255, unique=True)
username = models.CharField(null=True, ma... | [
"django.db.models.TextField",
"django.db.models.CharField",
"django.db.models.BooleanField",
"django.db.models.IntegerField",
"django.db.models.DateTimeField"
] | [((161, 204), 'django.db.models.CharField', 'models.CharField', ([], {'null': '(True)', 'max_length': '(255)'}), '(null=True, max_length=255)\n', (177, 204), False, 'from django.db import models\n'), ((217, 274), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(255)', 'unique':... |
from heroku import Flask, render_template
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
@app.route('/main', methods=['GET', 'POST'])
def hello_world():
return render_template('index.md')
if __name__ == '__main__':
app.run() | [
"heroku.Flask",
"heroku.render_template"
] | [((49, 64), 'heroku.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (54, 64), False, 'from heroku import Flask, render_template\n'), ((182, 209), 'heroku.render_template', 'render_template', (['"""index.md"""'], {}), "('index.md')\n", (197, 209), False, 'from heroku import Flask, render_template\n')] |
import json
import random
from itertools import cycle
import requests
class SessionBuilder:
"""
The SessionBuilder class is used to create and return request.session objects using different useragents and
proxies on a per-session basis
Proxies are obtained using an API key from ProxyBonanza
If ... | [
"json.load",
"json.loads",
"requests.Session",
"random.choice",
"requests.get",
"itertools.cycle"
] | [((3504, 3522), 'requests.Session', 'requests.Session', ([], {}), '()\n', (3520, 3522), False, 'import requests\n'), ((2275, 2371), 'requests.get', 'requests.get', (["self.api_data['api-url']"], {'headers': "{'Authorization': self.api_data['api-key']}"}), "(self.api_data['api-url'], headers={'Authorization': self.\n ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-05-31 21:52
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('nc', '0023_asset_trusted_by'),
]
operations = [
migrations.RemoveField(
... | [
"django.db.migrations.RemoveField"
] | [((286, 347), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""asset"""', 'name': '"""trusted_by"""'}), "(model_name='asset', name='trusted_by')\n", (308, 347), False, 'from django.db import migrations\n')] |
from time import time
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.clock import Clock, mainthread
from kivy.logger import Logger
from kivymd.app import MDApp
from kivymd.uix.button import MDFlatButton
from kivymd.uix.list import OneLineListItem
from kivymd.toast impor... | [
"utils.switch_screen",
"kivy.logger.Logger.error",
"random.randint",
"kivy.clock.Clock.create_trigger",
"kivymd.uix.chip.MDChip",
"kivymd.toast.toast",
"utils.Playlist",
"kivy.clock.Clock.schedule_once",
"kivymd.app.MDApp.get_running_app",
"kivymd.uix.spinner.MDSpinner",
"time.time",
"utils.cr... | [((852, 949), 'kivymd.uix.spinner.MDSpinner', 'MDSpinner', ([], {'size_hint': '(None, None)', 'size': "('30dp', '30dp')", 'pos_hint': 'pos_hint', 'size_hint_y': 'None'}), "(size_hint=(None, None), size=('30dp', '30dp'), pos_hint=pos_hint,\n size_hint_y=None)\n", (861, 949), False, 'from kivymd.uix.spinner import MDS... |
# Copyright (C) 2017-2018 Intel Corporation
#
# SPDX-License-Identifier: MIT
import dpctl
import base_l2_distance
import numpy as np
import numba_dppy
import math
@numba_dppy.kernel(access_types={"read_only": ["a", "b"], "write_only": ["c"]})
def l2_distance_kernel(a, b, c):
i = numba_dppy.get_global_id(0)
j... | [
"base_l2_distance.run",
"math.sqrt",
"numba_dppy.atomic.add",
"numba_dppy.get_global_id",
"numba_dppy.kernel",
"base_l2_distance.get_device_selector"
] | [((167, 245), 'numba_dppy.kernel', 'numba_dppy.kernel', ([], {'access_types': "{'read_only': ['a', 'b'], 'write_only': ['c']}"}), "(access_types={'read_only': ['a', 'b'], 'write_only': ['c']})\n", (184, 245), False, 'import numba_dppy\n'), ((695, 743), 'base_l2_distance.run', 'base_l2_distance.run', (['"""l2 distance""... |
from hetu import get_worker_communicate
from hetu.preduce import PartialReduce
from hetu import ndarray
import hetu as ht
import ctypes
import argparse
import numpy as np
from tqdm import tqdm
import time
import random
def test(args):
comm = get_worker_communicate()
rank = comm.rank()
comm.ssp_init(rank ... | [
"hetu.get_worker_communicate",
"hetu.worker_finish",
"hetu.wrapped_mpi_nccl_init",
"argparse.ArgumentParser",
"time.sleep",
"hetu.preduce.PartialReduce",
"hetu.ndarray.gpu",
"hetu.worker_init",
"numpy.repeat"
] | [((249, 273), 'hetu.get_worker_communicate', 'get_worker_communicate', ([], {}), '()\n', (271, 273), False, 'from hetu import get_worker_communicate\n'), ((490, 505), 'hetu.preduce.PartialReduce', 'PartialReduce', ([], {}), '()\n', (503, 505), False, 'from hetu.preduce import PartialReduce\n'), ((517, 543), 'hetu.wrapp... |
#!/usr/bin/python
#
# Copyright 2018 Jigsaw Operations LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | [
"ipaddress.ip_network",
"matplotlib.pyplot.show",
"networkx.draw_networkx_edges",
"networkx.draw_networkx_edge_labels",
"argparse.ArgumentParser",
"logging.basicConfig",
"logging.warning",
"ujson.load",
"ipaddress.ip_address",
"collections.defaultdict",
"socket.gethostbyaddr",
"networkx.spring... | [((4533, 4542), 'collections.Counter', 'Counter', ([], {}), '()\n', (4540, 4542), False, 'from collections import Counter, defaultdict\n'), ((7007, 7024), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (7018, 7024), False, 'from collections import Counter, defaultdict\n'), ((8022, 8040), 'network... |
# Copyright 2020 <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, softwa... | [
"jinja2.Environment"
] | [((681, 733), 'jinja2.Environment', 'jinja2.Environment', ([], {'undefined': 'jinja2.StrictUndefined'}), '(undefined=jinja2.StrictUndefined)\n', (699, 733), False, 'import jinja2\n')] |
import random
from typing import List
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
FIGSIZE = (3, 4.5)
class Card:
def __init__(self, rank, suit):
"""
Define a single card
@ Parameters
| rank : can be in ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', ... | [
"matplotlib.image.imread",
"random.shuffle",
"matplotlib.pyplot.subplots",
"random.seed",
"matplotlib.pyplot.pause"
] | [((1253, 1267), 'matplotlib.pyplot.pause', 'plt.pause', (['(0.1)'], {}), '(0.1)\n', (1262, 1267), True, 'import matplotlib.pyplot as plt\n'), ((916, 945), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': 'FIGSIZE'}), '(figsize=FIGSIZE)\n', (928, 945), True, 'import matplotlib.pyplot as plt\n'), ((1519, 15... |
import contextlib
import logging
import signal
import sys
LOGGER = logging.getLogger(__name__)
class ApplicationState(object):
LOAD = 0
MAIN_LOOP = 1
def __init__(self):
self.state = self.LOAD
self.running = True
signal.signal(signal.SIGINT, self.signal_handler)
def set_ap... | [
"sys.exit",
"signal.signal",
"signal.getsignal",
"logging.getLogger"
] | [((69, 96), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (86, 96), False, 'import logging\n'), ((255, 304), 'signal.signal', 'signal.signal', (['signal.SIGINT', 'self.signal_handler'], {}), '(signal.SIGINT, self.signal_handler)\n', (268, 304), False, 'import signal\n'), ((857, 888), 'si... |
"""Contains method for setting up application wide logger"""
from os import path, mkdir
from enum import Enum
import logging.config
import logging
import yaml
from api.helpers import generate_enviroment_variable_yaml_loader
class LoggerType(Enum):
"""Logger Type Enum to be used to return different configured log... | [
"api.helpers.generate_enviroment_variable_yaml_loader",
"os.mkdir",
"logging.basicConfig",
"os.path.exists",
"logging.config.dictConfig",
"logging.getLogger"
] | [((829, 860), 'os.path.exists', 'path.exists', (['logger_config_path'], {}), '(logger_config_path)\n', (840, 860), False, 'from os import path, mkdir\n'), ((1655, 1687), 'logging.getLogger', 'logging.getLogger', (['log_type.name'], {}), '(log_type.name)\n', (1672, 1687), False, 'import logging\n'), ((559, 591), 'os.pat... |
from subprocess import Popen, PIPE
from typing import List, Union, Any
def subprocess(cmd: Union[str, List[str]], *values: Any):
if isinstance(cmd, str):
items = cmd.split()
placeholders_count = sum(1 for item in items if '{}' in item)
if placeholders_count != len(values):
ra... | [
"subprocess.Popen"
] | [((709, 770), 'subprocess.Popen', 'Popen', (['cmd'], {'stdout': 'PIPE', 'stderr': 'PIPE', 'universal_newlines': '(True)'}), '(cmd, stdout=PIPE, stderr=PIPE, universal_newlines=True)\n', (714, 770), False, 'from subprocess import Popen, PIPE\n')] |
"""Image functions for PET data reconstruction and processing."""
import glob
import logging
import math
import multiprocessing
import os
import re
import shutil
from subprocess import run
import nibabel as nib
import numpy as np
import pydicom as dcm
from niftypet import nimpa
from .. import mmraux
from .. import ... | [
"os.remove",
"numpy.load",
"numpy.sum",
"niftypet.nipet.lm.mmrhist",
"re.finditer",
"numpy.floor",
"numpy.isnan",
"os.path.isfile",
"numpy.arange",
"shutil.rmtree",
"niftypet.nipet.lm.mmrhist.hist",
"os.path.join",
"multiprocessing.cpu_count",
"niftypet.nimpa.dcm2im",
"os.path.dirname",
... | [((343, 370), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (360, 370), False, 'import logging\n'), ((388, 413), 'numpy.array', 'np.array', (['[0.0, 0.0, 0.0]'], {}), '([0.0, 0.0, 0.0])\n', (396, 413), True, 'import numpy as np\n'), ((813, 841), 'numpy.transpose', 'np.transpose', (['img'... |
import serial, os, datetime
#generate the name of the file
now = datetime.datetime.now()
out_file = open(str(now).replace(".","").replace(" ","").replace(":","").replace("-",""), 'w')
#asking user to configure new port connection
print('Enter COM number: ')
C_PORT_NUMBER = int(input())
print('Enter COM-port speed: '... | [
"datetime.datetime.now"
] | [((66, 89), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (87, 89), False, 'import serial, os, datetime\n'), ((654, 677), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (675, 677), False, 'import serial, os, datetime\n')] |
"""
Usage:
kungfu-run -q -np 4 python3 -m kungfu.tensorflow.v1.benchmarks --method CPU
kungfu-run -q -np 4 python3 -m kungfu.tensorflow.v1.benchmarks --method NCCL
kungfu-run -q -np 4 python3 -m kungfu.tensorflow.v1.benchmarks --method NCCL+CPU
mpirun -np 4 python3 -m kungfu.tensorflow.v1.benchmarks --m... | [
"tensorflow.ones",
"horovod.tensorflow.local_rank",
"kungfu.python._get_cuda_index",
"horovod.tensorflow.init",
"argparse.ArgumentParser",
"horovod.tensorflow.allreduce",
"horovod.tensorflow.size",
"tensorflow.global_variables_initializer",
"kungfu.tensorflow.v1.helpers.utils.show_size",
"json.dum... | [((1091, 1101), 'horovod.tensorflow.init', 'hvd.init', ([], {}), '()\n', (1099, 1101), True, 'import horovod.tensorflow as hvd\n'), ((1920, 1936), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (1934, 1936), True, 'import tensorflow as tf\n'), ((2404, 2459), 'argparse.ArgumentParser', 'argparse.ArgumentP... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-10-18 11:45
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations... | [
"django.db.models.TextField",
"django.db.models.OneToOneField",
"django.db.migrations.swappable_dependency",
"django.db.models.URLField",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.AutoField",
"django.db.models.ImageField",
"django.db.models.IntegerField",
"djan... | [((310, 367), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (341, 367), False, 'from django.db import migrations, models\n'), ((499, 592), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)... |
from typing import List, Iterable, TypeVar
T = TypeVar('T')
def flat(some_list: Iterable[Iterable]) -> List:
return [item for sublist in some_list for item in sublist]
| [
"typing.TypeVar"
] | [((49, 61), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (56, 61), False, 'from typing import List, Iterable, TypeVar\n')] |
from slugify import slugify
from titan.react_view_pkg.router.resources import RouterConfig
def create_component_router_config(component, named_component, url=None, wraps=False):
slug = slugify(component.name)
return RouterConfig(
component=named_component, url=f"{slug if url is None else url}", wraps... | [
"titan.react_view_pkg.router.resources.RouterConfig",
"slugify.slugify"
] | [((192, 215), 'slugify.slugify', 'slugify', (['component.name'], {}), '(component.name)\n', (199, 215), False, 'from slugify import slugify\n'), ((227, 323), 'titan.react_view_pkg.router.resources.RouterConfig', 'RouterConfig', ([], {'component': 'named_component', 'url': 'f"""{slug if url is None else url}"""', 'wraps... |
import sys,os
import random
import copy
from random import shuffle
inp = open('Sly_pathway_annotation_20190117_with_expression_5_members_nonoverlapping.txt','r').readlines()
P = {} ###P[pathway] = [gene1,gene2,...]
for inl in inp:
pa = inl.strip().split('\t')[0]
gene = inl.split('\t')[1].strip()
if pa not in P:
P... | [
"random.sample",
"random.shuffle",
"copy.deepcopy"
] | [((537, 553), 'copy.deepcopy', 'copy.deepcopy', (['P'], {}), '(P)\n', (550, 553), False, 'import copy\n'), ((1457, 1475), 'random.shuffle', 'shuffle', (['gene_list'], {}), '(gene_list)\n', (1464, 1475), False, 'from random import shuffle\n'), ((599, 622), 'random.sample', 'random.sample', (['P[pa]', '(5)'], {}), '(P[pa... |
import numpy as np
from shapely.geometry import LineString, Polygon
import plotly.graph_objs as go
import utils.camera as cam_utils
import cv2
import matplotlib
import os
from os import listdir
from os.path import isfile, join, exists
import soccer
import argparse
import utils.io as io
from tqdm import tqdm
import plo... | [
"cv2.line",
"numpy.uint8",
"numpy.minimum",
"numpy.arctan2",
"shapely.geometry.Polygon",
"matplotlib.cm.get_cmap",
"numpy.zeros",
"plotly.offline.plot",
"shapely.geometry.LineString",
"numpy.sin",
"numpy.asmatrix",
"numpy.array",
"numpy.cos",
"cv2.fillConvexPoly",
"utils.camera.Camera"
] | [((2573, 2644), 'plotly.offline.plot', 'py.offline.plot', (['fig'], {'filename': '"""/home/bunert/Data/results/players.html"""'}), "(fig, filename='/home/bunert/Data/results/players.html')\n", (2588, 2644), True, 'import plotly as py\n'), ((2706, 2919), 'numpy.array', 'np.array', (['[[0, 1], [1, 2], [2, 3], [3, 4], [1,... |
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
import matplotlib as mpl
from .paths import paths_prob_to_edges_flux
def flattened(G, scale=1, vertical=False):
"""Get flattened positions for a genotype-phenotype graph.
Parameters
----------
G : GenotypePhenotypeGraph object
... | [
"networkx.draw_networkx_edges",
"matplotlib.colors.Normalize",
"matplotlib.cm.ScalarMappable",
"networkx.draw_networkx",
"networkx.draw_networkx_nodes",
"numpy.arange",
"matplotlib.pyplot.subplots"
] | [((6234, 6264), 'networkx.draw_networkx', 'nx.draw_networkx', (['G'], {}), '(G, **options)\n', (6250, 6264), True, 'import networkx as nx\n'), ((10099, 10296), 'networkx.draw_networkx_edges', 'nx.draw_networkx_edges', ([], {'G': 'G', 'pos': 'pos', 'edgelist': 'edgelist', 'width': 'width', 'edge_color': 'edge_color', 'a... |
#!/usr/bin/env python
# Author: <NAME>
# date: 2022-02-28
import numpy as np
import os
import pandas as pd
file_path = os.path.join('./data/raw/', 'athlete_events.csv')
# Read athlete data from raw folder
try:
abs_path = os.path.abspath(file_path)
except FileNotFoundError:
raise ("Absolute path to {input_f... | [
"pandas.read_csv",
"os.path.abspath",
"os.path.join",
"os.path.dirname"
] | [((122, 171), 'os.path.join', 'os.path.join', (['"""./data/raw/"""', '"""athlete_events.csv"""'], {}), "('./data/raw/', 'athlete_events.csv')\n", (134, 171), False, 'import os\n'), ((709, 769), 'os.path.join', 'os.path.join', (['"""./data/processed/"""', '"""athlete_events_2000.csv"""'], {}), "('./data/processed/', 'at... |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import logging
logger = logging.getLogger(__name__)
# {fact rule=log-injection@v1.0 defects=1}
def logging_noncompliant():
filename = input("Enter a filename: ")
# Noncompliant: unsanitized input is l... | [
"logging.getLogger"
] | [((134, 161), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (151, 161), False, 'import logging\n')] |
import tf_encrypted as tfe
from common import LogisticRegression, PredictionClient
num_features = 10
model = LogisticRegression(num_features)
prediction_client = PredictionClient('prediction-client', num_features)
x = tfe.define_private_input(prediction_client.player_name, prediction_client.provide_input)
y = mode... | [
"tf_encrypted.Session",
"tf_encrypted.define_private_input",
"common.LogisticRegression",
"common.PredictionClient",
"tf_encrypted.define_output",
"tf_encrypted.global_variables_initializer"
] | [((112, 144), 'common.LogisticRegression', 'LogisticRegression', (['num_features'], {}), '(num_features)\n', (130, 144), False, 'from common import LogisticRegression, PredictionClient\n'), ((165, 216), 'common.PredictionClient', 'PredictionClient', (['"""prediction-client"""', 'num_features'], {}), "('prediction-clien... |
# WeirdData Copyright (c) 2020.
# Author: <NAME>
#
# Functions related to Rainfall
#
# Data Source:
# Gov of India
# https://data.gov.in/catalog/rainfall-india
# <NAME>
# https://www.kaggle.com/rajanand/rainfall-in-india
#
# Shape file source:
# <NAME>
# https://groups.google.com/forum/#!topic/datameet/12L5jtjUKhI
i... | [
"SecretColors.Palette",
"pandas.read_csv",
"cartopy.crs.PlateCarree",
"matplotlib.pyplot.figure",
"SecretColors.cmaps.ColorMap",
"matplotlib.gridspec.GridSpec",
"geopandas.read_file"
] | [((638, 647), 'SecretColors.Palette', 'Palette', ([], {}), '()\n', (645, 647), False, 'from SecretColors import Palette\n'), ((1285, 1316), 'geopandas.read_file', 'geopandas.read_file', (['shape_file'], {}), '(shape_file)\n', (1304, 1316), False, 'import geopandas\n'), ((5192, 5218), 'matplotlib.pyplot.figure', 'plt.fi... |
import pygame
def drawWavFile(file, coord, disp):
result = open(file, "rb").read()
y=0
for width in [60]:
i=44
x=0
while i < len(result)-3:
color = (result[i], result[i+1], result[i+2])
disp.set_at((coord[0]+x, coord[1]+y), color)
i+=3
... | [
"pygame.display.set_mode",
"pygame.time.delay",
"pygame.display.flip",
"pygame.display.quit",
"pygame.display.init"
] | [((401, 422), 'pygame.display.init', 'pygame.display.init', ([], {}), '()\n', (420, 422), False, 'import pygame\n'), ((430, 465), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(640, 480)'], {}), '((640, 480))\n', (453, 465), False, 'import pygame\n'), ((626, 649), 'pygame.time.delay', 'pygame.time.delay', ([... |
# encoding: utf-8
from http import HTTPStatus
from flask_restx import Resource
from hash_chain.app.modules.auth.decorators import token_required
from hash_chain.app.modules.auth.dto import AuthDto
from hash_chain.app.modules.auth.services import Auth
api = AuthDto.api
user_auth = AuthDto.auth
user_model = AuthDto.us... | [
"hash_chain.app.modules.auth.services.Auth.logout_user",
"hash_chain.app.modules.auth.services.Auth.get_logged_in_user",
"hash_chain.app.modules.auth.services.Auth.login_user"
] | [((903, 920), 'hash_chain.app.modules.auth.services.Auth.login_user', 'Auth.login_user', ([], {}), '()\n', (918, 920), False, 'from hash_chain.app.modules.auth.services import Auth\n'), ((1436, 1461), 'hash_chain.app.modules.auth.services.Auth.get_logged_in_user', 'Auth.get_logged_in_user', ([], {}), '()\n', (1459, 146... |
import os.path
from askapdev.rbuild.builders import Setuptools as Builder
import askapdev.rbuild.utils as utils
builder = Builder()
builder.remote_archive = "scipy-0.18.1.tar.gz"
platform = utils.get_platform()
if platform['system'] != 'Darwin':
blas = builder.dep.get_install_path("blas")
lapack = b... | [
"askapdev.rbuild.builders.Setuptools",
"askapdev.rbuild.utils.get_platform"
] | [((124, 133), 'askapdev.rbuild.builders.Setuptools', 'Builder', ([], {}), '()\n', (131, 133), True, 'from askapdev.rbuild.builders import Setuptools as Builder\n'), ((193, 213), 'askapdev.rbuild.utils.get_platform', 'utils.get_platform', ([], {}), '()\n', (211, 213), True, 'import askapdev.rbuild.utils as utils\n')] |
import numpy as np
import tensorflow as tf
import random
import os
from collections import deque
from random import randint
from envFive import envFive
import player.dqn as dqn
INPUT_SIZE = 12
OUTPUT_SIZE = 10
DISCOUNT_RATE = 0.99
REPLAY_MEMORY = 50000
MAX_EPISODE = 100000
BATCH_SIZE = 64
# minimum epsilon for ep... | [
"tensorflow.train.Saver",
"player.dqn.DQN",
"tensorflow.global_variables_initializer",
"random.sample",
"tensorflow.Session",
"numpy.mean",
"numpy.array",
"numpy.random.rand",
"numpy.vstack",
"envFive.envFive",
"collections.deque"
] | [((1444, 1453), 'envFive.envFive', 'envFive', ([], {}), '()\n', (1451, 1453), False, 'from envFive import envFive\n'), ((794, 832), 'numpy.vstack', 'np.vstack', (['[x[0] for x in train_batch]'], {}), '([x[0] for x in train_batch])\n', (803, 832), True, 'import numpy as np\n'), ((852, 889), 'numpy.array', 'np.array', ([... |
import click
import os
from subprocess import Popen, PIPE, STDOUT, check_output
import time
import math
"""
Arrange necessary commands.
1. build from source
2. test with one input
3. test with whole input
4. make configure file for easy reusement
- source
- executable name
- test case path
- info opt... | [
"subprocess.Popen",
"subprocess.check_output",
"click.option",
"os.system",
"click.echo",
"time.time",
"math.floor",
"click.Path",
"click.group",
"click.style"
] | [((357, 370), 'click.group', 'click.group', ([], {}), '()\n', (368, 370), False, 'import click\n'), ((465, 552), 'click.option', 'click.option', (['"""--build-command"""'], {'default': '"""g++"""', 'help': '"""command to build from input"""'}), "('--build-command', default='g++', help=\n 'command to build from input... |
from si_prefix import si_format
import numpy as np
known_units = {"mA" : 1e-3, "uA" : 1e-6, "nA" : 1e-9, "pA" : 1e-12, "fA" : 1e-15,
"nV" : 1e-9, "uV" : 1e-6, "mV" : 1e-3,
"ns" : 1e-9, "us" : 1e-6, "ms" : 1e-3,
"KHz" : 1e3, "MHz" : 1e6, "GHz" : 1e9 }
def ... | [
"si_prefix.si_format",
"numpy.isnan"
] | [((569, 584), 'numpy.isnan', 'np.isnan', (['value'], {}), '(value)\n', (577, 584), True, 'import numpy as np\n'), ((615, 651), 'si_prefix.si_format', 'si_format', (['(value * scaler)', 'precision'], {}), '(value * scaler, precision)\n', (624, 651), False, 'from si_prefix import si_format\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Autopep8: https://pypi.org/project/autopep8/
# Check with http://pep8online.com/
# Make different plot types
import proplot as plot
from variables import get_var_infos
from zones import get_zone
def plot_ref_new_obs(
var, ref, new, obs, label, units,
levels,... | [
"zones.get_zone",
"proplot.subplots"
] | [((3680, 3748), 'proplot.subplots', 'plot.subplots', ([], {'proj': '"""cyl"""', 'ncols': 'ncols', 'nrows': 'nrows', 'axwidth': 'axwidth'}), "(proj='cyl', ncols=ncols, nrows=nrows, axwidth=axwidth)\n", (3693, 3748), True, 'import proplot as plot\n'), ((9125, 9156), 'proplot.subplots', 'plot.subplots', ([], {'nrows': '(3... |
import cfg
import sys
import onnx
import numpy as np
import cv2
import onnxruntime
import logging
from tool.utils import plot_boxes_cv2, post_processing, load_class_names
# Logging Setup
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
file_handler = logging.FileHandler("logs/detector.log")
formatte... | [
"cv2.resize",
"logging.FileHandler",
"cv2.cvtColor",
"numpy.transpose",
"numpy.expand_dims",
"logging.Formatter",
"onnxruntime.InferenceSession",
"cv2.imread",
"tool.utils.load_class_names",
"numpy.array",
"tool.utils.plot_boxes_cv2",
"tool.utils.post_processing",
"logging.getLogger"
] | [((197, 224), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (214, 224), False, 'import logging\n'), ((271, 311), 'logging.FileHandler', 'logging.FileHandler', (['"""logs/detector.log"""'], {}), "('logs/detector.log')\n", (290, 311), False, 'import logging\n'), ((324, 391), 'logging.Forma... |
import math
import sys
def dot(v, w):
x, y = v
X, Y = w
return x * X + y * Y
def length(v):
x, y = v
return math.sqrt(x * x + y * y)
def vector(b, e):
x, y = b
X, Y = e
return X - x, Y - y
def unit(v):
x, y = v
mag = length(v)
return x / mag, y / mag
def distance(p... | [
"math.sqrt"
] | [((133, 157), 'math.sqrt', 'math.sqrt', (['(x * x + y * y)'], {}), '(x * x + y * y)\n', (142, 157), False, 'import math\n')] |
from collections import namedtuple
from ctypes import Structure, c_int, c_void_p, sizeof
from itertools import product
from cached_property import cached_property
from cgen import Struct, Value
import numpy as np
from mpi4py import MPI
from devito.types import LEFT, RIGHT
from devito.tools import EnrichedTuple
__al... | [
"cgen.Value",
"ctypes.sizeof",
"devito.types.Object",
"devito.types.CompositeObject",
"mpi4py.MPI._addressof",
"collections.namedtuple",
"mpi4py.MPI._sizeof",
"itertools.product",
"devito.tools.EnrichedTuple"
] | [((2105, 2155), 'devito.tools.EnrichedTuple', 'EnrichedTuple', (['*glb_numbs'], {'getters': 'self.dimensions'}), '(*glb_numbs, getters=self.dimensions)\n', (2118, 2155), False, 'from devito.tools import EnrichedTuple\n'), ((2683, 2739), 'devito.tools.EnrichedTuple', 'EnrichedTuple', (['*self._glb_shape'], {'getters': '... |
import logging
import openpyxl
import openpyxl.utils as utils
# Application Utilities
from timecardgenerator import tuples
class Spreadsheet( object ):
def __init__( self, file ):
assert type( file ) == str, 'file must be a valid string path'
self.file = file
self.wb = openpyxl.load_wor... | [
"openpyxl.Workbook",
"openpyxl.load_workbook",
"timecardgenerator.tuples.Coordinate",
"logging.info",
"openpyxl.utils.coordinate_from_string",
"openpyxl.utils.get_column_letter"
] | [((303, 356), 'openpyxl.load_workbook', 'openpyxl.load_workbook', ([], {'filename': 'file', 'data_only': '(True)'}), '(filename=file, data_only=True)\n', (325, 356), False, 'import openpyxl\n'), ((411, 451), 'logging.info', 'logging.info', (['"""Spreadsheet instantiated"""'], {}), "('Spreadsheet instantiated')\n", (423... |
from typing import Union
from app.core.exceptions import ResourceAlreadyExists
from app.models.mta_sts import organisations, reports
from app.schemas.mta_sts_report import MtaStsReport
from app.schemas.mta_sts_report.report import ReportCreate
from app.schemas.resource_created import ResourceCreated
from sqlalchemy.ex... | [
"app.schemas.mta_sts_report.report.ReportCreate",
"app.models.mta_sts.reports.get_id",
"app.core.exceptions.ResourceAlreadyExists",
"app.models.mta_sts.organisations.upsert"
] | [((848, 924), 'app.models.mta_sts.reports.get_id', 'reports.get_id', (['db'], {'external_id': 'external_id', 'organisation_id': 'organisation_id'}), '(db, external_id=external_id, organisation_id=organisation_id)\n', (862, 924), False, 'from app.models.mta_sts import organisations, reports\n'), ((987, 1049), 'app.core.... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import constraints
from dpp.flows.base import Flow
from dpp.nn import Hypernet
class Polynomial(Flow):
"""Sum of squares polynomial flow layer.
We parametrize the inverse transformation, since we are interested in
... | [
"dpp.nn.Hypernet",
"torch.arange",
"torch.zeros",
"torch.get_default_dtype",
"torch.log"
] | [((1418, 1527), 'dpp.nn.Hypernet', 'Hypernet', (['config'], {'hidden_sizes': 'hypernet_hidden_sizes', 'param_sizes': '[self.n_terms * (self.max_degree + 1)]'}), '(config, hidden_sizes=hypernet_hidden_sizes, param_sizes=[self.\n n_terms * (self.max_degree + 1)])\n', (1426, 1527), False, 'from dpp.nn import Hypernet\n... |
from binaryninja import RegisterInfo
def get_regs():
regs = dict()
regs['sp'] = RegisterInfo('sp', 4)
for i in range(4):
regs['r{}'.format(i)] = RegisterInfo('r{}'.format(i), 4)
return regs
GPR = {
0 : 'r0',
1 : 'r1',
2 : 'r2',
3 : 'r3'
}
| [
"binaryninja.RegisterInfo"
] | [((90, 111), 'binaryninja.RegisterInfo', 'RegisterInfo', (['"""sp"""', '(4)'], {}), "('sp', 4)\n", (102, 111), False, 'from binaryninja import RegisterInfo\n')] |
#! Test gradient and Hessian transformations
import psi4
import qcelemental as qcel
import numpy as np
import optking
from optking import bend, stre, tors
#psi4.core.set_output_file('psi-output.dat')
def test_stationary_forces_h2o():
mol = psi4.geometry("""
0 1
O 0.0000000000 -0.0000000000 0... | [
"optking.tors.Tors",
"optking.stre.Stre",
"psi4.compare_values",
"psi4.set_options",
"optking.frag.Frag",
"psi4.hessian",
"optking.molsys.Molsys",
"psi4.gradient",
"optking.bend.Bend",
"psi4.geometry",
"psi4.core.Matrix.from_array"
] | [((247, 482), 'psi4.geometry', 'psi4.geometry', (['"""\n 0 1\n O 0.0000000000 -0.0000000000 0.0025968676\n H 0.0000000000 -0.7487897072 0.5811909492\n H -0.0000000000 0.7487897072 0.5811909492\n unit Angstrom\n """'], {}), '(\n """\n 0 1\n O 0.0000... |
#!/usr/bin/env python3
"""
Reads data from ESRI ascii Grids
@deprecated This has not been used since version 0.9
@author <NAME> & <NAME>
@copyright 2018 Intel Ltd (see LICENSE file).
"""
from __future__ import print_function
from collections import namedtuple
import sys
import glob
import pyproj
from volatree import Vo... | [
"volatree.VolaTree",
"pyproj.Proj",
"collections.namedtuple",
"glob.glob",
"pyproj.transform"
] | [((435, 456), 'glob.glob', 'glob.glob', (['filestring'], {}), '(filestring)\n', (444, 456), False, 'import glob\n'), ((1742, 1771), 'pyproj.Proj', 'pyproj.Proj', ([], {'init': '"""epsg:2157"""'}), "(init='epsg:2157')\n", (1753, 1771), False, 'import pyproj\n'), ((1833, 1862), 'pyproj.Proj', 'pyproj.Proj', ([], {'init':... |
# Copyright 2021 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | [
"api_access_info.get_access_info",
"inspect.currentframe",
"json.loads",
"common.server_error_to_message",
"flask.Flask",
"globals.logger.debug",
"json.dumps",
"common.get_namespace_name",
"flask.jsonify",
"common.UserException",
"flask.request.json.copy",
"requests.post",
"globals.init",
... | [((1097, 1112), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (1102, 1112), False, 'from flask import Flask, request, abort, jsonify, render_template\n'), ((1159, 1176), 'globals.init', 'globals.init', (['app'], {}), '(app)\n', (1171, 1176), False, 'import globals\n'), ((1540, 1570), 'globals.logger.debug... |
from bokeh.layouts import column
from bokeh.models.widgets import Div
from dashboard.bokeh.plots.descriptors.table import Table
from dashboard.bokeh.plots.descriptors.title import Title
from dashboard.bokeh.plots.patch.main import Patch
from qlf_models import QLFModels
from bokeh.resources import CDN
from bokeh.emb... | [
"dashboard.bokeh.plots.descriptors.table.Table",
"dashboard.bokeh.plots.descriptors.title.Title",
"bokeh.models.widgets.Div",
"bokeh.embed.file_html",
"bokeh.layouts.column",
"dashboard.bokeh.plots.patch.main.Patch",
"qlf_models.QLFModels"
] | [((3417, 3449), 'bokeh.embed.file_html', 'file_html', (['layout', 'CDN', '"""GETRMS"""'], {}), "(layout, CDN, 'GETRMS')\n", (3426, 3449), False, 'from bokeh.embed import file_html\n'), ((3043, 3048), 'bokeh.models.widgets.Div', 'Div', ([], {}), '()\n', (3046, 3048), False, 'from bokeh.models.widgets import Div\n'), ((3... |
from qcodes import Instrument, InstrumentChannel, ChannelList
from qcodes.utils.validators import Enum
from qcodes.utils.helpers import create_on_off_val_mapping
import urllib.request
class PowerChannel(InstrumentChannel):
"""
Channel class for a socket on the Aviosys IP Power 9258S.
Args:
parent... | [
"qcodes.ChannelList",
"qcodes.utils.helpers.create_on_off_val_mapping"
] | [((2677, 2745), 'qcodes.ChannelList', 'ChannelList', (['self', '"""PowerChannels"""', 'PowerChannel'], {'snapshotable': '(False)'}), "(self, 'PowerChannels', PowerChannel, snapshotable=False)\n", (2688, 2745), False, 'from qcodes import Instrument, InstrumentChannel, ChannelList\n'), ((1077, 1127), 'qcodes.utils.helper... |
import os
from dvc.command.common.base import CmdBase
from dvc.logger import Logger
from dvc.stage import Stage
from dvc.exceptions import DvcException
class CmdRun(CmdBase):
def run(self):
fname = self.stage_file_name(self.args.file, self.args.outs, self.args.outs_no_cache)
try:
sel... | [
"os.path.basename"
] | [((1366, 1389), 'os.path.basename', 'os.path.basename', (['fname'], {}), '(fname)\n', (1382, 1389), False, 'import os\n')] |
#!/usr/bin/env python3
"""Run MiddleKit test script."""
import webware
webware.mockAppWithPlugins()
from TestCommon import *
import MiddleKit.Run
def test(filename, configFilename, pyFilename, deleteData):
curDir = os.getcwd()
os.chdir(workDir)
try:
filename = '../' + filename
if os.pat... | [
"webware.mockAppWithPlugins",
"traceback.print_exception"
] | [((73, 101), 'webware.mockAppWithPlugins', 'webware.mockAppWithPlugins', ([], {}), '()\n', (99, 101), False, 'import webware\n'), ((2328, 2364), 'traceback.print_exception', 'traceback.print_exception', (['*exc_info'], {}), '(*exc_info)\n', (2353, 2364), False, 'import traceback\n')] |
# Copyright 2020 Tsinghua University, Author: <NAME>
# Apache 2.0.
# This script contrains TRF semi-supervised (JRF) training experiments.
import tensorflow as tf
import numpy as np
import json
import os
from base import *
import trf_semi
import argparse
paser = argparse.ArgumentParser()
paser.add_argument('--alpha... | [
"trf_semi.TRF",
"json.load",
"numpy.random.seed",
"argparse.ArgumentParser",
"tensorflow.contrib.slim.get_variables_to_restore",
"tensorflow.train.Saver",
"trf_semi.DefaultOps",
"tensorflow.set_random_seed",
"tensorflow.get_default_graph",
"tensorflow.ConfigProto",
"tensorflow.train.latest_check... | [((267, 292), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (290, 292), False, 'import argparse\n'), ((1715, 1744), 'tensorflow.set_random_seed', 'tf.set_random_seed', (['args.seed'], {}), '(args.seed)\n', (1733, 1744), True, 'import tensorflow as tf\n'), ((1745, 1770), 'numpy.random.seed', 'n... |
# ===============================================================
# Author: <NAME>
# Email: <EMAIL>
# Twitter: @FerroRodolfo
#
# ABOUT COPYING OR USING PARTIAL INFORMATION:
# This script was originally created by <NAME>, for
# his workshop in PythonDay Mexico 2018 at CUCEA in Gdl, Mx.
# Any explicit usage of this scrip... | [
"requests.post",
"requests.get"
] | [((666, 683), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (678, 683), False, 'import requests\n'), ((1351, 1405), 'requests.post', 'requests.post', (['url'], {'json': 'input_values', 'headers': 'headers'}), '(url, json=input_values, headers=headers)\n', (1364, 1405), False, 'import requests\n')] |
# creates MARC records for ReCAP orphan barcodes problem
from pymarc import Record, Field, MARCWriter
import csv
fh_in = 'orphan_barcodes.csv'
fh_out = 'orphan_barcodes.mrc'
def create_bib(file, barcode, cust_code):
# generates MARC records with barcode and customer code
# entered in appropriate fields
... | [
"pymarc.Field",
"csv.reader",
"pymarc.Record"
] | [((331, 339), 'pymarc.Record', 'Record', ([], {}), '()\n', (337, 339), False, 'from pymarc import Record, Field, MARCWriter\n'), ((2346, 2362), 'csv.reader', 'csv.reader', (['file'], {}), '(file)\n', (2356, 2362), False, 'import csv\n'), ((682, 745), 'pymarc.Field', 'Field', ([], {'tag': '"""245"""', 'indicators': "['0... |
from ubidots import ApiClient
from secrets import master_incubator_token
import pprint as pp
import traceback
import time
class Renderer(object):
def __init__(self):
self.count = 0
def render(self, incubator):
self.count += 1
def finish(self, incubator):
pass
class T... | [
"traceback.print_exc",
"ubidots.ApiClient",
"pprint.pprint",
"time.time"
] | [((698, 737), 'ubidots.ApiClient', 'ApiClient', ([], {'token': 'master_incubator_token'}), '(token=master_incubator_token)\n', (707, 737), False, 'from ubidots import ApiClient\n'), ((2912, 2943), 'pprint.pprint', 'pp.pprint', (['self.backlogged_data'], {}), '(self.backlogged_data)\n', (2921, 2943), True, 'import pprin... |
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | [
"grpc.framework.foundation.relay.relay",
"logging.error",
"grpc.framework.foundation.logging_pool.pool",
"time.time",
"threading.Lock",
"grpc.framework.interfaces.links.links.Ticket",
"grpc.framework.interfaces.links.links.Protocol",
"grpc._adapter._intermediary_low.CompletionQueue"
] | [((2782, 2798), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (2796, 2798), False, 'import threading\n'), ((3950, 3966), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (3964, 3966), False, 'import threading\n'), ((7248, 7414), 'grpc.framework.interfaces.links.links.Ticket', 'links.Ticket', (['operation_i... |
import apache_beam as beam
from apache_beam.options.pipeline_options import PipelineOptions
from beam_nuggets.io import relational_db
with beam.Pipeline(options=PipelineOptions()) as p:
source_config = relational_db.SourceConfiguration(
drivername='postgresql+pg8000',
host='localhost',
... | [
"apache_beam.options.pipeline_options.PipelineOptions",
"apache_beam.Map",
"beam_nuggets.io.relational_db.SourceConfiguration",
"beam_nuggets.io.relational_db.Read"
] | [((212, 378), 'beam_nuggets.io.relational_db.SourceConfiguration', 'relational_db.SourceConfiguration', ([], {'drivername': '"""postgresql+pg8000"""', 'host': '"""localhost"""', 'port': '(5432)', 'username': '"""postgres"""', 'password': '"""password"""', 'database': '"""calendar"""'}), "(drivername='postgresql+pg8000'... |
from dataset_utils import DatasetDownloader, LJSpeechDataset, LJSpeechCollator
from preprocessing.log_mel_spec import MelSpectrogram, MelSpectrogramConfig
from model.model import HiFiGAN
from train_utils.utils import *
from logger import *
from itertools import islice
import warnings
from utils.config import TaskConfig... | [
"model.model.HiFiGAN",
"dataset_utils.LJSpeechCollator",
"utils.config.TaskConfig",
"dataset_utils.DatasetDownloader",
"dataset_utils.LJSpeechDataset"
] | [((434, 469), 'dataset_utils.DatasetDownloader', 'DatasetDownloader', (['config.data_path'], {}), '(config.data_path)\n', (451, 469), False, 'from dataset_utils import DatasetDownloader, LJSpeechDataset, LJSpeechCollator\n'), ((920, 943), 'model.model.HiFiGAN', 'HiFiGAN', (['config', 'writer'], {}), '(config, writer)\n... |
from django.shortcuts import render
from django.views.generic import View,TemplateView
from rest_framework.views import APIView
from rest_framework.response import Response
from .form import mainform
from .models import riskdata
class adddataview(View):
error=None
def get(self,request):
p... | [
"django.shortcuts.render",
"rest_framework.response.Response"
] | [((1201, 1234), 'django.shortcuts.render', 'render', (['request', '"""index.html"""', '{}'], {}), "(request, 'index.html', {})\n", (1207, 1234), False, 'from django.shortcuts import render\n'), ((365, 400), 'django.shortcuts.render', 'render', (['request', '"""adddata.html"""', '{}'], {}), "(request, 'adddata.html', {}... |
from dal import autocomplete
from ckeditor.widgets import CKEditorWidget
from ckeditor_uploader.widgets import CKEditorUploadingWidget
from django import forms
from .models import Category, Tag, Post
class PostAdminForm(forms.ModelForm):
desc = forms.CharField(widget=forms.Textarea, label='摘要', required=False)
... | [
"dal.autocomplete.ModelSelect2Multiple",
"django.forms.CharField",
"ckeditor_uploader.widgets.CKEditorUploadingWidget",
"dal.autocomplete.ModelSelect2"
] | [((252, 318), 'django.forms.CharField', 'forms.CharField', ([], {'widget': 'forms.Textarea', 'label': '"""摘要"""', 'required': '(False)'}), "(widget=forms.Textarea, label='摘要', required=False)\n", (267, 318), False, 'from django import forms\n'), ((414, 468), 'dal.autocomplete.ModelSelect2', 'autocomplete.ModelSelect2',... |
import json
import os
import pathlib
import pickle
import unittest
from test.test_api.utils import dummy_do_dummy_prediction, dummy_eval_function
import ConfigSpace as CS
from ConfigSpace.configuration_space import Configuration
import numpy as np
import pandas as pd
import pytest
import sklearn
import sklearn.da... | [
"autoPyTorch.api.tabular_classification.TabularClassificationTask",
"pickle.dump",
"numpy.load",
"smac.runhistory.runhistory.RunHistory",
"sklearn.model_selection.train_test_split",
"numpy.ones",
"numpy.shape",
"pathlib.Path",
"pickle.load",
"pytest.mark.parametrize",
"sklearn.datasets.fetch_ope... | [((1110, 1214), 'unittest.mock.patch', 'unittest.mock.patch', (['"""autoPyTorch.evaluation.train_evaluator.eval_function"""'], {'new': 'dummy_eval_function'}), "('autoPyTorch.evaluation.train_evaluator.eval_function',\n new=dummy_eval_function)\n", (1129, 1214), False, 'import unittest\n'), ((1233, 1279), 'pytest.ma... |
from airflow import DAG
from datetime import datetime, timedelta
from airflow.providers.amazon.aws.operators.ecs import ECSOperator
default_args = {
'owner': 'ubuntu',
'start_date': datetime(2019, 8, 14),
'retry_delay': timedelta(seconds=60*60)
}
with DAG('airflow_dag_test_external', catchup=False, defau... | [
"airflow.providers.amazon.aws.operators.ecs.ECSOperator",
"datetime.timedelta",
"airflow.DAG",
"datetime.datetime"
] | [((192, 213), 'datetime.datetime', 'datetime', (['(2019)', '(8)', '(14)'], {}), '(2019, 8, 14)\n', (200, 213), False, 'from datetime import datetime, timedelta\n'), ((234, 260), 'datetime.timedelta', 'timedelta', ([], {'seconds': '(60 * 60)'}), '(seconds=60 * 60)\n', (243, 260), False, 'from datetime import datetime, t... |
from mongoengine import connect
from pymongo import MongoClient
from config import Config
from .annotations import *
from .categories import *
from .datasets import *
from .lisence import *
from .exports import *
from .images import *
from .events import *
from .users import *
from .tasks import *
import json
def c... | [
"pymongo.MongoClient",
"mongoengine.connect",
"json.load"
] | [((420, 437), 'pymongo.MongoClient', 'MongoClient', (['host'], {}), '(host)\n', (431, 437), False, 'from pymongo import MongoClient\n'), ((485, 552), 'mongoengine.connect', 'connect', (['name'], {'host': 'host', 'replicaset': 'Config.MONGODB_REPLICASET_NAME'}), '(name, host=host, replicaset=Config.MONGODB_REPLICASET_NA... |
import cv2 as cv
def face_detect(image):
gray = cv.cvtColor(image, cv.COLOR_BGR2GRAY)
face_detector = cv.CascadeClassifier("imgs/haarcascades/haarcascade_frontalface_alt_tree.xml")
faces = face_detector.detectMultiScale(gray, 1.2, 2)
for x, y, w, h in faces:
cv.rectangle(image, (x, y), (x + w,... | [
"cv2.cvtColor",
"cv2.waitKey",
"cv2.imshow",
"cv2.VideoCapture",
"cv2.rectangle",
"cv2.CascadeClassifier",
"cv2.flip",
"cv2.destroyAllWindows",
"cv2.namedWindow"
] | [((388, 406), 'cv2.VideoCapture', 'cv.VideoCapture', (['(0)'], {}), '(0)\n', (403, 406), True, 'import cv2 as cv\n'), ((407, 451), 'cv2.namedWindow', 'cv.namedWindow', (['"""Result"""', 'cv.WINDOW_AUTOSIZE'], {}), "('Result', cv.WINDOW_AUTOSIZE)\n", (421, 451), True, 'import cv2 as cv\n'), ((603, 625), 'cv2.destroyAllW... |
#%%
import tensorflow as tf
from tensorflow.keras.models import Sequential
import numpy as np
from PIL import Image
from tensorflow.keras.layers import Dense, Dropout, Flatten
model = tf.keras.applications.vgg16.VGG16(include_top=True, weights=None, input_tensor=None, input_shape=None, pooling=None, classes=20)
#%%
mo... | [
"tensorflow.keras.applications.vgg16.VGG16"
] | [((185, 317), 'tensorflow.keras.applications.vgg16.VGG16', 'tf.keras.applications.vgg16.VGG16', ([], {'include_top': '(True)', 'weights': 'None', 'input_tensor': 'None', 'input_shape': 'None', 'pooling': 'None', 'classes': '(20)'}), '(include_top=True, weights=None,\n input_tensor=None, input_shape=None, pooling=Non... |
from dockwrkr import (Command)
from dockwrkr.monads import (Try)
class Login(Command):
def getUsage(self):
return "dockwrkr login [REGISTRY...]"
def getHelpTitle(self):
return "Perform docker login using credentials in dockwrkr.yml"
def main(self):
if self.args:
regi... | [
"dockwrkr.monads.Try.sequence"
] | [((492, 513), 'dockwrkr.monads.Try.sequence', 'Try.sequence', (['results'], {}), '(results)\n', (504, 513), False, 'from dockwrkr.monads import Try\n')] |
import datetime
import os
import uuid
import simplejson as json
from decimal import Decimal
from src.db.ddb_client import Client as DynamoClient
from src.helpers import provisional_classification_helpers
# Create an instance of the database client for all db interactions.
db = DynamoClient(
os.environ['DB_TABLE_NAM... | [
"simplejson.dumps",
"os.environ.get",
"src.helpers.provisional_classification_helpers.build",
"simplejson.loads",
"datetime.datetime.now"
] | [((327, 364), 'os.environ.get', 'os.environ.get', (['"""IS_OFFLINE"""', '"""false"""'], {}), "('IS_OFFLINE', 'false')\n", (341, 364), False, 'import os\n'), ((2174, 2241), 'src.helpers.provisional_classification_helpers.build', 'provisional_classification_helpers.build', (['provisionalClassification'], {}), '(provision... |
#!/usr/bin/env python3
# Copyright 2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | [
"copy.deepcopy",
"yaml.load",
"avalon_crypto_utils.crypto_utility.encrypt_data",
"json.loads",
"random.randint",
"avalon_crypto_utils.crypto_utility.strip_begin_end_public_key",
"secrets.token_hex",
"random.choice",
"json.dumps",
"avalon_crypto_utils.crypto_utility.generate_encrypted_key",
"aval... | [((1100, 1127), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1117, 1127), False, 'import logging\n'), ((2824, 2862), 'json.dumps', 'json.dumps', (['json_rpc_request'], {'indent': '(4)'}), '(json_rpc_request, indent=4)\n', (2834, 2862), False, 'import json\n'), ((2984, 3005), 'secrets.t... |
import tensorflow as tf
import numpy as np
import tsp_env
def attention(W_ref, W_q, v, enc_outputs, query):
with tf.variable_scope("attention_mask"):
u_i0s = tf.einsum('kl,itl->itk', W_ref, enc_outputs)
u_i1s = tf.expand_dims(tf.einsum('kl,il->ik', W_q, query), 1)
u_is = tf.einsum('k,itk->i... | [
"tensorflow.einsum",
"tensorflow.nn.softmax",
"tensorflow.nn.dynamic_rnn",
"tensorflow.layers.dense",
"tensorflow.variable_scope",
"tensorflow.random_normal",
"tensorflow.nn.rnn_cell.LSTMCell",
"tensorflow.tanh"
] | [((118, 153), 'tensorflow.variable_scope', 'tf.variable_scope', (['"""attention_mask"""'], {}), "('attention_mask')\n", (135, 153), True, 'import tensorflow as tf\n'), ((171, 215), 'tensorflow.einsum', 'tf.einsum', (['"""kl,itl->itk"""', 'W_ref', 'enc_outputs'], {}), "('kl,itl->itk', W_ref, enc_outputs)\n", (180, 215),... |
#! /usr/bin/env python
#Python wrapper for ASP pc_align
#Will run co-registration for all input filenames
import os
import sys
import argparse
import subprocess
#TODO: better error handling, throw/catch exceptions at each stage
#Run ASP's dem_mosaic tool to create a mosaic
#TODO: add threads, all stat types
#TODO:... | [
"argparse.ArgumentParser",
"os.rename",
"os.path.realpath",
"os.path.exists",
"subprocess.call",
"os.path.splitext",
"os.path.split",
"sys.exit"
] | [((480, 502), 'os.path.exists', 'os.path.exists', (['mos_fn'], {}), '(mos_fn)\n', (494, 502), False, 'import os\n'), ((1159, 1179), 'subprocess.call', 'subprocess.call', (['cmd'], {}), '(cmd)\n', (1174, 1179), False, 'import subprocess\n'), ((1221, 1246), 'os.rename', 'os.rename', (['out_fn', 'mos_fn'], {}), '(out_fn, ... |
from pymongo import MongoClient
from config import MONGODB_CONNECTION, MONGODB_DATABASE_NAME
_MONGO_CLIENT = None
def get_client(connection_string=MONGODB_CONNECTION):
if(_MONGO_CLIENT == None):
return MongoClient(connection_string)
else:
return _MONGO_CLIENT
def get_database(connection_stri... | [
"pymongo.MongoClient"
] | [((217, 247), 'pymongo.MongoClient', 'MongoClient', (['connection_string'], {}), '(connection_string)\n', (228, 247), False, 'from pymongo import MongoClient\n')] |
"""
Tests for Instrument Class and Functions
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2016, Trident Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
#---... | [
"trident.instrument.Instrument"
] | [((704, 740), 'trident.instrument.Instrument', 'Instrument', (['(1000)', '(2000)'], {'n_lambda': '(101)'}), '(1000, 2000, n_lambda=101)\n', (714, 740), False, 'from trident.instrument import Instrument\n'), ((901, 966), 'trident.instrument.Instrument', 'Instrument', (['(100)', '(20000)'], {'dlambda': '(10)', 'lsf_kerne... |
from eth2spec.utils.ssz.ssz_impl import hash_tree_root
from eth2spec.utils.ssz.ssz_typing import (
is_uint_type, is_bool_type, is_list_type,
is_vector_type, is_bytes_type, is_bytesn_type, is_container_type,
read_vector_elem_type, read_list_elem_type,
Vector, BytesN
)
def decode(data, typ):
if is_u... | [
"eth2spec.utils.ssz.ssz_typing.is_uint_type",
"eth2spec.utils.ssz.ssz_typing.read_list_elem_type",
"eth2spec.utils.ssz.ssz_typing.is_container_type",
"eth2spec.utils.ssz.ssz_typing.read_vector_elem_type",
"eth2spec.utils.ssz.ssz_typing.is_bytes_type",
"eth2spec.utils.ssz.ssz_typing.is_list_type",
"eth2s... | [((316, 333), 'eth2spec.utils.ssz.ssz_typing.is_uint_type', 'is_uint_type', (['typ'], {}), '(typ)\n', (328, 333), False, 'from eth2spec.utils.ssz.ssz_typing import is_uint_type, is_bool_type, is_list_type, is_vector_type, is_bytes_type, is_bytesn_type, is_container_type, read_vector_elem_type, read_list_elem_type, Vect... |
from rustfst_python_bench.utils import check_property_set
class ArcSortAlgorithm:
def __init__(self, sort_olabel=False):
self.sort_olabel = sort_olabel
@classmethod
def openfst_cli(cls):
return "fstarcsort"
@classmethod
def rustfst_subcommand(cls):
return "arcsort"
... | [
"rustfst_python_bench.utils.check_property_set"
] | [((853, 912), 'rustfst_python_bench.utils.check_property_set', 'check_property_set', (['path_res_openfst', '"""output label sorted"""'], {}), "(path_res_openfst, 'output label sorted')\n", (871, 912), False, 'from rustfst_python_bench.utils import check_property_set\n'), ((925, 984), 'rustfst_python_bench.utils.check_p... |
import itertools
import numpy
import tensorflow
from tensorflow.python.keras import backend as K
from .base_layer import ComplexLayer
class ComplexDense(ComplexLayer):
def __init__(self, units, activation=None, use_bias=True,
kernel_initializer='complex_glorot', bias_initializer='zeros',
... | [
"tensorflow.manip.roll",
"tensorflow.python.keras.backend.bias_add",
"tensorflow.reshape",
"tensorflow.stack",
"tensorflow.python.keras.backend.dot",
"numpy.prod"
] | [((1768, 1794), 'tensorflow.python.keras.backend.dot', 'K.dot', (['inputs', 'self.kernel'], {}), '(inputs, self.kernel)\n', (1773, 1794), True, 'from tensorflow.python.keras import backend as K\n'), ((2449, 2471), 'numpy.prod', 'numpy.prod', (['input_dims'], {}), '(input_dims)\n', (2459, 2471), False, 'import numpy\n')... |
#Um programa para sortear a ordem de nomes, presentes em uma lista.
import random
n1 = str (input('Digite o nome do 1° aluno: '))
n2 = str (input('Digite o nome do 2° aluno: '))
n3 = str (input('Digite o nome do 3° aluno: '))
n4 = str (input('Digite o nome do 4° aluno: '))
lista = [n1,n2,n3,n4]
random.shuffle(lista)... | [
"random.shuffle"
] | [((299, 320), 'random.shuffle', 'random.shuffle', (['lista'], {}), '(lista)\n', (313, 320), False, 'import random\n')] |
import numpy as np
import matplotlib.pyplot as plt
class ZSpreadModel:
def __init__(self, params, b_t, c_t, T, n_step):
self.m_params = params
self.m_b_t = b_t
self.m_c_t = c_t
self.m_time_grid = np.linspace(0, T, n_step)
def optimal_portfolio(self, z, t):
b_t = sel... | [
"matplotlib.pyplot.show",
"numpy.linalg.inv",
"numpy.matmul",
"numpy.linspace",
"matplotlib.pyplot.subplots"
] | [((236, 261), 'numpy.linspace', 'np.linspace', (['(0)', 'T', 'n_step'], {}), '(0, T, n_step)\n', (247, 261), True, 'import numpy as np\n'), ((1474, 1502), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(6, 6)'}), '(figsize=(6, 6))\n', (1486, 1502), True, 'import matplotlib.pyplot as plt\n'), ((1699, 17... |
#!/usr/bin/env python
## category Conversion
## desc Convert BAM reads to FASTA sequences
'''
Convert BAM reads to FASTA sequences
'''
import tofastq
if __name__ == '__main__':
tofastq.main(False)
| [
"tofastq.main"
] | [((183, 202), 'tofastq.main', 'tofastq.main', (['(False)'], {}), '(False)\n', (195, 202), False, 'import tofastq\n')] |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Console reader
@file read_scripts.py
@author: <NAME> (juusokorhonen on github.com)
@license: MIT License
"""
import os
import sys
import time
import signal
import argparse
import traceback
import json
import logging
import logging.handlers
import imp... | [
"sys.stdout.write",
"os.path.abspath",
"argparse.ArgumentParser",
"importlib.import_module",
"logging.StreamHandler",
"time.time",
"logging.Formatter",
"sys.stdout.flush",
"traceback.format_exc",
"sys.exit",
"signal.signal",
"logging.getLogger"
] | [((346, 381), 'os.path.abspath', 'os.path.abspath', (['"""../readersender/"""'], {}), "('../readersender/')\n", (361, 381), False, 'import os\n'), ((2232, 2257), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2255, 2257), False, 'import argparse\n'), ((3182, 3208), 'logging.getLogger', 'loggin... |
from django.db import models
from django.forms import ImageField
class Location(models.Model):
name = models.CharField(max_length=60)
def __str__(self):
return self.name
def save_location(self):
self.save()
def update_location(self, name):
self.name = name
self.save()
def delete_locat... | [
"django.db.models.CharField",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.ImageField"
] | [((106, 137), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(60)'}), '(max_length=60)\n', (122, 137), False, 'from django.db import models\n'), ((391, 422), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(60)'}), '(max_length=60)\n', (407, 422), False, 'from django.db im... |
import sqlite3
from DataManagements.BackendAPIStaticList import singleton
from threading import Lock
# manipulation of Recommendation table
@singleton
class RecomendationDBManager:
def __init__(self):
"""
Here we start all the points necessary to start this class
We creat a global L... | [
"threading.Lock",
"sqlite3.connect"
] | [((373, 379), 'threading.Lock', 'Lock', ([], {}), '()\n', (377, 379), False, 'from threading import Lock\n'), ((520, 575), 'sqlite3.connect', 'sqlite3.connect', (['"""Database.db"""'], {'check_same_thread': '(False)'}), "('Database.db', check_same_thread=False)\n", (535, 575), False, 'import sqlite3\n')] |
# This code is copied from a github respotry 2020.08.08 8:54 a.m.
# This code is copied from a github respotry 2020.08.10 10:00 a.m.
# this code is to add logging function and siplify the main file. By Ruibing 2020.08.11.15:11
import argparse
import os
import random
import shutil
import time
import warnings... | [
"pprint.pformat",
"argparse.ArgumentParser",
"config.update_config",
"numpy.empty",
"numpy.clip",
"torch.cuda.device_count",
"os.path.isfile",
"pprint.pprint",
"matplotlib.pyplot.gca",
"torchvision.transforms.Normalize",
"torch.no_grad",
"os.path.join",
"torch.nn.BCELoss",
"torch.utils.dat... | [((921, 993), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""MOCT image classification network"""'}), "(description='MOCT image classification network')\n", (944, 993), False, 'import argparse\n'), ((1181, 1204), 'config.update_config', 'update_config', (['args.cfg'], {}), '(args.cfg)\n'... |