code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
#
# Copyright 2017 Human Longevity, 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 ... | [
"pandas.DataFrame",
"disdat.api.apply",
"pandas.concat"
] | [((2249, 2290), 'disdat.api.apply', 'api.apply', (['"""examples"""', '"""DFDup"""'], {'params': '{}'}), "('examples', 'DFDup', params={})\n", (2258, 2290), True, 'import disdat.api as api\n'), ((1210, 1282), 'pandas.DataFrame', 'pd.DataFrame', (["{'heart_rate': [60, 70, 100, 55], 'age': [30, 44, 18, 77]}"], {}), "({'he... |
import sys
#print(sys.path)
sys.path.append('/home/pi/.local/lib/python3.7/site-packages')
import nltk
from nltk.stem import WordNetLemmatizer
lemmatizer = WordNetLemmatizer()
import pickle
import numpy as np
from keras.models import load_model
model = load_model('chatbot_model4.h5')
import json
import rando... | [
"sys.path.append",
"keras.models.load_model",
"nltk.stem.WordNetLemmatizer",
"random.choice",
"numpy.array",
"nlip2.name",
"nltk.word_tokenize"
] | [((30, 92), 'sys.path.append', 'sys.path.append', (['"""/home/pi/.local/lib/python3.7/site-packages"""'], {}), "('/home/pi/.local/lib/python3.7/site-packages')\n", (45, 92), False, 'import sys\n'), ((161, 180), 'nltk.stem.WordNetLemmatizer', 'WordNetLemmatizer', ([], {}), '()\n', (178, 180), False, 'from nltk.stem impo... |
# -*- coding: utf-8 -*-
from dao import db, Base
class ItemLista(Base):
__tablename__ = 'itenslistas'
lista_id = db.Column(db.Integer, db.ForeignKey('listas.id'), primary_key=True)
item_id = db.Column(db.Integer, db.ForeignKey('itens.id'), primary_key=True)
preco = db.Column(db.String(100))
item =... | [
"dao.db.String",
"dao.db.relationship",
"dao.db.ForeignKey"
] | [((321, 389), 'dao.db.relationship', 'db.relationship', (['"""ItemModel"""'], {'back_populates': '"""listas"""', 'uselist': '(False)'}), "('ItemModel', back_populates='listas', uselist=False)\n", (336, 389), False, 'from dao import db, Base\n'), ((402, 470), 'dao.db.relationship', 'db.relationship', (['"""ListaModel"""... |
from django.http import HttpResponse, HttpRequest, JsonResponse
from rest_framework.decorators import api_view
from rest_framework.request import Request
@api_view(["POST"])
def success_view(request: Request) -> HttpResponse:
return JsonResponse({"status": "success", "body": request.data.get("field")})
def serv... | [
"rest_framework.decorators.api_view",
"django.http.HttpResponse"
] | [((157, 175), 'rest_framework.decorators.api_view', 'api_view', (["['POST']"], {}), "(['POST'])\n", (165, 175), False, 'from rest_framework.decorators import api_view\n'), ((384, 434), 'django.http.HttpResponse', 'HttpResponse', (['"""Internal server error."""'], {'status': '(500)'}), "('Internal server error.', status... |
from django import template
register = template.Library()
def get_parent_geo(geo_levels, geo):
"""
only return the parent geo for a particular geography
"""
compare_level = []
for level in geo["parents"]:
compare_level.append(level)
return compare_level[:2]
register.filter("parent_g... | [
"django.template.Library"
] | [((40, 58), 'django.template.Library', 'template.Library', ([], {}), '()\n', (56, 58), False, 'from django import template\n')] |
import dill
import numpy as np
import tensorflow as tf
from collections import defaultdict
from sklearn.model_selection import train_test_split
with open('motion_capture_20181011-1931.dill', 'rb') as f:
x = dill.load(f)
vec = [l[4] for l in x]
# print(len(vec))
x = map(str, vec)
x = list(x)
#X_train, X_test = ... | [
"tensorflow.train.import_meta_graph",
"tensorflow.get_collection",
"tensorflow.Session",
"dill.load",
"collections.defaultdict",
"tensorflow.train.latest_checkpoint",
"numpy.linalg.norm",
"numpy.dot"
] | [((420, 432), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (430, 432), True, 'import tensorflow as tf\n'), ((445, 490), 'tensorflow.train.import_meta_graph', 'tf.train.import_meta_graph', (['"""model.ckpt.meta"""'], {}), "('model.ckpt.meta')\n", (471, 490), True, 'import tensorflow as tf\n'), ((560, 585), 'ten... |
from java.lang import String
from org.myrobotlab.service import Speech
from org.myrobotlab.service import Sphinx
from org.myrobotlab.service import Runtime
# create ear and mouth
ear = Runtime.createAndStart("ear","Sphinx")
mouth = Runtime.createAndStart("mouth","Speech")
mouth.setGoogleURI("http://thehackettfamily.... | [
"org.myrobotlab.service.Runtime.createAndStart"
] | [((188, 227), 'org.myrobotlab.service.Runtime.createAndStart', 'Runtime.createAndStart', (['"""ear"""', '"""Sphinx"""'], {}), "('ear', 'Sphinx')\n", (210, 227), False, 'from org.myrobotlab.service import Runtime\n'), ((235, 276), 'org.myrobotlab.service.Runtime.createAndStart', 'Runtime.createAndStart', (['"""mouth"""'... |
# encoding: utf-8
# !/usr/bin/python
from redis import Redis
from functools import wraps
from flask import session, g, make_response, Blueprint, jsonify, request, redirect
from flask_login import LoginManager, UserMixin, login_required
from Tools.Mysql_db import DB
from Function.Common import *
from dms.utils.manager... | [
"redis.Redis",
"flask.Blueprint",
"flask.redirect",
"flask.request.headers.get",
"Tools.Mysql_db.DB",
"time.sleep",
"dms.utils.manager.Explorer.get_instance",
"flask.jsonify",
"functools.wraps",
"flask.make_response",
"flask_login.LoginManager"
] | [((404, 408), 'Tools.Mysql_db.DB', 'DB', ([], {}), '()\n', (406, 408), False, 'from Tools.Mysql_db import DB\n'), ((500, 539), 'redis.Redis', 'Redis', ([], {'host': 'redis_host', 'port': 'redis_port'}), '(host=redis_host, port=redis_port)\n', (505, 539), False, 'from redis import Redis\n'), ((740, 754), 'flask_login.Lo... |
import pytest
import Levenshtein as lev
from ..comp import cmp_titles
from ..helpers import std
from ..config import *
#test linking by titles
@pytest.mark.parametrize(
"titles1, titles2, output",
[
(
[
"Resident Evil 2",
"Biohazard 2"
],
... | [
"pytest.mark.parametrize"
] | [((145, 492), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""titles1, titles2, output"""', '[([\'Resident Evil 2\', \'Biohazard 2\'], [\'Resident Evil 2\', \'RE2\'], 1), ([\n \'Resident Evil 2\', \'Biohazard 2\'], [\'Resident Evil\', \'RE\'], 1 -\n NUMBERING_WEIGHT), ([\'FIFA 2015\'], ["Fifa \'16", \... |
""" Holds the Data class """
import tensorflow as tf
import rnn
class Data:
""" Train holds functions responsible for producing training examples from Shakespearian text """
@staticmethod
def get_sequences():
"""
Returns batch sequences of the training text
:return: [sequences]
... | [
"rnn.Vectorize.get_text_as_int",
"tensorflow.data.Dataset.from_tensor_slices"
] | [((379, 410), 'rnn.Vectorize.get_text_as_int', 'rnn.Vectorize.get_text_as_int', ([], {}), '()\n', (408, 410), False, 'import rnn\n'), ((434, 481), 'tensorflow.data.Dataset.from_tensor_slices', 'tf.data.Dataset.from_tensor_slices', (['text_as_int'], {}), '(text_as_int)\n', (468, 481), True, 'import tensorflow as tf\n')] |
import os
from shutil import copyfile
from shutil import move
from random import randint
source = "/home/vegas/CBIS-DDSM"
destination = "/home/vegas/CBIS-DDSM-COCO_format"
train = os.path.join(destination, 'train')
test = os.path.join(destination, 'test')
val = os.path.join(destination, 'validation')
os.mk... | [
"os.mkdir",
"os.walk",
"os.path.join",
"random.randint"
] | [((188, 222), 'os.path.join', 'os.path.join', (['destination', '"""train"""'], {}), "(destination, 'train')\n", (200, 222), False, 'import os\n'), ((231, 264), 'os.path.join', 'os.path.join', (['destination', '"""test"""'], {}), "(destination, 'test')\n", (243, 264), False, 'import os\n'), ((272, 311), 'os.path.join', ... |
import FWCore.ParameterSet.Config as cms
# the Emulator kBMTF DQM module
from DQM.L1TMonitor.L1TdeStage2BMTF_cfi import *
# compares the unpacked BMTF2 regional muon collection to the emulated BMTF2 regional muon collection (after the TriggerAlgoSelector decide which is BMTF2)
# Plots for BMTF
l1tdeStage2BmtfSecond =... | [
"FWCore.ParameterSet.Config.untracked.bool",
"FWCore.ParameterSet.Config.InputTag",
"FWCore.ParameterSet.Config.untracked.vint32",
"FWCore.ParameterSet.Config.untracked.string"
] | [((393, 427), 'FWCore.ParameterSet.Config.InputTag', 'cms.InputTag', (['"""bmtfDigis"""', '"""BMTF2"""'], {}), "('bmtfDigis', 'BMTF2')\n", (405, 427), True, 'import FWCore.ParameterSet.Config as cms\n'), ((475, 514), 'FWCore.ParameterSet.Config.InputTag', 'cms.InputTag', (['"""valBmtfAlgoSel"""', '"""BMTF2"""'], {}), "... |
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
General gateway tests.
@since: 0.1.0
"""
import unittest
import sys
import pyamf
from pyamf import remoting
from pyamf.remoting import gateway, amf0
class TestService(object):
def spam(self):
return 'spam'
def echo(self, x):
... | [
"pyamf.remoting.Envelope",
"pyamf.get_encoder",
"pyamf.remoting.Request",
"pyamf.remoting.gateway.authenticate",
"new.module",
"pyamf.remoting.gateway.preprocess",
"pyamf.remoting.gateway.ServiceWrapper",
"pyamf.remoting.gateway.ServiceCollection",
"sys.exc_info",
"pyamf.remoting.gateway.expose_re... | [((416, 437), 'pyamf.remoting.ErrorFault', 'remoting.ErrorFault', ([], {}), '()\n', (435, 437), False, 'from pyamf import remoting\n'), ((573, 648), 'pyamf.remoting.ErrorFault', 'remoting.ErrorFault', ([], {'code': '(404)', 'details': '"""Not Found"""', 'description': '"""Spam eggs"""'}), "(code=404, details='Not Found... |
# -*- coding: utf-8 -*-
# Copyright (c) 2016 Civic Knowledge. This file is licensed under the terms of the
# MIT License, included in this distribution as LICENSE.txt
"""
Try to automatically ingest row data from a URL into a Rowpack file.
"""
from . import RowpackWriter, RowpackReader, intuit_rows, intuit_types, run... | [
"os.path.abspath",
"tempfile.gettempdir",
"rowgenerators.SourceSpec"
] | [((467, 488), 'tempfile.gettempdir', 'tempfile.gettempdir', ([], {}), '()\n', (486, 488), False, 'import tempfile\n'), ((1701, 1716), 'rowgenerators.SourceSpec', 'SourceSpec', ([], {}), '(**d)\n', (1711, 1716), False, 'from rowgenerators import SourceSpec\n'), ((1800, 1829), 'os.path.abspath', 'abspath', (["(ss.file_na... |
from core import GameConfig as Game
from core import Board
from config import TRAINING_CONFIG
from keras import Sequential, Model, Input
from keras.layers import InputLayer
from keras.layers.core import Activation, Dense, Flatten
from keras.layers.convolutional import Conv2D
from keras.layers.merge import Add
from kera... | [
"keras.Input",
"os.mkdir",
"keras.regularizers.l2",
"keras.backend.set_value",
"core.Board",
"keras.layers.core.Activation",
"os.path.exists",
"keras.optimizers.sgd",
"keras.layers.InputLayer",
"keras.layers.core.Flatten",
"keras.layers.normalization.BatchNormalization"
] | [((1043, 1076), 'keras.layers.normalization.BatchNormalization', 'BatchNormalization', ([], {'epsilon': '(1e-05)'}), '(epsilon=1e-05)\n', (1061, 1076), False, 'from keras.layers.normalization import BatchNormalization\n'), ((1616, 1634), 'keras.Input', 'Input', (['input_shape'], {}), '(input_shape)\n', (1621, 1634), Fa... |
#! /usr/bin/python
def binary_search(lst, item):
""" Perform binary search on a sorted list.
Return the index of the element if it is in
the list, otherwise return -1.
"""
low = 0
high = len(lst) - 1
while low < high:
middle = (high+low)/2
current = lst[middle]
if c... | [
"doctest.testmod"
] | [((1023, 1040), 'doctest.testmod', 'doctest.testmod', ([], {}), '()\n', (1038, 1040), False, 'import doctest\n')] |
from django.contrib import admin
from .models import *
class TrainAdmin(admin.ModelAdmin):
pass
admin.site.register(User)
admin.site.register(Tweet)
| [
"django.contrib.admin.site.register"
] | [((105, 130), 'django.contrib.admin.site.register', 'admin.site.register', (['User'], {}), '(User)\n', (124, 130), False, 'from django.contrib import admin\n'), ((131, 157), 'django.contrib.admin.site.register', 'admin.site.register', (['Tweet'], {}), '(Tweet)\n', (150, 157), False, 'from django.contrib import admin\n'... |
# Generated from D:/AnacondaProjects/iust_start/grammars\expr3.g4 by ANTLR 4.8
# encoding: utf-8
from antlr4 import *
from io import StringIO
import sys
if sys.version_info[1] > 5:
from typing import TextIO
else:
from typing.io import TextIO
def serializedATN():
with StringIO() as buf:
buf.write("\3\u60... | [
"io.StringIO",
"antlr4.error.Errors.FailedPredicateException"
] | [((276, 286), 'io.StringIO', 'StringIO', ([], {}), '()\n', (284, 286), False, 'from io import StringIO\n'), ((9510, 9571), 'antlr4.error.Errors.FailedPredicateException', 'FailedPredicateException', (['self', '"""self.precpred(self._ctx, 3)"""'], {}), "(self, 'self.precpred(self._ctx, 3)')\n", (9534, 9571), False, 'fro... |
"""
Script to analyze distribution of squared Euclidean distance between gradients.
"""
from math import sqrt
import numpy as np
from scipy import stats
# Set constants.
k_vals = [35, 30, 36]
n_vals = [1, 18, 1]
total_n = sum(n_vals)
sigma = 0.01
start_t = 200
t = 250
num_trials = 100
alpha = 0.05
load = "vecs.np"
... | [
"scipy.stats.kstest",
"numpy.load",
"math.sqrt",
"numpy.zeros",
"numpy.mean",
"numpy.linalg.norm",
"numpy.random.normal",
"numpy.concatenate"
] | [((421, 453), 'numpy.zeros', 'np.zeros', (['(t, total_n, max_k, 2)'], {}), '((t, total_n, max_k, 2))\n', (429, 453), True, 'import numpy as np\n'), ((1557, 1574), 'numpy.concatenate', 'np.concatenate', (['z'], {}), '(z)\n', (1571, 1574), True, 'import numpy as np\n'), ((2089, 2112), 'scipy.stats.kstest', 'stats.kstest'... |
import os
class Tomcat:
def get_details_for_each_tomcat(self,server_xml):
self.tcf = server_xml
self.th = os.path.dirname(os.path.dirname(server_xml))
return None
def display_details(self):
print(f'The tomcat config file is : {self.tcf} \nThe tomcat home is : {self.th}')
return None
def main():
tomcat7... | [
"os.path.dirname"
] | [((128, 155), 'os.path.dirname', 'os.path.dirname', (['server_xml'], {}), '(server_xml)\n', (143, 155), False, 'import os\n')] |
import unittest
import fibonacci
class TestFibonacci(unittest.TestCase):
def test_fib(self):
self.assertEqual(fibonacci.fib(1), 1)
self.assertEqual(fibonacci.fib(2), 1)
self.assertEqual(fibonacci.fib(3), 2)
self.assertEqual(fibonacci.fib(4), 3)
self.assertEqual(fibonacci.fi... | [
"unittest.main",
"fibonacci.fib_rec",
"fibonacci.fib_binet",
"fibonacci.fib"
] | [((1381, 1396), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1394, 1396), False, 'import unittest\n'), ((124, 140), 'fibonacci.fib', 'fibonacci.fib', (['(1)'], {}), '(1)\n', (137, 140), False, 'import fibonacci\n'), ((170, 186), 'fibonacci.fib', 'fibonacci.fib', (['(2)'], {}), '(2)\n', (183, 186), False, 'impor... |
# Generated by Django 3.0.6 on 2020-05-25 13:25
from decimal import Decimal
import django.contrib.auth.models
import django.contrib.auth.validators
import django.utils.timezone
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
de... | [
"django.db.models.ManyToManyField",
"decimal.Decimal",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.PositiveIntegerField",
"django.db.models.BooleanField",
"django.db.models.EmailField",
"django.db.models.AutoField",
"django.db.models.IntegerField",
"django.db.mod... | [((580, 647), 'django.db.models.AutoField', 'models.AutoField', ([], {'editable': '(False)', 'primary_key': '(True)', 'serialize': '(False)'}), '(editable=False, primary_key=True, serialize=False)\n', (596, 647), False, 'from django.db import migrations, models\n'), ((679, 736), 'django.db.models.CharField', 'models.Ch... |
# tf_unet is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# tf_unet is distributed in the hope that it will be useful,
# but WITHOUT... | [
"tf_unet.util.crop_to_shape",
"click.option",
"os.path.exists",
"click.command",
"glob.glob"
] | [((1135, 1150), 'click.command', 'click.command', ([], {}), '()\n', (1148, 1150), False, 'import click\n'), ((1152, 1204), 'click.option', 'click.option', (['"""--data_root"""'], {'default': '"""./bleien_data"""'}), "('--data_root', default='./bleien_data')\n", (1164, 1204), False, 'import click\n'), ((1206, 1278), 'cl... |
import pygame,sys
import random
import math
from pygame.locals import *
from pygame.sprite import Group
import gF
import Bullet
import DADcharacter
import Slave
import global_var
import Effect
import Item
import gameRule
class Menu():
def __init__(self):
super(Menu,self).__init__()
self.image=pyga... | [
"pygame.font.SysFont",
"pygame.mixer.music.play",
"math.sin",
"global_var.get_value",
"pygame.mixer.music.set_volume",
"global_var.set_value",
"pygame.mixer.music.load",
"pygame.image.load",
"pygame.mixer.music.stop",
"sys.exit"
] | [((389, 421), 'global_var.get_value', 'global_var.get_value', (['"""menuSign"""'], {}), "('menuSign')\n", (409, 421), False, 'import global_var\n'), ((442, 476), 'global_var.get_value', 'global_var.get_value', (['"""menuShadow"""'], {}), "('menuShadow')\n", (462, 476), False, 'import global_var\n'), ((505, 543), 'globa... |
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Functions used to provision Fuchsia boot images."""
import common
import logging
import os
import subprocess
import tempfile
import time
import uuid
_SS... | [
"os.remove",
"logging.debug",
"os.path.exists",
"time.time",
"os.path.isfile",
"common.GetHostToolPathFromPlatform",
"os.path.join",
"subprocess.check_call"
] | [((1016, 1058), 'os.path.join', 'os.path.join', (['output_dir', '"""id_ed25519.pub"""'], {}), "(output_dir, 'id_ed25519.pub')\n", (1028, 1058), False, 'import os\n'), ((1163, 1198), 'os.path.join', 'os.path.join', (['output_dir', '"""ssh_key"""'], {}), "(output_dir, 'ssh_key')\n", (1175, 1198), False, 'import os\n'), (... |
##################################################
# Copyright (c) <NAME> [GitHub D-X-Y], 2019 #
##################################################
import torch, copy, random
import torch.utils.data as data
class SearchDataset(data.Dataset):
def __init__(self, name, data, train_split, valid_split, direct_index=Fal... | [
"random.choice"
] | [((2211, 2242), 'random.choice', 'random.choice', (['self.valid_split'], {}), '(self.valid_split)\n', (2224, 2242), False, 'import torch, copy, random\n')] |
from functools import reduce
from typing import List
from snakemake.io import glob_wildcards
import pandas as pd
import numpy as np
import os
N_JOBS, MAX_ITER, MAX_NR = 28, 100, 20
MODEL_NAMES = [
# "lda", "bayes",
# "log_reg",
"rf"
]
META_MODEL_NAMES = [
"stacking",
"voting_hard",
"voting_... | [
"sklearn.ensemble.RandomForestClassifier",
"sklearn.naive_bayes.GaussianNB",
"optimizer.ensemble.StackingClassifier",
"pandas.read_csv",
"optimizer.ensemble.VotingClassifier",
"snakemake.io.glob_wildcards",
"sklearn.linear_model.LogisticRegression",
"sklearn.discriminant_analysis.LinearDiscriminantAna... | [((367, 422), 'snakemake.io.glob_wildcards', 'glob_wildcards', (['f"""data/{dataset}/csv/all/{{csv_names}}"""'], {}), "(f'data/{dataset}/csv/all/{{csv_names}}')\n", (381, 422), False, 'from snakemake.io import glob_wildcards\n'), ((746, 774), 'sklearn.discriminant_analysis.LinearDiscriminantAnalysis', 'LinearDiscrimina... |
# -*- coding: utf-8 -*-
from django import forms
from .models import restaurants
# Para campos individuales:
class RestaurantesForm(forms.Form):
nombre = forms.CharField(required=True, label='Name', max_length=80)
cocina = forms.CharField(required=True, label='Cuisine', widget=forms.TextInput(attrs={'plac... | [
"django.forms.TextInput",
"django.forms.CharField",
"django.forms.ImageField"
] | [((163, 222), 'django.forms.CharField', 'forms.CharField', ([], {'required': '(True)', 'label': '"""Name"""', 'max_length': '(80)'}), "(required=True, label='Name', max_length=80)\n", (178, 222), False, 'from django import forms\n'), ((358, 404), 'django.forms.CharField', 'forms.CharField', ([], {'required': '(True)', ... |
import pytest
from process_reports import read_rpc, check_excel, check_extension, read_info
import os
@pytest.fixture
def good_fn():
return os.path.join('Sample_Reports', 'ALL_RPC-2-1-2018_Scrubbed.xlsx')
@pytest.fixture
def updated_fn():
return os.path.join('Sample_Reports', 'ALL_RPC-7-3_2018_Scrubbed.xlsx... | [
"process_reports.read_rpc",
"process_reports.check_excel",
"pytest.raises",
"process_reports.read_info",
"process_reports.check_extension",
"pytest.mark.parametrize",
"os.path.join"
] | [((326, 1019), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""fn,acceptable,case,expected"""', "[('cool.txt', ['txt', 'xls'], True, True), ('cool.ini', ['txt', 'xls'], \n True, False), ('C:\\\\monster\\\\cool.ini', ['txt', 'xls'], True, False), (\n 'C:\\\\monster\\\\cool.txt', ['txt', 'xls'], True, T... |
import cherrypy
from mako.lookup import TemplateLookup
class Tool(cherrypy.Tool):
_lookups = {}
def __init__(self):
cherrypy.Tool.__init__(self, 'before_handler',
self.callable,
priority=40)
def callable(self,
filenam... | [
"cherrypy.request.template.render",
"cherrypy.Tool.__init__",
"mako.lookup.TemplateLookup"
] | [((135, 209), 'cherrypy.Tool.__init__', 'cherrypy.Tool.__init__', (['self', '"""before_handler"""', 'self.callable'], {'priority': '(40)'}), "(self, 'before_handler', self.callable, priority=40)\n", (157, 209), False, 'import cherrypy\n'), ((1310, 1353), 'cherrypy.request.template.render', 'cherrypy.request.template.re... |
import flask_restful
import re
from miRNASNP3 import app, api
from miRNASNP3.core import mongo
from flask_restful import Resource, fields, marshal_with, reqparse, marshal
from flask import send_file
mirna_exp_df = {
"ACC": fields.String,
"DLBC": fields.String,
"READ": fields.String,
"GBM": fields.Str... | [
"miRNASNP3.core.mongo.db.utr_cosmic_gain_redundancy.aggregate",
"miRNASNP3.core.mongo.db.indel_seed_mutation_gain_redundancy.find",
"miRNASNP3.core.mongo.db.utr_clinvar_gain_indel_redundancy.aggregate",
"miRNASNP3.core.mongo.db.seed_gain_addindel_redundancy.aggregate",
"miRNASNP3.core.mongo.db.snp_in_seed_v... | [((2097, 2153), 'miRNASNP3.api.add_resource', 'api.add_resource', (['MirExpression', '"""/api/mirna_expression"""'], {}), "(MirExpression, '/api/mirna_expression')\n", (2113, 2153), False, 'from miRNASNP3 import app, api\n'), ((6993, 7053), 'miRNASNP3.api.add_resource', 'api.add_resource', (['SnpSeedGainFull', '"""/api... |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
import json
import pickle
import numpy as np
import pandas as pd
import azureml.train.automl
from sklearn.externals import joblib
from azure... | [
"pandas.DataFrame",
"azureml.core.model.Model.get_model_path",
"inference_schema.parameter_types.numpy_parameter_type.NumpyParameterType",
"json.dumps",
"inference_schema.parameter_types.pandas_parameter_type.PandasParameterType",
"numpy.array",
"sklearn.externals.joblib.load"
] | [((633, 729), 'pandas.DataFrame', 'pd.DataFrame', ([], {'data': "[{'winddirabs': 0.34244, 'winddirrel': 0.324235, 'windspeedrel': 1.3213}]"}), "(data=[{'winddirabs': 0.34244, 'winddirrel': 0.324235,\n 'windspeedrel': 1.3213}])\n", (645, 729), True, 'import pandas as pd\n'), ((740, 753), 'numpy.array', 'np.array', ([... |
import pygame
from pygame.locals import *
from pygame.event import wait
from deck import *
from game import *
from init import *
deck = Deck()
King = Game("Pit","Dotti","Lella","Rob")
giocata=0
position=[0,0,0,0]
carteGiocate=[[],[],[],[],[],[],[],[],[],[],[],[],[]]
timerScomparsa=0
timerGiocata=0
primaCarta = None
... | [
"pygame.quit",
"pygame.display.set_icon",
"pygame.font.SysFont",
"pygame.event.get",
"pygame.display.set_mode",
"pygame.init",
"pygame.display.update",
"pygame.image.load",
"pygame.display.set_caption",
"pygame.time.Clock"
] | [((370, 383), 'pygame.init', 'pygame.init', ([], {}), '()\n', (381, 383), False, 'import pygame\n'), ((392, 411), 'pygame.time.Clock', 'pygame.time.Clock', ([], {}), '()\n', (409, 411), False, 'import pygame\n'), ((442, 477), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(800, 600)'], {}), '((800, 600))\n', ... |
# Generated by Django 3.0.3 on 2020-02-07 02:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('products', '0001_initial'),
('carts', '0002_cart_user'),
]
operations = [
migrations.AddField(
model_name='cart',
... | [
"django.db.models.ManyToManyField"
] | [((361, 436), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'through': '"""carts.CartProducts"""', 'to': '"""products.Product"""'}), "(through='carts.CartProducts', to='products.Product')\n", (383, 436), False, 'from django.db import migrations, models\n')] |
from django.db import models
from django.db.models import base
from django.db.models.deletion import CASCADE
from django.db.models.expressions import F
from localflavor.br.models import BRCPFField
from localflavor.br.validators import BRCPFValidator
class PersonType(models.Model):
id = models.AutoField(primary_ke... | [
"django.db.models.TextField",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.AutoField",
"django.db.models.DateField",
"localflavor.br.models.BRCPFField"
] | [((293, 343), 'django.db.models.AutoField', 'models.AutoField', ([], {'primary_key': '(True)', 'editable': '(False)'}), '(primary_key=True, editable=False)\n', (309, 343), False, 'from django.db import models\n'), ((355, 411), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(32)', 'blank': '(Fals... |
# Standard imports
import collections
import json
import select
import socket
import threading
import zmq
# Custom imports
import job
import message
import taskunit
import utils.logger
class Messenger:
'''A class representing a messenger that handles all communication.
'''
def __init__(self):
# i... | [
"job.Job.deserialize",
"threading.Thread",
"message.Message.glue_fragments",
"taskunit.TaskUnit.deserialize",
"zmq.Context",
"socket.socket",
"message.Message.packed_fragments",
"json.dumps",
"socket.gethostbyname",
"select.epoll",
"message.Message",
"job.serialize",
"threading.Semaphore",
... | [((590, 609), 'collections.deque', 'collections.deque', ([], {}), '()\n', (607, 609), False, 'import collections\n'), ((640, 659), 'collections.deque', 'collections.deque', ([], {}), '()\n', (657, 659), False, 'import collections\n'), ((694, 722), 'threading.Semaphore', 'threading.Semaphore', ([], {'value': '(0)'}), '(... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: fds/protobuf/stach/v2/table/TableData.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf impor... | [
"google.protobuf.symbol_database.Default",
"google.protobuf.descriptor.FieldDescriptor",
"google.protobuf.reflection.GeneratedProtocolMessageType",
"google.protobuf.descriptor.FileDescriptor"
] | [((405, 431), 'google.protobuf.symbol_database.Default', '_symbol_database.Default', ([], {}), '()\n', (429, 431), True, 'from google.protobuf import symbol_database as _symbol_database\n'), ((837, 2405), 'google.protobuf.descriptor.FileDescriptor', '_descriptor.FileDescriptor', ([], {'name': '"""fds/protobuf/stach/v2/... |
import math
def is_prime(n):
if n <= 1:
return False
elif n == 2:
return True
elif n % 2 == 0:
return False
for divisor in range(3, math.ceil(math.sqrt(n)) + 1, 2):
if n % divisor == 0:
return False
return True
def find_n_primes(n):
primes = [2]
... | [
"math.sqrt"
] | [((1625, 1637), 'math.sqrt', 'math.sqrt', (['n'], {}), '(n)\n', (1634, 1637), False, 'import math\n'), ((184, 196), 'math.sqrt', 'math.sqrt', (['n'], {}), '(n)\n', (193, 196), False, 'import math\n'), ((474, 489), 'math.sqrt', 'math.sqrt', (['test'], {}), '(test)\n', (483, 489), False, 'import math\n'), ((767, 782), 'm... |
from tkinter import *
import tkinter as tk
import os
import inspect
import configparser
#Create a window with a title
window = tk.Tk()
window.geometry("650x670")
window.title("Manager")
#Gets the system path for the manager file
filePath = os.path.abspath(inspect.getfile(inspect.currentframe()))
extenstion = filePat... | [
"os.listdir",
"tkinter.Tk",
"inspect.currentframe"
] | [((128, 135), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (133, 135), True, 'import tkinter as tk\n'), ((696, 715), 'os.listdir', 'os.listdir', (['dirName'], {}), '(dirName)\n', (706, 715), False, 'import os\n'), ((275, 297), 'inspect.currentframe', 'inspect.currentframe', ([], {}), '()\n', (295, 297), False, 'import insp... |
#!/usr/bin/python3
import typing
import pytest
import ecological
def test_regular_types(monkeypatch):
monkeypatch.setenv("INTEGER", "42")
monkeypatch.setenv("BOOLEAN", "False")
monkeypatch.setenv("ANY_STR", "AnyStr Example")
monkeypatch.setenv("TEXT", "Text Example")
monkeypatch.setenv("DICT", ... | [
"pytest.raises",
"ecological.Variable"
] | [((1617, 1683), 'ecological.Variable', 'ecological.Variable', (['"""TEST_Integer"""'], {'transform': '(lambda v, wt: v * 2)'}), "('TEST_Integer', transform=lambda v, wt: v * 2)\n", (1636, 1683), False, 'import ecological\n'), ((1705, 1746), 'ecological.Variable', 'ecological.Variable', (['"""404"""'], {'default': '(Fal... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | [
"pulumi.get",
"pulumi.getter",
"pulumi.set",
"pulumi.InvokeOptions",
"pulumi.runtime.invoke"
] | [((1159, 1189), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""apiProxy"""'}), "(name='apiProxy')\n", (1172, 1189), False, 'import pulumi\n'), ((1600, 1636), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""samplingConfig"""'}), "(name='samplingConfig')\n", (1613, 1636), False, 'import pulumi\n'), ((721, 765), ... |
#
# Script for transferring Dynatrace timeseries into AWS CloudWatch.
#
import requests, datetime, time, sched, subprocess, shlex
# Enter your own environment id and API key token here
YOUR_ENV_ID = 'ENTER_YOUR_ENV_ID_HERE';
YOUR_API_TOKEN = 'ENTER_YOUR_API_TOKEN_HERE';
# Configure a list of monitored components yo... | [
"sched.scheduler",
"requests.post",
"shlex.split"
] | [((978, 1016), 'sched.scheduler', 'sched.scheduler', (['time.time', 'time.sleep'], {}), '(time.time, time.sleep)\n', (993, 1016), False, 'import requests, datetime, time, sched, subprocess, shlex\n'), ((1516, 1562), 'requests.post', 'requests.post', (['url'], {'json': 'data', 'headers': 'headers'}), '(url, json=data, h... |
from logging import log
import torch
import argparse
import sys
import os
import tqdm
from copy import deepcopy
import torchvision
from torchvision import transforms
from torch import nn
from fedlab.core.client.manager import PassiveClientManager
from fedlab.core.client.trainer import SGDClientTrainer
from fedlab.cor... | [
"fedlab.utils.Logger",
"copy.deepcopy",
"setting.get_dataloader",
"argparse.ArgumentParser",
"setting.get_model",
"torch.nn.CrossEntropyLoss",
"fedlab.utils.functional.load_dict",
"fedlab.utils.dataset.SubsetSampler",
"torch.pow",
"fedlab.core.client.manager.PassiveClientManager",
"fedlab.core.n... | [((4697, 4763), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Distbelief training example"""'}), "(description='Distbelief training example')\n", (4720, 4763), False, 'import argparse\n'), ((5616, 5631), 'setting.get_model', 'get_model', (['args'], {}), '(args)\n', (5625, 5631), False, ... |
import re
import numpy as np
#numerical operation
import matplotlib.pyplot as plt
#matploit provides functions that draws graphs or etc.
from sklearn.cluster import MiniBatchKMeans
from sklearn.cluster import KMeans
import array
import numpy as np
def findminmax(dirname, filename):
print('findminmax')
mf = op... | [
"sklearn.cluster.MiniBatchKMeans",
"numpy.random.seed",
"numpy.empty",
"sklearn.cluster.KMeans",
"numpy.array",
"numpy.reshape"
] | [((4919, 4979), 'numpy.empty', 'np.empty', (['(numberofinsatnces * numoffeattype)'], {'dtype': '"""float64"""'}), "(numberofinsatnces * numoffeattype, dtype='float64')\n", (4927, 4979), True, 'import numpy as np\n'), ((5266, 5328), 'numpy.reshape', 'np.reshape', (['TotalInstances', '(numberofinsatnces, numoffeattype)']... |
# This file will be (temporarily) included in the Python sys.path
# when config.yml is loaded by the Tiled server.
import io
from PIL import Image
from tiled.structures.image_serializer_helpers import img_as_ubyte
def smiley_separated_variables(array, metadata):
return "\n".join("🙂".join(str(number) for number... | [
"PIL.Image.fromarray",
"io.BytesIO",
"tiled.structures.image_serializer_helpers.img_as_ubyte"
] | [((389, 401), 'io.BytesIO', 'io.BytesIO', ([], {}), '()\n', (399, 401), False, 'import io\n'), ((502, 521), 'tiled.structures.image_serializer_helpers.img_as_ubyte', 'img_as_ubyte', (['array'], {}), '(array)\n', (514, 521), False, 'from tiled.structures.image_serializer_helpers import img_as_ubyte\n'), ((534, 565), 'PI... |
# Author: <NAME>
import math
import matplotlib.pyplot as plt
import numpy as np
from scipy.special import logsumexp
'''
z = Wx + µ + E
the equation above represents the latent variable model which
relates a d-dimensional data vector z to a corresponding q-dimensional
latent variables x
with q < d, for isot... | [
"numpy.random.seed",
"numpy.argmin",
"matplotlib.pyplot.figure",
"numpy.random.randint",
"numpy.sin",
"numpy.exp",
"numpy.arange",
"scipy.special.logsumexp",
"numpy.unique",
"numpy.random.randn",
"numpy.power",
"numpy.transpose",
"numpy.var",
"matplotlib.pyplot.show",
"numpy.hstack",
"... | [((1916, 1959), 'numpy.random.randint', 'np.random.randint', (['(0)', 'n_datapts', 'n_clusters'], {}), '(0, n_datapts, n_clusters)\n', (1933, 1959), True, 'import numpy as np\n'), ((2205, 2238), 'numpy.zeros', 'np.zeros', (['(n_datapts, n_clusters)'], {}), '((n_datapts, n_clusters))\n', (2213, 2238), True, 'import nump... |
import streamlit as st
def app():
st.write("## Welcome to the Skink Search Tool app")
st.write("""
The app filters existing skink data by multiple criteria in order to help with the identification of skinks.
Latest data update: 10 Apr 2020. \n
Use the navigat... | [
"streamlit.markdown",
"streamlit.image",
"streamlit.sidebar.beta_expander",
"streamlit.write",
"streamlit.beta_expander"
] | [((39, 90), 'streamlit.write', 'st.write', (['"""## Welcome to the Skink Search Tool app"""'], {}), "('## Welcome to the Skink Search Tool app')\n", (47, 90), True, 'import streamlit as st\n'), ((96, 398), 'streamlit.write', 'st.write', (['""" \n The app filters existing skink data by multiple criteria i... |
import json
import sys
import imageio
import matplotlib.pyplot as plt
import cv2
import random
def search_images_by_id(_id):
for _ in valid['images']:
if _['id'] == _id:
return _
def search_categories_by_id(_id):
for _ in valid['categories']:
if _['id'] == _id:
return... | [
"json.load",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.scatter",
"random.random",
"cv2.rectangle"
] | [((363, 379), 'matplotlib.pyplot.imshow', 'plt.imshow', (['mask'], {}), '(mask)\n', (373, 379), True, 'import matplotlib.pyplot as plt\n'), ((469, 479), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (477, 479), True, 'import matplotlib.pyplot as plt\n'), ((528, 540), 'json.load', 'json.load', (['f'], {}), '(f... |
from django.apps import AppConfig
class CoreConfig(AppConfig):
name = 'core'
def ready(self):
from mqtt.mqtt_file import client
client.loop_start()
| [
"mqtt.mqtt_file.client.loop_start"
] | [((155, 174), 'mqtt.mqtt_file.client.loop_start', 'client.loop_start', ([], {}), '()\n', (172, 174), False, 'from mqtt.mqtt_file import client\n')] |
# -*- coding:utf-8 -*-
"""
Author:
<NAME>,<EMAIL>
Reference:
[1] <NAME>, <NAME>, <NAME>, et al. Product-based neural networks for user response prediction[C]//Data Mining (ICDM), 2016 IEEE 16th International Conference on. IEEE, 2016: 1149-1154.(https://arxiv.org/pdf/1611.00144.pdf)
"""
import torch
import tor... | [
"torch.cat",
"torch.nn.Linear"
] | [((4252, 4315), 'torch.cat', 'torch.cat', (['[linear_signal, inner_product, outer_product]'], {'dim': '(1)'}), '([linear_signal, inner_product, outer_product], dim=1)\n', (4261, 4315), False, 'import torch\n'), ((3267, 3313), 'torch.nn.Linear', 'nn.Linear', (['dnn_hidden_units[-1]', '(1)'], {'bias': '(False)'}), '(dnn_... |
import os
import shutil
from utils.logger import Logger, LogLvl
_logger = Logger(LogLvl.LOG_ERROR)
# Creation
def is_directory_exists(dir_name):
directory_exists = os.path.exists(dir_name)
if not directory_exists:
_logger.info("Directory \"{}\" not exists".format(dir_name))
return directory_exis... | [
"os.makedirs",
"os.path.exists",
"utils.logger.Logger",
"shutil.rmtree",
"os.listdir"
] | [((75, 99), 'utils.logger.Logger', 'Logger', (['LogLvl.LOG_ERROR'], {}), '(LogLvl.LOG_ERROR)\n', (81, 99), False, 'from utils.logger import Logger, LogLvl\n'), ((172, 196), 'os.path.exists', 'os.path.exists', (['dir_name'], {}), '(dir_name)\n', (186, 196), False, 'import os\n'), ((743, 766), 'os.listdir', 'os.listdir',... |
from things import Room, Item
def build_rooms():
print("Building world...", end="")
house_front_yard = Room("house_front_yard")
print(" done.")
return
def generate_items():
print("Generating items...", end="")
print(" done.")
return | [
"things.Room"
] | [((113, 137), 'things.Room', 'Room', (['"""house_front_yard"""'], {}), "('house_front_yard')\n", (117, 137), False, 'from things import Room, Item\n')] |
"""
sphinx-simulink.directives
~~~~~~~~~~~~~~~~~~~~~~~
Embed Simulink diagrams on your documentation.
:copyright:
Copyright 2016 by <NAME> <<EMAIL>>.
:license:
MIT, see LICENSE for details.
"""
import hashlib
import os
import tempfile
from docutils.parsers.rst import directives
from do... | [
"sphinxsimulink.diagram.nodes.diagram",
"os.path.abspath",
"os.path.dirname",
"tempfile.gettempdir",
"docutils.parsers.rst.directives.images.Figure.run",
"docutils.parsers.rst.directives.path",
"os.path.join"
] | [((1946, 1976), 'os.path.join', 'os.path.join', (['outdir', 'filename'], {}), '(outdir, filename)\n', (1958, 1976), False, 'import os\n'), ((2918, 2941), 'docutils.parsers.rst.directives.images.Figure.run', 'images.Figure.run', (['self'], {}), '(self)\n', (2935, 2941), False, 'from docutils.parsers.rst.directives impor... |
from setuptools import setup, find_packages
exec(open('opensoar/version.py').read())
with open("README.rst", "r") as f:
long_description = f.read()
setup(
name='opensoar',
version=__version__, # has been import above in exec command
license='MIT',
description='Open source python library for glid... | [
"setuptools.find_packages"
] | [((404, 436), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['tests']"}), "(exclude=['tests'])\n", (417, 436), False, 'from setuptools import setup, find_packages\n')] |
""" Tests for the Dfa class"""
import math
import random
import itertools
import pytest
from citoolkit.specifications.spec import AbstractSpec
from citoolkit.specifications.dfa import Dfa, State, DfaCycleError
###################################################################################################
# Basi... | [
"citoolkit.specifications.dfa.Dfa.exact_length_dfa",
"citoolkit.specifications.dfa.Dfa.min_length_dfa",
"citoolkit.specifications.dfa.Dfa",
"random.randint",
"math.sqrt",
"random.shuffle",
"pytest.raises",
"itertools.product",
"citoolkit.specifications.dfa.State",
"citoolkit.specifications.dfa.Dfa... | [((1338, 1403), 'citoolkit.specifications.dfa.Dfa', 'Dfa', (['alphabet', 'states', 'accepting_states', 'start_state', 'transitions'], {}), '(alphabet, states, accepting_states, start_state, transitions)\n', (1341, 1403), False, 'from citoolkit.specifications.dfa import Dfa, State, DfaCycleError\n'), ((3239, 3304), 'cit... |
#!/usr/bin/env python3
import os
import sys
import html5lib
from xml.etree import ElementTree as ET
import subprocess
from html import escape as H
"""
If you've found this, then you should help me report a bug in IDLE,
the official Python code editor. In IDLE 3.8.5 on Python 3.8.5 in
Xubuntu 20.04 LTS, if you open a ... | [
"subprocess.run",
"xml.etree.ElementTree.register_namespace",
"html5lib.parse",
"xml.etree.ElementTree.tostring",
"html.escape"
] | [((1521, 1578), 'xml.etree.ElementTree.register_namespace', 'ET.register_namespace', (['""""""', '"""http://www.w3.org/1999/xhtml"""'], {}), "('', 'http://www.w3.org/1999/xhtml')\n", (1542, 1578), True, 'from xml.etree import ElementTree as ET\n'), ((2103, 2123), 'subprocess.run', 'subprocess.run', (['args'], {}), '(ar... |
from bs4 import BeautifulSoup
import requests
from urllib.parse import urlsplit, urlunsplit
from config import settings
from logo_finder_service import LogoFinderService
from phone_finder_service import PhoneFinderService
from time import sleep
from selenium import webdriver
#from webdriver_manager.chrome import Chrome... | [
"phone_finder_service.PhoneFinderService",
"selenium.webdriver.chrome.options.Options",
"time.sleep",
"urllib.parse.urlsplit",
"requests.get",
"logo_finder_service.LogoFinderService",
"bs4.BeautifulSoup",
"selenium.webdriver.Chrome"
] | [((613, 634), 'urllib.parse.urlsplit', 'urlsplit', (['website_url'], {}), '(website_url)\n', (621, 634), False, 'from urllib.parse import urlsplit, urlunsplit\n'), ((958, 988), 'requests.get', 'requests.get', (['self.website_url'], {}), '(self.website_url)\n', (970, 988), False, 'import requests\n'), ((1515, 1545), 're... |
# Generated by Django 4.0.1 on 2022-02-25 04:15
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('beatup', '0011_alter_customer_photo'),
]
operations = [
migrations.AlterField(
model_name='post... | [
"django.db.models.ForeignKey"
] | [((368, 467), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'null': '(True)', 'on_delete': 'django.db.models.deletion.CASCADE', 'to': '"""beatup.customer"""'}), "(null=True, on_delete=django.db.models.deletion.CASCADE,\n to='beatup.customer')\n", (385, 467), False, 'from django.db import migrations, mode... |
import tweepy
import pandas as pd
config = pd.read_csv("./config.csv")
twitterAPIkey = config['twitterApiKey'][0]
twitterAPIS = config['twitterApiSecret'][0]
twitterAPIAT = config['twitterApiAccessToken'][0]
twitterAPIATS = config['twitterApiAccessTokenSecret'][0]
auth = tweepy.OAuthHandler(twitterAPIkey, twitterAPIS)... | [
"pandas.read_csv",
"tweepy.OAuthHandler"
] | [((43, 70), 'pandas.read_csv', 'pd.read_csv', (['"""./config.csv"""'], {}), "('./config.csv')\n", (54, 70), True, 'import pandas as pd\n'), ((273, 320), 'tweepy.OAuthHandler', 'tweepy.OAuthHandler', (['twitterAPIkey', 'twitterAPIS'], {}), '(twitterAPIkey, twitterAPIS)\n', (292, 320), False, 'import tweepy\n')] |
"""
"""
import argparse
import os
import sys
import mlflow
import pandas as pd
import pytorch_lightning as pl
import yaml
from dotenv import load_dotenv
load_dotenv() # noqa
sys.path.append(f"{os.getenv('PROJECT_ROOT')}src/") # noqa
from image_predict.data_module.kiva_data_module import KivaDataModule
from image_... | [
"pytorch_lightning.Trainer",
"argparse.ArgumentParser",
"pandas.read_csv",
"mlflow.log_artifact",
"yaml.safe_load",
"module.utils.set_seed",
"mlflow.active_run",
"pytorch_lightning.loggers.MLFlowLogger",
"mlflow.end_run",
"pytorch_lightning.callbacks.EarlyStopping",
"mlflow.log_metric",
"pytor... | [((156, 169), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (167, 169), False, 'from dotenv import load_dotenv\n'), ((4776, 4801), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (4799, 4801), False, 'import argparse\n'), ((5181, 5213), 'mlflow.log_artifact', 'mlflow.log_artifact', (['a... |
"""[summary]
"""
import os
import numpy as np
import tensorflow as tf
from src.utils import evaluation
from src.draw import draw
class GCLSemi:
"""[summary]
"""
def __init__(self, train_relevance_labels, train_features,
test_relevance_labels, test_features, test_query_ids, train_features... | [
"numpy.random.seed",
"numpy.concatenate",
"numpy.random.randn",
"tensorflow.global_variables_initializer",
"numpy.zeros",
"tensorflow.Session",
"tensorflow.constant",
"tensorflow.placeholder",
"tensorflow.matmul",
"numpy.mean",
"numpy.array",
"tensorflow.square",
"tensorflow.train.AdamOptimi... | [((855, 895), 'numpy.zeros', 'np.zeros', (['[self.x_unlabeled.shape[0], 1]'], {}), '([self.x_unlabeled.shape[0], 1])\n', (863, 895), True, 'import numpy as np\n'), ((1165, 1195), 'numpy.concatenate', 'np.concatenate', (['(x, y)'], {'axis': '(1)'}), '((x, y), axis=1)\n', (1179, 1195), True, 'import numpy as np\n'), ((12... |
# -*- coding: utf-8 -*-
import curses
dogdance1=[[
' ▄','▄','▄', #3
'▄▄▄▄','▄','▄', #6
'▄'],[' ',' ', #9
' ', '▄','▄'],#12
[' ',' ' , '▄',#15
' ','▄',' ',#18
'▄▄', '▄▄ '],[ ' ',#21
' ','▄',' ',#24
' ','▄',' ',#27
'▄', ' ','▄▄▄▄▄▄',#30
'▄'],[' ',' ',#33
'▄▄▄▄',' ',' ',#36
'▀'],[' '... | [
"curses.color_pair"
] | [((2141, 2164), 'curses.color_pair', 'curses.color_pair', (['pair'], {}), '(pair)\n', (2158, 2164), False, 'import curses\n'), ((2436, 2459), 'curses.color_pair', 'curses.color_pair', (['pair'], {}), '(pair)\n', (2453, 2459), False, 'import curses\n')] |
from collections import OrderedDict
from providers import value, terminal
def result_format(database_result, fmt):
format_function = 'result_format_%s' % fmt
if format_function not in globals():
raise Exception('Unsupported format "%s"' % fmt)
return globals()[format_function](database_result)... | [
"collections.OrderedDict",
"providers.terminal.get_key_value_adjusted",
"providers.value.represents_int"
] | [((441, 454), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (452, 454), False, 'from collections import OrderedDict\n'), ((2104, 2159), 'providers.terminal.get_key_value_adjusted', 'terminal.get_key_value_adjusted', (['k', 'v', 'max_label_length'], {}), '(k, v, max_label_length)\n', (2135, 2159), False, '... |
"""
A CPython inspired RPython parser.
"""
from rpython.rlib.objectmodel import not_rpython
class Grammar(object):
"""
Base Grammar object.
Pass this to ParserGenerator.build_grammar to fill it with useful values for
the Parser.
"""
def __init__(self):
self.symbol_ids = {}
se... | [
"pytest.ensuretemp"
] | [((4103, 4132), 'pytest.ensuretemp', 'pytest.ensuretemp', (['"""pyparser"""'], {}), "('pyparser')\n", (4120, 4132), False, 'import pytest\n'), ((8970, 8999), 'pytest.ensuretemp', 'pytest.ensuretemp', (['"""pyparser"""'], {}), "('pyparser')\n", (8987, 8999), False, 'import pytest\n')] |
import json
import pandas as pd
import requests
from datetime import datetime
from io import StringIO
from furl import furl
from tqdm import tqdm
from time import sleep
class Appodeal:
DEFAULT_ENDPOINT = "https://api-services.appodeal.com/api/v2/stats_api?/"
TASK_ENDPOINT = "https://api-services.appodeal.c... | [
"io.StringIO",
"tqdm.tqdm",
"json.loads",
"pandas.json_normalize",
"furl.furl",
"time.sleep",
"requests.get",
"datetime.datetime.now"
] | [((1903, 1930), 'furl.furl', 'furl', (['self.DEFAULT_ENDPOINT'], {}), '(self.DEFAULT_ENDPOINT)\n', (1907, 1930), False, 'from furl import furl\n'), ((2485, 2504), 'requests.get', 'requests.get', (['f.url'], {}), '(f.url)\n', (2497, 2504), False, 'import requests\n'), ((2643, 2667), 'furl.furl', 'furl', (['self.TASK_END... |
from web.template import CompiledTemplate, ForLoop, TemplateResult
# coding: utf-8
def base (page):
__lineoffset__ = -4
loop = ForLoop()
self = TemplateResult(); extend_ = self.extend
extend_([u'\n'])
extend_([u'<html>\n'])
extend_([u'<head>\n'])
extend_([u' <meta name="viewport" conten... | [
"web.template.CompiledTemplate",
"web.template.TemplateResult",
"web.template.ForLoop"
] | [((4577, 4622), 'web.template.CompiledTemplate', 'CompiledTemplate', (['base', '"""templates/base.html"""'], {}), "(base, 'templates/base.html')\n", (4593, 4622), False, 'from web.template import CompiledTemplate, ForLoop, TemplateResult\n'), ((10303, 10350), 'web.template.CompiledTemplate', 'CompiledTemplate', (['inde... |
# -*- coding: utf-8 -*-
import numpy as np
import logging, sys, operator
from matplotlib.colors import Normalize
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotlib.figure import Figure
from matplotlib.ticker import MaxNLocator
from mpl_toolkits.axes_grid1 import make_axes_loca... | [
"numpy.abs",
"numpy.sum",
"matplotlib.pyplot.FixedFormatter",
"matplotlib.pyplot.figure",
"numpy.arange",
"numpy.tile",
"numpy.interp",
"matplotlib.colors.Normalize",
"matplotlib.backends.backend_agg.FigureCanvasAgg",
"matplotlib.ticker.MaxNLocator",
"matplotlib.figure.Figure",
"matplotlib.pyp... | [((2042, 2065), 'mpl_toolkits.axes_grid1.make_axes_locatable', 'make_axes_locatable', (['ax'], {}), '(ax)\n', (2061, 2065), False, 'from mpl_toolkits.axes_grid1 import make_axes_locatable\n'), ((5790, 5815), 'numpy.tile', 'np.tile', (['rankings', '(2, 1)'], {}), '(rankings, (2, 1))\n', (5797, 5815), True, 'import numpy... |
#This is a direct port of x_keckhelio.pro from XIDL
from __future__ import division, print_function
from math import pi
from numpy import cos, sin
import numpy as np
def x_keckhelio(ra, dec, epoch=2000.0, jd=None, tai=None,
longitude=None, latitude=None, altitude=None, obs='keck'):
"""
`ra` an... | [
"numpy.sum",
"numpy.abs",
"numpy.empty",
"numpy.sin",
"numpy.array",
"numpy.cos",
"numpy.dot"
] | [((7216, 7246), 'numpy.array', 'np.array', (['((theta + lng) / 15.0)'], {}), '((theta + lng) / 15.0)\n', (7224, 7246), True, 'import numpy as np\n'), ((16178, 16206), 'numpy.array', 'np.array', (['[1.0, dt, dt * dt]'], {}), '([1.0, dt, dt * dt])\n', (16186, 16206), True, 'import numpy as np\n'), ((16735, 16743), 'numpy... |
import loader
from migration_tool.adapters.mssql import MSSQLAdapter
from migration_tool.adapters.mysql import MySQLAdapter
from migration_tool.adapters.postgres import PostgresAdapter
from migration_tool.adapters.oracle import OracleAdapter
from migration_tool.sql2json import SQLtoJSON
if __name__ == '__main__':
... | [
"migration_tool.sql2json.SQLtoJSON",
"migration_tool.adapters.mssql.MSSQLAdapter"
] | [((1041, 1139), 'migration_tool.adapters.mssql.MSSQLAdapter', 'MSSQLAdapter', (["{'host': 'localhost', 'database': 'owf', 'user': 'sa', 'password': '<PASSWORD>'\n }"], {}), "({'host': 'localhost', 'database': 'owf', 'user': 'sa',\n 'password': '<PASSWORD>'})\n", (1053, 1139), False, 'from migration_tool.adapters.... |
import argparse
import importlib.util
import os
import sys
import chainer
import numpy as np
import six
from PIL import Image
from ..params import ProcessParams
from ..simple import BaseProcessor
PROJECT_DIR = os.path.dirname(__file__)
waifu2x_path = os.path.join(PROJECT_DIR, "waifu2x-chainer")
def import_waifu2x_... | [
"argparse.ArgumentParser",
"chainer.serializers.load_npz",
"numpy.ceil",
"os.path.isdir",
"numpy.log2",
"os.path.dirname",
"chainer.backends.cuda.get_device",
"os.path.exists",
"chainer.backends.cuda.check_cuda_available",
"numpy.round",
"os.path.join",
"six.print_"
] | [((213, 238), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (228, 238), False, 'import os\n'), ((254, 298), 'os.path.join', 'os.path.join', (['PROJECT_DIR', '"""waifu2x-chainer"""'], {}), "(PROJECT_DIR, 'waifu2x-chainer')\n", (266, 298), False, 'import os\n'), ((4536, 4554), 'numpy.log2', 'n... |
import argparse
from datetime import datetime
import gc
import joblib
from poutyne.framework import Model
from poutyne.framework.callbacks import *
from tensorboardX import SummaryWriter
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader
from load_dataset imp... | [
"torch.nn.Dropout",
"torch.nn.BCEWithLogitsLoss",
"argparse.ArgumentParser",
"torch.utils.data.DataLoader",
"torch.cuda.memory_allocated",
"torch.nn.Conv2d",
"torch.nn.BatchNorm1d",
"poutyne.framework.Model",
"torch.nn.BatchNorm2d",
"torch.cuda.is_available",
"torch.cuda.empty_cache",
"torch.n... | [((828, 883), 'joblib.load', 'joblib.load', (['"""/dcase/spec_vgg/label_to_files_train.zip"""'], {}), "('/dcase/spec_vgg/label_to_files_train.zip')\n", (839, 883), False, 'import joblib\n'), ((911, 965), 'joblib.load', 'joblib.load', (['"""/dcase/spec_vgg/label_to_files_test.zip"""'], {}), "('/dcase/spec_vgg/label_to_f... |
from __future__ import print_function, division
import os
import torch
import numpy as np
import pandas as pd
import math
import re
import pdb
import pickle
from scipy import stats
from torch.utils.data import Dataset
import h5py
from libs.utils.utils import generate_split, nth
def save_splits(split_datasets, colu... | [
"pandas.DataFrame",
"torch.from_numpy",
"h5py.File",
"numpy.random.seed",
"numpy.random.shuffle",
"libs.utils.utils.generate_split",
"pandas.read_csv",
"scipy.stats.mode",
"torch.load",
"numpy.where",
"numpy.array",
"numpy.intersect1d",
"pandas.concat",
"numpy.unique",
"libs.utils.utils.... | [((480, 524), 'pandas.concat', 'pd.concat', (['splits'], {'ignore_index': '(True)', 'axis': '(1)'}), '(splits, ignore_index=True, axis=1)\n', (489, 524), True, 'import pandas as pd\n'), ((566, 610), 'pandas.concat', 'pd.concat', (['splits'], {'ignore_index': '(True)', 'axis': '(0)'}), '(splits, ignore_index=True, axis=... |
import math
import gin
import torch
from torch import nn
@gin.configurable
class RegularizationLoss(nn.Module):
def __init__(self,
latent_dims,
scale_by_batch=True,
use_bayes_factor_vae0_loss=False,
use_tc_loss=False):
supe... | [
"torch.logsumexp",
"torch.exp",
"torch.zeros",
"math.log",
"torch.sum"
] | [((4890, 4908), 'torch.exp', 'torch.exp', (['(-logvar)'], {}), '(-logvar)\n', (4899, 4908), False, 'import torch\n'), ((2880, 2912), 'torch.sum', 'torch.sum', (['(log_qz - log_prod_qzi)'], {}), '(log_qz - log_prod_qzi)\n', (2889, 2912), False, 'import torch\n'), ((1050, 1062), 'torch.sum', 'torch.sum', (['x'], {}), '(x... |
from catsup.models import Post
from catsup.utils import to_unicode, ObjectDict
from catsup.reader.utils import split_content, parse_yaml_meta
def html_reader(path):
meta, content = split_content(path)
if not meta:
meta = ObjectDict()
else:
meta = parse_yaml_meta(meta, path)
return Post... | [
"catsup.reader.utils.split_content",
"catsup.utils.ObjectDict",
"catsup.utils.to_unicode",
"catsup.reader.utils.parse_yaml_meta"
] | [((187, 206), 'catsup.reader.utils.split_content', 'split_content', (['path'], {}), '(path)\n', (200, 206), False, 'from catsup.reader.utils import split_content, parse_yaml_meta\n'), ((239, 251), 'catsup.utils.ObjectDict', 'ObjectDict', ([], {}), '()\n', (249, 251), False, 'from catsup.utils import to_unicode, ObjectD... |
import json
import os
os.chdir(r'C:\Users\xtrem\Desktop\electric\Electric Packages\packages')
packages = [ f.replace('.json', '') for f in os.listdir(r'C:\Users\xtrem\Desktop\electric\Electric Packages\packages') ]
print(packages)
data = {
'packages': packages,
}
with open(r'C:\Users\xtrem\Desktop\electric\Electr... | [
"os.listdir",
"os.system",
"os.chdir",
"json.dumps"
] | [((23, 99), 'os.chdir', 'os.chdir', (['"""C:\\\\Users\\\\xtrem\\\\Desktop\\\\electric\\\\Electric Packages\\\\packages"""'], {}), "('C:\\\\Users\\\\xtrem\\\\Desktop\\\\electric\\\\Electric Packages\\\\packages')\n", (31, 99), False, 'import os\n'), ((404, 460), 'os.system', 'os.system', (['"""powershell.exe deploy "Upd... |
import numpy as np
import matplotlib.pyplot as plt
import cv2
import os
from PIL import Image
from mtcnn.mtcnn import MTCNN
train_dir = 'data/train'
valid_dir = 'data/val'
face_detector = MTCNN()
# for i in os.listdir(train_dir):
# print(i)
# my_img = 'data/train/madonna/httpiamediaimdbcomimagesMMVBMTANDQNTAxN... | [
"os.path.isdir",
"numpy.asarray",
"mtcnn.mtcnn.MTCNN",
"PIL.Image.open",
"PIL.Image.fromarray",
"os.path.join",
"os.listdir"
] | [((194, 201), 'mtcnn.mtcnn.MTCNN', 'MTCNN', ([], {}), '()\n', (199, 201), False, 'from mtcnn.mtcnn import MTCNN\n'), ((447, 467), 'PIL.Image.open', 'Image.open', (['img_path'], {}), '(img_path)\n', (457, 467), False, 'from PIL import Image\n'), ((504, 519), 'numpy.asarray', 'np.asarray', (['img'], {}), '(img)\n', (514,... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import os
import threading
g_ip_check = re.compile(r'^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$')
def check_ip_valid4(ip):
"""检查ipv4地址的合法性"""
ret = g_ip_check.match(ip)
if ret is not None:
"each item range: [0,255]"
for item in re... | [
"threading.Condition",
"os.urandom",
"re.compile"
] | [((98, 163), 're.compile', 're.compile', (['"""^(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\d{1,3})$"""'], {}), "('^(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\d{1,3})$')\n", (108, 163), False, 'import re\n'), ((2005, 2046), 're.compile', 're.compile', (['"""(?!-)[A-Z\\\\d-]{1,63}(?<!-)$"""'], {... |
from django.db import migrations
from django.db.migrations import RunPython
def add_fuel_classes(apps, schema_editor):
"""
Creates the fuel classes: Gasoline and Diesel
"""
db_alias = schema_editor.connection.alias
fuel_class = apps.get_model('api', 'FuelClass')
fuel_class.objects.using(db_a... | [
"django.db.migrations.RunPython"
] | [((1108, 1156), 'django.db.migrations.RunPython', 'RunPython', (['add_fuel_classes', 'remove_fuel_classes'], {}), '(add_fuel_classes, remove_fuel_classes)\n', (1117, 1156), False, 'from django.db.migrations import RunPython\n')] |
from django.db import models
from django.contrib.auth.models import User
class PostLike(models.Model):
post = models.ForeignKey("Post", on_delete=models.CASCADE)
user = models.ForeignKey(User, on_delete=models.CASCADE)
timestamp = models.DateTimeField(auto_now_add=True)
class Post(models.Model):
tit... | [
"django.db.models.ManyToManyField",
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.db.models.IntegerField",
"django.db.models.DateTimeField"
] | [((116, 167), 'django.db.models.ForeignKey', 'models.ForeignKey', (['"""Post"""'], {'on_delete': 'models.CASCADE'}), "('Post', on_delete=models.CASCADE)\n", (133, 167), False, 'from django.db import models\n'), ((179, 228), 'django.db.models.ForeignKey', 'models.ForeignKey', (['User'], {'on_delete': 'models.CASCADE'}),... |
from django.contrib import admin
from apps.inventories.models import Place
@admin.register(Place)
class PlaceAdmin(admin.ModelAdmin):
list_display = ('pk', 'name', 'all_members')
ordering = ('pk',)
def all_members(self, obj):
return '\n'.join([str(member) for member in obj.members.all().distinct... | [
"django.contrib.admin.register"
] | [((79, 100), 'django.contrib.admin.register', 'admin.register', (['Place'], {}), '(Place)\n', (93, 100), False, 'from django.contrib import admin\n')] |
import logging
import boto3
import re
import pandas as pd
import concurrent.futures
from itertools import repeat
from typing import Dict, List, Union
from datetime import datetime
from dateutil.parser import parse
__author__ = "mikethoun"
__copyright__ = "mikethoun"
__license__ = "apache license 2.0"
class LogQuery:... | [
"pandas.DataFrame",
"dateutil.parser.parse",
"logging._nameToLevel.items",
"re.findall",
"boto3.session.Session",
"pandas.concat",
"itertools.repeat"
] | [((1769, 1797), 'logging._nameToLevel.items', 'logging._nameToLevel.items', ([], {}), '()\n', (1795, 1797), False, 'import logging\n'), ((3508, 3547), 'pandas.DataFrame', 'pd.DataFrame', (['data'], {'columns': 'self.fields'}), '(data, columns=self.fields)\n', (3520, 3547), True, 'import pandas as pd\n'), ((4758, 4776),... |
import time
import os
import glob
import gc
import numpy as np
import torch
import torch.optim as optim
import torch.nn as nn
import pytorch_lightning as pl
import pytorch_lightning.loggers as pl_loggers
import pytorch_lightning.callbacks as pl_callbacks
from torch.utils.data import DataLoader
from config_modified im... | [
"pytorch_lightning.Trainer",
"numpy.random.seed",
"utils.decoders.ctc_search_decode",
"time.strftime",
"gc.collect",
"torch.utils.data.DataLoader",
"data.lrs2_dataset.LRS2Pretrain",
"utils.metrics.compute_wer",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"pytorch_lightning.loggers.NeptuneLogger"... | [((9879, 10025), 'pytorch_lightning.loggers.NeptuneLogger', 'pl_loggers.NeptuneLogger', ([], {'project_name': '"""benso/deep-avsr"""', 'experiment_name': 'f"""video_only_curriculum"""', 'params': 'args', 'tags': "{'start_date': timestr}"}), "(project_name='benso/deep-avsr', experiment_name=\n f'video_only_curriculum... |
from __future__ import print_function, division
import os
import torch
import pandas as pd
from skimage import io, transform
import numpy as np
import matplotlib.pyplot as plt
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, utils
from src.data.baseline_transformers import Transforms... | [
"numpy.load",
"torch.stack",
"numpy.random.randn",
"pandas.read_csv",
"torchvision.transforms.ToPILImage",
"torchvision.transforms.ToTensor",
"torchvision.transforms.Normalize",
"torch.from_numpy"
] | [((851, 871), 'pandas.read_csv', 'pd.read_csv', (['test_df'], {}), '(test_df)\n', (862, 871), True, 'import pandas as pd\n'), ((910, 945), 'pandas.read_csv', 'pd.read_csv', (['test_df_track_order_df'], {}), '(test_df_track_order_df)\n', (921, 945), True, 'import pandas as pd\n'), ((982, 1010), 'numpy.load', 'np.load', ... |
"""
Name: <NAME>
Class: K63K2
MSSV: 18020116
You should understand the code you write.
"""
import numpy as np
import cv2
import argparse
from matplotlib import pyplot as plt
def q_0(input_file, output_file, ):
img = cv2.imread(input_file, cv2.IMREAD_COLOR)
cv2.imshow('Test img', img)
cv2.waitKey(5000)
... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.xlim",
"numpy.zeros_like",
"matplotlib.pyplot.show",
"argparse.ArgumentParser",
"matplotlib.pyplot.plot",
"cv2.waitKey",
"cv2.imwrite",
"cv2.calcHist",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.axis",
"cv2.imread",
"matplotlib.pyplot.figure"... | [((224, 264), 'cv2.imread', 'cv2.imread', (['input_file', 'cv2.IMREAD_COLOR'], {}), '(input_file, cv2.IMREAD_COLOR)\n', (234, 264), False, 'import cv2\n'), ((269, 296), 'cv2.imshow', 'cv2.imshow', (['"""Test img"""', 'img'], {}), "('Test img', img)\n", (279, 296), False, 'import cv2\n'), ((301, 318), 'cv2.waitKey', 'cv... |
"""
echopype data model inherited from based class Process for EK80 data.
"""
import os
import datetime as dt
import numpy as np
import xarray as xr
from scipy import signal
from ..utils import uwa
from .processbase import ProcessBase
class ProcessEK80(ProcessBase):
"""Class for manipulating EK80 echo data alrea... | [
"numpy.abs",
"numpy.sum",
"numpy.floor",
"numpy.ones",
"numpy.mean",
"numpy.arange",
"numpy.linalg.norm",
"numpy.convolve",
"numpy.round",
"numpy.pad",
"os.path.exists",
"numpy.max",
"numpy.hanning",
"numpy.log10",
"datetime.datetime.now",
"numpy.conj",
"xarray.concat",
"numpy.cos"... | [((11802, 11834), 'os.path.splitext', 'os.path.splitext', (['self.file_path'], {}), '(self.file_path)\n', (11818, 11834), False, 'import os\n'), ((11963, 11986), 'os.path.exists', 'os.path.exists', (['cw_path'], {}), '(cw_path)\n', (11977, 11986), False, 'import os\n'), ((5434, 5482), 'numpy.cos', 'np.cos', (['(2 * np.... |
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('README.rst') as f:
description = f.read()
setup(
name='bikeshed',
version='0.1.0',
packages=find_packages(),
license=u'BSD 3-Clause License',
long_description=description,
include_package_data=True,
install... | [
"setuptools.find_packages"
] | [((190, 205), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (203, 205), False, 'from setuptools import setup, find_packages\n')] |
from model.contact import Contact
from random import randrange
import re
def test_contact_info_on_main_page(app):
if app.contact.count() == 0:
app.contact.add_contact(
Contact(firstname="Ivan", middlename="Sergeevich", lastname="Petrov", nickname="Butthead", title="test",
c... | [
"re.sub",
"model.contact.Contact"
] | [((1447, 1470), 're.sub', 're.sub', (['"""[() -]"""', '""""""', 's'], {}), "('[() -]', '', s)\n", (1453, 1470), False, 'import re\n'), ((194, 649), 'model.contact.Contact', 'Contact', ([], {'firstname': '"""Ivan"""', 'middlename': '"""Sergeevich"""', 'lastname': '"""Petrov"""', 'nickname': '"""Butthead"""', 'title': '"... |
"""
Run this script with -h for the help.
It produces for each method for a given dataset all the data needed to compare the methods on the specified dataset.
The strategies being compared are defined after line 88.
"""
from concurrent.futures import wait, ALL_COMPLETED
from concurrent.futures.process import ProcessPo... | [
"pandas.DataFrame",
"tqdm.tqdm",
"argparse.ArgumentParser",
"pseas.discrimination.wilcoxon.Wilcoxon",
"pseas.instance_selection.udd.UDD",
"pandas.read_csv",
"numpy.floor",
"pseas.standard_strategy.StandardStrategy",
"os.path.exists",
"pseas.test_env.TestEnv",
"concurrent.futures.process.ProcessP... | [((1356, 1412), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Produce run data."""'}), "(description='Produce run data.')\n", (1379, 1412), False, 'import argparse\n'), ((5860, 5905), 'os.path.exists', 'os.path.exists', (['f"""./runs_{output_suffix}.csv"""'], {}), "(f'./runs_{output_suf... |
import json
import plotly
import pandas as pd
import re
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
from flask import Flask
from flask import render_template, request, jsonify
from plotly.graph_objs import Bar
from sklearn.externals import joblib
f... | [
"nltk.stem.WordNetLemmatizer",
"flask.request.args.get",
"flask.Flask",
"plotly.graph_objs.Layout",
"json.dumps",
"pandas.read_sql_table",
"nltk.corpus.stopwords.words",
"sklearn.externals.joblib.load",
"sqlalchemy.create_engine",
"plotly.graph_objs.Figure",
"flask.render_template",
"re.sub",
... | [((394, 409), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (399, 409), False, 'from flask import Flask\n'), ((2677, 2731), 'sqlalchemy.create_engine', 'create_engine', (['"""sqlite:///../data/DisasterResponse.db"""'], {}), "('sqlite:///../data/DisasterResponse.db')\n", (2690, 2731), False, 'from sqlalche... |
#!/usr/bin/env python
#
# <NAME>
#
# This is a test of a Lindenmayer grammar that generates
# rather realistic-looking plant shrubbery. You can go to
# http://en.wikipedia.org/wiki/L-system for more information.
# This script requires the python-pygame dependency.
#
# Licensed under the MIT License.
import pygame, sys... | [
"pygame.quit",
"random.randint",
"pygame.draw.rect",
"pygame.display.set_mode",
"pygame.event.get",
"random.choice",
"pygame.init",
"pygame.display.flip",
"math.sin",
"math.cos",
"pygame.display.set_caption",
"pygame.time.Clock",
"sys.exit"
] | [((521, 534), 'pygame.init', 'pygame.init', ([], {}), '()\n', (532, 534), False, 'import pygame, sys, math, os, random\n'), ((558, 604), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(800, 600)', 'SWSURFACE'], {}), '((800, 600), SWSURFACE)\n', (581, 604), False, 'import pygame, sys, math, os, random\n'), ((6... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 16 23:08:55 2021
@author: maurol
"""
import os
from typing import Dict
import graphviz
import pandas as pd
from sklearn.tree import DecisionTreeRegressor
# TRUE False
f = """
digraph Tree {
node [shape=box, style="rounded", color="black", fontname=helvetica] ;
edge ... | [
"os.path.join",
"os.path.splitext"
] | [((1667, 1694), 'os.path.splitext', 'os.path.splitext', (['plot_name'], {}), '(plot_name)\n', (1683, 1694), False, 'import os\n'), ((1749, 1778), 'os.path.join', 'os.path.join', (['path_plot', 'name'], {}), '(path_plot, name)\n', (1761, 1778), False, 'import os\n')] |
import FWCore.ParameterSet.Config as cms
#
# produce ttSemiLep event hypotheses
#
## geom hypothesis
from TopQuarkAnalysis.TopJetCombination.TtSemiLepHypGeom_cff import *
## wMassDeltaTopMass hypothesis
from TopQuarkAnalysis.TopJetCombination.TtSemiLepHypWMassDeltaTopMass_cff import *
## wMassMaxSumPt hypothesis
fr... | [
"FWCore.ParameterSet.Config.Sequence",
"FWCore.ParameterSet.Config.Task"
] | [((958, 1220), 'FWCore.ParameterSet.Config.Task', 'cms.Task', (['makeHypothesis_geomTask', 'makeHypothesis_wMassDeltaTopMassTask', 'makeHypothesis_wMassMaxSumPtTask', 'makeHypothesis_maxSumPtWMassTask', 'makeHypothesis_genMatchTask', 'makeHypothesis_mvaDiscTask', 'makeHypothesis_kinFitTask', 'makeHypothesis_hitFitTask'... |
# coding=utf-8
# Copyright 2021 Google 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 applicable law or agreed ... | [
"jax.numpy.sum",
"jax.numpy.isfinite",
"jax.jit",
"ott.core.sinkhorn.make",
"jax.numpy.zeros",
"jax.numpy.isclose",
"ott.core.sinkhorn.Sinkhorn",
"jax.numpy.ones",
"jax.lax.stop_gradient"
] | [((9174, 9206), 'ott.core.sinkhorn.make', 'sinkhorn.make', ([], {}), '(**sinkhorn_kwargs)\n', (9187, 9206), False, 'from ott.core import sinkhorn\n'), ((4152, 4171), 'ott.core.sinkhorn.Sinkhorn', 'sinkhorn.Sinkhorn', ([], {}), '()\n', (4169, 4171), False, 'from ott.core import sinkhorn\n'), ((5877, 5900), 'jax.numpy.su... |
from django.test import TestCase
from django.urls import reverse
from interactions.models import Interaction
from interactions.tests.factories import InteractionFactory
class InteractionModelTestCase(TestCase):
"""Testing the interaction model class."""
def test_create_interaction(self):
interaction_... | [
"django.urls.reverse",
"interactions.tests.factories.InteractionFactory",
"interactions.models.Interaction.objects.count",
"interactions.models.Interaction.objects.first"
] | [((335, 355), 'interactions.tests.factories.InteractionFactory', 'InteractionFactory', ([], {}), '()\n', (353, 355), False, 'from interactions.tests.factories import InteractionFactory\n'), ((386, 413), 'interactions.models.Interaction.objects.first', 'Interaction.objects.first', ([], {}), '()\n', (411, 413), False, 'f... |
from torchtext.data import Field, TabularDataset, Iterator
from torchtext.vocab import Vectors
import torch
from .base import allennlp_tokenize, basic_tokenize, uniform_unk_init, space_tokenize, \
bert_tokenize, gpt2_tokenize
_REGISTRY = {}
class RegisteredDataset(TabularDataset):
def __init_subclass__(cl... | [
"torchtext.data.Iterator.splits",
"torchtext.vocab.Vectors",
"torchtext.data.Field"
] | [((883, 953), 'torchtext.data.Field', 'Field', ([], {'batch_first': '(True)', 'tokenize': 'basic_tokenize', 'include_lengths': '(True)'}), '(batch_first=True, tokenize=basic_tokenize, include_lengths=True)\n', (888, 953), False, 'from torchtext.data import Field, TabularDataset, Iterator\n'), ((972, 1030), 'torchtext.d... |
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 28 20:41:43 2020
@author: djamal
"""
import numpy as np
import matplotlib.pyplot as plt
import math
import pandas as pd
import sys
sys.path.append('C:/Users/DJAMAL/Documents/GitHub/Jamal_NREL2020')
#External Module
import MainBearing_Analytical_Model
import rwtparameters... | [
"sys.path.append",
"rwtparameters.RWTParameters",
"datetime.datetime.now",
"MainBearing_Analytical_Model.MainBearing_Analytical_Model"
] | [((179, 245), 'sys.path.append', 'sys.path.append', (['"""C:/Users/DJAMAL/Documents/GitHub/Jamal_NREL2020"""'], {}), "('C:/Users/DJAMAL/Documents/GitHub/Jamal_NREL2020')\n", (194, 245), False, 'import sys\n'), ((413, 442), 'rwtparameters.RWTParameters', 'rwtparameters.RWTParameters', ([], {}), '()\n', (440, 442), False... |
"""Belinsky observability blueprint."""
import os
from flask import Blueprint
from healthcheck import HealthCheck
from healthcheck.security import safe_dict
from prometheus_client import CollectorRegistry, generate_latest, multiprocess
from ..database import get_all
from ..models import User
# Create healthcheck fu... | [
"prometheus_client.generate_latest",
"prometheus_client.CollectorRegistry",
"flask.Blueprint",
"healthcheck.HealthCheck",
"healthcheck.security.safe_dict",
"prometheus_client.multiprocess.MultiProcessCollector"
] | [((613, 632), 'prometheus_client.CollectorRegistry', 'CollectorRegistry', ([], {}), '()\n', (630, 632), False, 'from prometheus_client import CollectorRegistry, generate_latest, multiprocess\n'), ((637, 681), 'prometheus_client.multiprocess.MultiProcessCollector', 'multiprocess.MultiProcessCollector', (['registry'], {}... |
import sys
import math
import warnings
import logging
class tcam:
""" a basic tcam class
"""
def __init__(self,entryWidth, priWidth=8, addrWidth=int(math.log2(sys.maxsize)), valueWidth=32, size=sys.maxsize):
"""
entryWidth : width in bits of the entry
priWidth : Width of the pr... | [
"warnings.warn",
"math.log2"
] | [((167, 189), 'math.log2', 'math.log2', (['sys.maxsize'], {}), '(sys.maxsize)\n', (176, 189), False, 'import math\n'), ((555, 570), 'math.log2', 'math.log2', (['size'], {}), '(size)\n', (564, 570), False, 'import math\n'), ((597, 659), 'warnings.warn', 'warnings.warn', (['"""addr width can\'t represents the size of tab... |
# coding: utf-8
"""
Automated Tool for Optimized Modelling (ATOM)
Author: Mavs
Description: Unit tests for feature_engineering.py
"""
# Standard packages
import pandas as pd
import pytest
from sklearn.ensemble import ExtraTreesClassifier
from sklearn.feature_selection import f_regression
# Own modules
from atom.fea... | [
"atom.feature_engineering.FeatureExtractor",
"atom.feature_engineering.FeatureSelector",
"sklearn.ensemble.ExtraTreesClassifier",
"pytest.raises",
"atom.feature_engineering.FeatureGenerator",
"pandas.to_datetime",
"pytest.mark.parametrize"
] | [((2520, 2740), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""fxs"""', "[('microsecond', '%f'), ('second', '%S'), ('hour', '%H'), ('weekday',\n '%d/%m/%Y'), ('day', '%d/%m/%Y'), ('dayofyear', '%d/%m/%Y'), ('month',\n '%d/%m/%Y'), ('quarter', '%d/%m/%Y')]"], {}), "('fxs', [('microsecond', '%f'), ('se... |
from Bio import Entrez, SeqIO
import argparse
def gb_to_fasta(db_name, id_name, out_fasta):
Entrez.email = "<EMAIL>"
handle = Entrez.efetch(db=db_name, id=id_name, rettype="gb", retmode='text')
genome = SeqIO.read(handle, 'genbank')
#print(genome.features)
with open(out_fasta, "w") as ofasta:
... | [
"Bio.Entrez.efetch",
"Bio.SeqIO.read",
"argparse.ArgumentParser"
] | [((135, 202), 'Bio.Entrez.efetch', 'Entrez.efetch', ([], {'db': 'db_name', 'id': 'id_name', 'rettype': '"""gb"""', 'retmode': '"""text"""'}), "(db=db_name, id=id_name, rettype='gb', retmode='text')\n", (148, 202), False, 'from Bio import Entrez, SeqIO\n'), ((217, 246), 'Bio.SeqIO.read', 'SeqIO.read', (['handle', '"""ge... |