code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# Copyright (c) 2017, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license. The license
# is also available online at http://www.ent... | [
"traits.api.Instance",
"traits.api.on_trait_change",
"numpy.unique",
"functools.wraps",
"numpy.stack",
"numpy.zeros"
] | [((1710, 1737), 'traits.api.Instance', 'Instance', (['CellularAutomaton'], {}), '(CellularAutomaton)\n', (1718, 1737), False, 'from traits.api import Callable, HasStrictTraits, Instance, List, on_trait_change\n'), ((4046, 4079), 'traits.api.on_trait_change', 'on_trait_change', (['"""automaton:tick"""'], {}), "('automat... |
import pandas as pd
import numpy as np
import os
from sklearn.externals import joblib
data = pd.read_csv('/home/hduser/iit_data/ask_ubuntu/posts-clean.csv', sep='\u0001')
# Cleaned tag set and year
data['CreationYear'] = data.CreationDate.str.slice(start=0,stop=4)
data['CreationMonth'] = data.CreationDate.str.slice(s... | [
"os.makedirs",
"pandas.read_csv"
] | [((94, 169), 'pandas.read_csv', 'pd.read_csv', (['"""/home/hduser/iit_data/ask_ubuntu/posts-clean.csv"""'], {'sep': '"""\x01"""'}), "('/home/hduser/iit_data/ask_ubuntu/posts-clean.csv', sep='\\x01')\n", (105, 169), True, 'import pandas as pd\n'), ((1046, 1107), 'os.makedirs', 'os.makedirs', (['"""/home/hduser/iit_data/... |
from cloud.permission import database_can_not_access_to_item
from cloud.permission import Permission, NeedPermission
from cloud.message import error
from cloud.database.get_policy_code import match_policy_after_get_policy_code
from cloud.database import util
# Define the input output format of the function.
# This in... | [
"cloud.database.util.get_index_keys_to_index",
"cloud.database.get_policy_code.match_policy_after_get_policy_code",
"cloud.permission.NeedPermission"
] | [((621, 675), 'cloud.permission.NeedPermission', 'NeedPermission', (['Permission.Run.Database.put_item_field'], {}), '(Permission.Run.Database.put_item_field)\n', (635, 675), False, 'from cloud.permission import Permission, NeedPermission\n'), ((1202, 1291), 'cloud.database.get_policy_code.match_policy_after_get_policy... |
import config
from bella import parsers
from bella import write_data
import bella
import target_extraction
from target_extraction.dataset_parsers import semeval_2014
from sklearn.model_selection import train_test_split
config.neural_dataset_dir.mkdir(parents=True, exist_ok=True)
dataset_names = ['Dong', 'Election', '... | [
"bella.parsers.election_test",
"bella.parsers.dong",
"config.neural_dataset_dir.mkdir",
"bella.data_types.TargetCollection",
"sklearn.model_selection.train_test_split",
"bella.data_types.Target",
"target_extraction.data_types.TargetTextCollection",
"bella.write_data.semeval_14",
"bella.parsers.semev... | [((221, 281), 'config.neural_dataset_dir.mkdir', 'config.neural_dataset_dir.mkdir', ([], {'parents': '(True)', 'exist_ok': '(True)'}), '(parents=True, exist_ok=True)\n', (252, 281), False, 'import config\n'), ((1656, 1702), 'bella.data_types.TargetCollection', 'bella.data_types.TargetCollection', (['new_dataset'], {}),... |
import json
import numpy as np
learning_map = {
0 : 0, # "unlabeled"
1 : 0, # "outlier" mapped to "unlabeled" --------------------------mapped
10: 1, # "car"
11: 2, # "bicycle"
13: 5, # "bus" mapped to "other-vehicle" --------------------------mapped
15: 3, # "motorcycle"
16: 5, ... | [
"numpy.fromfile",
"numpy.unique",
"numpy.array",
"numpy.sum",
"json.load",
"numpy.vectorize"
] | [((1973, 1985), 'json.load', 'json.load', (['f'], {}), '(f)\n', (1982, 1985), False, 'import json\n'), ((2214, 2233), 'numpy.array', 'np.array', (['lbl_count'], {}), '(lbl_count)\n', (2222, 2233), True, 'import numpy as np\n'), ((1507, 1550), 'numpy.fromfile', 'np.fromfile', (["('../' + file_)"], {'dtype': 'np.uint32'}... |
from model.contact import Contact
def test_edit_first_contact(app):
if app.contact.count() == 0:
app.contact.create(Contact(firstname="test", secondname="text"))
old_contacts = app.contact.get_contact_list()
app.contact.test_edit_first_contact()
new_contacts = app.contact.get_contact_list()
... | [
"model.contact.Contact"
] | [((130, 174), 'model.contact.Contact', 'Contact', ([], {'firstname': '"""test"""', 'secondname': '"""text"""'}), "(firstname='test', secondname='text')\n", (137, 174), False, 'from model.contact import Contact\n')] |
import MinkowskiEngine as ME
import MinkowskiEngine.MinkowskiFunctional as MEF
import torch
import torch.nn as nn
from src.models.common import conv, conv_tr, get_nonlinearity, get_norm
class BasicBlockBase(nn.Module):
expansion = 1
NORM_TYPE = "BN"
def __init__(
self,
inplanes,
p... | [
"src.models.common.get_norm",
"MinkowskiEngine.MinkowskiGlobalSumPooling",
"MinkowskiEngine.MinkowskiFunctional.relu",
"torch.cat",
"MinkowskiEngine.SparseTensor",
"src.models.common.get_nonlinearity",
"MinkowskiEngine.MinkowskiFunctional.sigmoid",
"src.models.common.conv"
] | [((527, 640), 'src.models.common.conv', 'conv', (['inplanes', 'planes'], {'kernel_size': '(3)', 'stride': 'stride', 'dilation': 'dilation', 'region_type': 'region_type', 'dimension': 'D'}), '(inplanes, planes, kernel_size=3, stride=stride, dilation=dilation,\n region_type=region_type, dimension=D)\n', (531, 640), Fa... |
import argparse
import bz2
import gzip
import json
import re
import os
import shutil
import subprocess
from urllib.request import urlretrieve
def evaluate_run_with_qrels(run, qrels):
output = subprocess.check_output(
f'python eval/ms_marco_eval.py {run} eval/{qrels}', shell=True).decode('utf-8')
pri... | [
"subprocess.check_output",
"os.path.exists",
"shutil.copyfileobj",
"argparse.ArgumentParser",
"urllib.request.urlretrieve",
"re.compile",
"gzip.open",
"os.path.join",
"bz2.BZ2File",
"json.load"
] | [((473, 509), 'os.path.join', 'os.path.join', (['"""."""', '"""submissions"""', 'id'], {}), "('.', 'submissions', id)\n", (485, 509), False, 'import os\n'), ((610, 634), 'os.path.exists', 'os.path.exists', (['base_dir'], {}), '(base_dir)\n', (624, 634), False, 'import os\n'), ((741, 778), 'os.path.join', 'os.path.join'... |
"""
[True] vstack []
[True] bstack []
[True] hello 0
[False] vstack []
[False] bstack []
[False] world 1
"""
from pyteleport import tp_dummy
from pyteleport.tests.helpers import setup_verbose_logging, print_, get_tp_args, print_stack_here
setup_verbose_logging()
def generator_fn():
print_stack_here(print_)
... | [
"pyteleport.tests.helpers.get_tp_args",
"pyteleport.tests.helpers.print_stack_here",
"pyteleport.tests.helpers.setup_verbose_logging"
] | [((241, 264), 'pyteleport.tests.helpers.setup_verbose_logging', 'setup_verbose_logging', ([], {}), '()\n', (262, 264), False, 'from pyteleport.tests.helpers import setup_verbose_logging, print_, get_tp_args, print_stack_here\n'), ((291, 315), 'pyteleport.tests.helpers.print_stack_here', 'print_stack_here', (['print_'],... |
#!/usr/bin/python3
import subprocess, os
import re
def get_output(cmd):
my_env = os.environ.copy()
if(variant == 'windows'):
my_env['PKG_CONFIG_PATH'] = '/tmp/gtk_download_test/lib/pkgconfig'
p = subprocess.Popen(cmd, env = my_env, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
... | [
"subprocess.Popen",
"os.environ.copy",
"re.compile"
] | [((83, 100), 'os.environ.copy', 'os.environ.copy', ([], {}), '()\n', (98, 100), False, 'import subprocess, os\n'), ((206, 292), 'subprocess.Popen', 'subprocess.Popen', (['cmd'], {'env': 'my_env', 'stdout': 'subprocess.PIPE', 'stderr': 'subprocess.PIPE'}), '(cmd, env=my_env, stdout=subprocess.PIPE, stderr=subprocess\n ... |
# coding: utf-8
from io import StringIO
import re
from lxml.etree import Comment
from lxml.html import tostring, _looks_like_full_html_unicode, parse
try:
from django.utils.encoding import force_text
except ImportError: # For Django < 1.4.2
from django.utils.encoding import force_unicode as force_text
from .m... | [
"re.compile",
"lxml.html.tostring",
"io.StringIO",
"django.utils.encoding.force_unicode",
"lxml.html._looks_like_full_html_unicode"
] | [((2355, 2410), 're.compile', 're.compile', (['"""^\\\\s*<p[^>]*>.*</p>\\\\s*$"""'], {'flags': 're.DOTALL'}), "('^\\\\s*<p[^>]*>.*</p>\\\\s*$', flags=re.DOTALL)\n", (2365, 2410), False, 'import re\n'), ((2483, 2508), 'django.utils.encoding.force_unicode', 'force_text', (['original_html'], {}), '(original_html)\n', (249... |
# Report on AWS IAM users the last time they used the console or API access
# Code is designed to be run on AWS Lambda but van be run via command line given the environment variables are set
from __future__ import print_function
import boto3
import os
import json
import pprint
import datetime
pp = pprint.PrettyPrint... | [
"boto3.setup_default_session",
"datetime.datetime.now",
"boto3.client",
"pprint.PrettyPrinter"
] | [((302, 332), 'pprint.PrettyPrinter', 'pprint.PrettyPrinter', ([], {'indent': '(4)'}), '(indent=4)\n', (322, 332), False, 'import pprint\n'), ((706, 745), 'boto3.client', 'boto3.client', (['"""iam"""'], {'region_name': 'region'}), "('iam', region_name=region)\n", (718, 745), False, 'import boto3\n'), ((764, 813), 'boto... |
from __future__ import division, print_function
__author__ = 'saeedamen' # <NAME> / <EMAIL>
#
# Copyright 2017 Cuemacro Ltd. - http//www.cuemacro.com / @cuemacro
#
# See the License for the specific language governing permissions and limitations under the License.
#
import os
from collections import OrderedDict
im... | [
"tcapy.conf.constants.Constants",
"tcapy.util.mediator.Mediator.get_volatile_cache",
"tcapy.analysis.tcaengine.TCAEngineImpl",
"os.path.join",
"tcapy.analysis.algos.resultsform.TimelineResultsForm",
"tcapy.analysis.algos.benchmark.BenchmarkMarketSpreadToMid",
"tcapy.analysis.algos.metric.MetricSlippage"... | [((428, 439), 'tcapy.conf.constants.Constants', 'Constants', ([], {}), '()\n', (437, 439), False, 'from tcapy.conf.constants import Constants\n'), ((503, 532), 'tcapy.util.mediator.Mediator.get_volatile_cache', 'Mediator.get_volatile_cache', ([], {}), '()\n', (530, 532), False, 'from tcapy.util.mediator import Mediator... |
from datetime import datetime, timedelta
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
from django.db.models import Prefetch, Q
from django.urls import reverse
from TWLight.applications.models import Application
from TWLight.resources.models import Partner
from TWLigh... | [
"django.db.models.Prefetch",
"TWLight.users.models.get_company_name",
"datetime.timedelta",
"TWLight.users.models.Editor.objects.select_related",
"django.urls.reverse",
"datetime.datetime.today",
"django.db.models.Q",
"django.contrib.auth.models.User.objects.select_related"
] | [((872, 909), 'TWLight.users.models.Editor.objects.select_related', 'Editor.objects.select_related', (['"""user"""'], {}), "('user')\n", (901, 909), False, 'from TWLight.users.models import Authorization, get_company_name, Editor\n'), ((1408, 1450), 'django.contrib.auth.models.User.objects.select_related', 'User.object... |
import unittest
import nlpaug.augmenter.word as naw
class TestSplit(unittest.TestCase):
def test_split(self):
texts = ["The quick brown fox jumps over the lazy dog"]
aug = naw.SplitAug()
for text in texts:
augmented_text = aug.augment(text)
self.assertLess(len(te... | [
"nlpaug.augmenter.word.SplitAug"
] | [((195, 209), 'nlpaug.augmenter.word.SplitAug', 'naw.SplitAug', ([], {}), '()\n', (207, 209), True, 'import nlpaug.augmenter.word as naw\n'), ((428, 452), 'nlpaug.augmenter.word.SplitAug', 'naw.SplitAug', ([], {'min_char': '(6)'}), '(min_char=6)\n', (440, 452), True, 'import nlpaug.augmenter.word as naw\n')] |
import numpy as np
from . import stereonet_math
def fit_girdle(*args, **kwargs):
"""
Fits a plane to a scatter of points on a stereonet (a.k.a. a "girdle").
Input arguments will be interpreted as poles, lines, rakes, or "raw"
longitudes and latitudes based on the ``measurement`` keyword argument.
... | [
"numpy.allclose",
"numpy.hstack",
"numpy.random.choice",
"numpy.squeeze",
"numpy.linalg.eigh",
"numpy.cov"
] | [((8249, 8262), 'numpy.cov', 'np.cov', (['xyz.T'], {}), '(xyz.T)\n', (8255, 8262), True, 'import numpy as np\n'), ((8286, 8305), 'numpy.linalg.eigh', 'np.linalg.eigh', (['cov'], {}), '(cov)\n', (8300, 8305), True, 'import numpy as np\n'), ((15470, 15496), 'numpy.random.choice', 'np.random.choice', (['lon', 'num'], {}),... |
from pyradioconfig.calculator_model_framework.interfaces.icalculator import ICalculator
from enum import Enum
from pycalcmodel.core.variable import ModelVariableFormat, CreateModelVariableEnum
class Calc_AoX_Bobcat(ICalculator):
###AoX Calculations###
def buildVariables(self, model):
var = self._addMo... | [
"pycalcmodel.core.variable.CreateModelVariableEnum"
] | [((605, 694), 'pycalcmodel.core.variable.CreateModelVariableEnum', 'CreateModelVariableEnum', (['"""AoxEnableEnum"""', '"""AoX Enable/Disable Selection"""', 'member_data'], {}), "('AoxEnableEnum', 'AoX Enable/Disable Selection',\n member_data)\n", (628, 694), False, 'from pycalcmodel.core.variable import ModelVariab... |
# 已知仓库中有若干商品,以及相应库存,类似:
# 袜子,10
# 鞋子,20
# 拖鞋,30
# 项链,40
# 要求随机返回一种商品,要求商品被返回的概率与其库存成正比。请描述实现的思路或者直接写一个实现的函数
import random
def randpick(n):
socks = ['wz'] * 10 * n
shoes = ['xz'] * 20 * n
slippers = ['tx'] * 30 * n
necklace = ['xl'] * 40 * n
for_all = socks + shoes + slippers + necklace
count=... | [
"random.sample"
] | [((363, 388), 'random.sample', 'random.sample', (['for_all', 'n'], {}), '(for_all, n)\n', (376, 388), False, 'import random\n')] |
from typing import Union, Optional, Dict
import torch
from falkon import sparse
from falkon.kernels.diff_kernel import DiffKernel
from falkon.la_helpers.square_norm_fn import square_norm_diff
from falkon.options import FalkonOptions
from falkon.sparse import SparseTensor
SQRT3 = 1.7320508075688772
SQRT5 = 2.23606797... | [
"torch.neg",
"torch.sqrt",
"falkon.sparse.sparse_square_norm",
"falkon.sparse.sparse_matmul",
"falkon.la_helpers.square_norm_fn.square_norm_diff"
] | [((2041, 2079), 'falkon.sparse.sparse_square_norm', 'sparse.sparse_square_norm', (['X1_csr', 'sq1'], {}), '(X1_csr, sq1)\n', (2066, 2079), False, 'from falkon import sparse\n'), ((2244, 2282), 'falkon.sparse.sparse_square_norm', 'sparse.sparse_square_norm', (['X2_csr', 'sq2'], {}), '(X2_csr, sq2)\n', (2269, 2282), Fals... |
import json
import pprint as p
import sys
import pandas as pd
from functools import reduce
import statistics
def deep_get(dictionary, keys, default=None):
return reduce(
lambda d, key: d.get(key, default) if isinstance(d, dict) else default,
keys.split("."),
dictionary,
)
def entry_n... | [
"statistics.median",
"pandas.concat",
"pandas.set_option"
] | [((1222, 1261), 'pandas.set_option', 'pd.set_option', (['"""display.max_rows"""', 'None'], {}), "('display.max_rows', None)\n", (1235, 1261), True, 'import pandas as pd\n'), ((1267, 1281), 'pandas.concat', 'pd.concat', (['dfs'], {}), '(dfs)\n', (1276, 1281), True, 'import pandas as pd\n'), ((965, 1001), 'statistics.med... |
import os
import pickle
import tempfile
import timeit
import sacred
from golf_course.core.model import ToyModel
from golf_course.utils import load_model_params
from sacred.observers import FileStorageObserver
log_folder = os.path.expanduser('~/logs/diffusion/capacity_based_hitprob')
ex = sacred.Experiment('capacity_b... | [
"tempfile.TemporaryDirectory",
"golf_course.core.model.ToyModel",
"pickle.dump",
"sacred.observers.FileStorageObserver.create",
"timeit.default_timer",
"os.path.join",
"sacred.Experiment",
"golf_course.utils.load_model_params",
"os.path.expanduser"
] | [((224, 285), 'os.path.expanduser', 'os.path.expanduser', (['"""~/logs/diffusion/capacity_based_hitprob"""'], {}), "('~/logs/diffusion/capacity_based_hitprob')\n", (242, 285), False, 'import os\n'), ((291, 334), 'sacred.Experiment', 'sacred.Experiment', (['"""capacity_based_hitprob"""'], {}), "('capacity_based_hitprob'... |
# For the class Data Science: Practical Deep Learning Concepts in Theano and TensorFlow
# https://deeplearningcourses.com/c/data-science-deep-learning-in-theano-tensorflow
# https://www.udemy.com/data-science-deep-learning-in-theano-tensorflow
from __future__ import print_function, division
from builtins import range
#... | [
"numpy.mean",
"theano.shared",
"numpy.sqrt",
"theano.function",
"matplotlib.pyplot.show",
"sklearn.utils.shuffle",
"theano.tensor.matrix",
"matplotlib.pyplot.plot",
"theano.tensor.ivector",
"theano.tensor.arange",
"numpy.zeros",
"theano.tensor.argmax",
"builtins.range",
"numpy.random.randn... | [((584, 607), 'numpy.random.randn', 'np.random.randn', (['M1', 'M2'], {}), '(M1, M2)\n', (599, 607), True, 'import numpy as np\n'), ((610, 627), 'numpy.sqrt', 'np.sqrt', (['(2.0 / M1)'], {}), '(2.0 / M1)\n', (617, 627), True, 'import numpy as np\n'), ((797, 809), 'numpy.zeros', 'np.zeros', (['M2'], {}), '(M2)\n', (805,... |
import turtle
def spiral(sides,turn,color,width):
t=turtle.Turtle()
t.color(color)
t.width(width)
t.speed(0)
for n in range(sides):
t.forward(n)
t.right(turn)
t.penup()
t.left(60)
t.forward(10)
t.right(60)
t.pendown()
t.hideturtle()
sp... | [
"turtle.Turtle"
] | [((57, 72), 'turtle.Turtle', 'turtle.Turtle', ([], {}), '()\n', (70, 72), False, 'import turtle\n')] |
"""
Copyright: MAXON Computer GmbH
Author: <NAME>
Description:
- Moves the first node in the Graph View created from the Xpresso Tag of the selected object.
Class/method highlighted:
- c4d.modules.graphview.GvNodeMaster
- c4d.modules.graphview.GvNode
- GvNodeMaster.GetRoot()
- GeListNode.GetDown()... | [
"c4d.EventAdd"
] | [((1801, 1815), 'c4d.EventAdd', 'c4d.EventAdd', ([], {}), '()\n', (1813, 1815), False, 'import c4d\n')] |
from canonical import Customer, Individual, CustomerStatus, PartyType, Gender, MaritalStatus, Account
def raw_table_cust_transform(payload):
individual = Individual()
individual.id = "CUST" + payload.get('cust_num', "")
individual.name = payload.get('name', None)
individual.first_name = payload.get('f... | [
"canonical.Customer",
"canonical.Individual",
"canonical.Account"
] | [((160, 172), 'canonical.Individual', 'Individual', ([], {}), '()\n', (170, 172), False, 'from canonical import Customer, Individual, CustomerStatus, PartyType, Gender, MaritalStatus, Account\n'), ((729, 739), 'canonical.Customer', 'Customer', ([], {}), '()\n', (737, 739), False, 'from canonical import Customer, Indivi... |
import unittest
import pickle
import tensorflow as tf
from railrl.misc.tf_test_case import TFTestCase
from railrl.policies.nn_policy import FeedForwardPolicy
from railrl.qfunctions.nn_qfunction import FeedForwardCritic
from railrl.qfunctions.quadratic_naf_qfunction import QuadraticNAF
class TestSerialization(TFTestC... | [
"railrl.qfunctions.quadratic_naf_qfunction.QuadraticNAF",
"pickle.dumps",
"railrl.policies.nn_policy.FeedForwardPolicy",
"tensorflow.global_variables_initializer",
"unittest.main",
"railrl.qfunctions.nn_qfunction.FeedForwardCritic"
] | [((1347, 1362), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1360, 1362), False, 'import unittest\n'), ((494, 600), 'railrl.qfunctions.nn_qfunction.FeedForwardCritic', 'FeedForwardCritic', ([], {'name_or_scope': '"""a"""', 'action_dim': 'self.action_dim', 'observation_dim': 'self.observation_dim'}), "(name_or_s... |
"""
Test the API interface to handle chained local/remote references.
"""
import pytest
import requests_mock
from rest_framework.reverse import reverse
from testapp.models import ZaakObject, ZaakType
pytestmark = pytest.mark.django_db()
def test_get_local_fk_after_remote_url(api_client):
zaaktype = ZaakType.obj... | [
"requests_mock.Mocker",
"testapp.models.ZaakObject.objects.create",
"testapp.models.ZaakType.objects.create",
"pytest.mark.django_db",
"rest_framework.reverse.reverse"
] | [((215, 238), 'pytest.mark.django_db', 'pytest.mark.django_db', ([], {}), '()\n', (236, 238), False, 'import pytest\n'), ((308, 344), 'testapp.models.ZaakType.objects.create', 'ZaakType.objects.create', ([], {'name': '"""test"""'}), "(name='test')\n", (331, 344), False, 'from testapp.models import ZaakObject, ZaakType\... |
from objects.CSCG._2d.mesh.domain.regions.region.interpolations.allocator import InterpolationSearcher
from objects.CSCG._2d.mesh.domain.regions.region.edge_geometries.allocator import EdgeGeometryDispatcher
from objects.CSCG._2d.mesh.domain.regions.region.types_wrt_metric.allocator import TypeWr2MetricGiver
from ob... | [
"screws.decorators.accepts.accepts",
"objects.CSCG._2d.mesh.domain.regions.region.edges.main.Edges",
"objects.CSCG._2d.mesh.domain.regions.region.types_wrt_metric.allocator.TypeWr2MetricGiver",
"objects.CSCG._2d.mesh.domain.regions.region.edge_geometries.allocator.EdgeGeometryDispatcher",
"numpy.array",
"... | [((716, 741), 'screws.decorators.accepts.accepts', 'accepts', (['"""self"""', 'int', 'str'], {}), "('self', int, str)\n", (723, 741), False, 'from screws.decorators.accepts import accepts\n'), ((3200, 3221), 'screws.decorators.accepts.accepts', 'accepts', (['"""self"""', 'dict'], {}), "('self', dict)\n", (3207, 3221), ... |
from airone.lib.http import render
from django.http import HttpResponse
def list_entry_without_context(request, entity):
return HttpResponse("return no data") if request.GET.get("return_resp", None) else None
def list_entry(request, entity, context):
return render(request, "list_entry.html", dict(context, *... | [
"django.http.HttpResponse"
] | [((134, 164), 'django.http.HttpResponse', 'HttpResponse', (['"""return no data"""'], {}), "('return no data')\n", (146, 164), False, 'from django.http import HttpResponse\n')] |
# Copyright 2021 <NAME> and Fujitsu Limited
#
# 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 ... | [
"networkx.draw_circular",
"pandas.read_csv",
"os.makedirs",
"networkx.DiGraph",
"matplotlib.pyplot.show"
] | [((1661, 1697), 'os.makedirs', 'os.makedirs', (['"""models"""'], {'exist_ok': '(True)'}), "('models', exist_ok=True)\n", (1672, 1697), False, 'import os\n'), ((2843, 2880), 'networkx.draw_circular', 'nx.draw_circular', (['G'], {'with_labels': '(True)'}), '(G, with_labels=True)\n', (2859, 2880), True, 'import networkx a... |
import argparse
from .RepublicanDate import RepublicanDate
from .DecimalTime import DecimalTime
from .RepublicanFormatter import RepublicanFormatter
from datetime import datetime, timedelta, time, date
import re
def main():
parser = argparse.ArgumentParser(description='Converts and prints date and time in the Fre... | [
"argparse.ArgumentParser",
"datetime.datetime.utcnow",
"re.compile",
"datetime.datetime.now",
"datetime.datetime.fromisoformat",
"datetime.timedelta",
"datetime.time.fromisoformat",
"datetime.date.fromisoformat"
] | [((239, 348), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Converts and prints date and time in the French Republican style."""'}), "(description=\n 'Converts and prints date and time in the French Republican style.')\n", (262, 348), False, 'import argparse\n'), ((1728, 1766), 're.c... |
from bebado import Bebado
p1=Bebado('Carlos',23)
p1.beber('Cerveja')
p1.parar_beber('cerveja')
p1.parar_beber('cerveja')
p1.beber('Whisky')
p1.brigar('Chutes')
p1.parar_beber('Whisky')
p1.brigar('Chutes')
#print(f'{p1.nome} tem {p1.idade} anos ') | [
"bebado.Bebado"
] | [((30, 50), 'bebado.Bebado', 'Bebado', (['"""Carlos"""', '(23)'], {}), "('Carlos', 23)\n", (36, 50), False, 'from bebado import Bebado\n')] |
# Copyright 2017,2021 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | [
"treehaus.treebase.btree.BTree.get",
"pickle.dump",
"treehaus.treebase.btree.BLeaf.__init__",
"pickle.load",
"treehaus.treebase.btree.BTree.remove",
"treehaus.treebase.btree.BNode.__init__",
"weakref.ref",
"treehaus.treebase.btree.BTree.__init__"
] | [((2329, 2347), 'weakref.ref', 'weakref.ref', (['c', 'fn'], {}), '(c, fn)\n', (2340, 2347), False, 'import weakref\n'), ((3026, 3074), 'treehaus.treebase.btree.BLeaf.__init__', 'BLeaf.__init__', (['self', 'tree', 'parent', 'keys', 'values'], {}), '(self, tree, parent, keys, values)\n', (3040, 3074), False, 'from treeha... |
from django.urls import path
from . import views
urlpatterns = [
path('ground', views.battle_ground, name='Ground Battle'),
path('naval', views.battle_naval, name='Naval Battle'),
]
| [
"django.urls.path"
] | [((70, 127), 'django.urls.path', 'path', (['"""ground"""', 'views.battle_ground'], {'name': '"""Ground Battle"""'}), "('ground', views.battle_ground, name='Ground Battle')\n", (74, 127), False, 'from django.urls import path\n'), ((133, 187), 'django.urls.path', 'path', (['"""naval"""', 'views.battle_naval'], {'name': '... |
# Copyright 2015-2016 <NAME> and The University of British Columbia
# 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 appli... | [
"numpy.sqrt",
"numpy.ones",
"pandas.read_csv",
"datetime.datetime.strptime",
"carbonate.calc_carbonate",
"xarray.DataArray",
"pandas.DataFrame",
"datetime.timedelta",
"pandas.concat"
] | [((1462, 1559), 'pandas.read_csv', 'pd.read_csv', (['filename'], {'delim_whitespace': '(True)', 'header': '(0)', 'names': 'field_names', 'skiprows': '(index + 1)'}), '(filename, delim_whitespace=True, header=0, names=field_names,\n skiprows=index + 1)\n', (1473, 1559), True, 'import pandas as pd\n'), ((3029, 3149), ... |
from io import BytesIO
from tds.tokens import SQLBatchStream
from .base import Request
class SQLBatchRequest(Request):
def __init__(self, buf):
"""
:param BytesIO buf:
"""
super(SQLBatchRequest, self).__init__()
self.stream = stream = SQLBatchStream()
... | [
"tds.tokens.SQLBatchStream"
] | [((297, 313), 'tds.tokens.SQLBatchStream', 'SQLBatchStream', ([], {}), '()\n', (311, 313), False, 'from tds.tokens import SQLBatchStream\n')] |
import unittest
from sql_manager import SqlManager
from app_interface import AppInterface
from data_container import SettingVariables, Question
class TestUserInterface(unittest.TestCase):
"""Unittest class. With test variables as class variables."""
test_table_name = "test_table"
test_database_na... | [
"data_container.SettingVariables",
"data_container.Question",
"sql_manager.SqlManager",
"app_interface.AppInterface"
] | [((550, 564), 'app_interface.AppInterface', 'AppInterface', ([], {}), '()\n', (562, 564), False, 'from app_interface import AppInterface\n'), ((822, 836), 'app_interface.AppInterface', 'AppInterface', ([], {}), '()\n', (834, 836), False, 'from app_interface import AppInterface\n'), ((1019, 1031), 'sql_manager.SqlManage... |
import factory
from user_accounts import models
from .organization_factory import FakeOrganizationFactory
from .user_factory import UserFactory, user_with_name_and_email_from_org_slug
class UserProfileFactory(factory.DjangoModelFactory):
name = factory.Sequence(lambda n: 'Fake User {}'.format(n))
user = facto... | [
"factory.SubFactory",
"user_accounts.models.Organization.objects.get"
] | [((315, 346), 'factory.SubFactory', 'factory.SubFactory', (['UserFactory'], {}), '(UserFactory)\n', (333, 346), False, 'import factory\n'), ((366, 409), 'factory.SubFactory', 'factory.SubFactory', (['FakeOrganizationFactory'], {}), '(FakeOrganizationFactory)\n', (384, 409), False, 'import factory\n'), ((1614, 1660), 'u... |
#python
import json
#web app
from tornado.web import RequestHandler
class BaseHandler(RequestHandler):
def data_received(self, chunk):
pass
def __init__(self, application, request, **kwargs):
RequestHandler.__init__(self, application, request, **kwargs)
self.set_header("Content-Type",... | [
"json.dumps",
"tornado.web.RequestHandler.__init__"
] | [((219, 280), 'tornado.web.RequestHandler.__init__', 'RequestHandler.__init__', (['self', 'application', 'request'], {}), '(self, application, request, **kwargs)\n', (242, 280), False, 'from tornado.web import RequestHandler\n'), ((796, 833), 'json.dumps', 'json.dumps', (["{'response': 'NOT FOUND'}"], {}), "({'response... |
from __future__ import absolute_import, division, print_function
import cmath
import math
from six.moves import zip
class least_squares:
def __init__(self, obs, calc):
self.obs = obs
self.calc = calc
a, b = self.calc.real, self.calc.imag
self.abs_calc = math.sqrt(a**2 + b**2)
self.delta = self.o... | [
"cmath.exp",
"math.sqrt",
"six.moves.zip"
] | [((274, 300), 'math.sqrt', 'math.sqrt', (['(a ** 2 + b ** 2)'], {}), '(a ** 2 + b ** 2)\n', (283, 300), False, 'import math\n'), ((2325, 2335), 'six.moves.zip', 'zip', (['d', 'd2'], {}), '(d, d2)\n', (2328, 2335), False, 'from six.moves import zip\n'), ((1578, 1601), 'cmath.exp', 'cmath.exp', (['(1.0j * alpha)'], {}), ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
快排,
用某个值分list成大小两半,
"""
import random
def test(quick):
l = random.sample(range(99), 10)
s = sorted(l)
quick(l)
assert l == s
def _swap(l, a, b):
l[a], l[b] = l[b], l[a]
def _part(l, a, b):
j = random.randrange(a, b)
_swap(l, a, j)
i =... | [
"random.randrange"
] | [((271, 293), 'random.randrange', 'random.randrange', (['a', 'b'], {}), '(a, b)\n', (287, 293), False, 'import random\n')] |
try:
import multiprocessing
except ImportError:
pass
from setuptools import setup
setup(
name='Flask-Imagine',
version='0.5',
description='Extension which provides easy image manipulation support in Flask applications.',
url='https://github.com/FlaskGuys/Flask-Imagine',
author='Kronas',
... | [
"setuptools.setup"
] | [((93, 891), 'setuptools.setup', 'setup', ([], {'name': '"""Flask-Imagine"""', 'version': '"""0.5"""', 'description': '"""Extension which provides easy image manipulation support in Flask applications."""', 'url': '"""https://github.com/FlaskGuys/Flask-Imagine"""', 'author': '"""Kronas"""', 'author_email': '"""<EMAIL>"... |
import os
import requests
import tarfile
import urllib.request
import zipfile
from tqdm import tqdm
def maybe_download_from_url(url, download_dir):
"""
Download the data from url, unless it's already here.
Args:
download_dir: string, path to download directory
url: url to download from
... | [
"os.path.getsize",
"tarfile.open",
"requests.Session",
"os.makedirs",
"zipfile.ZipFile",
"os.path.join",
"tarfile.is_tarfile",
"os.path.isfile",
"zipfile.is_zipfile"
] | [((425, 461), 'os.path.join', 'os.path.join', (['download_dir', 'filename'], {}), '(download_dir, filename)\n', (437, 461), False, 'import os\n'), ((467, 507), 'os.makedirs', 'os.makedirs', (['download_dir'], {'exist_ok': '(True)'}), '(download_dir, exist_ok=True)\n', (478, 507), False, 'import os\n'), ((2411, 2448), '... |
from quex.input.setup import NotificationDB
from quex.input.code.base import SourceRef
import quex.engine.misc.error as error
from quex.engine.misc.file_operations import get_file_content_or_die, \
open_file_or_die
from qu... | [
"quex.blackboard.Lng.Match_include.findall",
"quex.blackboard.Lng.Match_include.search",
"quex.engine.misc.error.warning",
"re.compile",
"os.access",
"quex.engine.misc.file_operations.open_file_or_die",
"quex.input.code.base.SourceRef",
"quex.engine.misc.file_operations.get_file_content_or_die",
"os... | [((4134, 4154), 're.compile', 're.compile', (['DefineRE'], {}), '(DefineRE)\n', (4144, 4154), False, 'import re\n'), ((4175, 4195), 're.compile', 're.compile', (['AssignRE'], {}), '(AssignRE)\n', (4185, 4195), False, 'import re\n'), ((4216, 4234), 're.compile', 're.compile', (['EnumRE'], {}), '(EnumRE)\n', (4226, 4234)... |
import sys
try:
#TODO this is a hack, at minimum should be done s.t. it'll work for aaaany ros distribution
sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages')
sys.path.append('/opt/ros/kinetic/lib/python2.7/dist-packages')
except Exception as e:
print(e)
print("no ros kinetic found in p... | [
"numpy.abs",
"numpy.ones",
"rospy.is_shutdown",
"cv2.findHomography",
"sys.path.remove",
"numpy.array",
"numpy.linalg.inv",
"numpy.linspace",
"numpy.zeros",
"rospy.sleep",
"numpy.load",
"sys.path.append",
"numpy.save"
] | [((116, 179), 'sys.path.remove', 'sys.path.remove', (['"""/opt/ros/kinetic/lib/python2.7/dist-packages"""'], {}), "('/opt/ros/kinetic/lib/python2.7/dist-packages')\n", (131, 179), False, 'import sys\n'), ((184, 247), 'sys.path.append', 'sys.path.append', (['"""/opt/ros/kinetic/lib/python2.7/dist-packages"""'], {}), "('... |
import json
from serverless.project.send_email import handler as send_email
from serverless.project.subscribe import handler as subscribe
from serverless.project.unsubscribe import handler as unsubscribe
def hello(event, context):
body = {
"message": "Go Serverless v1.0! Your function executed successful... | [
"json.dumps"
] | [((399, 415), 'json.dumps', 'json.dumps', (['body'], {}), '(body)\n', (409, 415), False, 'import json\n')] |
"""
<EMAIL>
"""
from __future__ import absolute_import
from PyQt5 import QtGui
from PyQt5 import QtCore
from PyQt5 import QtWidgets
from biobeam.beam_gui.fieldpanel import FieldPanel
from biobeam.beam_gui.fieldstate import CylindricalState, BeamState, LatticeState
class FieldListPanel(QtWidgets.QWidget):
_st... | [
"PyQt5.QtCore.pyqtSignal",
"PyQt5.QtWidgets.QComboBox",
"biobeam.beam_gui.fieldstate.LatticeState",
"PyQt5.QtWidgets.QApplication",
"PyQt5.QtWidgets.QVBoxLayout",
"biobeam.beam_gui.fieldpanel.FieldPanel",
"biobeam.beam_gui.fieldstate.CylindricalState",
"biobeam.beam_gui.fieldstate.BeamState"
] | [((333, 356), 'PyQt5.QtCore.pyqtSignal', 'QtCore.pyqtSignal', (['bool'], {}), '(bool)\n', (350, 356), False, 'from PyQt5 import QtCore\n'), ((1619, 1651), 'PyQt5.QtWidgets.QApplication', 'QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (1641, 1651), False, 'from PyQt5 import QtWidgets\n'), ((520, 543), 'Py... |
"""Tests for the ecobee.util module."""
import pytest
import voluptuous as vol
from homeassistant.components.ecobee.util import ecobee_date, ecobee_time
async def test_ecobee_date_with_valid_input():
"""Test that the date function returns the expected result."""
test_input = "2019-09-27"
assert ecobee_d... | [
"homeassistant.components.ecobee.util.ecobee_time",
"homeassistant.components.ecobee.util.ecobee_date",
"pytest.raises"
] | [((312, 335), 'homeassistant.components.ecobee.util.ecobee_date', 'ecobee_date', (['test_input'], {}), '(test_input)\n', (323, 335), False, 'from homeassistant.components.ecobee.util import ecobee_date, ecobee_time\n'), ((508, 534), 'pytest.raises', 'pytest.raises', (['vol.Invalid'], {}), '(vol.Invalid)\n', (521, 534),... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `pcuf` package."""
import hashlib
import warnings
import pytest
import pcuf
from tests.utils import TEST_DIR
@pytest.fixture
def file(request):
test_file = TEST_DIR / "foo.txt"
content = "hello"
with open(str(test_file), "w+") as f:
f.... | [
"pcuf.functions.retry",
"pcuf.file.sha1",
"pcuf.file.rename",
"warnings.catch_warnings",
"pcuf.warnings.deprecate",
"pytest.raises",
"warnings.simplefilter"
] | [((688, 716), 'pcuf.file.sha1', 'pcuf.file.sha1', (["file['file']"], {}), "(file['file'])\n", (702, 716), False, 'import pcuf\n'), ((934, 978), 'pcuf.file.rename', 'pcuf.file.rename', (["file['file']", '"""foobar.txt"""'], {}), "(file['file'], 'foobar.txt')\n", (950, 978), False, 'import pcuf\n'), ((2031, 2076), 'pcuf.... |
"""
Copyright (c) 2018 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wr... | [
"mo.utils.unittest.graph.build_graph_with_attrs",
"numpy.array",
"mo.graph.graph.Node",
"numpy.array_equal",
"extensions.middle.lstm_sequence_normalize.LSTMSequenceNormalize"
] | [((921, 944), 'extensions.middle.lstm_sequence_normalize.LSTMSequenceNormalize', 'LSTMSequenceNormalize', ([], {}), '()\n', (942, 944), False, 'from extensions.middle.lstm_sequence_normalize import LSTMSequenceNormalize\n'), ((1005, 1047), 'numpy.array', 'np.array', (['[10, 1, 20, 128]'], {'dtype': 'np.int64'}), '([10,... |
import sys
import unittest
from packaging import version
from unittest import mock
import tensorflow as tf
import larq_zoo as lqz
from tensorflow.python.eager import context
sys.modules["importlib.metadata"] = mock.MagicMock()
sys.modules["importlib_metadata"] = mock.MagicMock()
sys.modules["larq_compute_engine.mlir.... | [
"tensorflow.python.eager.context.eager_mode",
"larq_zoo.sota.QuickNet",
"larq_compute_engine.mlir._tf_tfl_flatbuffer.convert_saved_model_to_tflite_flatbuffer.assert_called_once_with",
"unittest.mock.MagicMock",
"unittest.main",
"packaging.version.parse",
"larq_compute_engine.mlir.python.converter.conver... | [((212, 228), 'unittest.mock.MagicMock', 'mock.MagicMock', ([], {}), '()\n', (226, 228), False, 'from unittest import mock\n'), ((265, 281), 'unittest.mock.MagicMock', 'mock.MagicMock', ([], {}), '()\n', (279, 281), False, 'from unittest import mock\n'), ((343, 359), 'unittest.mock.MagicMock', 'mock.MagicMock', ([], {}... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from dateutil import parser as date_parser
import dateutil.relativedelta as relativedelta
import dateutil.rrule as rrule
from util import *
from util import logs
class AllMusic(object):
def __init__(self):
self.base_url = "https://www.allmusic.com/newrelea... | [
"dateutil.rrule.rrule"
] | [((631, 704), 'dateutil.rrule.rrule', 'rrule.rrule', (['rrule.WEEKLY'], {'byweekday': 'relativedelta.FR', 'dtstart': 'start_date'}), '(rrule.WEEKLY, byweekday=relativedelta.FR, dtstart=start_date)\n', (642, 704), True, 'import dateutil.rrule as rrule\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Model serializer object related tests"""
# System imports
import logging
import importlib
from mock import patch, MagicMock
# Project imports
from ..models import TestModel2, TestModel5, TestModel6
from .utils.mixins import TestModelMixin
from draalcore.test_utils.base... | [
"logging.getLogger",
"draalcore.rest.serializer_object.SerializerDataObject.create",
"draalcore.rest.model.SerializerFinder",
"mock.patch.object",
"mock.MagicMock"
] | [((472, 499), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (489, 499), False, 'import logging\n'), ((1775, 1815), 'mock.patch.object', 'patch.object', (['importlib', '"""import_module"""'], {}), "(importlib, 'import_module')\n", (1787, 1815), False, 'from mock import patch, MagicMock\n'... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# package documentation build configuration file, created by
# sphinx-quickstart on Tue Jun 6 20:04:57 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# au... | [
"datetime.date.today",
"pybtex.plugin.register_plugin"
] | [((1957, 2027), 'pybtex.plugin.register_plugin', 'register_plugin', (['"""pybtex.style.formatting"""', '"""gyptisstyle"""', 'GyptisStyle'], {}), "('pybtex.style.formatting', 'gyptisstyle', GyptisStyle)\n", (1972, 2027), False, 'from pybtex.plugin import register_plugin\n'), ((2922, 2934), 'datetime.date.today', 'date.t... |
import RPi.GPIO as GPIO
from picamera import PiCamera
class DiceCam(object):
"""Dice Cam! Flash the LEDs, take a pic!"""
def __init__(self, *led_pins):
super(DiceCam, self).__init__()
self.led_pins = list(led_pins)
self.camera = PiCamera()
self.camera.stop_preview()
self.camera.resolution = ... | [
"RPi.GPIO.cleanup",
"RPi.GPIO.setup",
"RPi.GPIO.output",
"RPi.GPIO.setwarnings",
"picamera.PiCamera",
"RPi.GPIO.setmode"
] | [((249, 259), 'picamera.PiCamera', 'PiCamera', ([], {}), '()\n', (257, 259), False, 'from picamera import PiCamera\n'), ((797, 819), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BCM'], {}), '(GPIO.BCM)\n', (809, 819), True, 'import RPi.GPIO as GPIO\n'), ((824, 847), 'RPi.GPIO.setwarnings', 'GPIO.setwarnings', (['(False)... |
#!/opt/local/bin/python
# Physics Equation Graph
# <NAME> <<EMAIL>>
# automate entry of content
import yaml # for reading "config.input"
import readline # for auto-complete # https://pymotw.com/2/readline/
import rlcompleter # for auto-complete
import time # for pauses
import sys
import os
lib_path = ... | [
"readline.set_completer",
"os.path.exists",
"readline.parse_and_bind",
"lib_physics_graph.find_new_indx",
"os.makedirs",
"lib_physics_graph.get_set_of_derivations",
"lib_physics_graph.convert_infrule_csv_to_list_of_dics",
"yaml.load",
"lib_physics_graph.separate_connection_lists",
"time.sleep",
... | [((320, 345), 'os.path.abspath', 'os.path.abspath', (['"""../lib"""'], {}), "('../lib')\n", (335, 345), False, 'import os\n'), ((346, 371), 'sys.path.append', 'sys.path.append', (['lib_path'], {}), '(lib_path)\n', (361, 371), False, 'import sys\n'), ((421, 449), 'os.path.abspath', 'os.path.abspath', (['"""databases"""'... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
Deafult_desc = '''Lorem ipsum dolor sit amet,
agam probatus indoctum cu quo.
Est eu quod rationibus,
nam platonem sententiae no.
Eu mel vero oporteat elaboraret.'''
class Category(models.Model):
Name = models.CharField(... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.ImageField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((303, 334), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(30)'}), '(max_length=30)\n', (319, 334), False, 'from django.db import models\n'), ((567, 599), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(255)'}), '(max_length=255)\n', (583, 599), False, 'from django.db ... |
from decouple import config
HOST: str = config("HOST", default="0.0.0.0", cast=str)
PORT: int = config("PORT", default=8080, cast=int)
CONCURRENT_TASKS: int = config('CONCURRENT_TASKS', default=50, cast=int)
ADMIN_SECRET: str | None = config('ADMIN_SECRET', default=None)
DIRECTUS_CREATE_RESOURCE_ENDPOINT: str = confi... | [
"decouple.config"
] | [((41, 84), 'decouple.config', 'config', (['"""HOST"""'], {'default': '"""0.0.0.0"""', 'cast': 'str'}), "('HOST', default='0.0.0.0', cast=str)\n", (47, 84), False, 'from decouple import config\n'), ((97, 135), 'decouple.config', 'config', (['"""PORT"""'], {'default': '(8080)', 'cast': 'int'}), "('PORT', default=8080, c... |
#!/usr/bin/env python
import numpy as np
def ltr_parts(parts_dict):
# when we flip image left parts became right parts and vice versa. This is the list of parts to exchange each other.
leftParts = [ parts_dict[p] for p in ["Lsho", "Lelb", "Lwri", "Lhip", "Lkne", "Lank", "Leye", "Lear"] ]
rightParts = [ p... | [
"numpy.zeros",
"numpy.minimum"
] | [((2382, 2456), 'numpy.zeros', 'np.zeros', (['(joints.shape[0], RmpeGlobalConfig.num_parts, 3)'], {'dtype': 'np.float'}), '((joints.shape[0], RmpeGlobalConfig.num_parts, 3), dtype=np.float)\n', (2390, 2456), True, 'import numpy as np\n'), ((3453, 3548), 'numpy.minimum', 'np.minimum', (['joints[both_shoulders_known, Rsh... |
import setuptools
with open("requirements.txt", encoding='utf-8') as f:
requirements = f.read()
setuptools.setup(
install_requires=requirements,
keywords="Geospatial Analysis NLP Danish English",
)
| [
"setuptools.setup"
] | [((102, 205), 'setuptools.setup', 'setuptools.setup', ([], {'install_requires': 'requirements', 'keywords': '"""Geospatial Analysis NLP Danish English"""'}), "(install_requires=requirements, keywords=\n 'Geospatial Analysis NLP Danish English')\n", (118, 205), False, 'import setuptools\n')] |
#################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021
# by the softwar... | [
"pytest.approx",
"pyomo.environ.value",
"pyomo.environ.Objective",
"pyomo.environ.Var",
"pyomo.environ.SolverFactory",
"pyomo.environ.Constraint",
"pyomo.environ.ConcreteModel"
] | [((902, 921), 'pyomo.environ.ConcreteModel', 'pyo.ConcreteModel', ([], {}), '()\n', (919, 921), True, 'import pyomo.environ as pyo\n'), ((932, 953), 'pyomo.environ.Var', 'pyo.Var', ([], {'initialize': '(3)'}), '(initialize=3)\n', (939, 953), True, 'import pyomo.environ as pyo\n'), ((964, 985), 'pyomo.environ.Var', 'pyo... |
import os
import pandas as pd
import mysql.connector
from mysql.connector import Error
import configparser
import json
##Excel Dosyası İşlemleri##
data = pd.read_excel ("../bilisimsozluk/newList.xlsx")#Excel dosyasının bulunduğu dosya yolu
df_English = pd.DataFrame(data, columns= ['english']) #Excel dosyasındaki belir... | [
"pandas.DataFrame",
"json.dumps",
"pandas.read_excel"
] | [((155, 201), 'pandas.read_excel', 'pd.read_excel', (['"""../bilisimsozluk/newList.xlsx"""'], {}), "('../bilisimsozluk/newList.xlsx')\n", (168, 201), True, 'import pandas as pd\n'), ((254, 293), 'pandas.DataFrame', 'pd.DataFrame', (['data'], {'columns': "['english']"}), "(data, columns=['english'])\n", (266, 293), True... |
import numpy as np
import random
from scipy.misc import imresize
from PIL import Image
import math
# from torchvision import transforms
import torch
class MultiRescale(object):
"""MultiScale the input image in a sample by given scales.
Args:
scales_list (tuple or int): Desired output scale list.
... | [
"random.choice",
"numpy.where",
"numpy.asarray",
"numpy.array",
"numpy.zeros",
"scipy.misc.imresize",
"numpy.zeros_like"
] | [((3411, 3456), 'numpy.zeros', 'np.zeros', (['[num_pixel, col_]'], {'dtype': 'np.float32'}), '([num_pixel, col_], dtype=np.float32)\n', (3419, 3456), True, 'import numpy as np\n'), ((3471, 3516), 'numpy.zeros', 'np.zeros', (['[row_, num_pixel]'], {'dtype': 'np.float32'}), '([row_, num_pixel], dtype=np.float32)\n', (347... |
from torch import nn
from rcnn.modeling import registry
from rcnn.core.config import cfg
@registry.MASKIOU_OUTPUTS.register("linear_output")
class MaskIoU_output(nn.Module):
def __init__(self, dim_in):
super(MaskIoU_output, self).__init__()
num_classes = cfg.MODEL.NUM_CLASSES
self.maskio... | [
"torch.nn.init.normal_",
"rcnn.modeling.registry.MASKIOU_OUTPUTS.register",
"torch.nn.Linear",
"torch.nn.init.constant_"
] | [((93, 143), 'rcnn.modeling.registry.MASKIOU_OUTPUTS.register', 'registry.MASKIOU_OUTPUTS.register', (['"""linear_output"""'], {}), "('linear_output')\n", (126, 143), False, 'from rcnn.modeling import registry\n'), ((324, 354), 'torch.nn.Linear', 'nn.Linear', (['dim_in', 'num_classes'], {}), '(dim_in, num_classes)\n', ... |
import torch
from tqdm import tqdm
import os
import numpy as np
train_features=torch.load('train_features.pt')
n = len(list(np.load('/facebook/data/images/train_imlist.npy')))
print(n)
os.makedirs('/siim/sim_pt_256', exist_ok=True)
for i in tqdm(range(n)):
a=torch.mm(train_features[i:i+1],train_features.t())
to... | [
"os.makedirs",
"torch.load",
"os.path.join",
"numpy.array",
"torch.argsort",
"numpy.load"
] | [((79, 110), 'torch.load', 'torch.load', (['"""train_features.pt"""'], {}), "('train_features.pt')\n", (89, 110), False, 'import torch\n'), ((185, 231), 'os.makedirs', 'os.makedirs', (['"""/siim/sim_pt_256"""'], {'exist_ok': '(True)'}), "('/siim/sim_pt_256', exist_ok=True)\n", (196, 231), False, 'import os\n'), ((641, ... |
from django.db import models
class Article(models.Model):
code = models.IntegerField()
description = models.CharField(max_length=256)
| [
"django.db.models.CharField",
"django.db.models.IntegerField"
] | [((71, 92), 'django.db.models.IntegerField', 'models.IntegerField', ([], {}), '()\n', (90, 92), False, 'from django.db import models\n'), ((111, 143), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(256)'}), '(max_length=256)\n', (127, 143), False, 'from django.db import models\n')] |
import json
import os
class connect:
def __init__(self, filename):
self.filename = filename
check_file_exits=os.path.isfile(filename+'.json')
if check_file_exits==False:
fob=open(filename+'.json','w+')
fob.close()
print('New File... | [
"os.path.isfile",
"os.stat",
"json.dumps",
"json.load"
] | [((152, 186), 'os.path.isfile', 'os.path.isfile', (["(filename + '.json')"], {}), "(filename + '.json')\n", (166, 186), False, 'import os\n'), ((710, 736), 'json.dumps', 'json.dumps', (['data'], {'indent': '(4)'}), '(data, indent=4)\n', (720, 736), False, 'import json\n'), ((1589, 1622), 'json.dumps', 'json.dumps', (['... |
#!/usr/bin/python
'''
Lists Cocoa methods in given file or ./cocoa_indexes/methods.txt by default.
'''
import re, os, gzip
from cocoa_definitions import default_headers, format_function_line
def get_methods(headers):
'''Returns list of Cocoa methods.'''
matches = []
for header in headers:
f = open(... | [
"gzip.open",
"cocoa_definitions.format_function_line",
"re.match",
"os.path.dirname",
"re.sub",
"re.findall",
"cocoa_definitions.default_headers",
"re.search"
] | [((1249, 1277), 're.search', 're.search', (['"""\\\\w+\\\\s*:"""', 'line'], {}), "('\\\\w+\\\\s*:', line)\n", (1258, 1277), False, 'import re, os, gzip\n'), ((1530, 1560), 're.sub', 're.sub', (['"""\\\\s*:\\\\s*"""', '""":"""', 'line'], {}), "('\\\\s*:\\\\s*', ':', line)\n", (1536, 1560), False, 'import re, os, gzip\n'... |
from django.urls import path
from . import views
from django.conf.urls import url, static
urlpatterns=[
path("graph/<str:graph_id>",views.view_experiment_graph,name="graph"),
path("duplicate_experiment/<int:original_experiment_id>",views.duplicate_experiment,name="duplicate_experiment"),
path("media... | [
"django.urls.path"
] | [((114, 185), 'django.urls.path', 'path', (['"""graph/<str:graph_id>"""', 'views.view_experiment_graph'], {'name': '"""graph"""'}), "('graph/<str:graph_id>', views.view_experiment_graph, name='graph')\n", (118, 185), False, 'from django.urls import path\n'), ((190, 309), 'django.urls.path', 'path', (['"""duplicate_expe... |
import sys
import matplotlib
matplotlib.use("Qt5Agg")
from PyQt5 import QtCore as qtc
from PyQt5 import QtWidgets as qtw
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg
from matplotlib.figure import Figure
class MplCanvas(FigureCanvasQTAgg):
def __init__(self, parent=None, width=5, height=4, d... | [
"PyQt5.QtWidgets.QWidget",
"matplotlib.use",
"matplotlib.figure.Figure",
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtWidgets.QVBoxLayout"
] | [((30, 54), 'matplotlib.use', 'matplotlib.use', (['"""Qt5Agg"""'], {}), "('Qt5Agg')\n", (44, 54), False, 'import matplotlib\n'), ((343, 383), 'matplotlib.figure.Figure', 'Figure', ([], {'figsize': '(width, height)', 'dpi': 'dpi'}), '(figsize=(width, height), dpi=dpi)\n', (349, 383), False, 'from matplotlib.figure impor... |
"""Functions for plotting data files."""
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
def rivet_paths(file_name):
"""Return all :py:mod:`rivet` paths found at file_name."""
from . import yodaplot
return yodaplot.data_object_names(file_name)
def gridplot(file... | [
"numpy.ravel",
"matplotlib.pyplot.sca",
"matplotlib.pyplot.subplots"
] | [((698, 712), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (710, 712), True, 'import matplotlib.pyplot as plt\n'), ((821, 862), 'matplotlib.pyplot.subplots', 'plt.subplots', (['nrows', 'ncols'], {'squeeze': '(False)'}), '(nrows, ncols, squeeze=False)\n', (833, 862), True, 'import matplotlib.pyplot as... |
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 5 12:38:45 2017
@author: abench
"""
import cv2
camera_num=0
camera=cv2.VideoCapture(camera_num)
fourcc=cv2.VideoWriter_fourcc(*'XVID')
out=cv2.VideoWriter('output.avi',fourcc,20.0,(640,480))
while(camera.isOpened()):
ret,frame=camera.read()
if ret==True:
... | [
"cv2.flip",
"cv2.VideoWriter",
"cv2.imshow",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"cv2.VideoWriter_fourcc",
"cv2.waitKey"
] | [((118, 146), 'cv2.VideoCapture', 'cv2.VideoCapture', (['camera_num'], {}), '(camera_num)\n', (134, 146), False, 'import cv2\n'), ((156, 187), 'cv2.VideoWriter_fourcc', 'cv2.VideoWriter_fourcc', (["*'XVID'"], {}), "(*'XVID')\n", (178, 187), False, 'import cv2\n'), ((192, 247), 'cv2.VideoWriter', 'cv2.VideoWriter', (['"... |
# -*- coding: utf-8 -*-
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg
from quantity.digger.widgets.mplotwidgets.widgets import MultiWidgets
import matplotlib.pyplot as plt
class TechWidget(MultiWidgets, FigureCanvasQTAgg):
def __init__(self, parent=None, *args):
self.fig = plt.figure()
... | [
"matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg.__init__",
"matplotlib.pyplot.figure",
"quantity.digger.widgets.mplotwidgets.widgets.MultiWidgets.__init__"
] | [((307, 319), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (317, 319), True, 'import matplotlib.pyplot as plt\n'), ((328, 370), 'matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg.__init__', 'FigureCanvasQTAgg.__init__', (['self', 'self.fig'], {}), '(self, self.fig)\n', (354, 370), False, 'from matplot... |
from datetime import datetime
from enum import Enum
import typing
from opentrons_shared_data.labware.dev_types import LabwareDefinition
from opentrons_shared_data.pipette.dev_types import PipetteName
from typing_extensions import Literal
from robot_server.service.session.models.command_definitions import \
Comman... | [
"pydantic.Field"
] | [((895, 943), 'pydantic.Field', 'Field', (['...'], {'description': '"""Deck slot"""', 'ge': '(1)', 'lt': '(12)'}), "(..., description='Deck slot', ge=1, lt=12)\n", (900, 943), False, 'from pydantic import BaseModel, Field\n'), ((981, 1050), 'pydantic.Field', 'Field', (['...'], {'description': '"""Name used to reference... |
import bpy, os, shutil, stat
def create_folder_if_neeed(path):
if not os.path.exists(path):
os.makedirs(path)
def delete_folder_if_exist(path):
if os.path.exists(path):
shutil.rmtree(path, onerror=file_acces_handler)
def file_acces_handler(func, path, exc_info):
print('Handling Error for file ' , path)
... | [
"os.path.exists",
"os.makedirs",
"os.access",
"os.chmod",
"shutil.rmtree"
] | [((154, 174), 'os.path.exists', 'os.path.exists', (['path'], {}), '(path)\n', (168, 174), False, 'import bpy, os, shutil, stat\n'), ((72, 92), 'os.path.exists', 'os.path.exists', (['path'], {}), '(path)\n', (86, 92), False, 'import bpy, os, shutil, stat\n'), ((97, 114), 'os.makedirs', 'os.makedirs', (['path'], {}), '(p... |
import pulsar as psr
def load_ref_system():
""" Returns acetaldehyde as found in the IQMol fragment library.
All credit to https://github.com/nutjunkie/IQmol
"""
return psr.make_system("""
H 1.8870 -0.2640 0.6645
C 1.2203 -0.2396 -0.2074
H 1.45... | [
"pulsar.make_system"
] | [((189, 553), 'pulsar.make_system', 'psr.make_system', (['"""\n H 1.8870 -0.2640 0.6645\n C 1.2203 -0.2396 -0.2074\n H 1.4534 0.6668 -0.7811\n H 1.4662 -1.1053 -0.8363\n C -0.2092 -0.3158 0.2358\n H -0.5002 ... |
import copy
import random
class Cube:
def __init__(self):
self.cube = []
self.moves = []
for num in range(26):
self.cube.append(num)
def print_cube(self):
print(self.cube)
def turn(self, direction):
if direction < 0:
direction = -1 * directi... | [
"copy.copy",
"random.randint"
] | [((504, 524), 'copy.copy', 'copy.copy', (['self.cube'], {}), '(self.cube)\n', (513, 524), False, 'import copy\n'), ((538, 558), 'copy.copy', 'copy.copy', (['self.cube'], {}), '(self.cube)\n', (547, 558), False, 'import copy\n'), ((1814, 1834), 'random.randint', 'random.randint', (['(1)', '(6)'], {}), '(1, 6)\n', (1828,... |
# Copyright (c) 2015. Mount Sinai School of Medicine
#
# 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 l... | [
"sercol.Collection",
"nose.tools.eq_",
"nose.tools.assert_not_equal"
] | [((799, 820), 'sercol.Collection', 'Collection', (['[1, 2, 3]'], {}), '([1, 2, 3])\n', (809, 820), False, 'from sercol import Collection\n'), ((870, 884), 'sercol.Collection', 'Collection', (['[]'], {}), '([])\n', (880, 884), False, 'from sercol import Collection\n'), ((992, 1012), 'sercol.Collection', 'Collection', ([... |
from enum import Enum
import numpy as np
import scipy.stats as scistats
import matplotlib.pyplot as plt
from tqdm import tqdm
class Noise(Enum):
NORMAL = 1
CAUCHY = 2
def generate(
n_steps=101,
plate_width=10,
plate_height=10,
dx=0.1,
dy=0.1,
thermal_diffusivity=4,
temperature_co... | [
"numpy.clip",
"numpy.random.normal",
"numpy.ones",
"numpy.array",
"numpy.zeros",
"numpy.empty",
"scipy.stats.cauchy.rvs"
] | [((2971, 2988), 'numpy.array', 'np.array', (['latents'], {}), '(latents)\n', (2979, 2988), True, 'import numpy as np\n'), ((2999, 3012), 'numpy.array', 'np.array', (['obs'], {}), '(obs)\n', (3007, 3012), True, 'import numpy as np\n'), ((4373, 4391), 'numpy.empty', 'np.empty', (['(nx, ny)'], {}), '((nx, ny))\n', (4381, ... |
# -*- coding: utf-8 -*-
from typing import TYPE_CHECKING, Optional, Dict, Any, Tuple, List, Iterable, Sequence
import abc
import importlib
import itertools
import os
import yaml
from bag import float_to_si_string
from bag.io import read_yaml, open_file, load_sim_results, save_sim_results, load_sim_file
from bag.lay... | [
"bag.layout.RoutingGrid",
"bag.concurrent.core.batch_async_task",
"bag.io.load_sim_results",
"os.makedirs",
"importlib.import_module",
"yaml.dump",
"bag.io.open_file",
"bag.io.load_sim_file",
"itertools.product",
"os.path.join",
"yaml.load",
"bag.io.read_yaml",
"bag.float_to_si_string",
"o... | [((1495, 1522), 'os.path.abspath', 'os.path.abspath', (['data_fname'], {}), '(data_fname)\n', (1510, 1522), False, 'import os\n'), ((3072, 3098), 'bag.io.load_sim_results', 'load_sim_results', (['save_dir'], {}), '(save_dir)\n', (3088, 3098), False, 'from bag.io import read_yaml, open_file, load_sim_results, save_sim_r... |
#!/usr/bin/env python
import os, sys, argparse, input_file_utils, redis_utils, json
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir))
import utils as themis_utils
def reload_read_request_queues(
job_description_file, job_ids, redis_host, redis_port, redis_db,
skip_phase_zero, skip_phase_on... | [
"argparse.ArgumentParser",
"input_file_utils.generate_read_requests",
"utils.add_redis_params",
"os.path.dirname",
"redis_utils.CoordinatorDB",
"input_file_utils.load_read_requests",
"json.load",
"input_file_utils.gather_input_file_paths"
] | [((459, 518), 'redis_utils.CoordinatorDB', 'redis_utils.CoordinatorDB', (['redis_host', 'redis_port', 'redis_db'], {}), '(redis_host, redis_port, redis_db)\n', (484, 518), False, 'import os, sys, argparse, input_file_utils, redis_utils, json\n'), ((538, 635), 'input_file_utils.gather_input_file_paths', 'input_file_util... |
from tkinter import *
import subprocess
# Colors
# b9e7f0
# 4fadb5
# 71cccc
# 9adde1
# e2f2f7
# ffffff
# dbc7b3
def disableCloseButton():
pass
mainWindowFrame = Tk()
mainWindowFrame.title('Enigma')
mainWindowFrame.geometry('1920x1080')
mainWindowFrame.resizable(0, 0)
# mainWindowFrame.overrideredirect(True)
#... | [
"subprocess.call"
] | [((4486, 4525), 'subprocess.call', 'subprocess.call', (["['python', 'Start.py']"], {}), "(['python', 'Start.py'])\n", (4501, 4525), False, 'import subprocess\n'), ((4128, 4171), 'subprocess.call', 'subprocess.call', (["['python', 'Catalogue.py']"], {}), "(['python', 'Catalogue.py'])\n", (4143, 4171), False, 'import sub... |
from flask import Flask
from elasticsearch import Elasticsearch
import zlib
import datetime
import delorean
import base64
from flask import request, jsonify
from flask_cors import CORS
from models.metrics_pb2 import HistogramGauge, HistogramRender
from constants import ES_INDEX
def now_epoch():
dt = datetime.d... | [
"flask_cors.CORS",
"datetime.datetime.utcnow",
"flask.Flask",
"elasticsearch.Elasticsearch",
"models.metrics_pb2.HistogramGauge",
"base64.b64decode",
"flask.request.get_json",
"models.metrics_pb2.HistogramRender",
"delorean.Delorean",
"flask.jsonify"
] | [((412, 427), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (417, 427), False, 'from flask import Flask\n'), ((428, 437), 'flask_cors.CORS', 'CORS', (['app'], {}), '(app)\n', (432, 437), False, 'from flask_cors import CORS\n'), ((443, 458), 'elasticsearch.Elasticsearch', 'Elasticsearch', ([], {}), '()\n',... |
"""
Author: @matteobe
"""
from typing import Tuple, List
from pathlib import Path
import yaml
from clusty.utils.validation import validate_schema, format_input_to_list
class ConfigsParser:
"""
Class for parsing the YAML configuration file.
The default schema is defined in the configs folder under the ... | [
"clusty.utils.validation.validate_schema",
"yaml.full_load",
"pathlib.Path"
] | [((448, 465), 'yaml.full_load', 'yaml.full_load', (['f'], {}), '(f)\n', (462, 465), False, 'import yaml\n'), ((530, 599), 'clusty.utils.validation.validate_schema', 'validate_schema', ([], {'document': 'configs', 'schema': 'ConfigsParser.config_schema'}), '(document=configs, schema=ConfigsParser.config_schema)\n', (545... |
import unittest
import numpy as np
from iScore.graphrank.graph import iscore_graph
from iScore.graphrank.kernel import Kernel
class TestKernel(unittest.TestCase):
"""Test the kernels."""
def test_kernel(self):
# init and load the data
ker = Kernel(
testIDs="./kernel/testID.lst"... | [
"unittest.main",
"numpy.all",
"iScore.graphrank.kernel.Kernel",
"iScore.graphrank.graph.iscore_graph"
] | [((1030, 1045), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1043, 1045), False, 'import unittest\n'), ((271, 406), 'iScore.graphrank.kernel.Kernel', 'Kernel', ([], {'testIDs': '"""./kernel/testID.lst"""', 'trainIDs': '"""./kernel/trainID.lst"""', 'test_graph': '"""./kernel/graph/"""', 'train_graph': '"""./kern... |
import pandas as pd
import numpy as np
# s = pd.Series([1, 2, 3, np.nan], index=['A', 'B', 'C', 'D'])
# print(s)
# dates = pd.date_range('20191029', periods=5)
# print(dates)
# df = pd.DataFrame(np.random.rand(5, 5), columns=['a', 'b', 'c', 'd', 'e'])
# print(df)
# df1 = pd.DataFrame({
# 'A': 1,
# 'B': pd.date... | [
"pandas.read_html"
] | [((3096, 3118), 'pandas.read_html', 'pd.read_html', (['data_url'], {}), '(data_url)\n', (3108, 3118), True, 'import pandas as pd\n')] |
import pygame
from constants import (
MAILRAYS,
BUTTON_NORMAL,
BUTTON_MOUSE_OVER,
TEXTBOX_NORMAL,
TEXTBOX_MOUSE_OVER,
)
from sheldonchess.game.normal import ChessBoard
from pieces import Piece
class Widget(object):
def handle_event(self, event):
pass
class Button(Widget):
F... | [
"pygame.Surface",
"sheldonchess.game.normal.ChessBoard",
"pygame.image.load",
"pygame.font.Font",
"pieces.Piece"
] | [((326, 356), 'pygame.font.Font', 'pygame.font.Font', (['MAILRAYS', '(20)'], {}), '(MAILRAYS, 20)\n', (342, 356), False, 'import pygame\n'), ((1193, 1223), 'pygame.font.Font', 'pygame.font.Font', (['MAILRAYS', '(20)'], {}), '(MAILRAYS, 20)\n', (1209, 1223), False, 'import pygame\n'), ((799, 831), 'pygame.image.load', '... |
import xlrd
from tkinter.filedialog import askopenfilename
def path():
p=askopenfilename()
return p
def part():
p=path()
workbook=xlrd.open_workbook(p)
worksheet=workbook.sheet_by_index(0)
parts=[]
for i in range(9, 21):
party = worksheet.cell_value(10, i)
parts.append(part... | [
"xlrd.open_workbook",
"tkinter.filedialog.askopenfilename"
] | [((78, 95), 'tkinter.filedialog.askopenfilename', 'askopenfilename', ([], {}), '()\n', (93, 95), False, 'from tkinter.filedialog import askopenfilename\n'), ((148, 169), 'xlrd.open_workbook', 'xlrd.open_workbook', (['p'], {}), '(p)\n', (166, 169), False, 'import xlrd\n'), ((377, 402), 'xlrd.open_workbook', 'xlrd.open_w... |
"""model"""
from core import solution
class Station:
"""
station class
"""
def __init__(self, st_name, is_trans=False):
self._name = st_name
self._trans = is_trans
@property
def name(self):
"""get station's name"""
return self._name
@property
def is_t... | [
"core.solution.shortest_path",
"core.solution.is_nexto",
"core.solution.travel_path_from",
"core.solution.verify_path",
"core.solution.docorate_path"
] | [((4558, 4604), 'core.solution.shortest_path', 'solution.shortest_path', (['start', 'end', 'self.nexto'], {}), '(start, end, self.nexto)\n', (4580, 4604), False, 'from core import solution\n'), ((4685, 4729), 'core.solution.docorate_path', 'solution.docorate_path', (['ans_path', 'self.nexto'], {}), '(ans_path, self.nex... |
from discord.ext import commands
from apscheduler.schedulers.asyncio import AsyncIOScheduler
import asyncio
import datetime
class Break(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.scheduler= AsyncIOScheduler({'apscheduler.timezone': 'Europe/Helsinki'})
self.scheduler.start... | [
"discord.ext.commands.group",
"apscheduler.schedulers.asyncio.AsyncIOScheduler"
] | [((368, 437), 'discord.ext.commands.group', 'commands.group', ([], {'name': '"""break"""', 'help': '"""Handles reminders for break time"""'}), "(name='break', help='Handles reminders for break time')\n", (382, 437), False, 'from discord.ext import commands\n'), ((229, 290), 'apscheduler.schedulers.asyncio.AsyncIOSchedu... |
# Generated by Django 2.0 on 2017-12-02 22:46
import django.contrib.postgres.fields.jsonb
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
import djpaypal.fields
import djpaypal.utils
class Migration(migrations.Migration):
initial = True
dependencies = [... | [
"django.db.models.GenericIPAddressField",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"django.db.models.BooleanField",
"django.db.models.PositiveSmallIntegerField",
"django.db.models.BigAutoField",
"django.db.models.DateTimeField",
"django.db.migr... | [((323, 380), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (354, 380), False, 'from django.db import migrations, models\n'), ((21675, 21857), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'editable': '(Fal... |
from flask import Flask, render_template, request
import jsonify
import requests
import pickle
import numpy as np
import sklearn
from sklearn.preprocessing import StandardScaler
app = Flask(__name__)
model = pickle.load(open('random_forest_regression_model_car_prices.pkl','rb'))
@app.route('/',methods=['GE... | [
"sklearn.preprocessing.StandardScaler",
"flask.render_template",
"numpy.log",
"flask.Flask"
] | [((191, 206), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (196, 206), False, 'from flask import Flask, render_template, request\n'), ((399, 415), 'sklearn.preprocessing.StandardScaler', 'StandardScaler', ([], {}), '()\n', (413, 415), False, 'from sklearn.preprocessing import StandardScaler\n'), ((352, 3... |
from django.contrib import admin
from .models import Notifications
admin.site.register(Notifications)
| [
"django.contrib.admin.site.register"
] | [((68, 102), 'django.contrib.admin.site.register', 'admin.site.register', (['Notifications'], {}), '(Notifications)\n', (87, 102), False, 'from django.contrib import admin\n')] |
from odoo.tests.common import TransactionCase, tagged
from odoo.addons.base.models.res_users import name_selection_groups
@tagged("at_install", "post_install")
class TestFieldsGet(TransactionCase):
def test_base(self):
demo_user = self.env.ref("base.user_demo")
group_erp_manager = self.env.ref("b... | [
"odoo.addons.base.models.res_users.name_selection_groups",
"odoo.tests.common.tagged"
] | [((126, 162), 'odoo.tests.common.tagged', 'tagged', (['"""at_install"""', '"""post_install"""'], {}), "('at_install', 'post_install')\n", (132, 162), False, 'from odoo.tests.common import TransactionCase, tagged\n'), ((877, 922), 'odoo.addons.base.models.res_users.name_selection_groups', 'name_selection_groups', (['[gr... |
import os
import pickle
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
import numpy as np
import colorsys
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
number2name_ml10 = {
0: 'reach-v1',
1: 'push-v1',
2: 'pick-place-v1',
3: 'door-open-v1',
4: 'drawer-close-v1'... | [
"matplotlib.pyplot.grid",
"matplotlib.pyplot.legend",
"numpy.argmax",
"numpy.max",
"numpy.array",
"matplotlib.pyplot.rc",
"numpy.expand_dims",
"matplotlib.pyplot.tight_layout",
"matplotlib.patches.Ellipse",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.s... | [((131, 158), 'matplotlib.pyplot.rc', 'plt.rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (137, 158), True, 'import matplotlib.pyplot as plt\n'), ((159, 189), 'matplotlib.pyplot.rc', 'plt.rc', (['"""font"""'], {'family': '"""serif"""'}), "('font', family='serif')\n", (165, 189), True, 'import m... |
__all__ = ["BoundaryConditions", "BoundaryConditionsConf"]
from collections import namedtuple
import numpy as np
from ef.config.section import register, ConfigSection
from ef.config.component import ConfigComponent
class BoundaryConditions(ConfigComponent):
def __init__(self, potential=0):
self.potenti... | [
"numpy.array",
"collections.namedtuple"
] | [((765, 939), 'collections.namedtuple', 'namedtuple', (['"""BoundaryConditionsTuple"""', "('boundary_phi_right', 'boundary_phi_left', 'boundary_phi_bottom',\n 'boundary_phi_top', 'boundary_phi_near', 'boundary_phi_far')"], {}), "('BoundaryConditionsTuple', ('boundary_phi_right',\n 'boundary_phi_left', 'boundary_p... |
from setuptools import setup, find_packages
from os import path
setup(
name='marspylib',
packages=find_packages(),
version="0.1.1",
description='Library containing python Fiji launcher and python functions to interact with Mars Archives',
author='<NAME>, <NAME>, <NAME>',
url='https://github.com... | [
"setuptools.find_packages"
] | [((107, 122), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (120, 122), False, 'from setuptools import setup, find_packages\n')] |
import argparse
import json
from nbcollection.ci.commands.utils import validate_and_parse_inputs
from nbcollection.ci.constants import ENCODING
from nbcollection.ci.datatypes import Metadata
from nbcollection.ci.scanner.utils import find_build_jobs, generate_job_context
from nbcollection.ci.metadata.utils import reset... | [
"nbcollection.ci.metadata.utils.reset_notebook_execution",
"json.dumps",
"nbcollection.ci.commands.utils.validate_and_parse_inputs",
"nbcollection.ci.scanner.utils.find_build_jobs",
"nbcollection.ci.scanner.utils.generate_job_context",
"nbcollection.ci.metadata.utils.extract_metadata"
] | [((435, 469), 'nbcollection.ci.commands.utils.validate_and_parse_inputs', 'validate_and_parse_inputs', (['options'], {}), '(options)\n', (460, 469), False, 'from nbcollection.ci.commands.utils import validate_and_parse_inputs\n'), ((485, 577), 'nbcollection.ci.scanner.utils.find_build_jobs', 'find_build_jobs', (['optio... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name="docopt-uc",
description="A docopt library suitable for microcontrollers.",
license="MIT",
version="1.0.2",
author="<NAME>",
author_email="<EMAIL>",
maintainer="<NAME>",
maintainer_ema... | [
"setuptools.find_packages"
] | [((398, 424), 'setuptools.find_packages', 'find_packages', ([], {'where': '"""src"""'}), "(where='src')\n", (411, 424), False, 'from setuptools import setup, find_packages\n')] |
# -*- coding: utf-8 -*-
# This file is part of hoa-utils.
#
# hoa-utils 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.
#
# hoa-utils i... | [
"dataclasses.dataclass",
"hoa.ast.boolean_expression.boolean_op_wrapper"
] | [((1062, 1169), 'hoa.ast.boolean_expression.boolean_op_wrapper', 'boolean_op_wrapper', ([], {'and_': "And['LabelExpression']", 'or_': "Or['LabelExpression']", 'not_': "Not['LabelExpression']"}), "(and_=And['LabelExpression'], or_=Or['LabelExpression'],\n not_=Not['LabelExpression'])\n", (1080, 1169), False, 'from ho... |