code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import numpy as np
from scipy.stats import rankdata
from sklearn.datasets import load_iris
from utilities.rank_data import rank_data
def test_rank_data():
data = load_iris().data
# rank the data all at once
output = rank_data(data)
# check each column versus scipy equivalent
for i in range(data... | [
"sklearn.datasets.load_iris",
"numpy.allclose",
"scipy.stats.rankdata",
"pytest.main",
"utilities.rank_data.rank_data"
] | [((232, 247), 'utilities.rank_data.rank_data', 'rank_data', (['data'], {}), '(data)\n', (241, 247), False, 'from utilities.rank_data import rank_data\n'), ((500, 513), 'pytest.main', 'pytest.main', ([], {}), '()\n', (511, 513), False, 'import pytest\n'), ((169, 180), 'sklearn.datasets.load_iris', 'load_iris', ([], {}),... |
"""
MIT License
Copyright (c) 2018-Present NeuroAssassin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify,... | [
"discord.Embed",
"redbot.core.checks.bot_has_permissions",
"redbot.core.commands.group",
"aiohttp.ClientSession",
"redbot.core.utils.menus.menu"
] | [((1969, 2013), 'redbot.core.checks.bot_has_permissions', 'checks.bot_has_permissions', ([], {'embed_links': '(True)'}), '(embed_links=True)\n', (1995, 2013), False, 'from redbot.core import checks, commands\n'), ((2020, 2070), 'redbot.core.commands.group', 'commands.group', ([], {'name': '"""swapi"""', 'aliases': "['s... |
# -*- coding: utf-8 -*-
"""
The :mod:`parsimony.algorithms.bases` module includes several base classes
for using and creating algorithms.
Algorithms may not store states. I.e., if they are classes, do not keep
references to objects with state in the algorithm objects. It should be
possible to copy and share algorithms... | [
"doctest.testmod",
"functools.wraps",
"six.with_metaclass"
] | [((936, 971), 'six.with_metaclass', 'with_metaclass', (['abc.ABCMeta', 'object'], {}), '(abc.ABCMeta, object)\n', (950, 971), False, 'from six import with_metaclass\n'), ((3376, 3418), 'six.with_metaclass', 'with_metaclass', (['abc.ABCMeta', 'BaseAlgorithm'], {}), '(abc.ABCMeta, BaseAlgorithm)\n', (3390, 3418), False, ... |
#!/usr/bin/env python
import rospy
from mongodb_store.message_store import MessageStoreProxy
from bayes_people_tracker.msg import PeopleTracker
from topological_logging_manager.msg import LoggingManager
from bayes_people_tracker_logging.msg import PeopleTrackerLogging
from geometry_msgs.msg import Pose, PoseStamped
im... | [
"rospy.logwarn",
"geometry_msgs.msg.PoseStamped",
"mongodb_store.message_store.MessageStoreProxy",
"rospy.Subscriber",
"message_filters.ApproximateTimeSynchronizer",
"bayes_people_tracker_logging.msg.PeopleTrackerLogging",
"rospy.get_param",
"rospy.logdebug",
"rospy.init_node",
"message_filters.Su... | [((3684, 3724), 'rospy.init_node', 'rospy.init_node', (['"""save_people_locations"""'], {}), "('save_people_locations')\n", (3699, 3724), False, 'import rospy\n'), ((3754, 3766), 'rospy.spin', 'rospy.spin', ([], {}), '()\n', (3764, 3766), False, 'import rospy\n'), ((440, 477), 'rospy.logdebug', 'rospy.logdebug', (['"""... |
from libcloud.container.types import Provider
from libcloud.container.providers import get_driver
cls = get_driver(Provider.JOYENT)
conn = cls(host='us-east-1.docker.joyent.com', port=2376,
key_file='key.pem', cert_file='~/.sdc/docker/admin/ca.pem')
conn.list_images()
| [
"libcloud.container.providers.get_driver"
] | [((105, 132), 'libcloud.container.providers.get_driver', 'get_driver', (['Provider.JOYENT'], {}), '(Provider.JOYENT)\n', (115, 132), False, 'from libcloud.container.providers import get_driver\n')] |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-03-14 08:58
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
class Migration(migrations.Migration):
dependencies = [
('v1', '0148_relatedresource'),
... | [
"django.db.models.ManyToManyField",
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.db.models.BooleanField",
"django.db.migrations.DeleteModel",
"django.db.models.IntegerField"
] | [((404, 453), 'django.db.migrations.DeleteModel', 'migrations.DeleteModel', ([], {'name': '"""EnglishAnswerProxy"""'}), "(name='EnglishAnswerProxy')\n", (426, 453), False, 'from django.db import migrations, models\n'), ((486, 535), 'django.db.migrations.DeleteModel', 'migrations.DeleteModel', ([], {'name': '"""SpanishA... |
# --------------
# import the libraries
import numpy as np
import pandas as pd
import seaborn as sns
from sklearn.model_selection import train_test_split
import warnings
warnings.filterwarnings('ignore')
# Code starts here
# load the file using pandas
df = pd.read_csv(path)
# observe the top rows of the dataset
print... | [
"matplotlib.pyplot.title",
"sklearn.model_selection.GridSearchCV",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.accuracy_score",
"seaborn.pairplot",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.legend",
"s... | [((170, 203), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (193, 203), False, 'import warnings\n'), ((258, 275), 'pandas.read_csv', 'pd.read_csv', (['path'], {}), '(path)\n', (269, 275), True, 'import pandas as pd\n'), ((516, 569), 'sklearn.model_selection.train_test_spl... |
# -*- coding: utf-8 -*-
'''Example 01
Shows how to create simple geometry from splines and ellipse arcs, and how to mesh a quad mesh in GmshMesher.
Also demonstrates drawGeometry(), drawMesh, and drawing texts and labels in a figure.
'''
import numpy as np
import calfem.geometry as cfg
import calfem.mesh as cfm
imp... | [
"calfem.vis_mpl.figure",
"calfem.vis_mpl.draw_nodal_values_contourf",
"calfem.vis_mpl.draw_nodal_values_contour",
"calfem.vis_mpl.draw_mesh",
"calfem.core.coordxtr",
"numpy.shape",
"calfem.core.flw2i8s",
"calfem.core.solveq",
"calfem.geometry.Geometry",
"calfem.vis_mpl.draw_geometry",
"calfem.me... | [((400, 419), 'calfem.utils.enableLogging', 'cfu.enableLogging', ([], {}), '()\n', (417, 419), True, 'import calfem.utils as cfu\n'), ((590, 625), 'numpy.matrix', 'np.matrix', (['[[kx1, 0.0], [0.0, ky1]]'], {}), '([[kx1, 0.0], [0.0, ky1]])\n', (599, 625), True, 'import numpy as np\n'), ((718, 732), 'calfem.geometry.Geo... |
# Generated by Django 3.0.8 on 2020-07-08 22:35
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | [
"django.db.models.TextField",
"django.db.migrations.swappable_dependency",
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.db.models.BooleanField",
"django.db.models.EmailField",
"django.db.models.AutoField",
"django.db.models.ImageField"
] | [((247, 304), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (278, 304), False, 'from django.db import migrations, models\n'), ((3131, 3221), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delete': 'djang... |
#%%
import time
import math
import sys
import argparse
import cPickle as pickle
import codecs
import numpy as np
from chainer import cuda, Variable, FunctionSet
import chainer.functions as F
from CharRNN import CharRNN, make_initial_state
sys.stdout = codecs.getwriter('utf_8')(sys.stdout)
#%% arguments
parser = argp... | [
"sys.stdout.write",
"numpy.random.seed",
"argparse.ArgumentParser",
"numpy.sum",
"chainer.cuda.get_device",
"codecs.getwriter",
"numpy.ones",
"chainer.cuda.to_cpu",
"numpy.array",
"chainer.cuda.to_gpu",
"CharRNN.make_initial_state"
] | [((316, 341), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (339, 341), False, 'import argparse\n'), ((801, 826), 'numpy.random.seed', 'np.random.seed', (['args.seed'], {}), '(args.seed)\n', (815, 826), True, 'import numpy as np\n'), ((1154, 1207), 'CharRNN.make_initial_state', 'make_initial_s... |
# -*- coding: UTF-8 -*-
# Copyright 2014 <NAME>
# Copyright 2015 Modified by <NAME>
# License: BSD (see file COPYING for details)
from __future__ import unicode_literals
from __future__ import print_function
from commondata.utils import Place, PlaceGenerator
class PlaceInEgypt(Place):
def __unicode__(self):
... | [
"commondata.utils.PlaceGenerator"
] | [((528, 544), 'commondata.utils.PlaceGenerator', 'PlaceGenerator', ([], {}), '()\n', (542, 544), False, 'from commondata.utils import Place, PlaceGenerator\n')] |
# from envs.envs_assistive.scratch_itch_envs import ScratchItchPR2MeshEnv, ScratchItchBaxterMeshEnv, ScratchItchSawyerMeshEnv, ScratchItchJacoMeshEnv, ScratchItchStretchMeshEnv, ScratchItchPandaMeshEnv
from envs.envs_assistive.drinking_envs import DrinkingPR2Env, DrinkingBaxterEnv, DrinkingSawyerEnv, DrinkingJacoEnv, D... | [
"gym.envs.registration.register"
] | [((1744, 1852), 'gym.envs.registration.register', 'register', ([], {'id': '"""HumanTesting-v1"""', 'entry_point': '"""assistive_gym.envs:HumanTestingEnv"""', 'max_episode_steps': '(200)'}), "(id='HumanTesting-v1', entry_point=\n 'assistive_gym.envs:HumanTestingEnv', max_episode_steps=200)\n", (1752, 1852), False, 'f... |
# coding=utf-8
#
# Copyright (c) 2013-2015 First Flamingo Enterprise B.V.
#
# 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 requi... | [
"TSStation.TSStation.update_stations",
"ffe.ffe_time.now_utc",
"google.appengine.ext.db.Query",
"ffe.gae.task_name",
"datetime.timedelta",
"google.appengine.api.memcache.delete_multi",
"webapp2.WSGIApplication",
"ffe.gae.issue_tasks",
"google.appengine.ext.db.delete"
] | [((3342, 3389), 'webapp2.WSGIApplication', 'webapp2.WSGIApplication', (['URL_SCHEMA'], {'debug': '(True)'}), '(URL_SCHEMA, debug=True)\n', (3365, 3389), False, 'import webapp2\n'), ((2589, 2607), 'ffe.gae.issue_tasks', 'issue_tasks', (['tasks'], {}), '(tasks)\n', (2600, 2607), False, 'from ffe.gae import issue_tasks, t... |
#!/usr/bin/env python
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import os
import sys
import aurora_postgres_monitoring
def lambda_handler(event, context):
# resolve the configuration from the sources required
config_sources = [event, os.environ... | [
"aurora_postgres_monitoring.monitor_cluster"
] | [((326, 384), 'aurora_postgres_monitoring.monitor_cluster', 'aurora_postgres_monitoring.monitor_cluster', (['config_sources'], {}), '(config_sources)\n', (368, 384), False, 'import aurora_postgres_monitoring\n')] |
from celery.schedules import crontab
from django.conf import settings
from mycelery.main import app
# 任务队列的链接地址
# broker_url = '队伍队列软件类型://服务端地址:端口/仓库地址'
broker_url = 'redis://dba:123.com@127.0.0.1:6379/15'
# 结果队列的链接地址
result_backend = 'redis://dba:123.com@127.0.0.1:6379/14'
app.conf.timezone = settings.TIME_ZONE
a... | [
"celery.schedules.crontab"
] | [((584, 605), 'celery.schedules.crontab', 'crontab', ([], {'minute': '"""*/2"""'}), "(minute='*/2')\n", (591, 605), False, 'from celery.schedules import crontab\n')] |
from datetime import datetime
from typing import Literal, TypedDict, List
NotificationType = Literal["primary", "secondary", "success", "warning", "danger", "info"]
class Notification(TypedDict):
msg_type: NotificationType
msg_header: str
msg_content: str
timestamp: str
def post_notification(
... | [
"datetime.datetime.now"
] | [((595, 609), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (607, 609), False, 'from datetime import datetime\n')] |
import tensorflow as tf
from tensorflow.keras.initializers import random_normal
from tensorflow.python.keras.utils import data_utils
from .residual_block import Bottleneck, WEIGHTS_HASHES, BASE_WEIGHTS_PATH
class ResNetBackbone(tf.keras.Model):
def __init__(self, resnet_type):
resnet_spec = {50: (Bottlen... | [
"tensorflow.nn.relu",
"tensorflow.keras.layers.MaxPooling2D",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.python.keras.utils.data_utils.get_file",
"tensorflow.keras.Sequential",
"tensorflow.keras.initializers.random_normal"
] | [((979, 1015), 'tensorflow.keras.layers.BatchNormalization', 'tf.keras.layers.BatchNormalization', ([], {}), '()\n', (1013, 1015), True, 'import tensorflow as tf\n'), ((1039, 1107), 'tensorflow.keras.layers.MaxPooling2D', 'tf.keras.layers.MaxPooling2D', ([], {'pool_size': '(3)', 'strides': '(2)', 'padding': '"""same"""... |
import math
from geopandas import GeoDataFrame
from matplotlib import pyplot as plt
from map_poster_creator.geojson import MapGeometry
from map_poster_creator.logs import log_processing
def road_width(speed: int) -> float:
if speed in range(0, 30):
return 0.05
if speed in range(30, 50):
retu... | [
"matplotlib.pyplot.clf",
"matplotlib.pyplot.axis",
"math.cos",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig"
] | [((982, 997), 'matplotlib.pyplot.axis', 'plt.axis', (['"""off"""'], {}), "('off')\n", (990, 997), True, 'from matplotlib import pyplot as plt\n'), ((1091, 1138), 'matplotlib.pyplot.savefig', 'plt.savefig', (['path'], {'bbox_inches': '"""tight"""', 'dpi': 'dpi'}), "(path, bbox_inches='tight', dpi=dpi)\n", (1102, 1138), ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @File : server.py
# @Author : edgar.chen
# @Create Date : 2020/11/12-2:47 下午
import os
import json
import uuid
from werkzeug.wrappers import Response
from werkzeug.exceptions import BadRequest
from traceback import format_exc
from conf import config
from utils.log impo... | [
"utils.log.logger.debug",
"os.getpid",
"os.makedirs",
"json.loads",
"utils.errors.ParameterError",
"werkzeug.wrappers.Response",
"werkzeug.exceptions.BadRequest",
"utils.log.logger.error",
"os.path.exists",
"utils.log.init_log",
"json.dumps",
"uuid.uuid1",
"traceback.format_exc",
"decorato... | [((1612, 1645), 'decorator.expose', 'expose', (['"""/test"""'], {'methods': "['POST']"}), "('/test', methods=['POST'])\n", (1618, 1645), False, 'from decorator import timer, expose\n'), ((528, 539), 'os.getpid', 'os.getpid', ([], {}), '()\n', (537, 539), False, 'import os\n'), ((697, 732), 'utils.log.init_log', 'init_l... |
from __future__ import print_function
from __future__ import absolute_import
import unittest
import csv
from owmeta_core.context import Context
from owmeta_core.command import OWM
from owmeta_core.bundle import Bundle
from owmeta.worm import Worm
from owmeta.cell import Cell
from owmeta.neuron import Neuron
from owme... | [
"unittest.skip",
"owmeta_core.bundle.Bundle",
"csv.reader",
"rdflib.Literal"
] | [((5846, 5891), 'unittest.skip', 'unittest.skip', (['"""have not yet defined asserts"""'], {}), "('have not yet defined asserts')\n", (5859, 5891), False, 'import unittest\n'), ((804, 853), 'csv.reader', 'csv.reader', (['csvfile'], {'delimiter': '""";"""', 'quotechar': '"""|"""'}), "(csvfile, delimiter=';', quotechar='... |
from django.urls import path
from feedzero.feeds import views
app_name = "feeds"
urlpatterns = [
path("", views.InboxView.as_view(), name="inbox"),
path("feeds/add/", views.FeedAddView.as_view(), name="add"),
]
| [
"feedzero.feeds.views.FeedAddView.as_view",
"feedzero.feeds.views.InboxView.as_view"
] | [((113, 138), 'feedzero.feeds.views.InboxView.as_view', 'views.InboxView.as_view', ([], {}), '()\n', (136, 138), False, 'from feedzero.feeds import views\n'), ((178, 205), 'feedzero.feeds.views.FeedAddView.as_view', 'views.FeedAddView.as_view', ([], {}), '()\n', (203, 205), False, 'from feedzero.feeds import views\n')] |
from django.urls import path
from django.views.decorators.csrf import csrf_exempt
from . import views
urlpatterns = [
path('yougotmsg/', csrf_exempt(views.telegram_data), name='message_from_telegram')
]
| [
"django.views.decorators.csrf.csrf_exempt"
] | [((143, 175), 'django.views.decorators.csrf.csrf_exempt', 'csrf_exempt', (['views.telegram_data'], {}), '(views.telegram_data)\n', (154, 175), False, 'from django.views.decorators.csrf import csrf_exempt\n')] |
import numpy as np
def dichoto(function, p0, max_depth=10, eps=1e-10):
a,b=p0
i=0
while i < max_depth:
c=0.5*(a+b)
if np.abs(function(c))<=eps:
return c
if(function(c)<0):
a=c
if(function(c)>0):
b=c
i=i+1
return c
# Find ... | [
"numpy.tan"
] | [((472, 481), 'numpy.tan', 'np.tan', (['x'], {}), '(x)\n', (478, 481), True, 'import numpy as np\n')] |
# %%
import set_base_path
import numpy as np
import pandas as pd
from IPython.display import display
import plotly.figure_factory as ff
import plotly.graph_objects as go
from enum import Enum, auto
from typing import List, Sequence, Tuple
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as ... | [
"pandas.read_csv",
"src.utils.eda.print_null_percents",
"src.utils.eda.count_of_uniques",
"warnings.filterwarnings"
] | [((643, 676), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (666, 676), False, 'import warnings\n'), ((781, 824), 'pandas.read_csv', 'pd.read_csv', (["(RAW_DATA_PATH / 'metadata.zip')"], {}), "(RAW_DATA_PATH / 'metadata.zip')\n", (792, 824), True, 'import pandas as pd\n')... |
import unittest
import pandas as pd
import numpy as np
from dask import dataframe as dd
from .normalize_functions import (
encode_objects_general,
normalize_general,
normalize_chex,
)
class NormalizeTests(unittest.TestCase):
def test_encode_objects_general(self):
strings_feats = "alpha bravo ... | [
"unittest.main",
"pandas.DataFrame",
"pandas.DataFrame.from_dict",
"numpy.arange",
"numpy.column_stack",
"dask.dataframe.from_array"
] | [((2737, 2752), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2750, 2752), False, 'import unittest\n'), ((690, 705), 'numpy.arange', 'np.arange', (['(0)', '(5)'], {}), '(0, 5)\n', (699, 705), True, 'import numpy as np\n'), ((727, 786), 'numpy.column_stack', 'np.column_stack', (['(sequence.T, sequence[::-1].T, se... |
from bson.objectid import ObjectId
from CoordenacaoFacil import db
class UseOfAbstracts():
def __init__(self, origin=None, destiny=None, student=None, menu=None, createdAt=""):
self.origin = origin
self.destiny = destiny
self.student = student
self.menu = menu
self.status = ... | [
"CoordenacaoFacil.db.useOfAbstracts.insert",
"CoordenacaoFacil.db.useOfAbstracts.find",
"bson.objectid.ObjectId"
] | [((429, 603), 'CoordenacaoFacil.db.useOfAbstracts.insert', 'db.useOfAbstracts.insert', (["{'origin': uoa.origin, 'destiny': uoa.destiny, 'student': uoa.student,\n 'menu': uoa.menu, 'status': self.status, 'createdAt': self.createdAt}"], {}), "({'origin': uoa.origin, 'destiny': uoa.destiny,\n 'student': uoa.student... |
import unittest
from katas.kyu_7.credit_card_checker import valid_card
class ValidCardTestCase(unittest.TestCase):
def test_true_1(self):
self.assertTrue(valid_card('5457 6238 9823 4311'))
def test_true_2(self):
self.assertTrue(valid_card('2222 2222 2222 2224'))
def test_true_3(self):
... | [
"katas.kyu_7.credit_card_checker.valid_card"
] | [((169, 202), 'katas.kyu_7.credit_card_checker.valid_card', 'valid_card', (['"""5457 6238 9823 4311"""'], {}), "('5457 6238 9823 4311')\n", (179, 202), False, 'from katas.kyu_7.credit_card_checker import valid_card\n'), ((256, 289), 'katas.kyu_7.credit_card_checker.valid_card', 'valid_card', (['"""2222 2222 2222 2224""... |
from selenium import webdriver
driver = webdriver.Chrome('chromedriver.exe')
driver.get('https://www.google.com/recaptcha/api2/demo')
captcha_iframe = driver.find_element_by_css_selector("iframe[src^='https://www.google.com/recaptcha/api2/']")
# switch to captcha iframe
driver.switch_to.frame(captcha_iframe)
# this... | [
"selenium.webdriver.Chrome"
] | [((40, 76), 'selenium.webdriver.Chrome', 'webdriver.Chrome', (['"""chromedriver.exe"""'], {}), "('chromedriver.exe')\n", (56, 76), False, 'from selenium import webdriver\n')] |
'''
Community Application URLs
community/urls.py
@author <NAME> (810Teams)
'''
from django.urls import path, include
from rest_framework.routers import DefaultRouter
from community.views import CommunityViewSet, ClubViewSet, EventViewSet, CommunityEventViewSet, LabViewSet
from community.views import MyCom... | [
"community.views.MyCommunityView.as_view",
"community.views.MyClubView.as_view",
"django.urls.include",
"community.views.MyEventView.as_view",
"community.views.MyCommunityEventView.as_view",
"community.views.MyLabView.as_view",
"rest_framework.routers.DefaultRouter"
] | [((400, 415), 'rest_framework.routers.DefaultRouter', 'DefaultRouter', ([], {}), '()\n', (413, 415), False, 'from rest_framework.routers import DefaultRouter\n'), ((675, 700), 'community.views.MyCommunityView.as_view', 'MyCommunityView.as_view', ([], {}), '()\n', (698, 700), False, 'from community.views import MyCommun... |
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | [
"oci.exceptions.CompositeOperationError"
] | [((3249, 3336), 'oci.exceptions.CompositeOperationError', 'oci.exceptions.CompositeOperationError', ([], {'partial_results': '[operation_result]', 'cause': 'e'}), '(partial_results=[operation_result],\n cause=e)\n', (3287, 3336), False, 'import oci\n'), ((5365, 5452), 'oci.exceptions.CompositeOperationError', 'oci.e... |
import random
import secrets
import os
from datetime import datetime
from flask import Flask, render_template, redirect, url_for, send_file, request
from flask_sqlalchemy import SQLAlchemy
from flaskwebgui import FlaskUI
from win10toast import ToastNotifier
from flask_uploads import UploadSet, configure_uploads, ALL
im... | [
"flask.Flask"
] | [((384, 399), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (389, 399), False, 'from flask import Flask, render_template, redirect, url_for, send_file, request\n')] |
import os
import torchvision
from examples.NIPS.generate_data_utils import mnist_true_values, gather_examples, get_digit_for_initiated_at, \
get_correct_digit_for_initiated_at, default_noises, default_folder_name
trainset = torchvision.datasets.MNIST(root='../../../../../data/MNIST', train=True, download=True)
te... | [
"os.makedirs",
"torchvision.datasets.MNIST",
"examples.NIPS.generate_data_utils.gather_examples",
"os.path.exists"
] | [((230, 321), 'torchvision.datasets.MNIST', 'torchvision.datasets.MNIST', ([], {'root': '"""../../../../../data/MNIST"""', 'train': '(True)', 'download': '(True)'}), "(root='../../../../../data/MNIST', train=True,\n download=True)\n", (256, 321), False, 'import torchvision\n'), ((328, 420), 'torchvision.datasets.MNI... |
import rpyc
import rpyc.utils
import rpyc.utils.zerodeploy
import plumbum.machines.paramiko_machine
import fiepipelib.localuser.routines.localuser
class client(object):
"""Local client for the fiepipeserver server"""
_localUser = None
_hostname = None
_username = None
_policy = None
def __ini... | [
"rpyc.utils.zerodeploy.DeployedServer"
] | [((2097, 2222), 'rpyc.utils.zerodeploy.DeployedServer', 'rpyc.utils.zerodeploy.DeployedServer', ([], {'remote_machine': 'self._machine', 'server_class': '"""fiepipelib.fiepipeserver.server.server"""'}), "(remote_machine=self._machine,\n server_class='fiepipelib.fiepipeserver.server.server')\n", (2133, 2222), False, ... |
import os
import numpy as np
import h5py as h5
import tensorflow as tf
def _int64_feature(value):
return tf.train.Feature(int64_list=tf.train.Int64List(value=[value]))
def _bytes_feature(value):
return tf.train.Feature(bytes_list=tf.train.BytesList(value=[value]))
def _floats_feature(value):
return tf.train.... | [
"tensorflow.train.BytesList",
"h5py.File",
"tensorflow.python_io.TFRecordWriter",
"tensorflow.train.Int64List",
"tensorflow.train.Example",
"numpy.asarray",
"tensorflow.train.Features",
"tensorflow.train.FloatList",
"os.path.join"
] | [((590, 613), 'h5py.File', 'h5.File', (['this_file', '"""r"""'], {}), "(this_file, 'r')\n", (597, 613), True, 'import h5py as h5\n'), ((633, 655), 'numpy.asarray', 'np.asarray', (["hf['data']"], {}), "(hf['data'])\n", (643, 655), True, 'import numpy as np\n'), ((668, 692), 'numpy.asarray', 'np.asarray', (["hf['params']... |
import FWCore.ParameterSet.Config as cms
process = cms.Process("GEN")
# this will run plig-in energy-flat random particle gun
# and puts particles (HepMCPRoduct) into edm::Event
process.load("SimGeneral.HepPDTESSource.pdt_cfi")
process.RandomNumberGeneratorService = cms.Service("RandomNumberGeneratorService",
mod... | [
"FWCore.ParameterSet.Config.string",
"FWCore.ParameterSet.Config.untracked.int32",
"FWCore.ParameterSet.Config.double",
"FWCore.ParameterSet.Config.vint32",
"FWCore.ParameterSet.Config.untracked.string",
"FWCore.ParameterSet.Config.EndPath",
"FWCore.ParameterSet.Config.Process",
"FWCore.ParameterSet.C... | [((52, 70), 'FWCore.ParameterSet.Config.Process', 'cms.Process', (['"""GEN"""'], {}), "('GEN')\n", (63, 70), True, 'import FWCore.ParameterSet.Config as cms\n'), ((543, 568), 'FWCore.ParameterSet.Config.Source', 'cms.Source', (['"""EmptySource"""'], {}), "('EmptySource')\n", (553, 568), True, 'import FWCore.ParameterSe... |
from math import sqrt
primes = [2]
sp = [2] # Selected Primes
limit = 1000000
def check_sp(a):
if a < 10:
return True
for c in str(a):
if c in ['0', '2', '4', '5', '6', '8']:
return False
return True
def is_prime(a):
b = int(sqrt(a)) + 1
for p in primes:
if... | [
"math.sqrt"
] | [((276, 283), 'math.sqrt', 'sqrt', (['a'], {}), '(a)\n', (280, 283), False, 'from math import sqrt\n')] |
from datetime import date
atual = date.today().year
nacs = int(input('Digite o ano do seu nascimento '))
idade = atual - nacs
if idade <= 9:
print('Você tem {} anos de idade e é uma nadadora da classe MIRIM.'.format(idade))
elif idade <= 14:
print('Você tem {} de idade e é um nadador da classe INFANTIL.'.format... | [
"datetime.date.today"
] | [((34, 46), 'datetime.date.today', 'date.today', ([], {}), '()\n', (44, 46), False, 'from datetime import date\n')] |
from base import DatadogBaseAction
from datadog import api
class DatadogCreateComment(DatadogBaseAction):
def _run(self, **kwargs):
return api.Comment.create(**kwargs)
class DatadogDeleteComment(DatadogBaseAction):
def _run(self, **kwargs):
return api.Comment.delete(kwargs.pop("comment_id"))... | [
"datadog.api.Comment.create"
] | [((153, 181), 'datadog.api.Comment.create', 'api.Comment.create', ([], {}), '(**kwargs)\n', (171, 181), False, 'from datadog import api\n')] |
from flask import Flask
from snakeeyes.blueprints.page import page
def create_app(settings_override=None):
"""
Create a Flask application using the app factory pattern.
:param settings_override: Override settings
:return: Flask app
"""
app = Flask(__name__, instance_relative_config=True)
... | [
"flask.Flask"
] | [((270, 316), 'flask.Flask', 'Flask', (['__name__'], {'instance_relative_config': '(True)'}), '(__name__, instance_relative_config=True)\n', (275, 316), False, 'from flask import Flask\n')] |
from setuptools import setup
SHORT_DESCRIPTION = """
A tool to get your member's overtime from King of Time for every N weeks.""".strip()
DEPENDENCIES = [
'fire==0.1.2',
'beautifultable==0.4.0',
'requests==2.18.4',
]
TEST_DEPENDENCIES = [
]
VERSION = '0.1.4'
URL = 'https://github.com/showwin/scrum-overt... | [
"setuptools.setup"
] | [((330, 895), 'setuptools.setup', 'setup', ([], {'name': '"""sokot"""', 'version': 'VERSION', 'description': 'SHORT_DESCRIPTION', 'url': 'URL', 'author': '"""showwin"""', 'author_email': '"""<EMAIL>"""', 'license': '"""Apache Software License"""', 'classifiers': "['Programming Language :: Python', 'Programming Language... |
# This implementation is based on codes of <NAME> & <NAME>
import time
import random
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
from tqdm import tqdm
import pickle
from base.rl import ActorCriticRLAlgorithm
from base.replay_buffer import ReplayBuffer
@tf.function
def clip_with_grad... | [
"tensorflow.random.set_seed",
"tensorflow.keras.backend.set_value",
"tensorflow.reduce_sum",
"numpy.random.seed",
"numpy.nan_to_num",
"tensorflow.keras.layers.Dense",
"tensorflow.reshape",
"pickle.load",
"numpy.mean",
"base.replay_buffer.ReplayBuffer",
"numpy.prod",
"tensorflow.math.log",
"t... | [((361, 390), 'tensorflow.cast', 'tf.cast', (['(x > high)', 'tf.float32'], {}), '(x > high, tf.float32)\n', (368, 390), True, 'import tensorflow as tf\n'), ((406, 434), 'tensorflow.cast', 'tf.cast', (['(x < low)', 'tf.float32'], {}), '(x < low, tf.float32)\n', (413, 434), True, 'import tensorflow as tf\n'), ((860, 875)... |
# 크로바 아파트 들어가 아파트 이름, 주소, 정보까지 출력하는데 성공, csv화는 미성공
import requests, re, time
from bs4 import BeautifulSoup as bs
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Chrome(r'"D:\user\Documents\chromedriver.exe"')
driver.get('https://www.naver.com') | [
"selenium.webdriver.Chrome"
] | [((202, 261), 'selenium.webdriver.Chrome', 'webdriver.Chrome', (['""""D:\\\\user\\\\Documents\\\\chromedriver.exe\\""""'], {}), '(\'"D:\\\\user\\\\Documents\\\\chromedriver.exe"\')\n', (218, 261), False, 'from selenium import webdriver\n')] |
from runners.output_parser import OutputParser
def setup(oBenchmarkRunner, cores, phys_cores, scenario, memory):
oBenchmarkRunner.configure("caf", "caf/build/bin", memory, args = ["--parseable", "--scheduler.max-threads=" + str(cores)] + scenario)
def gnuplot(cores, files, results):
OutputParser(files).parse(core... | [
"runners.output_parser.OutputParser"
] | [((290, 309), 'runners.output_parser.OutputParser', 'OutputParser', (['files'], {}), '(files)\n', (302, 309), False, 'from runners.output_parser import OutputParser\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/7/17 15:22
# @Author : kimmy-pan
# @File : GET_DATA.py
from flask import Flask,request, jsonify
app = Flask(__name__)
@app.route('/getdata', methods=['POST','GET'])
def getdata():
if request.method == 'POST':
try:
... | [
"flask.jsonify",
"flask.Flask"
] | [((176, 191), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (181, 191), False, 'from flask import Flask, request, jsonify\n'), ((1541, 1597), 'flask.jsonify', 'jsonify', (["{'message': 'success', 'data': '', 'code': 200}"], {}), "({'message': 'success', 'data': '', 'code': 200})\n", (1548, 1597), False, '... |
# coding=utf-8
# Copyright (c) 2018 <NAME>
import logging
from django.db.models import Count
from django.db.models.functions import TruncDate
from rest_framework import permissions
from rest_framework.response import Response
from rest_framework.viewsets import GenericViewSet, ModelViewSet, ViewSet
from .. import mo... | [
"django.db.models.Count",
"rest_framework.response.Response",
"django.db.models.functions.TruncDate",
"logging.getLogger"
] | [((358, 385), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (375, 385), False, 'import logging\n'), ((2172, 2187), 'rest_framework.response.Response', 'Response', (['stats'], {}), '(stats)\n', (2180, 2187), False, 'from rest_framework.response import Response\n'), ((2528, 2548), 'django.... |
from django.contrib.admin.apps import AdminConfig
from django.apps import AppConfig
import sys, logging
class MyAdminConfig(AdminConfig):
default_site = 'homeauto.admin.MyAdminSite'
logger = logging.getLogger(__name__)
class HomeautoConfig(AppConfig):
name = 'homeauto'
verbose_name = "House Devices and ... | [
"homeauto.jobs.start",
"logging.getLogger"
] | [((198, 225), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (215, 225), False, 'import sys, logging\n'), ((507, 519), 'homeauto.jobs.start', 'jobs.start', ([], {}), '()\n', (517, 519), True, 'import homeauto.jobs as jobs\n')] |
import io
import json
import math
import re
import typing
import zipfile
import tempfile
from urllib.parse import urljoin
from base64 import b64encode
from io import BufferedIOBase
from typing import Optional, List
import textwrap
import graphviz
import requests
import svg_stack
from graphviz import escape
from flas... | [
"PIL.Image.new",
"jsonlines.Reader",
"urllib.parse.urljoin",
"PyPDF4.PdfFileWriter",
"neo4japp.services.file_types.exports.ExportFormatError",
"bioc.biocjson.toJSON",
"os.path.join",
"svg_stack.Document",
"os.path.sep.join",
"PyPDF4.PdfFileReader",
"tempfile.TemporaryDirectory",
"svg_stack.VBo... | [((3595, 3782), 're.compile', 're.compile', (["b'(doi[\\\\W]*)?((?:https?:\\\\/\\\\/)(?:[-A-z0-9]*\\\\.)*doi\\\\.org\\\\/)?(10\\\\.[0-9]{3,}(?:[\\\\.][0-9]+)*\\\\/)([-A-z0-9]*)([^ \\\\n\\\\f#]*)([^\\\\n\\\\f#]{0,20})'"], {'flags': 're.IGNORECASE'}), "(\n b'(doi[\\\\W]*)?((?:https?:\\\\/\\\\/)(?:[-A-z0-9]*\\\\.)*doi\... |
from puzzle8 import Puzzle
from time import sleep
def main():
puzzle8 = Puzzle([1,2,3,4,5,6,7,8,0])
print('Seu puzzle embaralhado')
puzzle8.print_matrix(puzzle8.get_initial_state())
sleep(5)
puzzle8.clear_terminal()
print('Resolvendo seu puzzle')
puzzle8.print_matrix(puzzle8.get_initial_state())
sleep(5)
... | [
"puzzle8.Puzzle",
"time.sleep"
] | [((74, 109), 'puzzle8.Puzzle', 'Puzzle', (['[1, 2, 3, 4, 5, 6, 7, 8, 0]'], {}), '([1, 2, 3, 4, 5, 6, 7, 8, 0])\n', (80, 109), False, 'from puzzle8 import Puzzle\n'), ((190, 198), 'time.sleep', 'sleep', (['(5)'], {}), '(5)\n', (195, 198), False, 'from time import sleep\n'), ((311, 319), 'time.sleep', 'sleep', (['(5)'], ... |
from functools import wraps
import time
def retry(func, max_retry=5, backoff=300):
@wraps(func)
def wrapper(*args, **kwargs):
retExc = None
for i in range(max_retry):
try:
return func(*args, **kwargs)
except Exception as e:
retExc = e
... | [
"functools.wraps",
"time.sleep"
] | [((90, 101), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (95, 101), False, 'from functools import wraps\n'), ((333, 352), 'time.sleep', 'time.sleep', (['backoff'], {}), '(backoff)\n', (343, 352), False, 'import time\n')] |
from specter.test.test_psf import TestPixPSF, TestSpotPSF
from specter.test.test_specio import TestSpecIO
from specter.test.test_throughput import TestThroughput
from specter.test.test_util import TestUtil
from specter.test.test_extract import TestExtract
from specter.test.test_pixspline import TestPixSpline
from spect... | [
"unittest.TextTestRunner",
"unittest.TestSuite"
] | [((832, 857), 'unittest.TestSuite', 'unittest.TestSuite', (['tests'], {}), '(tests)\n', (850, 857), False, 'import unittest\n'), ((862, 898), 'unittest.TextTestRunner', 'unittest.TextTestRunner', ([], {'verbosity': '(2)'}), '(verbosity=2)\n', (885, 898), False, 'import unittest\n')] |
import pyfolio as pyf
import pandas as pd
import yfinance as yf
#tickers to analyze
tickers = ['AAPL','MSFT','AMZN','WMT']
#create a dataframe placeholder
data = pd.DataFrame(columns=tickers)
#get data
for ticker in tickers:
data[ticker] = yf.download(ticker,period='5y',)['Adj Close']
#print(data.head())
# com... | [
"pandas.DataFrame",
"pyfolio.create_full_tear_sheet",
"yfinance.download"
] | [((164, 193), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': 'tickers'}), '(columns=tickers)\n', (176, 193), True, 'import pandas as pd\n'), ((489, 521), 'pyfolio.create_full_tear_sheet', 'pyf.create_full_tear_sheet', (['data'], {}), '(data)\n', (515, 521), True, 'import pyfolio as pyf\n'), ((247, 279), 'yfinance... |
from timeit import default_timer as timer
from opensfm import io
from opensfm import tracking
from opensfm.dataset_base import DataSetBase
def run_dataset(data: DataSetBase):
"""Link matches pair-wise matches into tracks."""
start = timer()
features, colors, segmentations, instances = tracking.load_feat... | [
"timeit.default_timer",
"opensfm.io.json_dumps",
"opensfm.tracking.create_tracks_manager"
] | [((245, 252), 'timeit.default_timer', 'timer', ([], {}), '()\n', (250, 252), True, 'from timeit import default_timer as timer\n'), ((379, 386), 'timeit.default_timer', 'timer', ([], {}), '()\n', (384, 386), True, 'from timeit import default_timer as timer\n'), ((462, 469), 'timeit.default_timer', 'timer', ([], {}), '()... |
"""Python Cookbook
Chapter 9, recipe 10.
"""
import logging
import sys
from logging import Formatter
from pathlib import Path
def create_log():
PROD_LOG_FORMAT = ('[{asctime}]'
' {levelname} in {module}: {message}'
)
with Path('sample.log').open('w') as sample_log_file:
logging.basicC... | [
"logging.basicConfig",
"re.compile",
"logging.Formatter",
"pathlib.Path",
"collections.Counter",
"logging.getLogger",
"csv.DictWriter"
] | [((717, 836), 're.compile', 're.compile', (['"""\\\\[(?P<timestamp>.*?)\\\\]\\\\s(?P<levelname>\\\\w+)\\\\sin\\\\s(?P<module>[\\\\w\\\\._]+):\\\\s(?P<message>.*)"""'], {}), "(\n '\\\\[(?P<timestamp>.*?)\\\\]\\\\s(?P<levelname>\\\\w+)\\\\sin\\\\s(?P<module>[\\\\w\\\\._]+):\\\\s(?P<message>.*)'\n )\n", (727, 836), ... |
# Generated by Django 3.2.2 on 2021-07-04 21:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blweb', '0007_vehicleconfig'),
]
operations = [
migrations.AlterField(
model_name='vehicleconfig',
name='config_name... | [
"django.db.models.CharField"
] | [((341, 467), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'default': 'None', 'help_text': '"""The name of this vehicle configuration"""', 'max_length': '(200)', 'null': '(True)'}), "(blank=True, default=None, help_text=\n 'The name of this vehicle configuration', max_length=200, null=T... |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2018, Anaconda, Inc. and Intake contributors
# All rights reserved.
#
# The full license is in the LICENSE file, distributed with this software.
#------------------------------------------------------------------------... | [
"importlib.import_module",
"os.fspath",
"warnings.warn",
"re.sub",
"logging.getLogger"
] | [((1050, 1077), 'logging.getLogger', 'logging.getLogger', (['"""intake"""'], {}), "('intake')\n", (1067, 1077), False, 'import logging\n'), ((4511, 4525), 'os.fspath', 'os.fspath', (['uri'], {}), '(uri)\n', (4520, 4525), False, 'import os\n'), ((2552, 2588), 're.sub', 're.sub', (['"""[-=~^&|@+]"""', '"""_"""', 'func_na... |
from __future__ import print_function, unicode_literals
try:
import http.server as http_server
except ImportError:
# Python 2.7
import BaseHTTPServer as http_server
root_path = '/'
intan_status_path = '/intan_status.html'
OK = 200
NO_CONTENT = 204
NOT_FOUND = 404
METHOD_NOT_ALLOWED = 405
class RCBLVDSR... | [
"BaseHTTPServer.HTTPServer"
] | [((1472, 1538), 'BaseHTTPServer.HTTPServer', 'http_server.HTTPServer', (["('localhost', 8080)", 'RCBLVDSRequestHandler'], {}), "(('localhost', 8080), RCBLVDSRequestHandler)\n", (1494, 1538), True, 'import BaseHTTPServer as http_server\n')] |
import socket
import multiprocessing
import re
import time
import mini_framework
class WSGIServer:
def __init__(self):
"""初始化功能,创建套接字/绑定等"""
# 创建一个服务器套接字
self.server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# 套接字 地址重用选项 1设置0取消
self.server_socket.setsocko... | [
"multiprocessing.Process",
"socket.socket",
"re.match",
"mini_framework.application"
] | [((207, 256), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (220, 256), False, 'import socket\n'), ((1107, 1149), 're.match', 're.match', (['"""[^/]+([^ ]+)"""', 'request_str_data'], {}), "('[^/]+([^ ]+)', request_str_data)\n", (1115, 1149), ... |
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 27 14:20:08 2018
@author: haider.raheem-ug
"""
import random
import matplotlib.pyplot as plt
numberofparticles = int(input("Enter number of particles: "))
nofsteps = int(input("Enter number of steps: "))
prob = float(input("Enter the probability of going rig... | [
"matplotlib.pyplot.plot",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.hist",
"random.choice",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((1008, 1017), 'matplotlib.pyplot.clf', 'plt.clf', ([], {}), '()\n', (1015, 1017), True, 'import matplotlib.pyplot as plt\n'), ((1019, 1037), 'matplotlib.pyplot.plot', 'plt.plot', (['fp', '"""ro"""'], {}), "(fp, 'ro')\n", (1027, 1037), True, 'import matplotlib.pyplot as plt\n'), ((1039, 1067), 'matplotlib.pyplot.ylabe... |
from mlpproc.conditions import *
from mlpproc.defaults import Preprocessor
def test_lexer():
test = [
("a==b", ["a", "==", "b"]),
("not a\tand\nb!=notop", ["not", "a", "and", "b", "!=", "notop"]),
("allo=(d))not(b and c)", ["allo=", "(", "d", ")", ")", "not", "(", "b", "and", "c", ")"]),
]
for string, tokenl... | [
"mlpproc.defaults.Preprocessor"
] | [((414, 428), 'mlpproc.defaults.Preprocessor', 'Preprocessor', ([], {}), '()\n', (426, 428), False, 'from mlpproc.defaults import Preprocessor\n')] |
import subprocess
import sys
import difflib
def prepend(itm):
return '\'' + itm
master = sys.argv[1].replace('%0A', '\n')
branch = sys.argv[2].replace('%0A', '\n')
diff = ''.join(difflib.Differ().compare(master.splitlines(True), branch.splitlines(True)))
lines = [line for line in diff.splitlines() if line[0] == '... | [
"difflib.Differ"
] | [((185, 201), 'difflib.Differ', 'difflib.Differ', ([], {}), '()\n', (199, 201), False, 'import difflib\n')] |
# 导入类库
from flask_bootstrap import Bootstrap
from flask_mail import Mail
from flask_sqlalchemy import SQLAlchemy
# 实例化对象
bootstrap = Bootstrap()
mail = Mail()
db = SQLAlchemy()
# 封装函数 完成初始化
def config_extensions(app):
bootstrap.init_app(app=app)
mail.init_app(app=app)
db.init_app(app=app) | [
"flask_sqlalchemy.SQLAlchemy",
"flask_bootstrap.Bootstrap",
"flask_mail.Mail"
] | [((137, 148), 'flask_bootstrap.Bootstrap', 'Bootstrap', ([], {}), '()\n', (146, 148), False, 'from flask_bootstrap import Bootstrap\n'), ((156, 162), 'flask_mail.Mail', 'Mail', ([], {}), '()\n', (160, 162), False, 'from flask_mail import Mail\n'), ((168, 180), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', ([], {}), '()\... |
import torch
float_tensor = torch.tensor([-1.0, 0.0, 1.0, 2.0])
q_made_per_tensor = torch.quantize_per_tensor(float_tensor, 0.1, 10, torch.quint8)
# Dequantize
dequantized_tensor = q_made_per_tensor.dequantize()
# Quantized Tensor supports slicing like usual Tensors do
s = q_made_per_tensor[2] # a quantized Tensor ... | [
"tempfile.NamedTemporaryFile",
"torch.load",
"torch.save",
"torch._empty_affine_quantized",
"torch.quantize_per_tensor",
"torch.tensor"
] | [((29, 64), 'torch.tensor', 'torch.tensor', (['[-1.0, 0.0, 1.0, 2.0]'], {}), '([-1.0, 0.0, 1.0, 2.0])\n', (41, 64), False, 'import torch\n'), ((85, 147), 'torch.quantize_per_tensor', 'torch.quantize_per_tensor', (['float_tensor', '(0.1)', '(10)', 'torch.quint8'], {}), '(float_tensor, 0.1, 10, torch.quint8)\n', (110, 14... |
""" LoopFullUnrolling fully unrolls loops with static bounds. """
from pythran import metadata
from pythran.analyses import HasBreak, HasContinue, NodeCount
from pythran.openmp import OMPDirective
from pythran.passmanager import Transformation
from copy import deepcopy
import gast as ast
from functools import reduce
... | [
"copy.deepcopy",
"pythran.metadata.get"
] | [((995, 1027), 'pythran.metadata.get', 'metadata.get', (['node', 'OMPDirective'], {}), '(node, OMPDirective)\n', (1007, 1027), False, 'from pythran import metadata\n'), ((1855, 1874), 'copy.deepcopy', 'deepcopy', (['node.body'], {}), '(node.body)\n', (1863, 1874), False, 'from copy import deepcopy\n'), ((1795, 1816), '... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-11-08 07:14
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0004_auto_20171108_0659'),
]
operations = [
migrations.AlterField(
... | [
"django.db.models.DateField",
"django.db.models.DecimalField"
] | [((403, 441), 'django.db.models.DateField', 'models.DateField', ([], {'default': '"""1998-01-02"""'}), "(default='1998-01-02')\n", (419, 441), False, 'from django.db import migrations, models\n'), ((561, 627), 'django.db.models.DecimalField', 'models.DecimalField', ([], {'decimal_places': '(15)', 'default': '(0.0)', 'm... |
from random import randint
import pytest
from flask import url_for
from registry.donor.models import (
DonationCenter,
DonorsOverride,
DonorsOverview,
IgnoredDonors,
)
from .fixtures import sample_of_rc, skip_if_ignored
from .helpers import login
class TestDonorsOverview:
@pytest.mark.parametri... | [
"registry.donor.models.DonorsOverview.rodne_cislo.desc",
"registry.donor.models.DonorsOverview.query.get",
"registry.donor.models.DonationCenter.query.all",
"random.randint",
"registry.donor.models.DonorsOverview.query.filter_by",
"registry.donor.models.DonorsOverride.query.get",
"flask.url_for",
"reg... | [((1027, 1053), 'registry.donor.models.DonationCenter.query.all', 'DonationCenter.query.all', ([], {}), '()\n', (1051, 1053), False, 'from registry.donor.models import DonationCenter, DonorsOverride, DonorsOverview, IgnoredDonors\n'), ((1666, 1703), 'registry.donor.models.DonorsOverride.query.get', 'DonorsOverride.quer... |
import json
from rest_framework import serializers
from fastrunner import models
from fastrunner.utils.parser import Parse
class ProjectSerializer(serializers.ModelSerializer):
"""
项目信息序列化
"""
class Meta:
model = models.Project
fields = ['id', 'name', 'desc', 'responsible', 'update_t... | [
"rest_framework.serializers.CharField",
"json.loads",
"rest_framework.serializers.SerializerMethodField"
] | [((424, 478), 'rest_framework.serializers.CharField', 'serializers.CharField', ([], {'source': '"""get_permission_display"""'}), "(source='get_permission_display')\n", (445, 478), False, 'from rest_framework import serializers\n'), ((493, 537), 'rest_framework.serializers.CharField', 'serializers.CharField', ([], {'sou... |
import pytest
from django.contrib import auth as django_auth
UserModel = django_auth.get_user_model()
@pytest.fixture
def context(mocker):
class Session(dict):
def cycle_key(self):
pass
def flush(self):
pass
context = mocker.Mock()
context.request.session = Sess... | [
"django.contrib.auth.logout",
"django.contrib.auth.get_user_model"
] | [((75, 103), 'django.contrib.auth.get_user_model', 'django_auth.get_user_model', ([], {}), '()\n', (101, 103), True, 'from django.contrib import auth as django_auth\n'), ((330, 365), 'django.contrib.auth.logout', 'django_auth.logout', (['context.request'], {}), '(context.request)\n', (348, 365), True, 'from django.cont... |
import io
EXAMPLE = """[({(<(())[]>[[{[]{<()<>>
[(()[<>])]({[<{<<[]>>(
{([(<{}[<>[]}>{[]{[(<()>
(((({<>}<{<{<>}{[]{[]{}
[[<[([]))<([[{}[[()]]]
[{[{({}]{}}([{[{{{}}([]
{<[[]]>}<{[{[{[]{()[[[]
[<(<(<(<{}))><([]([]()
<{([([[(<>()){}]>(<<{{
<{([{{}}[<[[[<>{}]]]>[]]"""
PAIRS = {
"(": ")",
"[": "]",
"{": "}",
... | [
"io.StringIO"
] | [((864, 884), 'io.StringIO', 'io.StringIO', (['EXAMPLE'], {}), '(EXAMPLE)\n', (875, 884), False, 'import io\n')] |
"""Global constants for the app
"""
import pathlib
LOGFILENAME = pathlib.Path(__file__).parent / "data/weightlog.csv"
FIELDS = ["date", "weight in lbs"]
GRAPH_FILENAME = pathlib.Path(__file__).parent / "data/weightlog.png"
NOTRENDFLAG = 10000
| [
"pathlib.Path"
] | [((66, 88), 'pathlib.Path', 'pathlib.Path', (['__file__'], {}), '(__file__)\n', (78, 88), False, 'import pathlib\n'), ((171, 193), 'pathlib.Path', 'pathlib.Path', (['__file__'], {}), '(__file__)\n', (183, 193), False, 'import pathlib\n')] |
import tensorflow as tf
from keras import backend as K
from keras_segmentation.custom_losses import smooth_l1_loss
def bounding_box_iou_based_network_loss(y_true, y_pred):
pred_x1 = y_pred[:, 0]
pred_y1 = y_pred[:, 1]
pred_x2 = pred_x1 + y_pred[:, 2]
pred_y2 = pred_y1 + y_pred[:, 3]
true_x1 = y_... | [
"tensorflow.reduce_sum",
"tensorflow.maximum",
"keras_segmentation.custom_losses.smooth_l1_loss",
"keras.backend.epsilon",
"tensorflow.zeros_like",
"tensorflow.minimum",
"tensorflow.ones_like",
"tensorflow.log"
] | [((455, 483), 'tensorflow.maximum', 'tf.maximum', (['pred_x1', 'true_x1'], {}), '(pred_x1, true_x1)\n', (465, 483), True, 'import tensorflow as tf\n'), ((506, 534), 'tensorflow.maximum', 'tf.maximum', (['pred_y1', 'true_y1'], {}), '(pred_y1, true_y1)\n', (516, 534), True, 'import tensorflow as tf\n'), ((557, 585), 'ten... |
from __future__ import absolute_import
from __future__ import unicode_literals
from django.utils import timezone
import factory
from factory import fuzzy
class UserFactory(factory.django.DjangoModelFactory):
class Meta:
model = 'auth.User'
username = fuzzy.FuzzyText()
password = factory.PostGen... | [
"factory.RelatedFactory",
"factory.fuzzy.FuzzyText",
"django.utils.timezone.now",
"factory.SubFactory",
"django.utils.timezone.timedelta",
"factory.PostGenerationMethodCall"
] | [((272, 289), 'factory.fuzzy.FuzzyText', 'fuzzy.FuzzyText', ([], {}), '()\n', (287, 289), False, 'from factory import fuzzy\n'), ((305, 367), 'factory.PostGenerationMethodCall', 'factory.PostGenerationMethodCall', (['"""set_password"""', '"""<PASSWORD>"""'], {}), "('set_password', '<PASSWORD>')\n", (337, 367), False, '... |
from django.shortcuts import get_object_or_404
from rest_framework import status
from rest_framework.response import Response
from rest_framework.views import APIView
from v1.accounts.models.profile import Profile
from v1.accounts.models.user import User
from v1.accounts.models.libraries import Library
from v1.accounts... | [
"v1.utils.permissions.is_moderator",
"v1.accounts.serializers.user.UserSerializer",
"v1.accounts.serializers.user.UserSerializerCreate",
"django.shortcuts.get_object_or_404",
"rest_framework.response.Response",
"v1.accounts.models.libraries.Library",
"v1.accounts.serializers.user.UserSerializerUpdate",
... | [((656, 674), 'v1.accounts.models.user.User.objects.all', 'User.objects.all', ([], {}), '()\n', (672, 674), False, 'from v1.accounts.models.user import User\n'), ((846, 915), 'v1.accounts.serializers.user.UserSerializerCreate', 'UserSerializerCreate', ([], {'data': 'request.data', 'context': "{'request': request}"}), "... |
from django import forms
from django.forms import widgets
class ChooseGameForm(forms.Form):
game_choice = forms.ChoiceField(
label="New or existing Game?",
widget=widgets.RadioSelect(),
choices=(
("solo", "New Solo Game"),
("new", "New Game"),
("id", "Co... | [
"django.forms.widgets.RadioSelect",
"django.forms.CharField"
] | [((366, 426), 'django.forms.CharField', 'forms.CharField', ([], {'label': '"""Continue Game by id"""', 'required': '(False)'}), "(label='Continue Game by id', required=False)\n", (381, 426), False, 'from django import forms\n'), ((185, 206), 'django.forms.widgets.RadioSelect', 'widgets.RadioSelect', ([], {}), '()\n', (... |
from http.server import HTTPServer
from typing import Callable, Dict, Optional
from .routes import Route
from .request_handler import ReqHandler
class API():
def __init__(self) -> None:
self.server: HTTPServer
self.serverinfo: Dict = {}
self.routes = {}
def get(self, path: str, statu... | [
"http.server.HTTPServer"
] | [((811, 882), 'http.server.HTTPServer', 'HTTPServer', ([], {'server_address': '(host, port)', 'RequestHandlerClass': 'ReqHandler'}), '(server_address=(host, port), RequestHandlerClass=ReqHandler)\n', (821, 882), False, 'from http.server import HTTPServer\n')] |
import numpy as np
from code.waveform import Triangle, Sawtooth, SquareWave, Sine
# discrete integration where s is your signal as array and l is your first entry
def running_sum(s, l):
y = np.zeros(len(s))
y[0] = s[0] + l
for n in range(1, len(s)):
y[n] = s[n] + y[n - 1]
return y
def normal... | [
"code.waveform.Sine.trigonometric",
"code.waveform.Triangle.trigonometric",
"code.waveform.Sawtooth.trigonometric",
"code.waveform.SquareWave.trigonometric"
] | [((786, 826), 'code.waveform.Triangle.trigonometric', 'Triangle.trigonometric', (['a', 'fm', 'x', 'c', 'lfo'], {}), '(a, fm, x, c, lfo)\n', (808, 826), False, 'from code.waveform import Triangle, Sawtooth, SquareWave, Sine\n'), ((872, 912), 'code.waveform.Sawtooth.trigonometric', 'Sawtooth.trigonometric', (['a', 'fm', ... |
# -*- coding: utf-8 -*-
import logging
from django.apps import AppConfig
logger = logging.getLogger('inventree')
class CommonConfig(AppConfig):
name = 'common'
def ready(self):
self.clear_restart_flag()
def clear_restart_flag(self):
"""
Clear the SERVER_RESTART_REQUIRED sett... | [
"logging.getLogger"
] | [((86, 116), 'logging.getLogger', 'logging.getLogger', (['"""inventree"""'], {}), "('inventree')\n", (103, 116), False, 'import logging\n')] |
from IDQCorrelator import *
sys.path.append("D:/Control/PythonPackages/")
import pbec_analysis
#Parameters
expo_time = 0.5
channel_mask = 1+2+8 #7
buffer_size = 2e5
##auto_col_channel=1
elec_trig_ch=0
optical_trig_ch=1
signal_ch=3
#Setup the correlator device: seems to be needed each time we retrieve t... | [
"pbec_analysis.make_timestamp"
] | [((735, 765), 'pbec_analysis.make_timestamp', 'pbec_analysis.make_timestamp', ([], {}), '()\n', (763, 765), False, 'import pbec_analysis\n')] |
from Products.ATContentTypes.content import schemata
from Products.Archetypes import atapi
from AccessControl import ClassSecurityInfo
from DateTime import DateTime
from Products.ATExtensions.ateapi import DateTimeField, DateTimeWidget, RecordsField
from Products.Archetypes.config import REFERENCE_CATALOG
from Products... | [
"bika.lims.bikaMessageFactory",
"bika.lims.idserver.renameAfterCreation",
"DateTime.DateTime",
"Products.CMFCore.utils.getToolByName",
"Products.Archetypes.atapi.registerType",
"AccessControl.ClassSecurityInfo",
"bika.lims.content.bikaschema.BikaSchema.copy"
] | [((5278, 5321), 'Products.Archetypes.atapi.registerType', 'atapi.registerType', (['Attachment', 'PROJECTNAME'], {}), '(Attachment, PROJECTNAME)\n', (5296, 5321), False, 'from Products.Archetypes import atapi\n'), ((729, 746), 'bika.lims.content.bikaschema.BikaSchema.copy', 'BikaSchema.copy', ([], {}), '()\n', (744, 746... |
import os
import sys
from pip.req import parse_requirements
from pip.download import PipSession
from setuptools import find_packages
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
# reading requirements
install_reqs = parse_requirements('requirements.txt', session=PipS... | [
"pip.download.PipSession",
"os.path.dirname",
"setuptools.find_packages"
] | [((393, 418), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (408, 418), False, 'import os\n'), ((316, 328), 'pip.download.PipSession', 'PipSession', ([], {}), '()\n', (326, 328), False, 'from pip.download import PipSession\n'), ((496, 511), 'setuptools.find_packages', 'find_packages', ([], {... |
import logging
import re
logging.basicConfig(level=logging.DEBUG)
def _clear_str(s):
return ''.join([c for c in s if c not in '\\;"\'\n'])
class BaseCol():
"""Base class for table col type"""
def __init__(self, **kwargs):
"""
:param kwargs:
'name' - column name,
'type' -... | [
"logging.warning",
"logging.error",
"logging.basicConfig"
] | [((26, 66), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (45, 66), False, 'import logging\n'), ((2285, 2336), 'logging.error', 'logging.error', (['"""__tablename__ or connection missed"""'], {}), "('__tablename__ or connection missed')\n", (2298, 2336), Fals... |
import io
import os
import sys
import copy
import subprocess
import importlib
from dotenv import load_dotenv
from timeout import timeout
dotenv_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '.env'))
load_dotenv(dotenv_path)
PYTHON_EXE = os.environ.get('PYTHON_EXE')
# might bring this back next ... | [
"timeout.timeout",
"os.path.basename",
"os.path.dirname",
"copy.copy",
"dotenv.load_dotenv",
"os.environ.get"
] | [((223, 247), 'dotenv.load_dotenv', 'load_dotenv', (['dotenv_path'], {}), '(dotenv_path)\n', (234, 247), False, 'from dotenv import load_dotenv\n'), ((261, 289), 'os.environ.get', 'os.environ.get', (['"""PYTHON_EXE"""'], {}), "('PYTHON_EXE')\n", (275, 289), False, 'import os\n'), ((181, 206), 'os.path.dirname', 'os.pat... |
"""
A helper module that initializes the display and buttons for the
Adafruit PyGamer game console.
"""
import board
import analogio
import stage
import displayio
import busio
import time
import keypad
K_X = 0x01
K_O = 0x02
K_START = 0x04
K_SELECT = 0x08
K_DOWN = 0x10
K_LEFT = 0x20
K_RIGHT = 0x40
K_UP = 0x80
# re-i... | [
"displayio.FourWire",
"displayio.Display",
"stage.Audio",
"keypad.Event",
"keypad.ShiftRegisterKeys",
"analogio.AnalogIn",
"time.monotonic",
"busio.SPI",
"displayio.release_displays"
] | [((2876, 2904), 'displayio.release_displays', 'displayio.release_displays', ([], {}), '()\n', (2902, 2904), False, 'import displayio\n'), ((2916, 2967), 'busio.SPI', 'busio.SPI', ([], {'clock': 'board.TFT_SCK', 'MOSI': 'board.TFT_MOSI'}), '(clock=board.TFT_SCK, MOSI=board.TFT_MOSI)\n', (2925, 2967), False, 'import busi... |
import time
import picamera
import numpy as np
import cv2
with picamera.PiCamera() as camera:
camera.resolution = (320, 240)
camera.framerate = 24
time.sleep(2)
image = np.empty((240 * 320 * 3,), dtype=np.uint8)
camera.capture(image, 'bgr')
image = image.reshape((240, 320, 3))
| [
"numpy.empty",
"time.sleep",
"picamera.PiCamera"
] | [((64, 83), 'picamera.PiCamera', 'picamera.PiCamera', ([], {}), '()\n', (81, 83), False, 'import picamera\n'), ((160, 173), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (170, 173), False, 'import time\n'), ((186, 228), 'numpy.empty', 'np.empty', (['(240 * 320 * 3,)'], {'dtype': 'np.uint8'}), '((240 * 320 * 3,), ... |
import pandas as pd
import yfinance as yf
from ta.others import DailyReturnIndicator,CumulativeReturnIndicator
# get data
gspc= yf.Ticker("^GSPC")
df = gspc.history(start= '2007-01-01', end= '2020-12-31')
daily_returns = DailyReturnIndicator(close=df["close"])
df["daily_returns"] = daily_returns.daily_return()
df.to... | [
"ta.others.DailyReturnIndicator",
"yfinance.Ticker"
] | [((130, 148), 'yfinance.Ticker', 'yf.Ticker', (['"""^GSPC"""'], {}), "('^GSPC')\n", (139, 148), True, 'import yfinance as yf\n'), ((223, 262), 'ta.others.DailyReturnIndicator', 'DailyReturnIndicator', ([], {'close': "df['close']"}), "(close=df['close'])\n", (243, 262), False, 'from ta.others import DailyReturnIndicator... |
import paho.mqtt.client as paho
import config
# from transitions import Machine
import os, sys, inspect
from transitions import *
from transitions.extensions import GraphMachine
from IPython.display import Image, display, display_png
from threading import Timer
from time import sleep
import logging
import socket
imp... | [
"uuid.uuid4",
"logging.debug",
"json.loads",
"logging.basicConfig",
"logging.warning",
"json.dumps",
"logging.info",
"socket.gethostname",
"paho.mqtt.client.Client"
] | [((363, 485), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""[%(levelname)s] %(asctime)s %(message)s"""', 'datefmt': '"""%Y-%m-%d %H:%M:%S"""', 'level': 'logging.INFO'}), "(format='[%(levelname)s] %(asctime)s %(message)s',\n datefmt='%Y-%m-%d %H:%M:%S', level=logging.INFO)\n", (382, 485), False, '... |
# Copyright 2017 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.
from common import constants
from common import exceptions
from gae_libs import appengine_util
from gae_libs.http import auth_util
def IsPrivilegedUser(use... | [
"common.exceptions.UnauthorizedException",
"gae_libs.http.auth_util.GetOauthUserEmail",
"gae_libs.http.auth_util.GetOauthClientId",
"gae_libs.appengine_util.IsStaging",
"gae_libs.http.auth_util.IsCurrentOauthUserAdmin"
] | [((1465, 1494), 'gae_libs.http.auth_util.GetOauthUserEmail', 'auth_util.GetOauthUserEmail', ([], {}), '()\n', (1492, 1494), False, 'from gae_libs.http import auth_util\n'), ((2151, 2186), 'gae_libs.http.auth_util.IsCurrentOauthUserAdmin', 'auth_util.IsCurrentOauthUserAdmin', ([], {}), '()\n', (2184, 2186), False, 'from... |
# --coding:utf-8--
#
# Copyright (c) 2020 vesoft inc. All rights reserved.
#
# This source code is licensed under Apache 2.0 License.
import time
from tests.common.nebula_test_suite import NebulaTestSuite
class TestBigInt(NebulaTestSuite):
@classmethod
def prepare(self):
resp = self.execute(
... | [
"time.sleep"
] | [((587, 609), 'time.sleep', 'time.sleep', (['self.delay'], {}), '(self.delay)\n', (597, 609), False, 'import time\n'), ((735, 757), 'time.sleep', 'time.sleep', (['self.delay'], {}), '(self.delay)\n', (745, 757), False, 'import time\n')] |
"""
Create a Workset
Creates a Workset - Revit 2017+
TESTED REVIT API: 2017
Author: <NAME> | github.com/gtalarico
This file is shared on www.revitapidocs.com
For more information visit http://github.com/gtalarico/revitapidocs
License: http://github.com/gtalarico/revitapidocs/blob/master/LICENSE.md
"""
import clr
cl... | [
"clr.AddReference",
"Autodesk.Revit.DB.Transaction",
"Autodesk.Revit.DB.Workset.Create"
] | [((318, 346), 'clr.AddReference', 'clr.AddReference', (['"""RevitAPI"""'], {}), "('RevitAPI')\n", (334, 346), False, 'import clr\n'), ((475, 491), 'Autodesk.Revit.DB.Transaction', 'Transaction', (['doc'], {}), '(doc)\n', (486, 491), False, 'from Autodesk.Revit.DB import Workset, Transaction\n'), ((518, 551), 'Autodesk.... |
#!/usr/bin/python3
# -*- coding_ utf-8 -*-
""" This program implements a viewer for the LPO data structure.
A LPO is a partial ordered set of events. If two events are ordered
this order is represented by an arrow. If there is an arrow form an
event a to an event b this means event b occurs after event a.
Usage: pyt... | [
"PyQt5.QtGui.QPainter",
"math.sqrt",
"PyQt5.QtGui.QColor",
"math.fabs",
"os.path.exists",
"PyQt5.QtGui.QFont",
"math.sin",
"PyQt5.QtWidgets.QFileDialog.getOpenFileName",
"partialorder.parse_lpo_file",
"PyQt5.QtWidgets.qApp.quit",
"math.cos",
"PyQt5.QtCore.QPoint",
"PyQt5.QtWidgets.QApplicati... | [((8763, 8785), 'PyQt5.QtWidgets.QApplication', 'QApplication', (['sys.argv'], {}), '(sys.argv)\n', (8775, 8785), False, 'from PyQt5.QtWidgets import QApplication, QWidget, QMainWindow, QAction, qApp, QFileDialog, QTabWidget\n'), ((8923, 8954), 'os.path.exists', 'os.path.exists', (['"""../abcabc.lpo"""'], {}), "('../ab... |
# -*- coding:UTF-8 -*-
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | [
"argparse.ArgumentParser",
"logging.Formatter",
"os.path.isfile",
"os.path.join",
"sys.path.append",
"logging.FileHandler",
"tensorflow.subtract",
"os.path.exists",
"tensorflow.placeholder",
"tensorflow.cast",
"shutil.copyfile",
"tensorflow.GraphDef",
"os.rename",
"logging.StreamHandler",
... | [((980, 1000), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (995, 1000), False, 'import sys, os\n'), ((1120, 1130), 'tensorflow.Graph', 'tf.Graph', ([], {}), '()\n', (1128, 1130), True, 'import tensorflow as tf\n'), ((1145, 1158), 'tensorflow.GraphDef', 'tf.GraphDef', ([], {}), '()\n', (1156, 115... |
import multiprocessing
import numpy
from smqtk.representation import DescriptorElement
from smqtk.utils.postgres import norm_psql_cmd_string, PsqlConnectionHelper
# Try to import required modules
try:
import psycopg2
except ImportError:
psycopg2 = None
PSQL_TABLE_CREATE_RLOCK = multiprocessing.RLock()
# ... | [
"smqtk.utils.postgres.PsqlConnectionHelper",
"numpy.copy",
"numpy.frombuffer",
"smqtk.utils.postgres.norm_psql_cmd_string",
"psycopg2.Binary",
"multiprocessing.RLock"
] | [((292, 315), 'multiprocessing.RLock', 'multiprocessing.RLock', ([], {}), '()\n', (313, 315), False, 'import multiprocessing\n'), ((748, 1022), 'smqtk.utils.postgres.norm_psql_cmd_string', 'norm_psql_cmd_string', (['"""\n CREATE TABLE IF NOT EXISTS {table_name:s} (\n {type_col:s} TEXT NOT NULL,\n ... |
""" Tests of responsiveness of sample merger """
import os
from collections import Iterable, Mapping
import pytest
import yaml
from peppy import *
from peppy.const import *
from peppy.project import NEW_PIPES_KEY
ANNS_NAME = "ann.csv"
PLIF_NAME = "plif.yaml"
SUBPROJECT_NAME = "changed_output"
@pytest.fixture
def ... | [
"yaml.dump",
"os.path.join",
"os.makedirs"
] | [((1552, 1572), 'os.makedirs', 'os.makedirs', (['mainout'], {}), '(mainout)\n', (1563, 1572), False, 'import os\n'), ((1577, 1596), 'os.makedirs', 'os.makedirs', (['subout'], {}), '(subout)\n', (1588, 1596), False, 'import os\n'), ((505, 523), 'yaml.dump', 'yaml.dump', (['data', 'f'], {}), '(data, f)\n', (514, 523), Fa... |
import pytest
import wn
@pytest.mark.usefixtures('empty_db')
def test_lexicons_empty():
assert len(wn.lexicons()) == 0
@pytest.mark.usefixtures('mini_db')
def test_lexicons_mini():
assert len(wn.lexicons()) == 2
assert all(isinstance(lex, wn.Lexicon) for lex in wn.lexicons())
results = wn.lexicon... | [
"wn.sense",
"wn.Wordnet",
"wn.senses",
"wn.word",
"wn.Tag",
"wn.words",
"pytest.raises",
"wn.lexicons",
"wn.synset",
"pytest.mark.usefixtures",
"wn.synsets"
] | [((29, 64), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""empty_db"""'], {}), "('empty_db')\n", (52, 64), False, 'import pytest\n'), ((130, 164), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""mini_db"""'], {}), "('mini_db')\n", (153, 164), False, 'import pytest\n'), ((1226, 1260), 'pytest.ma... |
#!/usr/bin/env python3
import argparse
import mock
import json
import unittest
from letsdebughelper import letsdebug
class TestLetsdebug(unittest.TestCase):
def setUp(self):
self.url = 'https://letsdebug.net'
self.domain = 'jeffistotallyawesome.space'
self.test_id = 359646
self.p... | [
"argparse.Namespace",
"letsdebughelper.letsdebug.check_status",
"letsdebughelper.letsdebug.parse_args",
"json.loads",
"mock.patch",
"mock.Mock",
"letsdebughelper.letsdebug.le_get_call",
"letsdebughelper.letsdebug.decode_result",
"letsdebughelper.letsdebug.le_post_call"
] | [((2936, 2962), 'mock.patch', 'mock.patch', (['"""requests.get"""'], {}), "('requests.get')\n", (2946, 2962), False, 'import mock\n'), ((3237, 3263), 'mock.patch', 'mock.patch', (['"""requests.get"""'], {}), "('requests.get')\n", (3247, 3263), False, 'import mock\n'), ((3553, 3580), 'mock.patch', 'mock.patch', (['"""re... |
from ckeditor.fields import RichTextField
from django.db import models
from src.accounts.models import User
class Company(models.Model):
TYPE_CHOICE = (
('per', 'Personal'),
('pre', 'Premium'),
('ent', 'Enterprise'),
)
user = models.OneToOneField(User, on_delete=models.CASCADE)
... | [
"django.db.models.FileField",
"django.db.models.OneToOneField",
"django.db.models.TextField",
"django.db.models.ManyToManyField",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.PositiveIntegerField",
"django.db.models.BooleanField",
"ckeditor.fields.RichTextField",
... | [((265, 317), 'django.db.models.OneToOneField', 'models.OneToOneField', (['User'], {'on_delete': 'models.CASCADE'}), '(User, on_delete=models.CASCADE)\n', (285, 317), False, 'from django.db import models\n'), ((329, 377), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(255)', 'default': '"""Name... |
import logging
import mimetypes
from confy import env
import six
from django.conf import settings
from django.core.mail import EmailMultiAlternatives, EmailMessage
from django.core.urlresolvers import reverse
from django.template import loader, Template
from django.utils.encoding import smart_text
from django.utils.ht... | [
"django.core.urlresolvers.reverse",
"confy.env",
"mimetypes.guess_type",
"django.core.mail.EmailMultiAlternatives",
"django.utils.html.strip_tags",
"django.utils.encoding.smart_text",
"django.template.Template",
"logging.getLogger",
"django.template.loader.get_template"
] | [((469, 498), 'logging.getLogger', 'logging.getLogger', (['"""__name__"""'], {}), "('__name__')\n", (486, 498), False, 'import logging\n'), ((680, 698), 'django.template.Template', 'Template', (['template'], {}), '(template)\n', (688, 698), False, 'from django.template import loader, Template\n'), ((833, 872), 'django.... |
"""
Routines that manipulate, read and convert lists of dependencies.
"""
# This file is part of the Snakefood open source package.
# See http://furius.ca/snakefood/ for licensing details.
import sys, logging
from operator import itemgetter
def read_depends(f):
"Generator for the dependencies read from the give... | [
"logging.warning",
"operator.itemgetter"
] | [((786, 799), 'operator.itemgetter', 'itemgetter', (['(0)'], {}), '(0)\n', (796, 799), False, 'from operator import itemgetter\n'), ((435, 479), 'logging.warning', 'logging.warning', (['("Invalid line: \'%s\'" % line)'], {}), '("Invalid line: \'%s\'" % line)\n', (450, 479), False, 'import sys, logging\n')] |
from __future__ import unicode_literals
import logging
from django.conf import settings
from push import mobile_module
from push import pusher_module
logger = logging.getLogger()
def send_all(message_type, message, crowd, user=None):
if settings.PUSH_DISABLED:
logger.info('Push disabled, skipping push'... | [
"push.pusher_module.send_all",
"push.mobile_module.send_all",
"logging.getLogger"
] | [((162, 181), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (179, 181), False, 'import logging\n'), ((538, 596), 'push.mobile_module.send_all', 'mobile_module.send_all', (['message_type', 'message', 'crowd', 'user'], {}), '(message_type, message, crowd, user)\n', (560, 596), False, 'from push import mobil... |
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import gradcheck
from torch.autograd import Function
from torch.autograd import Variable
from torch.autograd import gradcheck
from torch.autograd import Function
import numpy as np
############... | [
"torch.cat",
"torch.nn.InstanceNorm2d",
"torch.nn.MSELoss",
"torch.nn.functional.grid_sample",
"torch.cuda.FloatTensor",
"torch.FloatTensor",
"torch.nn.Linear",
"torch.mean",
"torch.nn.ModuleList",
"torch.nn.Tanh",
"torch.autograd.Variable",
"torch.nn.Conv2d",
"torch.nn.BatchNorm1d",
"torc... | [((573, 585), 'torch.nn.MSELoss', 'nn.MSELoss', ([], {}), '()\n', (583, 585), True, 'import torch.nn as nn\n'), ((736, 768), 'torch.autograd.Variable', 'Variable', (['w'], {'requires_grad': '(False)'}), '(w, requires_grad=False)\n', (744, 768), False, 'from torch.autograd import Variable\n'), ((1169, 1201), 'torch.auto... |
# -*- coding: utf-8 -*-
"""Install binary dependencies."""
# standard library imports
import os
import shutil
import sys
import tempfile
from pathlib import Path
# first-party imports
import click
import sh
from packaging import version
from progressbar import DataTransferBar
from requests_download import ProgressTrac... | [
"tempfile.TemporaryDirectory",
"click.argument",
"sh.make.install",
"packaging.version.parse",
"shutil.copy2",
"click.option",
"sh.which",
"sh.Command",
"sh.tar",
"pathlib.Path",
"progressbar.DataTransferBar",
"requests_download.download",
"os.chdir",
"sh.git.clone",
"sh.make",
"pathli... | [((11399, 11500), 'click.option', 'click.option', (['"""--force/--no-force"""'], {'help': '"""Force overwrites of existing binaries."""', 'default': '(False)'}), "('--force/--no-force', help=\n 'Force overwrites of existing binaries.', default=False)\n", (11411, 11500), False, 'import click\n'), ((11512, 11552), 'cl... |