code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
"""
This tests the Real Time Clock (RTC) component of a PIM Mini, using the I2C protocol.
These test cases require that a PC is attached to the SDA and SCL lines between the MPU and
I2C components in order to use the Aardvark drivers.
If the PC is running Linux, it is assumed that it is running a 64-bit version.
"""
i... | [
"datetime.datetime",
"unittest.TestSuite",
"collections.namedtuple",
"aardvark_py.aai2c_slave.aa_configure",
"unittest.makeSuite",
"aardvark_py.aai2c_slave.aa_target_power",
"time.sleep",
"aardvark_py.aai2c_slave.aa_i2c_write",
"aardvark_py.aai2c_slave.aa_i2c_read",
"aardvark_py.aai2c_slave.aa_ope... | [((954, 1062), 'collections.namedtuple', 'namedtuple', (['"""ClockData"""', "['year', 'month', 'day_of_month', 'day_of_week', 'hours', 'minutes', 'seconds']"], {}), "('ClockData', ['year', 'month', 'day_of_month', 'day_of_week',\n 'hours', 'minutes', 'seconds'])\n", (964, 1062), False, 'from collections import named... |
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------
# Copyright (c) 2021
#
# See the LICENSE file for details
# see the AUTHORS file for authors
# ----------------------------------------------------------------------
#--------------------
# System wide imports
# ----------... | [
"logging.getLogger"
] | [((542, 573), 'logging.getLogger', 'logging.getLogger', (['"""streetoool"""'], {}), "('streetoool')\n", (559, 573), False, 'import logging\n')] |
import pandas as pd
import nltk
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
import os
nltk.download('stopwords')
nltk.download('punkt')
nltk.download('wordnet_ic')
nltk.download('genesis')
nltk.download('averaged_perceptron_tagger')
nltk.download('wordnet')
from src.Preprocess import Uti... | [
"os.path.exists",
"os.makedirs",
"nltk.download",
"src.Preprocess.Utils.readDataset",
"os.path.join",
"pandas.set_option",
"numpy.random.seed"
] | [((116, 142), 'nltk.download', 'nltk.download', (['"""stopwords"""'], {}), "('stopwords')\n", (129, 142), False, 'import nltk\n'), ((143, 165), 'nltk.download', 'nltk.download', (['"""punkt"""'], {}), "('punkt')\n", (156, 165), False, 'import nltk\n'), ((166, 193), 'nltk.download', 'nltk.download', (['"""wordnet_ic"""'... |
import hmac
import hashlib
from typing import Optional
import json
from hdwallet import BIP44HDWallet
from hdwallet.cryptocurrencies import EthereumMainnet
from hdwallet.derivations import BIP44Derivation
from hdwallet.utils import generate_mnemonic
from decouple import config
def generate_address(account_index) -> ... | [
"hmac.new",
"hdwallet.derivations.BIP44Derivation",
"json.dumps",
"decouple.config",
"hdwallet.BIP44HDWallet"
] | [((341, 359), 'decouple.config', 'config', (['"""MNEMONIC"""'], {}), "('MNEMONIC')\n", (347, 359), False, 'from decouple import config\n'), ((445, 490), 'hdwallet.BIP44HDWallet', 'BIP44HDWallet', ([], {'cryptocurrency': 'EthereumMainnet'}), '(cryptocurrency=EthereumMainnet)\n', (458, 490), False, 'from hdwallet import ... |
import numpy as np
from prml.nn.function import Function
class Product(Function):
def __init__(self, axis=None, keepdims=False):
if isinstance(axis, int):
axis = (axis,)
elif isinstance(axis, tuple):
axis = tuple(sorted(axis))
self.axis = axis
self.keepdims... | [
"numpy.prod",
"numpy.expand_dims",
"numpy.squeeze"
] | [((382, 423), 'numpy.prod', 'np.prod', (['x'], {'axis': 'self.axis', 'keepdims': '(True)'}), '(x, axis=self.axis, keepdims=True)\n', (389, 423), True, 'import numpy as np\n'), ((473, 496), 'numpy.squeeze', 'np.squeeze', (['self.output'], {}), '(self.output)\n', (483, 496), True, 'import numpy as np\n'), ((690, 715), 'n... |
import factory
import pytest
from django.conf import settings
from django.db.utils import IntegrityError
from datahub.company.models import OneListTier
from datahub.company.test.factories import (
AdviserFactory,
CompanyExportCountryFactory,
CompanyExportCountryHistoryFactory,
CompanyFactory,
Conta... | [
"datahub.company.test.factories.CompanyExportCountryFactory",
"datahub.company.test.factories.CompanyFactory",
"datahub.company.test.factories.AdviserFactory",
"factory.Iterator",
"datahub.company.test.factories.CompanyFactory.build",
"datahub.company.models.OneListTier.objects.first",
"datahub.company.... | [((3939, 4087), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""with_global_account_manager"""', '(True, False)'], {'ids': '(lambda val: f"{\'With\' if val else \'Without\'} global account manager")'}), '(\'with_global_account_manager\', (True, False), ids=\n lambda val: f"{\'With\' if val else \'Without... |
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from typing import cast
from pants.core.util_rules.external_tool import (
DownloadedExternalTool,
ExternalTool,
ExternalToolRequest,
)
from pants.engine.console import Console... | [
"typing.cast",
"pants.engine.rules.Get",
"pants.engine.fs.MergeDigests",
"pants.engine.rules.collect_rules"
] | [((4318, 4333), 'pants.engine.rules.collect_rules', 'collect_rules', ([], {}), '()\n', (4331, 4333), False, 'from pants.engine.rules import Get, collect_rules, goal_rule\n'), ((1898, 1930), 'typing.cast', 'cast', (['bool', 'self.options.ignored'], {}), '(bool, self.options.ignored)\n', (1902, 1930), False, 'from typing... |
"""
Check that we have a valid class to work upon in our live tile notifications
"""
from django.core.exceptions import ImproperlyConfigured
from mezzanine.utils.importing import import_dotted_path
from mezzanine.conf import settings
model_class_path, fields = settings.WINDOWS_TILE_MODEL
try:
import_dotted_path(mode... | [
"django.core.exceptions.ImproperlyConfigured",
"mezzanine.utils.importing.import_dotted_path"
] | [((297, 333), 'mezzanine.utils.importing.import_dotted_path', 'import_dotted_path', (['model_class_path'], {}), '(model_class_path)\n', (315, 333), False, 'from mezzanine.utils.importing import import_dotted_path\n'), ((361, 488), 'django.core.exceptions.ImproperlyConfigured', 'ImproperlyConfigured', (["('The WINDOWS_T... |
import time
from datetime import datetime, timedelta
from flask import g, render_template, request, session, redirect, url_for, jsonify, current_app, abort
from blog import constants, db
from blog.models import User, Category, Blogs
from blog.utils.commons import login_required
# from blog.utils.image_storage import ... | [
"flask.render_template",
"flask.request.args.get",
"blog.models.Blogs.title.contains",
"datetime.timedelta",
"flask.jsonify",
"blog.models.Category",
"blog.models.Category.query.get",
"flask.request.form.get",
"flask.request.json.get",
"flask.abort",
"time.localtime",
"flask.current_app.logger... | [((1177, 1205), 'flask.request.form.get', 'request.form.get', (['"""username"""'], {}), "('username')\n", (1193, 1205), False, 'from flask import g, render_template, request, session, redirect, url_for, jsonify, current_app, abort\n'), ((1221, 1249), 'flask.request.form.get', 'request.form.get', (['"""password"""'], {}... |
import os
import stripe
from flask import Flask, jsonify, render_template, request
app = Flask(__name__)
stripe_keys = {
"secret_key": os.environ["STRIPE_SECRET_KEY"],
"publishable_key": os.environ["STRIPE_PUBLISHABLE_KEY"],
"price_id": os.environ["STRIPE_PRICE_ID"],
"endpoint_secret": os.environ["ST... | [
"flask.render_template",
"flask.Flask",
"stripe.Webhook.construct_event",
"flask.request.get_data",
"stripe.checkout.Session.create",
"flask.request.headers.get",
"flask.jsonify"
] | [((91, 106), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (96, 106), False, 'from flask import Flask, jsonify, render_template, request\n'), ((443, 467), 'flask.jsonify', 'jsonify', (['"""hello, world!"""'], {}), "('hello, world!')\n", (450, 467), False, 'from flask import Flask, jsonify, render_template... |
import utils
import model
import pandas as pd
dictionary = pd.read_csv(
'/.../dictionary.csv'
)
item_occurrences = utils.stream_csv(
'/.../item_co_occurrences.csv'
)
sim_model = model.SimilarityModel(
dictionary,
item_occurrences,
1_234_567 # num of occurrences must be previously known
)
sim_mo... | [
"utils.stream_csv",
"model.SimilarityModel",
"pandas.read_csv"
] | [((61, 95), 'pandas.read_csv', 'pd.read_csv', (['"""/.../dictionary.csv"""'], {}), "('/.../dictionary.csv')\n", (72, 95), True, 'import pandas as pd\n'), ((121, 169), 'utils.stream_csv', 'utils.stream_csv', (['"""/.../item_co_occurrences.csv"""'], {}), "('/.../item_co_occurrences.csv')\n", (137, 169), False, 'import ut... |
import requests
import urllib3
adddress = "http://businesscorp.com.br"
def webrequest( ):
site = requests.get(adddress)
site.content
print (site.content)
print ("Status code:", site.status_code)
print ("Headers:", site.headers)
print ("Server:", site.headers['Server'])
site = requests.o... | [
"urllib3.PoolManager",
"requests.get",
"requests.options"
] | [((105, 127), 'requests.get', 'requests.get', (['adddress'], {}), '(adddress)\n', (117, 127), False, 'import requests\n'), ((310, 356), 'requests.options', 'requests.options', (['"""http://businesscorp.com.br"""'], {}), "('http://businesscorp.com.br')\n", (326, 356), False, 'import requests\n'), ((506, 527), 'urllib3.P... |
# -*- mode: python; encoding: utf-8 -*-
#
# Copyright 2017 the Critic contributors, Opera Software ASA
#
# 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/LI... | [
"api.impl.comment.makeFileVersionLocation",
"api.impl.comment.fetch",
"api.impl.comment.makeCommitMessageLocation",
"api.impl.comment.fetchMany",
"api.impl.comment.fetchAll"
] | [((13046, 13088), 'api.impl.comment.fetch', 'api.impl.comment.fetch', (['critic', 'comment_id'], {}), '(critic, comment_id)\n', (13068, 13088), False, 'import api\n'), ((13376, 13423), 'api.impl.comment.fetchMany', 'api.impl.comment.fetchMany', (['critic', 'comment_ids'], {}), '(critic, comment_ids)\n', (13402, 13423),... |
from importlib.metadata import entry_points
from setuptools import find_packages, setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="flitton_fib_py",
version=("0.0.1"),
author=("KKK"),
author_email=("<EMAIL>"),
description="Calculates a Fibonacci number",
lo... | [
"setuptools.find_packages"
] | [((407, 440), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "('tests',)"}), "(exclude=('tests',))\n", (420, 440), False, 'from setuptools import find_packages, setup\n')] |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name = 'cardiopy',
version = "1.0.0",
author = "<NAME>",
author_email = "<EMAIL>",
description = "Analysis package for single-lead clinical EKG data",
long_description = long_description,
long_description_conte... | [
"setuptools.find_packages"
] | [((404, 430), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (428, 430), False, 'import setuptools\n')] |
import flow
import tensorflow as tf
import gin
import numpy as np
import numpy.testing as npt
def test_f():
mol = gin.i_o.from_smiles.to_mol('CC')
mol = gin.deterministic.hydrogen.add_hydrogen(mol)
atoms, adjacency_map = mol
chinese_postman_routes = tf.constant(
[
[0, 1, 4, 1, 5, ... | [
"tensorflow.random.normal",
"gin.i_o.from_smiles.to_mol",
"gin.deterministic.hydrogen.add_hydrogen",
"flow.GraphFlow",
"tensorflow.constant"
] | [((120, 152), 'gin.i_o.from_smiles.to_mol', 'gin.i_o.from_smiles.to_mol', (['"""CC"""'], {}), "('CC')\n", (146, 152), False, 'import gin\n'), ((163, 207), 'gin.deterministic.hydrogen.add_hydrogen', 'gin.deterministic.hydrogen.add_hydrogen', (['mol'], {}), '(mol)\n', (202, 207), False, 'import gin\n'), ((269, 1742), 'te... |
import factory
from factory import fuzzy
from .. import models
class RegionFactory(factory.django.DjangoModelFactory):
class Meta:
model = models.Region
name = fuzzy.FuzzyChoice(models.RegionName)
| [
"factory.fuzzy.FuzzyChoice"
] | [((180, 216), 'factory.fuzzy.FuzzyChoice', 'fuzzy.FuzzyChoice', (['models.RegionName'], {}), '(models.RegionName)\n', (197, 216), False, 'from factory import fuzzy\n')] |
INPUTPATH = "input.txt"
#INPUTPATH = "input-test.txt"
with open(INPUTPATH) as ifile:
raw = ifile.read()
program = tuple(map(int, raw.strip().split(",")))
from enum import Enum
class Mde(Enum):
POS = 0
IMM = 1
REL = 2
from itertools import chain, repeat, islice
from collections import defaultdict
from typing import... | [
"itertools.islice",
"collections.defaultdict",
"itertools.repeat"
] | [((2725, 2741), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (2736, 2741), False, 'from collections import defaultdict\n'), ((1073, 1082), 'itertools.repeat', 'repeat', (['(0)'], {}), '(0)\n', (1079, 1082), False, 'from itertools import chain, repeat, islice\n'), ((1134, 1175), 'itertools.islice'... |
""" This example sends a simple query to the ARAX API.
A one-line curl equivalent is:
curl -X POST "https://arax.ncats.io/devED/api/arax/v1.0/query?bypass_cache=false" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"asynchronous\":\"stream\",\"message\":{\"query_graph\":{\"edges\":{\"e00\":{... | [
"requests.post",
"re.search"
] | [((2026, 2105), 'requests.post', 'requests.post', (['endpoint_url'], {'json': 'query', 'headers': "{'accept': 'application/json'}"}), "(endpoint_url, json=query, headers={'accept': 'application/json'})\n", (2039, 2105), False, 'import requests\n'), ((3016, 3057), 're.search', 're.search', (['"""(\\\\d+)$"""', "response... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from lxml import html
class JREast:
URL = 'http://traininfo.jreast.co.jp/train_info/{}.aspx'
lines = {
'kanto': ('東海道線', '京浜東北線', '横須賀線', '南武線', '横浜線',
'伊東線', '相模線', '鶴見線',
'宇都宮線', '高崎線', '京浜東北線', '埼京線', '川越線',
... | [
"lxml.html.parse"
] | [((2200, 2215), 'lxml.html.parse', 'html.parse', (['url'], {}), '(url)\n', (2210, 2215), False, 'from lxml import html\n')] |
import datetime
from django.db import models
from django.utils import timezone
class Question( models.Model):
question_text = models.CharField( max_length=200 )
pub_date = models.DateTimeField( 'date published' )
def __str__( self ):
return self.question_text
def was_published_recently( self ):
retu... | [
"django.db.models.IntegerField",
"django.db.models.ForeignKey",
"django.utils.timezone.now",
"django.db.models.DateTimeField",
"datetime.timedelta",
"django.db.models.CharField"
] | [((130, 162), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)'}), '(max_length=200)\n', (146, 162), False, 'from django.db import models\n'), ((178, 216), 'django.db.models.DateTimeField', 'models.DateTimeField', (['"""date published"""'], {}), "('date published')\n", (198, 216), False, 'fr... |
# Generated by Django 3.2.7 on 2021-10-30 10:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('market', '0004_auto_20211029_1856'),
]
operations = [
migrations.AddField(
model_name='fiat_details',
name='account_... | [
"django.db.models.CharField"
] | [((345, 392), 'django.db.models.CharField', 'models.CharField', ([], {'default': '"""None"""', 'max_length': '(50)'}), "(default='None', max_length=50)\n", (361, 392), False, 'from django.db import migrations, models\n')] |
from skfem import *
from skfem.helpers import dot, grad
# # enable additional mesh validity checks, sacrificing performance
# import logging
# logging.basicConfig(format='%(levelname)s %(asctime)s %(name)s %(message)s')
# logging.getLogger('skfem').setLevel(logging.DEBUG)
# create the mesh
m = MeshTri().refined(4)
# ... | [
"skfem.helpers.grad",
"os.path.splitext",
"skfem.visuals.matplotlib.plot"
] | [((1101, 1145), 'skfem.visuals.matplotlib.plot', 'plot', (['m', 'x'], {'shading': '"""gouraud"""', 'colorbar': '(True)'}), "(m, x, shading='gouraud', colorbar=True)\n", (1105, 1145), False, 'from skfem.visuals.matplotlib import plot, savefig\n'), ((540, 547), 'skfem.helpers.grad', 'grad', (['u'], {}), '(u)\n', (544, 54... |
import xrootdpyfs
import pdb
from subprocess import call, PIPE
import os
from fs.opener import opener
def connect_test():
"""Do some test connecting awww yeahhhh"""
kdestroy()
# `klist` is empty (returns 0 when not empty)
with open(os.devnull, 'wb') as discard:
call(['klist'], stdout=discard... | [
"fs.opener.opener.parse",
"subprocess.call"
] | [((621, 659), 'fs.opener.opener.parse', 'opener.parse', (['(remote_root + remote_dir)'], {}), '(remote_root + remote_dir)\n', (633, 659), False, 'from fs.opener import opener\n'), ((290, 337), 'subprocess.call', 'call', (["['klist']"], {'stdout': 'discard', 'stderr': 'discard'}), "(['klist'], stdout=discard, stderr=dis... |
#!/usr/bin/python3
'''
Simple q-learning algorithm implementation
MIT License
Copyright (c) 2019 <NAME> (<EMAIL>)
See LICENSE file
'''
import random
import logging
import pickle
dataset = {}
history = []
model_filename = 'data/.deepq.pickle'
logger = logging.getLogger(__name__)
try:
dataset = pickle.load( ... | [
"logging.getLogger",
"random.choice",
"logging.StreamHandler"
] | [((259, 286), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (276, 286), False, 'import logging\n'), ((2506, 2528), 'random.choice', 'random.choice', (['actions'], {}), '(actions)\n', (2519, 2528), False, 'import random\n'), ((2703, 2722), 'logging.getLogger', 'logging.getLogger', ([], {}... |
import tensorflow as tf
import tfcoreml
from coremltools.proto import FeatureTypes_pb2 as _FeatureTypes_pb2
import coremltools
"""FIND GRAPH INFO"""
tf_model_path = "./graph.pb"
with open(tf_model_path, "rb") as f:
serialized = f.read()
tf.reset_default_graph()
original_gdef = tf.GraphDef()
original_gdef.ParseFrom... | [
"tensorflow.import_graph_def",
"tensorflow.Graph",
"tensorflow.reset_default_graph",
"tensorflow.GraphDef"
] | [((242, 266), 'tensorflow.reset_default_graph', 'tf.reset_default_graph', ([], {}), '()\n', (264, 266), True, 'import tensorflow as tf\n'), ((283, 296), 'tensorflow.GraphDef', 'tf.GraphDef', ([], {}), '()\n', (294, 296), True, 'import tensorflow as tf\n'), ((379, 422), 'tensorflow.import_graph_def', 'tf.import_graph_de... |
from django.db import models
# from django import forms
from django.contrib.auth.models import User, Group
from rest_framework import serializers
from .models import Call, Album
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('url', 'username', 'pa... | [
"rest_framework.serializers.StringRelatedField"
] | [((1127, 1168), 'rest_framework.serializers.StringRelatedField', 'serializers.StringRelatedField', ([], {'many': '(True)'}), '(many=True)\n', (1157, 1168), False, 'from rest_framework import serializers\n')] |
from rest_framework import viewsets
from .serializers import TeamSerializer
from .models import Team
from django.core.exceptions import PermissionDenied
class TeamViewSet(viewsets.ModelViewSet):
serializer_class = TeamSerializer
queryset = Team.objects.all()
def get_queryset(self):
teams = self.... | [
"django.core.exceptions.PermissionDenied"
] | [((776, 814), 'django.core.exceptions.PermissionDenied', 'PermissionDenied', (['"""Wrong object owner"""'], {}), "('Wrong object owner')\n", (792, 814), False, 'from django.core.exceptions import PermissionDenied\n')] |
def main():
from matplotlib import rc
rc('backend', qt4="PySide")
import automator, sys
try:
mainGui = automator.Automator()
except SystemExit:
del mainGui
sys.exit()
exit
# Instantiate a class
if __name__ == '__main__': # Windows multiprocessing safety... | [
"sys.exit",
"matplotlib.rc",
"automator.Automator"
] | [((47, 74), 'matplotlib.rc', 'rc', (['"""backend"""'], {'qt4': '"""PySide"""'}), "('backend', qt4='PySide')\n", (49, 74), False, 'from matplotlib import rc\n'), ((133, 154), 'automator.Automator', 'automator.Automator', ([], {}), '()\n', (152, 154), False, 'import automator, sys\n'), ((206, 216), 'sys.exit', 'sys.exit'... |
from collections import OrderedDict
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.utils.data import DataLoader
torch.set_printoptions(linewidth=120)
torch.set_grad_enabled(True)
import torchvision
from torchvision.transforms import transf... | [
"torch.nn.ConvTranspose2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Tanh",
"torch.set_printoptions",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.set_grad_enabled",
"sys.path.append"
] | [((192, 229), 'torch.set_printoptions', 'torch.set_printoptions', ([], {'linewidth': '(120)'}), '(linewidth=120)\n', (214, 229), False, 'import torch\n'), ((230, 258), 'torch.set_grad_enabled', 'torch.set_grad_enabled', (['(True)'], {}), '(True)\n', (252, 258), False, 'import torch\n'), ((337, 358), 'sys.path.append', ... |
import operator
def pozicijaSprite(broj, x_velicina):
#vraca pixel na kojem se sprite nalazi
pixel = broj * (x_velicina + 1) #1 je prazan red izmedu spritova
return(pixel)
#spriteSlova = ["A", "B", "C", "D", "E", "F", "G", "H", "i", "s", "e"]
spriteSlova = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "s", ",",... | [
"subprocess.check_output"
] | [((6499, 6563), 'subprocess.check_output', 'subprocess.check_output', (["['git', 'rev-parse', '--short', 'HEAD']"], {}), "(['git', 'rev-parse', '--short', 'HEAD'])\n", (6522, 6563), False, 'import subprocess\n')] |
# -*- coding: utf-8 -*-
from pyspark.mllib.clustering import KMeans, KMeansModel
from numpy import array
from math import sqrt
from pyspark import SparkContext, SparkConf
conf = SparkConf()
conf.setAppName("deep test")#.setMaster("spark://192.168.1.14:7077")#.setExecutorEnv("CLASSPATH", path)
#conf.set("spark.schedule... | [
"pyspark.mllib.clustering.KMeansModel.load",
"pyspark.SparkContext",
"pyspark.SparkConf",
"pyspark.mllib.clustering.KMeans.train"
] | [((179, 190), 'pyspark.SparkConf', 'SparkConf', ([], {}), '()\n', (188, 190), False, 'from pyspark import SparkContext, SparkConf\n'), ((415, 438), 'pyspark.SparkContext', 'SparkContext', ([], {'conf': 'conf'}), '(conf=conf)\n', (427, 438), False, 'from pyspark import SparkContext, SparkConf\n'), ((632, 720), 'pyspark.... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-09-02 04:17
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Questio... | [
"django.db.models.DateTimeField",
"django.db.models.AutoField",
"django.db.models.TextField",
"django.db.models.CharField"
] | [((369, 462), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (385, 462), False, 'from django.db import migrations, models\... |
import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
import os
import seaborn as sns
from mantis import sdp_km_burer_monteiro
from data import toy
from experiments.utils import plot_matrix, plot_data_clustered
dir_name = '../results/'
if not os.path.exists(dir_name):
os.mkdir(dir_name)
dir_name +... | [
"os.path.exists",
"matplotlib.pyplot.show",
"data.toy.moons",
"experiments.utils.plot_matrix",
"seaborn.set_style",
"matplotlib.pyplot.figure",
"matplotlib.gridspec.GridSpec",
"os.mkdir",
"matplotlib.pyplot.tight_layout",
"experiments.utils.plot_data_clustered",
"data.toy.double_swiss_roll",
"... | [((261, 285), 'os.path.exists', 'os.path.exists', (['dir_name'], {}), '(dir_name)\n', (275, 285), False, 'import os\n'), ((291, 309), 'os.mkdir', 'os.mkdir', (['dir_name'], {}), '(dir_name)\n', (299, 309), False, 'import os\n'), ((343, 367), 'os.path.exists', 'os.path.exists', (['dir_name'], {}), '(dir_name)\n', (357, ... |
import numpy as np
from scipy import sparse
from sklearn.model_selection import train_test_split
rows = [0,1,2,8]
cols = [1,0,4,8]
vals = [1,2,1,4]
A = sparse.coo_matrix((vals, (rows, cols)))
print(A.todense())
B = A.tocsr()
C = sparse.csr_matrix(np.array([0,1,0,0,2,0,0,0,1]).reshape(1,9))
print(B.shape,C.shape)... | [
"sklearn.model_selection.train_test_split",
"scipy.sparse.load_npz",
"numpy.array",
"numpy.random.randint",
"scipy.sparse.coo_matrix",
"scipy.sparse.save_npz",
"scipy.sparse.vstack"
] | [((156, 195), 'scipy.sparse.coo_matrix', 'sparse.coo_matrix', (['(vals, (rows, cols))'], {}), '((vals, (rows, cols)))\n', (173, 195), False, 'from scipy import sparse\n'), ((325, 346), 'scipy.sparse.vstack', 'sparse.vstack', (['[B, C]'], {}), '([B, C])\n', (338, 346), False, 'from scipy import sparse\n'), ((417, 446), ... |
# Copyright (c) 2022 PaddlePaddle 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
#
# Unless required by appli... | [
"os.path.exists",
"argparse.ArgumentParser",
"predict.LongDocClassifier",
"shutil.rmtree",
"paddlenlp.utils.log.logger.info",
"paddle.set_device"
] | [((768, 793), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (791, 793), False, 'import argparse\n'), ((1972, 2002), 'paddle.set_device', 'paddle.set_device', (['args.device'], {}), '(args.device)\n', (1989, 2002), False, 'import paddle\n'), ((2011, 2050), 'os.path.exists', 'os.path.exists', ([... |
import numpy as np
import matplotlib.pyplot as plt
# mass, spring constant, initial position and velocity
m = 1
k = 1
x = 0
v = 1
# Creating first two data using Euler's method
t_max = 0.2
dt = 0.1
t_array = np.arange(0, t_max, dt)
x_list = []
v_list = []
for t in t_array:
x_list.append(x)
v_list.append(v)
... | [
"matplotlib.pyplot.grid",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.plot",
"numpy.array",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((210, 233), 'numpy.arange', 'np.arange', (['(0)', 't_max', 'dt'], {}), '(0, t_max, dt)\n', (219, 233), True, 'import numpy as np\n'), ((426, 451), 'numpy.arange', 'np.arange', (['(0.2)', 't_max', 'dt'], {}), '(0.2, t_max, dt)\n', (435, 451), True, 'import numpy as np\n'), ((905, 921), 'numpy.array', 'np.array', (['x_... |
#!/usr/bin/env python3
import sys
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import datetime as dt
import numpy as np
import argparse
global pred_map,sat_map,inst_map
pred_map = { 1 : '1 (constant) ',
2 : '1000-300hPa thickness',
3 : '200-50hPa thickness... | [
"matplotlib.pyplot.savefig",
"numpy.add",
"argparse.ArgumentParser",
"matplotlib.dates.WeekdayLocator",
"datetime.datetime.strptime",
"matplotlib.dates.DateFormatter",
"matplotlib.pyplot.tight_layout",
"sys.exit",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
... | [((3935, 3968), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(8.27, 3.6)'}), '(figsize=(8.27, 3.6))\n', (3947, 3968), True, 'import matplotlib.pyplot as plt\n'), ((4067, 4090), 'matplotlib.pyplot.title', 'plt.title', (['title_string'], {}), '(title_string)\n', (4076, 4090), True, 'import matplotlib.p... |
# -*- coding: utf-8 -*-
import json
import urllib.parse
import tornado.gen
from app.const import *
from app.base.configs import tp_cfg
from app.base.session import tp_session
from app.base.core_server import core_service_async_post_http
from app.model import record
from app.base.stats import tp_stats
from app.base.lo... | [
"app.model.record.session_begin",
"json.loads",
"app.base.stats.tp_stats",
"app.base.configs.tp_cfg",
"app.base.session.tp_session",
"app.model.record.session_update",
"app.base.core_server.core_service_async_post_http",
"app.model.record.session_fix",
"app.model.record.session_end"
] | [((3018, 3200), 'app.model.record.session_begin', 'record.session_begin', (['_sid', '_user_id', '_host_id', '_account_id', '_user_name', '_acc_name', '_host_ip', '_conn_ip', '_conn_port', '_client_ip', '_auth_type', '_protocol_type', '_protocol_sub_type'], {}), '(_sid, _user_id, _host_id, _account_id, _user_name,\n ... |
"""
Copy the contents of a local directory into the correct S3 location,
using the correct metadata as supplied by the metadata file (or
internal defaults).
"""
####
#### Copy the contents of a local directory into the correct S3
#### location, using the correct metadata as supplied by the metadata
#### file (or intern... | [
"logging.basicConfig",
"logging.getLogger",
"argparse.ArgumentParser",
"os.path.join",
"os.path.splitext",
"boto3.resource",
"boto3.set_stream_logger",
"sys.exit",
"urllib.parse.urlencode",
"os.walk"
] | [((1816, 1855), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (1835, 1855), False, 'import logging\n'), ((1862, 1892), 'logging.getLogger', 'logging.getLogger', (['"""aggregate"""'], {}), "('aggregate')\n", (1879, 1892), False, 'import logging\n'), ((2057, 2068... |
#!/usr/bin/env python
__author__ = '<NAME>'
import turtle
from datetime import datetime
import requests
import json
# Cleans up the json so that it is readable
def jprint(obj):
text = json.dumps(obj, sort_keys=True, indent=4)
print(text)
# gets the number and name of each astronaught
def get_astronauts_in... | [
"json.dumps",
"requests.get",
"turtle.mainloop",
"turtle.Screen",
"turtle.Turtle"
] | [((192, 233), 'json.dumps', 'json.dumps', (['obj'], {'sort_keys': '(True)', 'indent': '(4)'}), '(obj, sort_keys=True, indent=4)\n', (202, 233), False, 'import json\n'), ((364, 398), 'requests.get', 'requests.get', (["(URL + '/astros.json')"], {}), "(URL + '/astros.json')\n", (376, 398), False, 'import requests\n'), ((7... |
#!/usr/bin/env python3
import unittest
import os
import sys
import requests
import utils_test
from multiprocessing import Process
import time
sys.path.append(os.path.abspath('engram'))
import engram
class TestRedirect(utils_test.EngramTestCase):
def test_index(self):
"""
Story: Bookmark pages loads.... | [
"unittest.main",
"os.path.abspath",
"requests.get"
] | [((840, 855), 'unittest.main', 'unittest.main', ([], {}), '()\n', (853, 855), False, 'import unittest\n'), ((164, 189), 'os.path.abspath', 'os.path.abspath', (['"""engram"""'], {}), "('engram')\n", (179, 189), False, 'import os\n'), ((648, 698), 'requests.get', 'requests.get', (['"""http://localhost:5000/"""'], {'timeo... |
from thunder.utils.common import checkParams
from thunder.extraction.source import SourceModel
class SourceExtraction(object):
"""
Factory for constructing source extraction methods.
Returns a source extraction method given a string identifier.
Options include: 'nmf', 'localmax', 'sima'
"""
d... | [
"thunder.extraction.source.SourceModel.load",
"thunder.extraction.source.SourceModel.deserialize"
] | [((860, 882), 'thunder.extraction.source.SourceModel.load', 'SourceModel.load', (['file'], {}), '(file)\n', (876, 882), False, 'from thunder.extraction.source import SourceModel\n'), ((944, 973), 'thunder.extraction.source.SourceModel.deserialize', 'SourceModel.deserialize', (['file'], {}), '(file)\n', (967, 973), Fals... |
from nonebot import on_command
from nonebot.typing import T_State
from nonebot.adapters.cqhttp import Bot, MessageEvent, MessageSegment, unescape
from .data_source import t2p, m2p
__des__ = '文本、Markdown转图片'
__cmd__ = '''
text2pic/t2p {text}
md2pic/m2p {text}
'''.strip()
__short_cmd__ = 't2p、m2p'
__example__ = '''
t2p... | [
"nonebot.on_command",
"nonebot.adapters.cqhttp.MessageSegment.image"
] | [((443, 495), 'nonebot.on_command', 'on_command', (['"""text2pic"""'], {'aliases': "{'t2p'}", 'priority': '(12)'}), "('text2pic', aliases={'t2p'}, priority=12)\n", (453, 495), False, 'from nonebot import on_command\n'), ((505, 567), 'nonebot.on_command', 'on_command', (['"""md2pic"""'], {'aliases': "{'markdown', 'm2p'}... |
import pytest
from helpers import create_request
import acurl
def test_to_curl():
r = create_request("GET", "http://foo.com")
assert r.to_curl() == "curl -X GET http://foo.com"
def test_to_curl_headers():
r = create_request(
"GET", "http://foo.com", headers=("Foo: bar", "My-Header: is-aweso... | [
"pytest.mark.skip",
"acurl._Cookie",
"helpers.create_request"
] | [((1104, 1144), 'pytest.mark.skip', 'pytest.mark.skip', ([], {'reason': '"""unimplemented"""'}), "(reason='unimplemented')\n", (1120, 1144), False, 'import pytest\n'), ((93, 132), 'helpers.create_request', 'create_request', (['"""GET"""', '"""http://foo.com"""'], {}), "('GET', 'http://foo.com')\n", (107, 132), False, '... |
import torch
import torch.nn as nn
class Conv4(nn.Module):
def __init__(self, in_ch, imgsz, num_classes=10):
super(Conv4, self).__init__()
self.conv1 = nn.Conv2d(in_ch, 64, kernel_size=(3, 3), stride=1, padding=1)
self.conv2 = nn.Conv2d(64, 64, kernel_size=(3, 3), stride=1, padding=1)
self.conv3 = nn... | [
"torch.nn.ReLU",
"torch.nn.MaxPool2d",
"torch.nn.Linear",
"torch.nn.Conv2d"
] | [((163, 224), 'torch.nn.Conv2d', 'nn.Conv2d', (['in_ch', '(64)'], {'kernel_size': '(3, 3)', 'stride': '(1)', 'padding': '(1)'}), '(in_ch, 64, kernel_size=(3, 3), stride=1, padding=1)\n', (172, 224), True, 'import torch.nn as nn\n'), ((242, 300), 'torch.nn.Conv2d', 'nn.Conv2d', (['(64)', '(64)'], {'kernel_size': '(3, 3)... |
'''
This code is used for testing MoDL on JPEG-compressed data, for the results shown in figures 6, 7 and 8c in the paper.
Before running this script you should update the following:
basic_data_folder - it should be the same as the output folder defined in the script /crime_2_jpeg/data_prep/jpeg_data_prep.py
(c... | [
"logging.getLogger",
"utils.datasets.create_data_loaders",
"MoDL_single.UnrolledModel",
"numpy.array",
"torch.cuda.is_available",
"matplotlib.pyplot.imshow",
"os.path.exists",
"numpy.savez",
"numpy.asarray",
"matplotlib.pyplot.axis",
"numpy.abs",
"matplotlib.pyplot.show",
"logging.basicConfi... | [((652, 691), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (671, 691), False, 'import logging\n'), ((702, 729), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (719, 729), False, 'import logging\n'), ((1324, 1352), 'numpy.array', ... |
"""Common entities."""
from __future__ import annotations
from abc import ABC
import logging
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from homeassistant.util import slugify
from .const import DOMAIN as MULTIMATIC
from .coordinator import MultimaticCoordinator
_LOGGER = logging.getLogge... | [
"logging.getLogger",
"homeassistant.util.slugify"
] | [((304, 331), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (321, 331), False, 'import logging\n'), ((645, 741), 'homeassistant.util.slugify', 'slugify', (["(device_id + (f'_{coordinator.api.serial}' if coordinator.api.fixed_serial else\n ''))"], {}), "(device_id + (f'_{coordinator.ap... |
"""
# Problem: flip_bit_mutation.py
# Description:
# Created by ngocjr7 on [2020-03-31 16:49:14]
"""
from __future__ import absolute_import
from geneticpython.models.binary_individual import BinaryIndividual
from .mutation import Mutation
from geneticpython.utils.validation import check_random_state
from ... | [
"geneticpython.utils.validation.check_random_state"
] | [((780, 812), 'geneticpython.utils.validation.check_random_state', 'check_random_state', (['random_state'], {}), '(random_state)\n', (798, 812), False, 'from geneticpython.utils.validation import check_random_state\n')] |
from __future__ import unicode_literals
from django.conf import settings
from django.contrib.auth import logout
def cradmin_logoutview(request, template_name='cradmin_authenticate/logout.django.html'):
next_page = None
if 'next' in request.GET:
next_page = request.GET['next']
return logout(
... | [
"django.contrib.auth.logout"
] | [((306, 424), 'django.contrib.auth.logout', 'logout', (['request'], {'template_name': 'template_name', 'next_page': 'next_page', 'extra_context': "{'LOGIN_URL': settings.LOGIN_URL}"}), "(request, template_name=template_name, next_page=next_page,\n extra_context={'LOGIN_URL': settings.LOGIN_URL})\n", (312, 424), Fals... |
from gemstone.core.modules import Module
import gemstone
class SecondModule(Module):
@gemstone.exposed_method("module2.say_hello")
def say_hello(self):
return "Hello from module 2!"
| [
"gemstone.exposed_method"
] | [((92, 136), 'gemstone.exposed_method', 'gemstone.exposed_method', (['"""module2.say_hello"""'], {}), "('module2.say_hello')\n", (115, 136), False, 'import gemstone\n')] |
from ..entity.host import Node
from ..valueobject.validator import ValidatorResult
import time
import datetime
import tornado.log
class Validator:
max_cache_time = 120.0
# static
cache = {}
def __init__(self, max_cache_time: int):
self.max_cache_time = max_cache_time
def _get_cache_ide... | [
"datetime.datetime.now",
"time.time"
] | [((694, 705), 'time.time', 'time.time', ([], {}), '()\n', (703, 705), False, 'import time\n'), ((1246, 1257), 'time.time', 'time.time', ([], {}), '()\n', (1255, 1257), False, 'import time\n'), ((525, 548), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (546, 548), False, 'import datetime\n')] |
import numpy as np
from scipy.spatial import cKDTree as KDTree
import math
import argparse
# ref: https://github.com/facebookresearch/DeepSDF/blob/master/deep_sdf/metrics/chamfer.py
# takes one pair of reconstructed and gt point cloud and return the cd
def compute_cd(gt_points, gen_points):
# one direction
... | [
"argparse.ArgumentParser",
"scipy.spatial.cKDTree",
"numpy.square",
"math.isnan",
"numpy.load",
"numpy.random.shuffle"
] | [((341, 359), 'scipy.spatial.cKDTree', 'KDTree', (['gen_points'], {}), '(gen_points)\n', (347, 359), True, 'from scipy.spatial import cKDTree as KDTree\n'), ((537, 554), 'scipy.spatial.cKDTree', 'KDTree', (['gt_points'], {}), '(gt_points)\n', (543, 554), True, 'from scipy.spatial import cKDTree as KDTree\n'), ((810, 83... |
#!/usr/bin/env python3
# This is the master ImageAnalysis processing script. For DJI and
# Sentera cameras it should typically be able to run through with
# default settings and produce a good result with no further input.
#
# If something goes wrong, there are usually specific sub-scripts that
# can be run to fix th... | [
"lib.smart.update_srtm_elevations",
"lib.pose.set_aircraft_poses",
"lib.optimizer.Optimizer",
"lib.match_cleanup.triangulate_smart",
"props_json.load",
"lib.match_cleanup.merge_duplicates",
"os.path.exists",
"lib.state.check",
"argparse.ArgumentParser",
"lib.pose.make_pix4d",
"lib.matcher.find_m... | [((1275, 1338), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Create an empty project."""'}), "(description='Create an empty project.')\n", (1298, 1338), False, 'import argparse\n'), ((4865, 4911), 'lib.logger.log', 'log', (['"""Project processed with arguments:"""', 'args'], {}), "('Pr... |
#!/usr/bin/env python3
import click
import requests
import re
import os
from bs4 import BeautifulSoup
headers = {
'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36"
}
sources = {
'boj': {
'url': 'https://acmicpc.net/proble... | [
"os.path.exists",
"click.argument",
"os.makedirs",
"click.secho",
"click.option",
"re.compile",
"requests.get",
"bs4.BeautifulSoup",
"click.ClickException",
"click.Path",
"click.command"
] | [((1029, 1044), 'click.command', 'click.command', ([], {}), '()\n', (1042, 1044), False, 'import click\n'), ((1046, 1079), 'click.argument', 'click.argument', (['"""source"""'], {'nargs': '(1)'}), "('source', nargs=1)\n", (1060, 1079), False, 'import click\n'), ((1081, 1116), 'click.argument', 'click.argument', (['"""p... |
# Copyright 2017 National Research Foundation (Square Kilometre Array)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditi... | [
"logging.getLogger",
"re.compile",
"inspect.signature",
"inspect.iscoroutinefunction",
"functools.wraps",
"asyncio.Lock",
"asyncio.Event",
"inspect.Parameter",
"time.time",
"types.coroutine",
"ipaddress.ip_address"
] | [((1782, 1809), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1799, 1809), False, 'import logging\n'), ((1851, 1884), 're.compile', 're.compile', (["b'^[ \\\\t]*[\\\\r\\\\n]?$'"], {}), "(b'^[ \\\\t]*[\\\\r\\\\n]?$')\n", (1861, 1884), False, 'import re\n'), ((9995, 10021), 'inspect.signa... |
#!/usr/bin/python3
import os
import subprocess
import sys
import json
import requests
import time
# --- Function to execute command with interactive printout sent to web-terminal in real-time
def interactive_command(cmd,session_name):
# --- Execute command
try:
cmd2 = 'printf "' + cmd + '" > /VVebUQ_ru... | [
"os.path.expanduser",
"subprocess.Popen",
"time.sleep",
"os.getcwd",
"os.path.basename",
"requests.put",
"sys.exit",
"json.load",
"json.dump",
"os.remove"
] | [((3409, 3420), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (3418, 3420), False, 'import os\n'), ((4863, 4881), 'os.remove', 'os.remove', (['tarball'], {}), '(tarball)\n', (4872, 4881), False, 'import os\n'), ((7341, 7427), 'subprocess.Popen', 'subprocess.Popen', (['cmd'], {'shell': '(True)', 'stdout': 'subprocess.PIPE... |
import datetime
import random
from typing import Union
from modules.duel_history import DuelHistory
def get_latest_duel(group_id: int) -> Union[DuelHistory, None]:
"""
:说明:
根据群号获取最近一场决斗记录
:参数
* group_id:QQ群号
:返回
* DuelHistory:俄罗斯轮盘决斗记录
* None:不存在记录
"""
r = Due... | [
"modules.duel_history.DuelHistory.select",
"datetime.datetime.now",
"random.uniform",
"modules.duel_history.DuelHistory.start_time.desc"
] | [((2009, 2029), 'random.uniform', 'random.uniform', (['(0)', '(1)'], {}), '(0, 1)\n', (2023, 2029), False, 'import random\n'), ((2683, 2706), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (2704, 2706), False, 'import datetime\n'), ((2797, 2820), 'datetime.datetime.now', 'datetime.datetime.now', ([... |
import os, lmdb
class UTXOIndex:
'''
Basically it is index [public_key -> set of unspent outputs with this public key]
'''
__shared_states = {}
def __init__(self, storage_space, path):
if not path in self.__shared_states:
self.__shared_states[path]={}
self.__dict__ = self.__shared_states[p... | [
"os.path.exists",
"lmdb.open",
"os.makedirs"
] | [((448, 485), 'lmdb.open', 'lmdb.open', (['self.directory'], {'max_dbs': '(10)'}), '(self.directory, max_dbs=10)\n', (457, 485), False, 'import os, lmdb\n'), ((362, 382), 'os.path.exists', 'os.path.exists', (['path'], {}), '(path)\n', (376, 382), False, 'import os, lmdb\n'), ((393, 420), 'os.makedirs', 'os.makedirs', (... |
#!/usr/bin/env python
#
# genbank_get_genomes_by_taxon.py
#
# A script that takes an NCBI taxonomy identifier (or string, though this is
# not reliable for taxonomy tree subgraphs...) and downloads all genomes it
# can find from NCBI in the corresponding taxon subgraph with the passed
# argument as root.
#
# (c) TheJa... | [
"logging.getLogger",
"os.path.exists",
"logging.StreamHandler",
"time.asctime",
"argparse.ArgumentParser",
"Bio.Entrez.esearch",
"os.makedirs",
"logging.Formatter",
"os.path.join",
"Bio.Entrez.elink",
"Bio.Entrez.esummary",
"shutil.rmtree",
"collections.defaultdict",
"Bio.Entrez.read",
"... | [((670, 725), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'prog': '"""genbacnk_get_genomes_by_taxon.py"""'}), "(prog='genbacnk_get_genomes_by_taxon.py')\n", (684, 725), False, 'from argparse import ArgumentParser\n'), ((2980, 3011), 'os.path.exists', 'os.path.exists', (['args.outdirname'], {}), '(args.outdirname... |
import datetime
from django.test import TestCase
from ..utils import get_fiscal_year, Holiday
import logging
logger = logging.getLogger(__name__)
__author__ = 'lberrocal'
class TestUtils(TestCase):
def test_get_fiscal_year(self):
cdates = [[datetime.date(2015, 10, 1), 'AF16'],
[datetime.... | [
"logging.getLogger",
"datetime.datetime",
"datetime.date"
] | [((118, 145), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (135, 145), False, 'import logging\n'), ((963, 990), 'datetime.date', 'datetime.date', (['(2015)', '(12)', '(25)'], {}), '(2015, 12, 25)\n', (976, 990), False, 'import datetime\n'), ((1109, 1136), 'datetime.date', 'datetime.date... |
import pytorch_lightning as pl
import torch
from torch.utils.data import Dataset, DataLoader, random_split
from sklearn.preprocessing import LabelEncoder
from PIL import Image
import numpy as np
import pandas as pd
def encode_labels(labels):
le = LabelEncoder()
encoded = le.fit_transform(labels)
... | [
"sklearn.preprocessing.LabelEncoder",
"PIL.Image.open",
"pandas.read_csv",
"numpy.array",
"torch.utils.data.DataLoader",
"numpy.transpose",
"torch.Generator"
] | [((256, 270), 'sklearn.preprocessing.LabelEncoder', 'LabelEncoder', ([], {}), '()\n', (268, 270), False, 'from sklearn.preprocessing import LabelEncoder\n'), ((384, 400), 'PIL.Image.open', 'Image.open', (['path'], {}), '(path)\n', (394, 400), False, 'from PIL import Image\n'), ((470, 483), 'numpy.array', 'np.array', ([... |
#
# This file is part of pysnmp software.
#
# Copyright (c) 2005-2019, <NAME> <<EMAIL>>
# License: http://snmplabs.com/pysnmp/license.html
#
# This file instantiates some of the MIB managed objects for SNMP engine use
#
if 'mibBuilder' not in globals():
import sys
sys.stderr.write(__doc__)
sys.exit(1)
Mi... | [
"sys.stderr.write",
"sys.exit"
] | [((275, 300), 'sys.stderr.write', 'sys.stderr.write', (['__doc__'], {}), '(__doc__)\n', (291, 300), False, 'import sys\n'), ((305, 316), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (313, 316), False, 'import sys\n')] |
import argparse
import shutil
import numpy as np
from project.data_preprocessing.preprocessing import Preprocessor
from project.data_preprocessing.data_loader import Loader
from project.models.model import Model
from prostagma.techniques.grid_search import GridSearch
from prostagma.performances.cross_validation impor... | [
"project.data_preprocessing.data_loader.Loader",
"argparse.ArgumentParser",
"project.data_preprocessing.preprocessing.Preprocessor",
"numpy.random.seed",
"shutil.rmtree",
"prostagma.performances.cross_validation.CrossValidation",
"project.models.model.Model"
] | [((348, 373), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (371, 373), False, 'import argparse\n'), ((1718, 1735), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (1732, 1735), True, 'import numpy as np\n'), ((1770, 1818), 'project.data_preprocessing.data_loader.Loader', 'Loade... |
from __future__ import unicode_literals
from django.db import models
from ckeditor_uploader.fields import RichTextUploadingField
from django.db.models.signals import pre_save
from django.template.defaultfilters import slugify
from django.dispatch import receiver
class Season(models.Model):
name = models.CharField... | [
"ckeditor_uploader.fields.RichTextUploadingField",
"django.db.models.ForeignKey",
"django.db.models.DateTimeField",
"django.db.models.BooleanField",
"django.template.defaultfilters.slugify",
"django.db.models.SlugField",
"django.dispatch.receiver",
"django.db.models.CharField"
] | [((1623, 1656), 'django.dispatch.receiver', 'receiver', (['pre_save'], {'sender': 'Season'}), '(pre_save, sender=Season)\n', (1631, 1656), False, 'from django.dispatch import receiver\n'), ((1761, 1793), 'django.dispatch.receiver', 'receiver', (['pre_save'], {'sender': 'Robot'}), '(pre_save, sender=Robot)\n', (1769, 17... |
from django.shortcuts import render, redirect
from django.db import connection
from .forms import ProfileForm, LocationForm, SearchLocationForm
import populartimes
import datetime
import math
from mycrawl import popCrawl
def index(request):
# Render the HTML template index.html with the data in the context varia... | [
"django.shortcuts.render",
"populartimes.get",
"populartimes.get_id",
"mycrawl.popCrawl",
"math.sqrt",
"math.cos",
"django.shortcuts.redirect",
"django.db.connection.cursor",
"datetime.datetime.today",
"math.sin"
] | [((336, 365), 'django.shortcuts.render', 'render', (['request', '"""index.html"""'], {}), "(request, 'index.html')\n", (342, 365), False, 'from django.shortcuts import render, redirect\n'), ((427, 475), 'django.shortcuts.render', 'render', (['request', '"""catalog/user_info_create.html"""'], {}), "(request, 'catalog/us... |
# -*- coding: utf-8 -*-
#
# cli.py
# questioner
#
"""
A command-line client for annotating things.
"""
import re
import os
from typing import List, Set, Optional
import readchar
import blessings
SKIP_KEY = '\r'
SKIP_LINE = ''
QUIT_KEY = 'q'
QUIT_LINE = 'q'
EMAIL_REGEX = '^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}$... | [
"os.system",
"re.match",
"readchar.readchar",
"blessings.Terminal"
] | [((750, 770), 'blessings.Terminal', 'blessings.Terminal', ([], {}), '()\n', (768, 770), False, 'import blessings\n'), ((2235, 2254), 'readchar.readchar', 'readchar.readchar', ([], {}), '()\n', (2252, 2254), False, 'import readchar\n'), ((5433, 5452), 'readchar.readchar', 'readchar.readchar', ([], {}), '()\n', (5450, 54... |
"""
Hu moments calculation
"""
# Import required packages:
import cv2
from matplotlib import pyplot as plt
def centroid(moments):
"""Returns centroid based on moments"""
x_centroid = round(moments['m10'] / moments['m00'])
y_centroid = round(moments['m01'] / moments['m00'])
return x_centroid, y_centr... | [
"matplotlib.pyplot.imshow",
"cv2.drawContours",
"cv2.threshold",
"cv2.HuMoments",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.figure",
"cv2.circle",
"cv2.cvtColor",
"cv2.moments",
"cv2.findContours",
"matplotlib.pyplot.title",
"cv2.imread",
"matplotlib.pyplot.... | [((850, 877), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(12, 5)'}), '(figsize=(12, 5))\n', (860, 877), True, 'from matplotlib import pyplot as plt\n'), ((878, 936), 'matplotlib.pyplot.suptitle', 'plt.suptitle', (['"""Hu moments"""'], {'fontsize': '(14)', 'fontweight': '"""bold"""'}), "('Hu moments', f... |
## 1. Interfering with the Built-in Functions ##
a_list = [1, 8, 10, 9, 7]
print(max(a_list))
def max(a_list):
return "No max value returned"
max_val_test_0 = max(a_list)
print(max_val_test_0)
del max
## 3. Default Arguments ##
# INITIAL CODE
def open_dataset(file_name):
opened_file = open(file_name)
... | [
"csv.reader"
] | [((363, 382), 'csv.reader', 'reader', (['opened_file'], {}), '(opened_file)\n', (369, 382), False, 'from csv import reader\n'), ((575, 594), 'csv.reader', 'reader', (['opened_file'], {}), '(opened_file)\n', (581, 594), False, 'from csv import reader\n'), ((1034, 1053), 'csv.reader', 'reader', (['opened_file'], {}), '(o... |
#import sys
#!{sys.executable} -m pip install pyathena
from pyathena import connect
import pandas as pd
conn = connect(s3_staging_dir='s3://aws-athena-query-results-459817416023-us-east-1/', region_name='us-east-1')
df = pd.read_sql('SELECT * FROM "ticketdata"."nfl_stadium_data" order by stadium limit 10;', conn)
df | [
"pandas.read_sql",
"pyathena.connect"
] | [((113, 227), 'pyathena.connect', 'connect', ([], {'s3_staging_dir': '"""s3://aws-athena-query-results-459817416023-us-east-1/"""', 'region_name': '"""us-east-1"""'}), "(s3_staging_dir=\n 's3://aws-athena-query-results-459817416023-us-east-1/', region_name=\n 'us-east-1')\n", (120, 227), False, 'from pyathena imp... |
import requests
import json
import api_informations as api_info # this is used to not expose the api key
def json_print(obj):
text = json.dumps(obj, sort_keys=True, indent=4)
print(text)
parameters = {
"api_key" : api_info.api_key,
"language" : "en-US",
}
response = requests.get("https://api.themovie... | [
"json.dumps",
"requests.get"
] | [((286, 364), 'requests.get', 'requests.get', (['"""https://api.themoviedb.org/3/discover/movie"""'], {'params': 'parameters'}), "('https://api.themoviedb.org/3/discover/movie', params=parameters)\n", (298, 364), False, 'import requests\n'), ((138, 179), 'json.dumps', 'json.dumps', (['obj'], {'sort_keys': '(True)', 'in... |
import requests
import time
i = 0
while True:
response = requests.get(
"http://localhost:5000/send?idNode=ESP")
print(i)
i = i+1
print(response)
time.sleep(60)
| [
"time.sleep",
"requests.get"
] | [((62, 115), 'requests.get', 'requests.get', (['"""http://localhost:5000/send?idNode=ESP"""'], {}), "('http://localhost:5000/send?idNode=ESP')\n", (74, 115), False, 'import requests\n'), ((174, 188), 'time.sleep', 'time.sleep', (['(60)'], {}), '(60)\n', (184, 188), False, 'import time\n')] |
#
# 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, software
# distributed under ... | [
"dateutil.parser.parse"
] | [((3623, 3649), 'dateutil.parser.parse', 'parse', (['self.obj.start_time'], {}), '(self.obj.start_time)\n', (3628, 3649), False, 'from dateutil.parser import parse\n'), ((4202, 4226), 'dateutil.parser.parse', 'parse', (['self.obj.end_time'], {}), '(self.obj.end_time)\n', (4207, 4226), False, 'from dateutil.parser impor... |
import mosspy
userid = 223762299
m = mosspy.Moss(userid, "javascript")
# Submission Files
m.addFile("files/d3.js")
m.addFilesByWildcard("files/map.js")
url = m.send() # Submission Report URL
print ("Report Url: " + url)
# Save report file
m.saveWebPage(url, "report/report.html")
# Download whole report locally i... | [
"mosspy.Moss",
"mosspy.download_report"
] | [((39, 72), 'mosspy.Moss', 'mosspy.Moss', (['userid', '"""javascript"""'], {}), "(userid, 'javascript')\n", (50, 72), False, 'import mosspy\n'), ((345, 402), 'mosspy.download_report', 'mosspy.download_report', (['url', '"""report/src/"""'], {'connections': '(8)'}), "(url, 'report/src/', connections=8)\n", (367, 402), F... |
import imp
ID = "newload"
permission = 3
def execute(self, name, params, channel, userdata, rank):
files = self.__ListDir__("commands")
currentlyLoaded = [self.commands[cmd][1] for cmd in self.commands]
for item in currentlyLoaded:
filename = item.partition("/")[2]
files.remove(filena... | [
"imp.load_source"
] | [((712, 763), 'imp.load_source', 'imp.load_source', (["('RenolIRC_' + filename[0:-3])", 'path'], {}), "('RenolIRC_' + filename[0:-3], path)\n", (727, 763), False, 'import imp\n')] |
# -*- coding utf-8 -*-#
# ------------------------------------------------------------------
# Name: middlewire
# Author: liangbaikai
# Date: 2020/12/28
# Desc: there is a python file description
# ------------------------------------------------------------------
from copy import copy
from functools ... | [
"copy.copy",
"functools.wraps"
] | [((807, 818), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (812, 818), False, 'from functools import wraps\n'), ((1183, 1202), 'copy.copy', 'copy', (['order_or_func'], {}), '(order_or_func)\n', (1187, 1202), False, 'from copy import copy\n'), ((1555, 1572), 'functools.wraps', 'wraps', (['middleware'], {}), '... |
import os
import unittest
this_dir = os.path.dirname(os.path.realpath(__file__))
class TestPageXML(unittest.TestCase):
def run_dataset_viewer(self, add_args):
from calamari_ocr.scripts.dataset_viewer import main
main(add_args + ["--no_plot"])
def test_cut_modes(self):
images = os.pa... | [
"os.path.realpath",
"calamari_ocr.scripts.dataset_viewer.main",
"os.path.join"
] | [((54, 80), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (70, 80), False, 'import os\n'), ((236, 266), 'calamari_ocr.scripts.dataset_viewer.main', 'main', (["(add_args + ['--no_plot'])"], {}), "(add_args + ['--no_plot'])\n", (240, 266), False, 'from calamari_ocr.scripts.dataset_viewer imp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# preproc_BrainSpan_link.py
# made by <NAME>
# 2020-04-20 16:21:05
#########################
import sys
import os
SVRNAME = os.uname()[1]
if "MBI" in SVRNAME.upper():
sys_path = "/Users/pcaso/bin/python_lib"
elif SVRNAME == "T7":
sys_path = "/ms1/bin/python_lib"
els... | [
"proc_util.run_cmd",
"time.sleep",
"sys.path.append",
"csv.reader",
"os.uname"
] | [((367, 392), 'sys.path.append', 'sys.path.append', (['sys_path'], {}), '(sys_path)\n', (382, 392), False, 'import sys\n'), ((416, 437), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (431, 437), False, 'import sys\n'), ((170, 180), 'os.uname', 'os.uname', ([], {}), '()\n', (178, 180), False, 'im... |
# encoding: utf-8
from nose.tools import (
eq_,
set_trace,
)
from util.cdn import cdnify
class TestCDN(object):
def unchanged(self, url, cdns):
self.ceq(url, url, cdns)
def ceq(self, expect, url, cdns):
eq_(expect, cdnify(url, cdns))
def test_no_cdns(self):
url = "http:... | [
"util.cdn.cdnify"
] | [((252, 269), 'util.cdn.cdnify', 'cdnify', (['url', 'cdns'], {}), '(url, cdns)\n', (258, 269), False, 'from util.cdn import cdnify\n')] |
""" Test for act helpers """
import pytest
import act.api
def test_add_uri_fqdn() -> None: # type: ignore
""" Test for extraction of facts from uri with fqdn """
api = act.api.Act("", None, "error")
uri = "http://www.mnemonic.no/home"
facts = act.api.helpers.uri_facts(api, uri)
assert len(fac... | [
"pytest.raises"
] | [((837, 880), 'pytest.raises', 'pytest.raises', (['act.api.base.ValidationError'], {}), '(act.api.base.ValidationError)\n', (850, 880), False, 'import pytest\n'), ((942, 985), 'pytest.raises', 'pytest.raises', (['act.api.base.ValidationError'], {}), '(act.api.base.ValidationError)\n', (955, 985), False, 'import pytest\... |
import threading
class BaseEventHandler(object):
screen_lock = threading.Lock()
def __init__(self, browser, tab, directory='./'):
self.browser = browser
self.tab = tab
self.start_frame = None
self.directory = directory
def frame_started_loading(self, frameId):
if ... | [
"threading.Lock"
] | [((69, 85), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (83, 85), False, 'import threading\n')] |
import numpy as np
import requests
import talib
class stock_ins:
BASE_URL = "https://paper-api.alpaca.markets"
DATA_URL = "https://data.alpaca.markets"
def __init__(self, stock_name, save_len, api_key, secret_key):
self.stock_name = stock_name
self.save_len = save_len
self.ask_data... | [
"numpy.array",
"market.is_open",
"time.sleep",
"time.time"
] | [((2142, 2158), 'market.is_open', 'market.is_open', ([], {}), '()\n', (2156, 2158), False, 'import market\n'), ((1350, 1380), 'numpy.array', 'np.array', (['data'], {'dtype': '"""double"""'}), "(data, dtype='double')\n", (1358, 1380), True, 'import numpy as np\n'), ((2186, 2197), 'time.time', 'time.time', ([], {}), '()\... |
import json
import warnings
from pathlib import Path
import sys
from bilby.core.utils import logger
from bilby.core.result import BilbyJsonEncoder
from memestr.injection import create_injection
warnings.filterwarnings("ignore")
if len(sys.argv) > 1:
minimum_id = int(sys.argv[1])
maximum_id = int(sys.argv[2]... | [
"pathlib.Path",
"bilby.core.utils.logger.info",
"memestr.injection.create_injection",
"warnings.filterwarnings",
"json.dump"
] | [((197, 230), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (220, 230), False, 'import warnings\n'), ((413, 446), 'bilby.core.utils.logger.info', 'logger.info', (['f"""Injection ID: {i}"""'], {}), "(f'Injection ID: {i}')\n", (424, 446), False, 'from bilby.core.utils impor... |
"""This module contains various decorators.
There are two kinds of decorators defined in this module which consists of either two or
three nested functions. The former are decorators without and the latter with arguments.
For more information on decorators, see this `guide`_ on https://realpython.com which
provides a... | [
"estimagic.parameters.process_constraints.process_constraints",
"estimagic.parameters.reparametrize.reparametrize_from_internal",
"functools.wraps",
"warnings.warn",
"estimagic.exceptions.get_traceback"
] | [((1579, 1619), 'estimagic.parameters.process_constraints.process_constraints', 'process_constraints', (['constraints', 'params'], {}), '(constraints, params)\n', (1598, 1619), False, 'from estimagic.parameters.process_constraints import process_constraints\n'), ((5850, 5871), 'functools.wraps', 'functools.wraps', (['f... |
import pandas as pd
df = pd.DataFrame()
files = pd.read_csv('grandtlinks.csv')
try:
files['status'] = files['status'].astype(str)
header=False
except KeyError:
files['status'] = ''
header=True
for index, row in files.iterrows():
if row['status'] == 'parsed':
continue
filename = row['f... | [
"pandas.DataFrame",
"pandas.read_csv"
] | [((26, 40), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (38, 40), True, 'import pandas as pd\n'), ((50, 80), 'pandas.read_csv', 'pd.read_csv', (['"""grandtlinks.csv"""'], {}), "('grandtlinks.csv')\n", (61, 80), True, 'import pandas as pd\n'), ((341, 372), 'pandas.read_csv', 'pd.read_csv', (['f"""data/{filenam... |
import os
class PathUtil:
@staticmethod
def filter_hidden_inplace(item_list):
if(not len(item_list)):
return
wanted = filter(
lambda item:
not ((item.startswith('.') and item != ".htaccess") or item.endswith('~')), item_list)
... | [
"os.path.join",
"os.path.basename",
"os.makedirs",
"os.path.split"
] | [((1584, 1632), 'os.path.join', 'os.path.join', (['mirror_directory', 'current_fragment'], {}), '(mirror_directory, current_fragment)\n', (1596, 1632), False, 'import os\n'), ((793, 819), 'os.path.split', 'os.path.split', (['current_dir'], {}), '(current_dir)\n', (806, 819), False, 'import os\n'), ((851, 904), 'os.path... |
from __future__ import annotations
from argparse import ArgumentParser
from pathlib import Path
from .._colors import get_colors
from ..linter import TransformationType, Transformer
from ._base import Command
from ._common import get_paths
class DecorateCommand(Command):
"""Add decorators to your code.
```... | [
"pathlib.Path"
] | [((1547, 1556), 'pathlib.Path', 'Path', (['arg'], {}), '(arg)\n', (1551, 1556), False, 'from pathlib import Path\n')] |
import os,sys,inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, currentdir+'/../../data-structures/stacks_and_queues')
p = currentdir+'/../../data-structures/linked_list'
sys.path.insert(0,p)
from stack... | [
"stacks_and_queues.Stack",
"os.path.dirname",
"sys.path.insert",
"inspect.currentframe"
] | [((125, 152), 'os.path.dirname', 'os.path.dirname', (['currentdir'], {}), '(currentdir)\n', (140, 152), False, 'import os, sys, inspect\n'), ((156, 231), 'sys.path.insert', 'sys.path.insert', (['(0)', "(currentdir + '/../../data-structures/stacks_and_queues')"], {}), "(0, currentdir + '/../../data-structures/stacks_and... |
import os
import git
from shutil import move
from printing import *
from config import get_config
#########
# GLOBALS
#########
COMMIT_MSG = {
"fonts": "Back up fonts.",
"packages": "Back up packages.",
"configs": "Back up configs.",
"all": "Full back up.",
"dotfiles": "Back up dotfiles."
}
###########
# FUNCTI... | [
"os.path.exists",
"shutil.move",
"git.Repo.init",
"os.path.join",
"config.get_config",
"git.Repo"
] | [((917, 953), 'os.path.join', 'os.path.join', (['dir_path', '""".gitignore"""'], {}), "(dir_path, '.gitignore')\n", (929, 953), False, 'import os\n'), ((958, 988), 'os.path.exists', 'os.path.exists', (['gitignore_path'], {}), '(gitignore_path)\n', (972, 988), False, 'import os\n'), ((2476, 2509), 'os.path.join', 'os.pa... |
"""Client software that receives the data.
Author: <NAME>
Email : <EMAIL>
"""
from __future__ import print_function, absolute_import
import socket
try:
import cPickle as pickle
except:
import pickle
import zlib
import cv2
buffer_size = 2**17
IP_address = "172.19.11.178"
port = 8080
address = (IP_address, p... | [
"zlib.decompress",
"cv2.waitKey",
"socket.socket",
"cv2.imshow"
] | [((341, 389), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_DGRAM'], {}), '(socket.AF_INET, socket.SOCK_DGRAM)\n', (354, 389), False, 'import socket\n'), ((546, 567), 'zlib.decompress', 'zlib.decompress', (['data'], {}), '(data)\n', (561, 567), False, 'import zlib\n'), ((617, 648), 'cv2.imshow', 'c... |
from bs4 import BeautifulSoup as Bs4
from time import sleep
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import pandas as pd
def scroll(driver, timeout):
scroll_pause_time = timeout
# Get scroll height
last_height = driver.execute_script("return document.body.sc... | [
"bs4.BeautifulSoup",
"selenium.webdriver.Chrome",
"pandas.DataFrame",
"time.sleep"
] | [((861, 927), 'selenium.webdriver.Chrome', 'webdriver.Chrome', ([], {'executable_path': '"""C:/WebDrivers/chromedriver.exe"""'}), "(executable_path='C:/WebDrivers/chromedriver.exe')\n", (877, 927), False, 'from selenium import webdriver\n'), ((1438, 1446), 'time.sleep', 'sleep', (['(6)'], {}), '(6)\n', (1443, 1446), Fa... |
import logging
import pickle
from datetime import datetime
import munch
from rocketgram import Bot, Dispatcher, DefaultValuesMiddleware, ParseModeType
logger = logging.getLogger('mybot')
router = Dispatcher()
def get_bot(token: str):
bot = Bot(token, router=router, globals_class=munch.Munch, context_data_clas... | [
"logging.getLogger",
"rocketgram.DefaultValuesMiddleware",
"rocketgram.Bot",
"rocketgram.Dispatcher"
] | [((163, 189), 'logging.getLogger', 'logging.getLogger', (['"""mybot"""'], {}), "('mybot')\n", (180, 189), False, 'import logging\n'), ((200, 212), 'rocketgram.Dispatcher', 'Dispatcher', ([], {}), '()\n', (210, 212), False, 'from rocketgram import Bot, Dispatcher, DefaultValuesMiddleware, ParseModeType\n'), ((250, 339),... |
import numpy as np
from rotations import rot2, rot3
import mavsim_python_parameters_aerosonde_parameters as P
class Gravity:
def __init__(self, state):
self.mass = P.mass
self.gravity = P.gravity
self.state = state
# Aero quantities
@property
def force(self):
... | [
"numpy.array"
] | [((385, 421), 'numpy.array', 'np.array', (['[0, 0, P.mass * P.gravity]'], {}), '([0, 0, P.mass * P.gravity])\n', (393, 421), True, 'import numpy as np\n')] |
from tensorflow.python.framework import ops
import tensorflow as tf
from utilities import model as md
import matplotlib.pyplot as plt
import numpy as np
from sklearn.model_selection import train_test_split
import os
import time
import cv2
def model(photos_train, Y_train, photos_test, Y_test, learning_rate=0.0005,
... | [
"tensorflow.python.framework.ops.reset_default_graph",
"matplotlib.pyplot.ylabel",
"utilities.model.forward_propagation",
"utilities.model.get_data_chunk",
"tensorflow.set_random_seed",
"tensorflow.cast",
"numpy.save",
"utilities.model.compute_cost",
"utilities.model.initialize_parameters",
"tenso... | [((969, 994), 'tensorflow.python.framework.ops.reset_default_graph', 'ops.reset_default_graph', ([], {}), '()\n', (992, 994), False, 'from tensorflow.python.framework import ops\n'), ((1065, 1086), 'tensorflow.set_random_seed', 'tf.set_random_seed', (['(1)'], {}), '(1)\n', (1083, 1086), True, 'import tensorflow as tf\n... |
import FreeCAD
import FPEventDispatcher
from FPInitialPlacement import InitialPlacements
import FPSimServer
import FPUtils
pressEventLocationXY = dict()
rotationAngleAtPress = dict()
class FPSimRotaryPotentiometer(InitialPlacements):
def __init__(self, obj):
InitialPlacements.__init__(self, obj)
o... | [
"FreeCAD.ActiveDocument.addObject",
"FPEventDispatcher.eventDispatcher.registerForButtonEvent",
"FreeCAD.ActiveDocument.getObject",
"FreeCAD.Rotation",
"FPUtils.clamp",
"FreeCAD.Console.PrintError",
"FPSimServer.dataAquisitionCBHolder.setPotentiometerCB",
"FreeCAD.Gui.Selection.getSelectionEx",
"FPE... | [((6755, 6853), 'FreeCAD.ActiveDocument.addObject', 'FreeCAD.ActiveDocument.addObject', (['"""App::DocumentObjectGroupPython"""', '"""FPSimRotaryPotentiometer"""'], {}), "('App::DocumentObjectGroupPython',\n 'FPSimRotaryPotentiometer')\n", (6787, 6853), False, 'import FreeCAD\n'), ((6958, 6996), 'FreeCAD.Gui.Selecti... |
import os
import scipy
import numpy as np
from ImageStatistics import UsefulImDirectory
import scipy as sp
import ast
from bokeh.charts import Histogram, show
import pandas as pd
class Game(object):
def __init__(self, gamefolder):
self.gamefolder = os.path.abspath(gamefolder)
file = open(os.path.jo... | [
"numpy.mean",
"numpy.median",
"scipy.stats.iqr",
"os.path.join",
"ast.literal_eval",
"numpy.std",
"os.path.abspath",
"numpy.var"
] | [((262, 289), 'os.path.abspath', 'os.path.abspath', (['gamefolder'], {}), '(gamefolder)\n', (277, 289), False, 'import os\n'), ((310, 343), 'os.path.join', 'os.path.join', (['gamefolder', '"""sales"""'], {}), "(gamefolder, 'sales')\n", (322, 343), False, 'import os\n'), ((465, 503), 'os.path.join', 'os.path.join', (['g... |
import argparse
import compile_sandbox
import default_nemesis_proto
import logging
import nemesis_pb2
import os
import runner
import shutil
import tempfile
class Judger(object):
def __init__(self, conf, logger):
self.conf = conf
self.logger = logger
self.checker_path = None
self.w... | [
"logging.basicConfig",
"logging.getLogger",
"argparse.ArgumentParser",
"nemesis_pb2.Job",
"os.path.join",
"compile_sandbox.Compiler",
"shutil.rmtree",
"default_nemesis_proto.default_Status",
"runner.Runner",
"default_nemesis_proto.default_CustomInvocationStatus",
"tempfile.mkdtemp",
"default_n... | [((14203, 14256), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Nemesis Judger"""'}), "(description='Nemesis Judger')\n", (14226, 14256), False, 'import argparse\n'), ((14380, 14419), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n'... |
# -*- coding: utf-8 -*-
# ========================================================================
#
# Copyright © <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.a... | [
"argparse.ArgumentParser",
"datetime.datetime.strptime",
"monthdelta.monthdelta",
"os.path.join",
"io.open",
"time.sleep",
"requests.get",
"sys.stderr.write",
"datetime.timedelta",
"os.path.expanduser"
] | [((1062, 1141), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Obtain earthquakes via ReSTful interface"""'}), "(description='Obtain earthquakes via ReSTful interface')\n", (1085, 1141), False, 'import argparse\n'), ((6423, 6500), 'os.path.join', 'os.path.join', (['args.tgt_path', '(args... |
from .ranking import CreditRanking
from .interleaving_method import InterleavingMethod
import numpy as np
from scipy.optimize import linprog
class Optimized(InterleavingMethod):
'''
Optimized Interleaving
Args:
lists: lists of document IDs
max_length: the maximum length of resultant inter... | [
"numpy.sum",
"numpy.array",
"numpy.vstack"
] | [((2386, 2413), 'numpy.sum', 'np.sum', (['self._probabilities'], {}), '(self._probabilities)\n', (2392, 2413), True, 'import numpy as np\n'), ((4982, 5011), 'numpy.vstack', 'np.vstack', (['(A_p_sum, ub_cons)'], {}), '((A_p_sum, ub_cons))\n', (4991, 5011), True, 'import numpy as np\n'), ((5027, 5069), 'numpy.array', 'np... |
from collections import defaultdict
class HashTable(object):
def singleNumber(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
#initialize a hash table object
hash_table = defaultdict(int)
#for each num in list nums
for num in nums:
#... | [
"collections.defaultdict"
] | [((230, 246), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (241, 246), False, 'from collections import defaultdict\n')] |