code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# -*- test-case-name: vumi.transports.imimobile.tests.test_imimobile_ussd -*-
import re
import json
from datetime import datetime, timedelta
from twisted.python import log
from twisted.web import http
from twisted.internet.defer import inlineCallbacks
from vumi.components.session import SessionManager
from vumi.mes... | [
"twisted.python.log.msg",
"datetime.datetime.strptime",
"vumi.components.session.SessionManager.from_redis_config",
"json.dumps",
"datetime.timedelta"
] | [((4935, 5033), 'twisted.python.log.msg', 'log.msg', (["('ImiMobileTransport receiving inbound message from %s to %s.' % (from_addr,\n to_addr))"], {}), "('ImiMobileTransport receiving inbound message from %s to %s.' % (\n from_addr, to_addr))\n", (4942, 5033), False, 'from twisted.python import log\n'), ((3052, ... |
from twisted.internet import defer
from twisted.internet.defer import Deferred
from twisted.trial import unittest
from scrapy import Spider, signals, Request
from scrapy.utils.test import get_crawler
from tests.mockserver import MockServer
class SimplePipeline:
def process_item(self, item, spider):
item... | [
"scrapy.utils.test.get_crawler",
"tests.mockserver.MockServer",
"twisted.internet.defer.Deferred"
] | [((531, 541), 'twisted.internet.defer.Deferred', 'Deferred', ([], {}), '()\n', (539, 541), False, 'from twisted.internet.defer import Deferred\n'), ((911, 923), 'tests.mockserver.MockServer', 'MockServer', ([], {}), '()\n', (921, 923), False, 'from tests.mockserver import MockServer\n'), ((1376, 1409), 'scrapy.utils.te... |
"""
Takes advantage of multicore systems to speed up the simulation runs.
"""
import matplotlib
matplotlib.use('qt4agg')
from bandits.agent import Agent, BetaAgent
from bandits.bandit import BernoulliBandit, BinomialBandit
from bandits.policy import GreedyPolicy, EpsilonGreedyPolicy, UCBPolicy
from bandits.environment ... | [
"bandits.environment.Environment",
"bandits.policy.UCBPolicy",
"matplotlib.use",
"bandits.bandit.BernoulliBandit",
"bandits.policy.EpsilonGreedyPolicy",
"bandits.bandit.BinomialBandit",
"bandits.policy.GreedyPolicy"
] | [((96, 120), 'matplotlib.use', 'matplotlib.use', (['"""qt4agg"""'], {}), "('qt4agg')\n", (110, 120), False, 'import matplotlib\n'), ((421, 452), 'bandits.bandit.BernoulliBandit', 'BernoulliBandit', (['(10)'], {'t': '(3 * 1000)'}), '(10, t=3 * 1000)\n', (436, 452), False, 'from bandits.bandit import BernoulliBandit, Bin... |
import os.path
import sys
import setuptools
root_dir = os.path.abspath(os.path.dirname(__file__))
readme_file = os.path.join(root_dir, 'README.rst')
with open(readme_file, encoding='utf-8') as f:
long_description = f.read()
if os.environ.get('READTHEDOCS') == 'True':
cffi_modules=[]
else:
cffi_modules=[
... | [
"setuptools.setup"
] | [((406, 1317), 'setuptools.setup', 'setuptools.setup', ([], {'name': '"""aiortc"""', 'version': '"""0.8.0"""', 'description': '"""An implementation of WebRTC and ORTC"""', 'long_description': 'long_description', 'url': '"""https://github.com/jlaine/aiortc"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', ... |
# Copyright IBM Corp. 2016 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 applicable law or ag... | [
"contexthelper.ContextHelper.GetHelper",
"os.path.join",
"os.environ.copy",
"uuid.uuid1",
"os.path.isdir",
"bdd_test_util.cli_call"
] | [((2805, 2845), 'contexthelper.ContextHelper.GetHelper', 'ContextHelper.GetHelper', ([], {'context': 'context'}), '(context=context)\n', (2828, 2845), False, 'from contexthelper import ContextHelper\n'), ((5377, 5394), 'os.environ.copy', 'os.environ.copy', ([], {}), '()\n', (5392, 5394), False, 'import os\n'), ((6050, ... |
#!/home/francisco/Projects/Pycharm/py-binary-trees-draw/venv/bin/python
# -*- coding: utf-8 -*-
from node import Node
class AVLTree:
def __init__(self):
self.root = None
self.leaf = Node(None)
self.leaf.height = -1
self.nodes_dict_aux = {}
self.nodes_dict = {}
def ins... | [
"node.Node"
] | [((204, 214), 'node.Node', 'Node', (['None'], {}), '(None)\n', (208, 214), False, 'from node import Node\n'), ((552, 561), 'node.Node', 'Node', (['key'], {}), '(key)\n', (556, 561), False, 'from node import Node\n')] |
import matplotlib.pyplot as plt
from sklearn.utils.multiclass import unique_labels
import numpy as np
from sklearn import svm
from sklearn.metrics import confusion_matrix
from sklearn.metrics import roc_auc_score
from sklearn.metrics import roc_curve
from sklearn.metrics import auc
from sklearn.metrics import f1_score
... | [
"sklearn.svm.SVC",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"numpy.arange",
"sklearn.metrics.auc",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"inspect.getfullargspec",
"sklearn.metrics.roc_auc_score",
"numpy.array",
"sklearn.metrics.roc_curve",
"matplotlib.pyplot.title"... | [((1361, 1430), 'sklearn.svm.SVC', 'svm.SVC', ([], {'kernel': 'kernel', 'C': 'C', 'degree': 'degree', 'class_weight': 'class_weight'}), '(kernel=kernel, C=C, degree=degree, class_weight=class_weight)\n', (1368, 1430), False, 'from sklearn import svm\n'), ((2286, 2303), 'numpy.array', 'np.array', (['classes'], {}), '(cl... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Driver for aom.py
import sys
print(sys.path)
import os, re, time, subprocess
iterModDiv = 1
#dirPathList = ["/home/tomas/documenten/modelling/diatomas_symlink/results/aom_seed1_anmeStick_randomInit09BasedOn07","/home/tomas/documenten/modelling/diatomas_symlink/results/ao... | [
"os.listdir",
"subprocess.Popen",
"time.strftime",
"os.path.join",
"os.path.splitext",
"re.match",
"os.getcwd",
"re.search"
] | [((830, 858), 'os.path.join', 'os.path.join', (['resultsPath', 'd'], {}), '(resultsPath, d)\n', (842, 858), False, 'import os, re, time, subprocess\n'), ((758, 769), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (767, 769), False, 'import os, re, time, subprocess\n'), ((868, 891), 'os.listdir', 'os.listdir', (['resultsPa... |
import sklearn
import copy
import numpy as np
import scipy as sp
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import seaborn as sns
# from viz import viz
from bokeh.plotting import figure, show, output_notebook, output_file, save
from functions import merge_data
from sklearn.mod... | [
"naive_autoreg_baselines.train_and_evaluate_model",
"naive_autoreg_baselines.make_predictions",
"exponential_modeling.get_exponential_forecasts",
"pmdl_weight.compute_pmdl_weight",
"numpy.array",
"exponential_modeling.linear_fit",
"exponential_modeling.leave_t_day_out",
"exponential_modeling.fit_and_p... | [((1423, 1436), 'numpy.array', 'np.array', (['[1]'], {}), '([1])\n', (1431, 1436), True, 'import numpy as np\n'), ((5002, 5015), 'numpy.array', 'np.array', (['[1]'], {}), '([1])\n', (5010, 5015), True, 'import numpy as np\n'), ((6580, 6653), 'pmdl_weight.compute_pmdl_weight', 'pmdl_weight.compute_pmdl_weight', (['use_d... |
# coding:utf-8
"""[resolve group_genesis.ini]
Raises:
MCError -- [description]
MCError -- [description]
MCError -- [description]
MCError -- [description]
Returns:
[bool] -- [true or false]
"""
import configparser
import codecs
from pys.tool import utils
from pys.log import LOGGER
from pys.error.e... | [
"configparser.ConfigParser",
"pys.log.LOGGER.info",
"pys.log.LOGGER.error",
"pys.error.exp.MCError",
"pys.tool.utils.valid_string",
"codecs.open",
"pys.tool.utils.valid_package"
] | [((1308, 1354), 'pys.log.LOGGER.info', 'LOGGER.info', (['"""group_genesis.ini is %s"""', 'mgroup'], {}), "('group_genesis.ini is %s', mgroup)\n", (1319, 1354), False, 'from pys.log import LOGGER\n'), ((1678, 1705), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (1703, 1705), False, 'import ... |
"""Tests for the design module"""
import numpy as np
import turbigen.compflow as cf
from turbigen import design
# Set up test data
# Ranges of velocity triangle parameters covering the classic Smith chart
phi = np.linspace(0.4, 1.2, 5)
psi = np.linspace(0.8, 2.4, 5)
# "Reasonable" range of reaction (usually close to... | [
"numpy.radians",
"numpy.ptp",
"turbigen.design.nondim_stage_from_Lam",
"numpy.sqrt",
"turbigen.compflow.V_cpTo_from_Ma",
"numpy.log",
"turbigen.design.pitch_circulation",
"turbigen.design.pitch_Zweifel",
"numpy.array",
"numpy.isfinite",
"turbigen.compflow.Po_P_from_Ma",
"numpy.diff",
"numpy.... | [((213, 237), 'numpy.linspace', 'np.linspace', (['(0.4)', '(1.2)', '(5)'], {}), '(0.4, 1.2, 5)\n', (224, 237), True, 'import numpy as np\n'), ((244, 268), 'numpy.linspace', 'np.linspace', (['(0.8)', '(2.4)', '(5)'], {}), '(0.8, 2.4, 5)\n', (255, 268), True, 'import numpy as np\n'), ((425, 449), 'numpy.linspace', 'np.li... |
#!/usr/bin/env python
# coding: utf-8
# #<NAME>
# ## <b> Problem Description </b>
#
# ### This project aims to build a classification model to predict the sentiment of COVID-19 tweets.The tweets have been pulled from Twitter and manual tagging has been done then. Leveraging Natural Language Processing, sentiment ana... | [
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"nltk.download",
"sklearn.metrics.classification_report",
"pandas.to_datetime",
"matplotlib.pyplot.imshow",
"textblob.TextBlob",
"seaborn.set",
"nltk.corpus.stopwords.words",
"sklearn.feature_extraction.text.CountVectorizer",
"matplotlib.pyplot.xlab... | [((907, 949), 'pandas.set_option', 'pd.set_option', (['"""display.max_colwidth"""', '(200)'], {}), "('display.max_colwidth', 200)\n", (920, 949), True, 'import pandas as pd\n'), ((2075, 2188), 'pandas.read_csv', 'pd.read_csv', (['"""https://raw.githubusercontent.com/gabrielpreda/covid-19-tweets/master/covid19_tweets.cs... |
"""Code to embed a set of sequences in an embedding space using a trained protvec model and an embedding set of sequences. Creates a .csv file of the embedded sequences. Also returns file of sequences which could not be successfully embedded"""
import pickle
import numpy as np
from Bio import SeqIO
import pandas as ... | [
"numpy.mean",
"random.shuffle",
"pickle.load",
"numpy.array",
"Bio.SeqIO.index",
"numpy.std",
"pandas.DataFrame",
"numpy.all",
"warnings.filterwarnings",
"numpy.var"
] | [((414, 452), 'warnings.filterwarnings', 'warnings.filterwarnings', ([], {'action': '"""once"""'}), "(action='once')\n", (437, 452), False, 'import warnings\n'), ((4228, 4289), 'Bio.SeqIO.index', 'SeqIO.index', (['"""../sequences/bacillus_embeddingset.fa"""', '"""fasta"""'], {}), "('../sequences/bacillus_embeddingset.f... |
# evaluate a smoothed classifier on a dataset
import argparse
import datetime
import os
from time import time
from architectures import get_architecture
from core import Smooth
from datasets import get_dataset, DATASETS, get_num_classes
import torch
parser = argparse.ArgumentParser(description='Certify many examples... | [
"argparse.ArgumentParser",
"torch.load",
"datasets.get_num_classes",
"architectures.get_architecture",
"datetime.timedelta",
"time.time",
"datasets.get_dataset"
] | [((262, 322), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Certify many examples"""'}), "(description='Certify many examples')\n", (285, 322), False, 'import argparse\n'), ((1303, 1335), 'torch.load', 'torch.load', (['args.base_classifier'], {}), '(args.base_classifier)\n', (1313, 1335... |
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import json
import os
import unittest
import warnings
from monty.os.path import which
from monty.serialization import loadfn
from pymatgen.electronic_structure.bandstructure import BandStructure
from pymatgen.electronic_str... | [
"monty.os.path.which",
"pymatgen.electronic_structure.boltztrap.BoltztrapRunner",
"unittest.skipIf",
"json.dumps",
"os.path.join",
"json.load",
"warnings.simplefilter",
"pymatgen.electronic_structure.bandstructure.BandStructure.from_dict",
"unittest.main"
] | [((647, 663), 'monty.os.path.which', 'which', (['"""x_trans"""'], {}), "('x_trans')\n", (652, 663), False, 'from monty.os.path import which\n'), ((667, 710), 'unittest.skipIf', 'unittest.skipIf', (['(not x_trans)', '"""No x_trans."""'], {}), "(not x_trans, 'No x_trans.')\n", (682, 710), False, 'import unittest\n'), ((4... |
#!/usr/bin/env python
"""
Code to load an expert policy and generate roll-out data for behavioral cloning.
Example usage:
python dagger_pytorch.py experts/Humanoid-v1.pkl Humanoid-v2 --render \
--num_rollouts 20
Author of this script and included expert policies: <NAME> (<EMAIL>)
"""
import pickle
im... | [
"numpy.mean",
"numpy.reshape",
"random.shuffle",
"argparse.ArgumentParser",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"tensorflow.Session",
"load_policy.load_policy",
"tf_util.initialize",
"torch.FloatTensor",
"torch.max",
"torch.nn.MSELoss",
"matplo... | [((778, 821), 'load_policy.load_policy', 'load_policy.load_policy', (['expert_policy_file'], {}), '(expert_policy_file)\n', (801, 821), False, 'import load_policy\n'), ((2128, 2156), 'numpy.reshape', 'np.reshape', (['pair[0]', '(1, -1)'], {}), '(pair[0], (1, -1))\n', (2138, 2156), True, 'import numpy as np\n'), ((2168,... |
import curses
# un-insane-ify the screen so we can debug
debugging=False
def debug():
global debugging
if not debugging:
curses.nocbreak()
curses.echo()
curses.endwin()
debugging = True
def end_debug():
global debugging
stdscr = curses.initscr()
curses.noecho()
... | [
"curses.nocbreak",
"curses.endwin",
"curses.noecho",
"curses.initscr",
"curses.cbreak",
"curses.echo"
] | [((283, 299), 'curses.initscr', 'curses.initscr', ([], {}), '()\n', (297, 299), False, 'import curses\n'), ((304, 319), 'curses.noecho', 'curses.noecho', ([], {}), '()\n', (317, 319), False, 'import curses\n'), ((324, 339), 'curses.cbreak', 'curses.cbreak', ([], {}), '()\n', (337, 339), False, 'import curses\n'), ((140... |
from __future__ import absolute_import
import pkg_resources
__version__ = '0.3.0'
BASE_JAR = "pyleus-base.jar"
BASE_JAR_PATH = pkg_resources.resource_filename('pyleus', BASE_JAR)
| [
"pkg_resources.resource_filename"
] | [((130, 181), 'pkg_resources.resource_filename', 'pkg_resources.resource_filename', (['"""pyleus"""', 'BASE_JAR'], {}), "('pyleus', BASE_JAR)\n", (161, 181), False, 'import pkg_resources\n')] |
# coding=utf-8
# Copyright 2021 The TensorFlow Datasets Authors.
#
# 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 appl... | [
"tensorflow.io.FixedLenSequenceFeature",
"tensorflow_datasets.public_api.features.Image",
"tensorflow.ones",
"tensorflow.io.parse_single_example",
"tensorflow.concat",
"tensorflow.io.FixedLenFeature",
"tensorflow.ones_like",
"tensorflow.size"
] | [((4650, 4709), 'tensorflow.io.parse_single_example', 'tf.io.parse_single_example', (['tf_example', 'feature_description'], {}), '(tf_example, feature_description)\n', (4676, 4709), True, 'import tensorflow as tf\n'), ((4729, 4753), 'tensorflow.size', 'tf.size', (["data['actions']"], {}), "(data['actions'])\n", (4736, ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Wrapper service of Google Maps Directions API
"""
import os
import logging.config
import json
import requests
from flask import Flask, request
from flask_cors import CORS
LOGGING_CONF_FILE = 'logging.json'
DEFAULT_LOGGING_LVL = logging.INFO
path = LOGGING_CONF_FILE
va... | [
"os.path.exists",
"flask.request.args.get",
"flask_cors.CORS",
"os.getenv",
"flask.Flask",
"requests.get",
"json.load"
] | [((326, 352), 'os.getenv', 'os.getenv', (['"""LOG_CFG"""', 'None'], {}), "('LOG_CFG', None)\n", (335, 352), False, 'import os\n'), ((383, 403), 'os.path.exists', 'os.path.exists', (['path'], {}), '(path)\n', (397, 403), False, 'import os\n'), ((679, 694), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (684... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#File afsk1200lib.py
#Author <NAME>/M0ZJO
#Date 05/10/2019
#Desc. This is a physical layer decoder for UOSAT-2 AFSK
__author__ = "Jonathan/M0ZJO"
__copyright__ = "Jonathan/M0ZJO 2019"
__credits__ = ["Surrey University"]
__license__ = "MIT"
__versi... | [
"matplotlib.pyplot.grid",
"matplotlib.pyplot.ylabel",
"numpy.array",
"numpy.sin",
"logging.info",
"numpy.arange",
"numpy.mean",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.max",
"numpy.exp",
"wavio.read",
"scipy.signal.firwin",
"numpy.cos",
"matplotlib.pyplot.title",
"... | [((562, 628), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': '"""PyAFSK1200.log"""', 'level': 'logging.INFO'}), "(filename='PyAFSK1200.log', level=logging.INFO)\n", (581, 628), False, 'import logging\n'), ((1544, 1564), 'wavio.read', 'wavio.read', (['filename'], {}), '(filename)\n', (1554, 1564), False... |
import torch
from .adamw import AdamW
def init_optim(optim, params, lr, weight_decay):
if optim == 'adam':
return torch.optim.Adam(params, lr=lr, weight_decay=weight_decay)
elif optim == 'adamw':
return AdamW(params, lr=lr, weight_decay=weight_decay)
elif optim == 'amsgrad':
return... | [
"torch.optim.Adam",
"torch.optim.SGD",
"torch.optim.RMSprop"
] | [((128, 186), 'torch.optim.Adam', 'torch.optim.Adam', (['params'], {'lr': 'lr', 'weight_decay': 'weight_decay'}), '(params, lr=lr, weight_decay=weight_decay)\n', (144, 186), False, 'import torch\n'), ((321, 393), 'torch.optim.Adam', 'torch.optim.Adam', (['params'], {'lr': 'lr', 'weight_decay': 'weight_decay', 'amsgrad'... |
from typing import List
from fastapi import APIRouter, BackgroundTasks, Depends, HTTPException, Query
from sqlalchemy.orm import Session
from dispatch.auth.service import get_current_user
from dispatch.database import get_db, search_filter_sort_paginate
from .flows import (
incident_create_flow,
incident_act... | [
"fastapi.HTTPException",
"fastapi.APIRouter",
"fastapi.Query",
"fastapi.Depends",
"dispatch.database.search_filter_sort_paginate"
] | [((544, 555), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (553, 555), False, 'from fastapi import APIRouter, BackgroundTasks, Depends, HTTPException, Query\n'), ((761, 776), 'fastapi.Depends', 'Depends', (['get_db'], {}), '(get_db)\n', (768, 776), False, 'from fastapi import APIRouter, BackgroundTasks, Depends,... |
"""
Unit and regression test for the get_sequence_identity module of the molsysmt package on molsysmt MolSys molecular
systems.
"""
# Import package, test suite, and other packages as needed
import molsysmt as msm
import numpy as np
import math as math
# Distance between atoms in space and time
def test_get_sequence... | [
"math.isclose",
"molsysmt.topology.get_sequence_identity",
"numpy.array",
"numpy.all",
"molsysmt.convert"
] | [((364, 451), 'molsysmt.convert', 'msm.convert', (["msm.demo['T4 lysozyme L99A']['181l.msmpk']"], {'to_form': '"""molsysmt.MolSys"""'}), "(msm.demo['T4 lysozyme L99A']['181l.msmpk'], to_form=\n 'molsysmt.MolSys')\n", (375, 451), True, 'import molsysmt as msm\n'), ((462, 549), 'molsysmt.convert', 'msm.convert', (["ms... |
import os
from pprint import pprint
import requests
from flask import Flask, request
from flask.views import MethodView
from config import setting
from models import User
from apps import hitcon_zeroday
app = Flask(__name__)
class BotCommand:
def parse(self, dict_data):
if dict_data["text"] == "/start... | [
"flask.request.get_json",
"models.User",
"apps.hitcon_zeroday.App.as_view",
"flask.Flask"
] | [((213, 228), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (218, 228), False, 'from flask import Flask, request\n'), ((808, 854), 'models.User', 'User', (['username', 'first_name', 'last_name', 'chat_id'], {}), '(username, first_name, last_name, chat_id)\n', (812, 854), False, 'from models import User\n'... |
"""Used for scripting
These are used in other scripts and mostly require explicit input,
such as which specific nodes they apply to.
For interactive use, see :mod:`interactive.py`
"""
import sys
from maya import cmds
from . import util, lib
if sys.version_info[0] == 3:
basestring = str
# Flags
LocalSpace = ... | [
"maya.cmds.sets",
"maya.cmds.delete",
"maya.cmds.nodeType",
"maya.cmds.listRelatives",
"maya.cmds.parent",
"maya.cmds.listConnections",
"maya.cmds.createNode",
"maya.cmds.group",
"maya.cmds.setAttr",
"maya.cmds.select",
"maya.cmds.warning",
"maya.cmds.getAttr",
"maya.cmds.objExists",
"maya... | [((4766, 4800), 'maya.cmds.createNode', 'cmds.createNode', (['"""decomposeMatrix"""'], {}), "('decomposeMatrix')\n", (4781, 4800), False, 'from maya import cmds\n'), ((4823, 4852), 'maya.cmds.createNode', 'cmds.createNode', (['"""multMatrix"""'], {}), "('multMatrix')\n", (4838, 4852), False, 'from maya import cmds\n'),... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [
"os.path.exists",
"re.compile",
"shutil.which",
"os.path.join",
"os.environ.get",
"os.mkdir",
"shutil.rmtree",
"os.path.abspath"
] | [((3844, 3893), 're.compile', 're.compile', (['"""CMAKE_BUILD_TYPE:STRING=([a-zA-Z]+)"""'], {}), "('CMAKE_BUILD_TYPE:STRING=([a-zA-Z]+)')\n", (3854, 3893), False, 'import re\n'), ((1239, 1253), 'shutil.which', 'which', (['"""ninja"""'], {}), "('ninja')\n", (1244, 1253), False, 'from shutil import rmtree, which\n'), ((2... |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | [
"logging.exception",
"os.environ.get",
"flask.Flask"
] | [((715, 730), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (720, 730), False, 'from flask import Flask\n'), ((766, 825), 'os.environ.get', 'os.environ.get', (['"""MEMCACHE_PORT_11211_TCP_ADDR"""', '"""localhost"""'], {}), "('MEMCACHE_PORT_11211_TCP_ADDR', 'localhost')\n", (780, 825), False, 'import os\n'... |
import logging
# 这段打印日志的代码可以删掉, 感觉没什么用
logger = logging.getLogger(__name__)
logger.setLevel(level=logging.ERROR)
handle = logging.FileHandler('./log/partition_log.txt')
handle.setLevel(level=logging.ERROR)
fmt = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handle.setFormatter(fmt)
logger.a... | [
"logging.getLogger",
"logging.Formatter",
"logging.FileHandler"
] | [((49, 76), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (66, 76), False, 'import logging\n'), ((123, 169), 'logging.FileHandler', 'logging.FileHandler', (['"""./log/partition_log.txt"""'], {}), "('./log/partition_log.txt')\n", (142, 169), False, 'import logging\n'), ((213, 286), 'loggi... |
import copy
import logging
import os
import time
from collections import Counter
from statistics import mean
import numpy as np
import pandas as pd
from .fold_fitting_strategy import AbstractFoldFittingStrategy, SequentialLocalFoldFittingStrategy
from ..abstract.abstract_model import AbstractModel
from ...constants i... | [
"logging.getLogger",
"statistics.mean",
"numpy.where",
"collections.Counter",
"os.rmdir",
"numpy.zeros",
"copy.deepcopy",
"time.time",
"os.remove"
] | [((587, 614), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (604, 614), False, 'import logging\n'), ((4896, 4960), 'numpy.where', 'np.where', (['(oof_pred_model_repeats == 0)', '(1)', 'oof_pred_model_repeats'], {}), '(oof_pred_model_repeats == 0, 1, oof_pred_model_repeats)\n', (4904, 496... |
"""
Interfacing with the Student Web Service, Enrollment resource.
"""
import logging
from restclients.pws import PWS
from restclients.models.sws import Term
from restclients.models.sws import StudentGrades, StudentCourseGrade
from restclients.models.sws import Enrollment, Major, Minor
from restclients.sws import get_r... | [
"logging.getLogger",
"restclients.sws.section.get_section_by_url",
"restclients.sws.get_resource",
"restclients.models.sws.Major",
"restclients.models.sws.StudentGrades",
"restclients.models.sws.Minor",
"restclients.pws.PWS",
"restclients.models.sws.StudentCourseGrade",
"restclients.models.sws.Enrol... | [((394, 421), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (411, 421), False, 'import logging\n'), ((899, 914), 'restclients.models.sws.StudentGrades', 'StudentGrades', ([], {}), '()\n', (912, 914), False, 'from restclients.models.sws import StudentGrades, StudentCourseGrade\n'), ((1841... |
# SPDX-Copyright: Copyright (c) Capital One Services, LLC
# SPDX-License-Identifier: Apache-2.0
# Copyright 2020 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | [
"celpy.__main__.arg_type_value",
"unittest.mock.Mock",
"celpy.CELEvalError",
"celpy.__main__.get_options",
"celpy.celtypes.BoolType",
"unittest.mock.call",
"celpy.celtypes.IntType",
"celpy.celtypes.StringType",
"argparse.Namespace",
"celpy.__main__.CEL_REPL",
"celpy.__main__.main",
"io.StringI... | [((1938, 2009), 'celpy.__main__.get_options', 'celpy.__main__.get_options', (["['--arg', 'name:int=42', '-n', '355./113.']"], {}), "(['--arg', 'name:int=42', '-n', '355./113.'])\n", (1964, 2009), False, 'import celpy\n'), ((2185, 2242), 'celpy.__main__.get_options', 'celpy.__main__.get_options', (['[\'-v\', \'-n\', \'"... |
'''
WIP - pulled directly from workflow-deeplabcut
'''
import csv
import ruamel.yaml as yaml
from element_interface.utils import find_full_path
from ..pipeline import train, model
from ..paths import get_dlc_root_data_dir
def ingest_general(csvs, tables, verbose=True, skip_duplicates=True):
"""
Inserts data ... | [
"csv.DictReader",
"ruamel.yaml.safe_load"
] | [((2134, 2166), 'csv.DictReader', 'csv.DictReader', (['f'], {'delimiter': '""","""'}), "(f, delimiter=',')\n", (2148, 2166), False, 'import csv\n'), ((2564, 2581), 'ruamel.yaml.safe_load', 'yaml.safe_load', (['y'], {}), '(y)\n', (2578, 2581), True, 'import ruamel.yaml as yaml\n'), ((786, 818), 'csv.DictReader', 'csv.Di... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Tag'
db.create_table(u'unisender_tag', (
(u'i... | [
"south.db.db.send_create_signal",
"django.db.models.ForeignKey",
"south.db.db.shorten_name",
"south.db.db.create_unique",
"django.db.models.AutoField",
"south.db.db.delete_table",
"south.utils.datetime_utils.datetime"
] | [((806, 850), 'south.db.db.send_create_signal', 'db.send_create_signal', (['u"""unisender"""', "['Tag']"], {}), "(u'unisender', ['Tag'])\n", (827, 850), False, 'from south.db import db\n'), ((1713, 1759), 'south.db.db.send_create_signal', 'db.send_create_signal', (['u"""unisender"""', "['Field']"], {}), "(u'unisender',... |
"""
<NAME>
University of Manitoba
July 30th, 2019
"""
import numpy as np
###############################################################################
def shuffle_arrays(arrays_list, rand_seed=0, return_seed=False):
"""Shuffle arrays to maintain inter-array ordering
Shuffles each array in t... | [
"numpy.ones_like",
"numpy.size",
"numpy.max",
"numpy.random.seed",
"numpy.shape",
"numpy.random.shuffle"
] | [((2407, 2425), 'numpy.ones_like', 'np.ones_like', (['data'], {}), '(data)\n', (2419, 2425), True, 'import numpy as np\n'), ((1164, 1189), 'numpy.random.seed', 'np.random.seed', (['rand_seed'], {}), '(rand_seed)\n', (1178, 1189), True, 'import numpy as np\n'), ((1558, 1589), 'numpy.random.shuffle', 'np.random.shuffle',... |
# -*- coding: UTF-8 -*-
from .ldata import bitPosArray, fileBits, rankBits, moveArray
from .bitboard import firstBit, iterBits
from .validator import validateMove
from pychess.Utils.const import (
SAN,
AN,
LAN,
ENPASSANT,
EMPTY,
PAWN,
KING_CASTLE,
QUEEN_CASTLE,
reprFile,
reprRa... | [
"pychess.Utils.lutils.lmovegen.genAllMoves",
"pychess.Utils.lutils.lmovegen.genPieceMoves",
"pychess.Utils.lutils.lmovegen.newMove",
"pychess.Variants.atomic.kingExplode"
] | [((24006, 24033), 'pychess.Utils.lutils.lmovegen.newMove', 'newMove', (['fcord', 'tcord', 'flag'], {}), '(fcord, tcord, flag)\n', (24013, 24033), False, 'from pychess.Utils.lutils.lmovegen import genAllMoves, genPieceMoves, newMove\n'), ((27754, 27781), 'pychess.Utils.lutils.lmovegen.newMove', 'newMove', (['fcord', 'tc... |
import click
APP_ID_LEN = 26
STATUS_TEXT_LEN = 4
STATUS_COUNT_LEN = 5
def _app_id_text(name, status):
if status == 'UP':
return click.style(name.lower().rjust(APP_ID_LEN), fg='yellow')
else:
return click.style(name.lower().rjust(APP_ID_LEN), fg='red')
def _status_text(count, status):
co... | [
"click.echo",
"click.unstyle",
"click.style"
] | [((1450, 1521), 'click.echo', 'click.echo', (["(name_text + '\\t' + style_text_up + '\\t' + up_instances_text)"], {}), "(name_text + '\\t' + style_text_up + '\\t' + up_instances_text)\n", (1460, 1521), False, 'import click\n'), ((1589, 1674), 'click.echo', 'click.echo', (["(name_text_down + '\\t' + style_text_down + '\... |
import os
from peewee import IntegrityError
from playhouse.berkeleydb import *
from playhouse.tests.base import database_initializer
from playhouse.tests.base import ModelTestCase
database = database_initializer.get_database('berkeleydb')
class BaseModel(Model):
class Meta:
database = database
class Per... | [
"playhouse.tests.base.database_initializer.get_database"
] | [((193, 240), 'playhouse.tests.base.database_initializer.get_database', 'database_initializer.get_database', (['"""berkeleydb"""'], {}), "('berkeleydb')\n", (226, 240), False, 'from playhouse.tests.base import database_initializer\n')] |
# Generated by Django 2.2.19 on 2021-03-19 10:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ucsrb', '0025_auto_20210317_1105'),
]
operations = [
migrations.AddField(
model_name='streamflowreading',
name='seg... | [
"django.db.models.CharField"
] | [((348, 454), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'default': 'None', 'max_length': '(30)', 'null': '(True)', 'verbose_name': '"""Streat Segment ID"""'}), "(blank=True, default=None, max_length=30, null=True,\n verbose_name='Streat Segment ID')\n", (364, 454), False, 'from djang... |
#================================================================
#
# File name : utils.py
# Author : PyLessons
# Created date: 2020-09-27
# Website : https://pylessons.com/
# GitHub : https://github.com/pythonlessons/TensorFlow-2.x-YOLOv3
# Description : additional yolov3 and yolov4 functio... | [
"cv2.rectangle",
"numpy.product",
"numpy.fromfile",
"tensorflow.shape",
"numpy.multiply.reduce",
"multiprocessing.Process",
"colorsys.hsv_to_rgb",
"cv2.imshow",
"numpy.array",
"cv2.destroyAllWindows",
"tensorflow.saved_model.load",
"cv2.VideoWriter",
"numpy.exp",
"tensorflow.concat",
"nu... | [((698, 730), 'tensorflow.keras.backend.clear_session', 'tf.keras.backend.clear_session', ([], {}), '()\n', (728, 730), True, 'import tensorflow as tf\n'), ((2930, 2981), 'tensorflow.config.experimental.list_physical_devices', 'tf.config.experimental.list_physical_devices', (['"""GPU"""'], {}), "('GPU')\n", (2974, 2981... |
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | [
"mxnet.nd.random.uniform",
"gluonts.mx.distribution.Binned",
"numpy.ones",
"mxnet.nd.ones",
"mxnet.random.uniform",
"itertools.product",
"pytest.mark.parametrize",
"mxnet.nd.arange",
"mxnet.nd.array",
"gluonts.mx.distribution.BinnedOutput"
] | [((2927, 2978), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""hybridize"""', '[True, False]'], {}), "('hybridize', [True, False])\n", (2950, 2978), False, 'import pytest\n'), ((993, 1038), 'mxnet.random.uniform', 'mx.random.uniform', ([], {'low': '(-6)', 'high': '(1)', 'shape': '(2,)'}), '(low=-6, high=1,... |
import click
import ujson
import bbscript
from bbscript.flags import RepeatStatement
def test_input(ctx):
"""
To get custom user input!
input: Yes/No
If yes
it stores value in user_input of context
"""
if ctx.get("user_input"):
print("We got: ", ctx.get("user_input"))
return
val = input("Say y... | [
"click.group",
"click.option",
"bbscript.Runtime",
"bbscript.flags.RepeatStatement",
"ujson.load"
] | [((401, 414), 'click.group', 'click.group', ([], {}), '()\n', (412, 414), False, 'import click\n'), ((449, 507), 'click.option', 'click.option', (['"""--path"""'], {'help': '"""A bbscript json file to run"""'}), "('--path', help='A bbscript json file to run')\n", (461, 507), False, 'import click\n'), ((381, 398), 'bbsc... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from django.contrib import admin
from django.contrib.admin import ModelAdmin
from .models import TableStorage
@admin.register(TableStorage)
class ICustomFieldHolder(ModelAdmin):
list_display = ('field', 'value')
| [
"django.contrib.admin.register"
] | [((212, 240), 'django.contrib.admin.register', 'admin.register', (['TableStorage'], {}), '(TableStorage)\n', (226, 240), False, 'from django.contrib import admin\n')] |
from time import sleep
from PyQt5.QtCore import pyqtSignal, Qt
from PyQt5.QtWidgets import QMessageBox, QDialog
from gui.file_transfer import Ui_FileTransferDialog
from src.logic.file_transfer import FileTransfer
class FileTransferDialog(QDialog, Ui_FileTransferDialog):
_update_signal = pyqtSignal()
#FIXME... | [
"PyQt5.QtWidgets.QMessageBox",
"PyQt5.QtCore.pyqtSignal",
"time.sleep"
] | [((296, 308), 'PyQt5.QtCore.pyqtSignal', 'pyqtSignal', ([], {}), '()\n', (306, 308), False, 'from PyQt5.QtCore import pyqtSignal, Qt\n'), ((1560, 1573), 'PyQt5.QtWidgets.QMessageBox', 'QMessageBox', ([], {}), '()\n', (1571, 1573), False, 'from PyQt5.QtWidgets import QMessageBox, QDialog\n'), ((1806, 1816), 'time.sleep'... |
# Generated by Django 2.2.2 on 2019-08-07 00:36
from django.db import migrations, models
from .. import twitch
def gen_usernames(apps, schema_editor):
TwitchUser = apps.get_model('classic_tetris_project', 'TwitchUser')
for twitch_user in TwitchUser.objects.all():
twitch_user.username = twitch.client.... | [
"django.db.migrations.RunPython",
"django.db.models.CharField"
] | [((752, 827), 'django.db.migrations.RunPython', 'migrations.RunPython', (['gen_usernames'], {'reverse_code': 'migrations.RunPython.noop'}), '(gen_usernames, reverse_code=migrations.RunPython.noop)\n', (772, 827), False, 'from django.db import migrations, models\n'), ((652, 695), 'django.db.models.CharField', 'models.Ch... |
import sys, os, subprocess, importlib
import numpy as np
import ctypes
__all__ = ['Potential', 'TTM', 'MBPol']
class Potential:
"""Abstract base class for potential energy surfaces. A single function, evaluate(),
must be implemented which returns the energy and gradients.
Each child class needs... | [
"sys.path.insert",
"ctypes.c_int32",
"importlib.import_module",
"ctypes.POINTER",
"ctypes.cdll.LoadLibrary",
"numpy.reshape",
"numpy.asarray",
"os.getcwd",
"os.chdir",
"numpy.array",
"numpy.zeros",
"numpy.ctypeslib.ndpointer",
"numpy.ascontiguousarray",
"sys.exit",
"numpy.shape",
"nump... | [((1302, 1313), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1311, 1313), False, 'import sys, os, subprocess, importlib\n'), ((5504, 5534), 'os.chdir', 'os.chdir', (['self.path_to_library'], {}), '(self.path_to_library)\n', (5512, 5534), False, 'import sys, os, subprocess, importlib\n'), ((5653, 5676), 'os.chdir', 'os.... |
#!/usr/bin/env python
import sys
from cvangysel import argparse_utils, logging_utils
import argparse
import logging
import matplotlib.cm as cm
import matplotlib.markers as markers
import matplotlib.pyplot as plt
import numpy as np
import os
import pylatex.utils
import pyndri
from sklearn.manifold import TSNE
import... | [
"numpy.copy",
"pyndri.Index",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.savefig",
"argparse.ArgumentParser",
"nvsm.load_meta",
"matplotlib.pyplot.gca",
"os.path.splitext",
"matplotlib.pyplot.style.use",
"sklearn.manifold.TSNE",
"cvangysel.logging_utils.configure_logging",
"os.path.basename"... | [((682, 707), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (705, 707), False, 'import argparse\n'), ((2335, 2355), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""bmh"""'], {}), "('bmh')\n", (2348, 2355), True, 'import matplotlib.pyplot as plt\n'), ((2361, 2391), 'logging.info', 'loggin... |
# coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
from __future__ import print_function
# import os
import sys
import copy
import numpy as np
from collections import Orde... | [
"numpy.copy",
"collections.OrderedDict",
"numpy.delete",
"numpy.equal",
"numpy.append",
"numpy.array"
] | [((3044, 3057), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (3055, 3057), False, 'from collections import OrderedDict, Sequence\n'), ((11675, 11713), 'numpy.delete', 'np.delete', (['self._lists[k]', 'key'], {'axis': '(0)'}), '(self._lists[k], key, axis=0)\n', (11684, 11713), True, 'import numpy as np\n'... |
from uqcsbot import bot, Command
@bot.on_command("cookbook")
def handle_cookbook(command: Command):
bot.post_message(command.channel, "https://github.com/UQComputingSociety/cookbook")
| [
"uqcsbot.bot.on_command",
"uqcsbot.bot.post_message"
] | [((36, 62), 'uqcsbot.bot.on_command', 'bot.on_command', (['"""cookbook"""'], {}), "('cookbook')\n", (50, 62), False, 'from uqcsbot import bot, Command\n'), ((106, 193), 'uqcsbot.bot.post_message', 'bot.post_message', (['command.channel', '"""https://github.com/UQComputingSociety/cookbook"""'], {}), "(command.channel,\n... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License... | [
"odps.tests.core.to_str",
"odps.compat.unittest.main"
] | [((2397, 2412), 'odps.compat.unittest.main', 'unittest.main', ([], {}), '()\n', (2410, 2412), False, 'from odps.compat import unittest\n'), ((1853, 1868), 'odps.tests.core.to_str', 'to_str', (['got_xml'], {}), '(got_xml)\n', (1859, 1868), False, 'from odps.tests.core import TestBase, to_str\n'), ((1870, 1905), 'odps.te... |
# The Hazard Library
# Copyright (C) 2012-2018 GEM Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#... | [
"numpy.exp",
"numpy.dot"
] | [((5955, 5986), 'numpy.exp', 'numpy.exp', (['(-3.0 / b * distances)'], {}), '(-3.0 / b * distances)\n', (5964, 5986), False, 'import numpy\n'), ((3573, 3600), 'numpy.dot', 'numpy.dot', (['corma', 'residuals'], {}), '(corma, residuals)\n', (3582, 3600), False, 'import numpy\n')] |
# !/usr/bin/python
# -*- coding: utf-8 -*-
# @time : 2020/5/7 21:06
# @author : Mo
# @function: CharCNN [Character-level Convolutional Networks for Text Classification](https://arxiv.org/pdf/1509.01626.pdf)
from macadam.base.graph import graph
from macadam import K, L, M, O
class CharCNNGraph(graph):
def __... | [
"macadam.L.MaxPooling1D",
"macadam.L.Dense",
"macadam.M.Model",
"macadam.L.Flatten",
"macadam.L.ThresholdedReLU",
"macadam.L.Convolution1D",
"macadam.L.Dropout"
] | [((1619, 1663), 'macadam.M.Model', 'M.Model', ([], {'inputs': 'inputs', 'outputs': 'self.outputs'}), '(inputs=inputs, outputs=self.outputs)\n', (1626, 1663), False, 'from macadam import K, L, M, O\n'), ((1271, 1282), 'macadam.L.Flatten', 'L.Flatten', ([], {}), '()\n', (1280, 1282), False, 'from macadam import K, L, M, ... |
# BSD 3-Clause License.
#
# Copyright (c) 2019-2021 <NAME>. All rights reserved.
#
# 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 ... | [
"gpflow.mean_functions.Zero"
] | [((2752, 2758), 'gpflow.mean_functions.Zero', 'Zero', ([], {}), '()\n', (2756, 2758), False, 'from gpflow.mean_functions import MeanFunction, Zero\n')] |
# Generated by Django 2.0 on 2017-12-11 04:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('podcast', '0028_auto_20171211_0424'),
]
operations = [
migrations.AlterField(
model_name='show',
name='managing_editor... | [
"django.db.models.EmailField"
] | [((341, 455), 'django.db.models.EmailField', 'models.EmailField', ([], {'help_text': '"""E-mail of administrative contact"""', 'max_length': '(255)', 'verbose_name': '"""editor e-mail"""'}), "(help_text='E-mail of administrative contact', max_length=\n 255, verbose_name='editor e-mail')\n", (358, 455), False, 'from ... |
from re import sub
import emoji
from sentry_sdk import capture_message
import datetime
import bot_parser
import config
from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engine
import db_ops
engine = create_engine(config.DATABASE_URI)
Session = sessionmaker(bind=engine)
s = Session()
def tabulate... | [
"sqlalchemy.orm.sessionmaker",
"db_ops.find_bill",
"db_ops.create_vote",
"datetime.datetime.utcnow",
"sqlalchemy.create_engine",
"db_ops.update_thread",
"db_ops.find_thread",
"emoji.emojize",
"bot_parser.parse_vote",
"db_ops.find_user"
] | [((221, 255), 'sqlalchemy.create_engine', 'create_engine', (['config.DATABASE_URI'], {}), '(config.DATABASE_URI)\n', (234, 255), False, 'from sqlalchemy import create_engine\n'), ((266, 291), 'sqlalchemy.orm.sessionmaker', 'sessionmaker', ([], {'bind': 'engine'}), '(bind=engine)\n', (278, 291), False, 'from sqlalchemy.... |
#setting sys.path for importing modules
import os
import sys
if __name__ == "__main__":
abspath= os.getcwd()
parent_module= os.path.join(abspath.split("LSTrAP-denovo")[0], "LSTrAP-denovo")
sys.path.insert(0, parent_module)
import subprocess
from setup import constants
def launch_fast... | [
"sys.path.insert",
"os.getcwd"
] | [((105, 116), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (114, 116), False, 'import os\n'), ((213, 246), 'sys.path.insert', 'sys.path.insert', (['(0)', 'parent_module'], {}), '(0, parent_module)\n', (228, 246), False, 'import sys\n')] |
"""
A pytest module to test the functions in _math.py.
"""
import galois
def test_prod():
assert galois.prod(2, 4, 14) == 2*4*14
| [
"galois.prod"
] | [((103, 124), 'galois.prod', 'galois.prod', (['(2)', '(4)', '(14)'], {}), '(2, 4, 14)\n', (114, 124), False, 'import galois\n')] |
import unittest
import time
from tir import Webapp
from datetime import datetime
DateSystem = datetime.today().strftime('%d/%m/%Y')
"""-------------------------------------------------------------------
/*/{Protheus.doc} FINA560TestCase
TIR - Casos de testes da rotina movimentos de caixinha
@author <NAME>
@since 23/... | [
"unittest.main",
"datetime.datetime.today",
"tir.Webapp"
] | [((1982, 1997), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1995, 1997), False, 'import unittest\n'), ((95, 111), 'datetime.datetime.today', 'datetime.today', ([], {}), '()\n', (109, 111), False, 'from datetime import datetime\n'), ((640, 648), 'tir.Webapp', 'Webapp', ([], {}), '()\n', (646, 648), False, 'from... |
import pandas as pd
def preprocess():
train_data = pd.read_csv("datasets/adult/adult.data", sep = ', ', header=None, names = ('age', 'workclass', 'fnlwgt', 'education', 'education-num', 'marital-status',
'occupation', 'relationship', 'race', 'sex', 'capital-gain', 'capital-loss',
'hours-per-... | [
"pandas.get_dummies",
"pandas.concat",
"pandas.read_csv"
] | [((59, 361), 'pandas.read_csv', 'pd.read_csv', (['"""datasets/adult/adult.data"""'], {'sep': '""", """', 'header': 'None', 'names': "('age', 'workclass', 'fnlwgt', 'education', 'education-num',\n 'marital-status', 'occupation', 'relationship', 'race', 'sex',\n 'capital-gain', 'capital-loss', 'hours-per-week', 'na... |
# db/db.py
import sqlite3
from os.path import join, split
# this file is external to the code
SQLITE_DATABASE_NAME = 'sqlite-sakila.sq'
def dictionary_factory(cursor, row):
"""
Create a dictionary from rows in a cursor result.
The keys will be the column names
:param cursor a cursor from which a query row ... | [
"sqlite3.connect"
] | [((612, 634), 'sqlite3.connect', 'sqlite3.connect', (['fname'], {}), '(fname)\n', (627, 634), False, 'import sqlite3\n')] |
"""Unit tests for the :mod:`networkx.generators.random_graphs` module."""
import networkx as nx
import pytest
_gnp_generators = [
nx.gnp_random_graph,
nx.fast_gnp_random_graph,
nx.binomial_graph,
nx.erdos_renyi_graph,
]
@pytest.mark.parametrize("generator", _gnp_generators)
@pytest.mark.parametrize(... | [
"networkx.barabasi_albert_graph",
"networkx.random_powerlaw_tree_sequence",
"networkx.random_powerlaw_tree",
"networkx.dense_gnm_random_graph",
"networkx.connected_watts_strogatz_graph",
"networkx.random_regular_graph",
"networkx.random_kernel_graph",
"networkx.watts_strogatz_graph",
"networkx.dual_... | [((241, 294), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""generator"""', '_gnp_generators'], {}), "('generator', _gnp_generators)\n", (264, 294), False, 'import pytest\n'), ((296, 346), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""directed"""', '(True, False)'], {}), "('directed', (True, ... |
# -*-coding:Utf-8 -*
# Copyright (c) 2010 <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of cond... | [
"traceback.format_exc",
"sys.exit"
] | [((6403, 6414), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (6411, 6414), False, 'import sys\n'), ((6536, 6547), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (6544, 6547), False, 'import sys\n'), ((8959, 8981), 'traceback.format_exc', 'traceback.format_exc', ([], {}), '()\n', (8979, 8981), False, 'import traceba... |
from time import sleep
print(' Olá programa feito para brinar om números ')
sleep(3)
n1 = int(input('Primeiro valor'))
n2 = int(input('Segundo valor'))
opção = 0
while opção != 5:
print('''[1] SOMAR
[2] MULTIPLICAR
[3] MAIOR
[4] NOVOS NÚMEROS
[5] SAIR DO PROGRAMA ''')
opção = int(inp... | [
"time.sleep"
] | [((78, 86), 'time.sleep', 'sleep', (['(3)'], {}), '(3)\n', (83, 86), False, 'from time import sleep\n'), ((462, 470), 'time.sleep', 'sleep', (['(3)'], {}), '(3)\n', (467, 470), False, 'from time import sleep\n'), ((608, 616), 'time.sleep', 'sleep', (['(3)'], {}), '(3)\n', (613, 616), False, 'from time import sleep\n'),... |
from toolchain import Recipe, shprint, ensure_dir
from os.path import join, exists
import os
import sh
import shutil
class Hostpython2Recipe(Recipe):
version = "2.7.1"
url = "https://www.python.org/ftp/python/{version}/Python-{version}.tar.bz2"
depends = ["hostlibffi"]
optional_depends = ["openssl"]
... | [
"toolchain.shprint",
"os.path.exists",
"shutil.move",
"os.path.join",
"sh.xcrun",
"shutil.rmtree"
] | [((539, 593), 'os.path.join', 'join', (['self.ctx.dist_dir', '"""hostpython"""', '"""bin"""', '"""python"""'], {}), "(self.ctx.dist_dir, 'hostpython', 'bin', 'python')\n", (543, 593), False, 'from os.path import join, exists\n'), ((622, 674), 'os.path.join', 'join', (['self.ctx.dist_dir', '"""hostpython"""', '"""bin"""... |
#!/usr/bin/python
"""
This module contains an OpenSoundControl implementation (in Pure Python), based
(somewhat) on the good old 'SimpleOSC' implementation by <NAME> & <NAME>.
This implementation is intended to still be 'simple' to the user, but much more
complete (with OSCServer & OSCClient classes) and much more pow... | [
"re.compile",
"time.sleep",
"calendar.timegm",
"sys.exc_info",
"time.ctime",
"socketserver.TCPServer.__init__",
"threading.Lock",
"socketserver.StreamRequestHandler.__init__",
"socketserver.StreamRequestHandler.finish",
"socketserver.StreamRequestHandler.setup",
"struct.pack_into",
"math.modf"... | [((7126, 7155), 'calendar.timegm', 'timegm', (['(1900, 1, 1, 0, 0, 0)'], {}), '((1900, 1, 1, 0, 0, 0))\n', (7132, 7155), False, 'from calendar import timegm\n'), ((24402, 24433), 'struct.unpack', 'struct.unpack', (['""">ll"""', 'data[0:8]'], {}), "('>ll', data[0:8])\n", (24415, 24433), False, 'import math, re, socket, ... |
from rest_framework.test import APIClient
from tests.app.serializers import QuoteSerializer
from tests.utils import decode_content
def test_list_response_unfiltered():
response = APIClient().get('/quotes/')
expected = [
{
'character': 'Customer',
'line': "It's certainly uncont... | [
"tests.utils.decode_content",
"tests.app.serializers.QuoteSerializer",
"rest_framework.test.APIClient"
] | [((558, 582), 'tests.utils.decode_content', 'decode_content', (['response'], {}), '(response)\n', (572, 582), False, 'from tests.utils import decode_content\n'), ((881, 905), 'tests.utils.decode_content', 'decode_content', (['response'], {}), '(response)\n', (895, 905), False, 'from tests.utils import decode_content\n'... |
from __future__ import absolute_import, division, print_function
import os
from idaskins import UI_DIR
from PyQt5 import uic
from PyQt5.Qt import qApp
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QCursor, QFont, QKeySequence
from PyQt5.QtWidgets import QShortcut, QWidget
Ui_ObjectInspector, ObjectInspectorBas... | [
"PyQt5.QtGui.QKeySequence",
"os.path.join",
"PyQt5.QtGui.QFont",
"PyQt5.QtGui.QCursor.pos"
] | [((344, 386), 'os.path.join', 'os.path.join', (['UI_DIR', '"""ObjectInspector.ui"""'], {}), "(UI_DIR, 'ObjectInspector.ui')\n", (356, 386), False, 'import os\n'), ((846, 864), 'PyQt5.QtGui.QFont', 'QFont', (['"""Monospace"""'], {}), "('Monospace')\n", (851, 864), False, 'from PyQt5.QtGui import QCursor, QFont, QKeySequ... |
#!/usr/bin/python
import os.path
import subprocess
import sys
#./query_sequencer.py 192.168.100.75:9200 test_suites/paths/math/K/ccss_add_path_Math_K.json
hostname = sys.argv[1]
hostport = sys.argv[2]
pathsFile = sys.argv[3]
fh = open(pathsFile)
lines = fh.readlines()
pathFiles = []
for line in lines:
line = li... | [
"subprocess.Popen"
] | [((628, 725), 'subprocess.Popen', 'subprocess.Popen', (['args'], {'stdin': 'subprocess.PIPE', 'stdout': 'subprocess.PIPE', 'stderr': 'subprocess.PIPE'}), '(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE,\n stderr=subprocess.PIPE)\n', (644, 725), False, 'import subprocess\n')] |
muon_container = '{{calib.muon_collection}}'
from MuonAnalysisAlgorithms.MuonAnalysisSequence import makeMuonAnalysisSequence
muonSequence = makeMuonAnalysisSequence('mc', workingPoint='{{calib.muon_working_point}}.{{calib.muon_isolation}}', postfix = '{{calib.muon_working_point}}_{{calib.muon_isolation}}')
muonSequenc... | [
"MuonAnalysisAlgorithms.MuonAnalysisSequence.makeMuonAnalysisSequence"
] | [((141, 316), 'MuonAnalysisAlgorithms.MuonAnalysisSequence.makeMuonAnalysisSequence', 'makeMuonAnalysisSequence', (['"""mc"""'], {'workingPoint': '"""{{calib.muon_working_point}}.{{calib.muon_isolation}}"""', 'postfix': '"""{{calib.muon_working_point}}_{{calib.muon_isolation}}"""'}), "('mc', workingPoint=\n '{{calib... |
# -*- coding: utf-8 -*-
#
import os
import logging # noqa
import numpy as np
import concurrent.futures
from concurrent.futures import ThreadPoolExecutor
from module.MMath import MRect, MVector3D, MVector4D, MQuaternion, MMatrix4x4 # noqa
from module.MOptions import MOptions, MOptionsDataSet
from utils import MServiceU... | [
"traceback.format_exc",
"utils.MServiceUtils.calc_global_pos",
"utils.MLogger.MLogger",
"module.MMath.MVector3D",
"os.path.basename"
] | [((461, 499), 'utils.MLogger.MLogger', 'MLogger', (['__name__'], {'level': 'logging.DEBUG'}), '(__name__, level=logging.DEBUG)\n', (468, 499), False, 'from utils.MLogger import MLogger\n'), ((3060, 3167), 'utils.MServiceUtils.calc_global_pos', 'MServiceUtils.calc_global_pos', (['data_set.rep_model', 'bone_link', 'data_... |
#!/usr/bin/env python3
import socket
# GET a definition from the dictionary
def get_defition(reply_split):
arg = reply_split[1] # Will only return the first definition if multiple are passed
if arg in defs.keys():
definition = str(defs[arg])
# Respond to the client with the definition
... | [
"socket.socket"
] | [((1707, 1756), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (1720, 1756), False, 'import socket\n')] |
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
# Compare substitution pairs from kaldi ops file.
# Check the BÍN database if the words possibly belong to the same lemma, indicating that the error
# is not as severe as when the substituted word is a representation of another lemma
#
# Important remark:
# - Before runnin... | [
"argparse.FileType",
"verification.verify_input",
"argparse.ArgumentParser",
"time.strftime",
"categories.Categories",
"os.mkdir"
] | [((4369, 4381), 'categories.Categories', 'Categories', ([], {}), '()\n', (4379, 4381), False, 'from categories import Categories\n'), ((5807, 5964), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Compare words in substitution ops - same lemma or not"""', 'formatter_class': 'argparse.Argu... |
import ray
import unittest
import numpy as np
from ray.rllib.agents.callbacks import DefaultCallbacks
from ray.rllib.env.multi_agent_env import MultiAgentEnv
from ray.rllib.evaluation.rollout_worker import RolloutWorker
from ray.rllib.examples.env.mock_env import MockEnv3
from ray.rllib.policy import Policy
from ray.rl... | [
"unittest.TestCase",
"ray.shutdown",
"numpy.where",
"pytest.main",
"ray.rllib.utils.override",
"ray.rllib.examples.env.mock_env.MockEnv3",
"ray.init"
] | [((2200, 2216), 'ray.rllib.utils.override', 'override', (['Policy'], {}), '(Policy)\n', (2208, 2216), False, 'from ray.rllib.utils import override\n'), ((512, 531), 'unittest.TestCase', 'unittest.TestCase', ([], {}), '()\n', (529, 531), False, 'import unittest\n'), ((3575, 3595), 'ray.init', 'ray.init', ([], {'num_cpus... |
import abc
import numpy as np
import copy
import csv
import os
from beluga.liepack import *
# The following math import statements appear to be unused, but they are required on import of the specific
# methods since an eval() is called
from math import sqrt
class Method(object):
"""
Class containing informati... | [
"os.path.abspath",
"numpy.array",
"copy.copy",
"csv.reader"
] | [((968, 1021), 'numpy.array', 'np.array', (["self.data[self.name]['a']"], {'dtype': 'np.float64'}), "(self.data[self.name]['a'], dtype=np.float64)\n", (976, 1021), True, 'import numpy as np\n'), ((1041, 1094), 'numpy.array', 'np.array', (["self.data[self.name]['b']"], {'dtype': 'np.float64'}), "(self.data[self.name]['b... |
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.http import HttpResponseForbidden, JsonResponse
from django.shortcuts import get_object_or_404
from django.template.loader import render_to_string
from django.views.generic import View
from .categories import catego... | [
"django.http.HttpResponseForbidden",
"django.template.loader.render_to_string",
"django.http.JsonResponse"
] | [((2073, 2091), 'django.http.JsonResponse', 'JsonResponse', (['data'], {}), '(data)\n', (2085, 2091), False, 'from django.http import HttpResponseForbidden, JsonResponse\n'), ((1126, 1211), 'django.http.HttpResponseForbidden', 'HttpResponseForbidden', (['"""Invalid category. It must match a preconfigured setting"""'], ... |
import sys
import nltk
import re
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import RegexpTokenizer
from nltk.corpus import stopwords
from nltk.corpus import brown
from autocorrect import Speller
sys.path.append("./../")
from services.database_service import (data_basis_query, get_number_of_links_to_be... | [
"nltk.corpus.stopwords.words",
"nltk.word_tokenize",
"autocorrect.Speller",
"nltk.stem.WordNetLemmatizer",
"re.sub",
"sys.path.append"
] | [((212, 236), 'sys.path.append', 'sys.path.append', (['"""./../"""'], {}), "('./../')\n", (227, 236), False, 'import sys\n'), ((1272, 1311), 're.sub', 're.sub', (['"""([^a-zA-Z0-9\\\\s]+?)"""', '""""""', 'text'], {}), "('([^a-zA-Z0-9\\\\s]+?)', '', text)\n", (1278, 1311), False, 'import re\n'), ((1422, 1449), 'nltk.wor... |
# -*- coding: utf-8 -*-
import base64
import copy
import json
import yaml
from yaml.scanner import ScannerError
from iparrot.modules.helper import *
from iparrot.modules.logger import logger, set_logger
# refer to https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers
PUBLIC_HEADERS = [
'accept',
'accept... | [
"json.loads",
"yaml.dump",
"json.dumps",
"base64.b64decode",
"iparrot.modules.logger.set_logger",
"copy.deepcopy",
"iparrot.modules.logger.logger.info"
] | [((42118, 42151), 'iparrot.modules.logger.set_logger', 'set_logger', ([], {'mode': '(1)', 'level': '"""debug"""'}), "(mode=1, level='debug')\n", (42128, 42151), False, 'from iparrot.modules.logger import logger, set_logger\n'), ((6090, 6110), 'iparrot.modules.logger.logger.info', 'logger.info', (['"""Done."""'], {}), "... |
from tkinter import *
import math
import pickle
from PIL import ImageTk, Image
from utils.mapcreator import map
from utils import coordinate
class MapCreator:
def __init__(self):
self.n1 = []
self.n2 = []
self.img_h = 0
self.map = map.Map()
scale = 0.9
root = Tk... | [
"utils.mapcreator.map.Map",
"PIL.Image.open",
"pickle.dump",
"pickle.load",
"math.fabs",
"utils.coordinate.Coordinate",
"PIL.ImageTk.PhotoImage"
] | [((271, 280), 'utils.mapcreator.map.Map', 'map.Map', ([], {}), '()\n', (278, 280), False, 'from utils.mapcreator import map\n'), ((613, 634), 'PIL.Image.open', 'Image.open', (['"""map.png"""'], {}), "('map.png')\n", (623, 634), False, 'from PIL import ImageTk, Image\n'), ((878, 901), 'PIL.ImageTk.PhotoImage', 'ImageTk.... |
import spotipy
from spotipy.oauth2 import SpotifyClientCredentials
import requests
import pandas as pd
import pickle
from sklearn import model_selection
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
# import finalized_model
# #pickle_filename =
# #Loading the... | [
"pandas.DataFrame",
"requests.get",
"requests.post",
"pandas.read_csv"
] | [((536, 563), 'pandas.read_csv', 'pd.read_csv', (['"""track_id.csv"""'], {}), "('track_id.csv')\n", (547, 563), True, 'import pandas as pd\n'), ((762, 870), 'requests.post', 'requests.post', (['AUTH_URL', "{'grant_type': 'client_credentials', 'client_id': cid, 'client_secret': secret}"], {}), "(AUTH_URL, {'grant_type':... |
import time
print("I will write the same line 3 times, slowly.\n")
time.sleep(2)
for n in range(3):
print("Sleep ... zzz ...")
time.sleep(5)
print("\nThe End")
| [
"time.sleep"
] | [((69, 82), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (79, 82), False, 'import time\n'), ((138, 151), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (148, 151), False, 'import time\n')] |
# -*- coding: utf8 -*-
"""
This is part of shot detector.
Produced by w495 at 2017.05.04 04:18:27
"""
from __future__ import (absolute_import,
division,
print_function,
unicode_literals)
import itertools
import logging
from builtins impor... | [
"logging.getLogger",
"shot_detector.filters.WienerSWFilter",
"shot_detector.filters.NormFilter",
"shot_detector.filters.KurtosisSWFilter",
"shot_detector.filters.SignAngleDiff1DFilter",
"shot_detector.filters.SavitzkyGolaySWFilter",
"shot_detector.filters.DCTRegressorSWFilter",
"shot_detector.filters.... | [((1450, 1473), 'shot_detector.filters.SignAngleDiff1DFilter', 'SignAngleDiff1DFilter', ([], {}), '()\n', (1471, 1473), False, 'from shot_detector.filters import DelayFilter, MinStdMeanSWFilter, NikitinSWFilter, AlphaBetaSWFilter, BsplineSWFilter, DetrendSWFilter, SavitzkyGolaySWFilter, WienerSWFilter, MedianSWFilter, ... |
from aiohttp_json_api.controller import DefaultController
from aiohttp_json_api.errors import ResourceNotFound
from aiohttp_json_api.fields.decorators import includes
import examples.fantasy.tables as tbl
from examples.fantasy.models import Author
class CommonController(DefaultController):
async def create_resou... | [
"aiohttp_json_api.errors.ResourceNotFound",
"examples.fantasy.tables.authors.c.id.in_",
"aiohttp_json_api.fields.decorators.includes",
"examples.fantasy.models.Author.fetch_many"
] | [((1230, 1248), 'aiohttp_json_api.fields.decorators.includes', 'includes', (['"""author"""'], {}), "('author')\n", (1238, 1248), False, 'from aiohttp_json_api.fields.decorators import includes\n'), ((647, 708), 'aiohttp_json_api.errors.ResourceNotFound', 'ResourceNotFound', ([], {'type': 'self.ctx.resource_type', 'id':... |
import boto3
import base64
import os
from botocore.exceptions import ClientError
def get_secret():
secret_name = "your-secrets-name"
region_name = "your-regions-name"
session = boto3.session.Session()
client = session.client(
service_name='secretsmanager',
region_name=region_name
... | [
"boto3.session.Session",
"base64.b64decode"
] | [((193, 216), 'boto3.session.Session', 'boto3.session.Session', ([], {}), '()\n', (214, 216), False, 'import boto3\n'), ((1111, 1170), 'base64.b64decode', 'base64.b64decode', (["get_secret_value_response['SecretBinary']"], {}), "(get_secret_value_response['SecretBinary'])\n", (1127, 1170), False, 'import base64\n')] |
# Copyright 2020 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license" file accompanying this file. This file is
# ... | [
"aws_lambda_powertools.tracing.Tracer",
"aws_lambda_powertools.logging.Logger"
] | [((911, 947), 'aws_lambda_powertools.logging.Logger', 'Logger', ([], {'service': '"""Logger interceptor"""'}), "(service='Logger interceptor')\n", (917, 947), False, 'from aws_lambda_powertools.logging import Logger\n'), ((957, 993), 'aws_lambda_powertools.tracing.Tracer', 'Tracer', ([], {'service': '"""Logger intercep... |
from funboost import boost
import re
import requests
from parsel import Selector
from pathlib import Path
"""
http://www.5442tu.com/mingxing/list_2_1.html 下载所有明星图片
"""
@boost('xiaoxianrou_list_page', qps=0.05)
def cralw_list_page(page_index):
url = f'http://www.5442tu.com/mingxing/list_2_{page_index}.html'
... | [
"re.search",
"funboost.boost",
"requests.get",
"pathlib.Path"
] | [((173, 213), 'funboost.boost', 'boost', (['"""xiaoxianrou_list_page"""'], {'qps': '(0.05)'}), "('xiaoxianrou_list_page', qps=0.05)\n", (178, 213), False, 'from funboost import boost\n'), ((645, 708), 'funboost.boost', 'boost', (['"""xiaoxianrou_detail_page"""'], {'qps': '(2)', 'do_task_filtering': '(True)'}), "('xiaox... |
# -*- coding: utf-8 -*-
"""
This is a Python binding to Microsoft Chakra Javascript engine.
Modified from PyChakra (https://github.com/zhengrenzhe/PyChakra) to
support Win10's built-in Chakra.
"""
import ctypes as _ctypes
# load win10's built-in chakra binary
try:
chakra = _ctypes.windll.Chakra
chakra_ava... | [
"ctypes.byref",
"ctypes.c_size_t",
"ctypes.c_void_p",
"ctypes.c_wchar_p"
] | [((3311, 3329), 'ctypes.byref', '_ctypes.byref', (['any'], {}), '(any)\n', (3324, 3329), True, 'import ctypes as _ctypes\n'), ((482, 500), 'ctypes.c_void_p', '_ctypes.c_void_p', ([], {}), '()\n', (498, 500), True, 'import ctypes as _ctypes\n'), ((573, 591), 'ctypes.c_void_p', '_ctypes.c_void_p', ([], {}), '()\n', (589,... |
"""
Vortex dynamics
Several initial states are provided: select one with 'vortex_config'
"""
import sys
try:
from param import Param
except:
print("[ERROR] unable to import the param module")
print("[INFO] you likely forgot to set $PYTHONPATH")
print("[INFO] depending on your shell")
print("> so... | [
"grid.Grid",
"numpy.shape",
"numpy.sqrt",
"ana_profiles.vortex",
"numpy.asarray",
"fluid2d.Fluid2d",
"numpy.exp",
"numpy.array",
"numpy.random.seed",
"numpy.cos",
"sys.exit",
"param.Param",
"numpy.round"
] | [((820, 840), 'param.Param', 'Param', (['"""default.xml"""'], {}), "('default.xml')\n", (825, 840), False, 'from param import Param\n'), ((1670, 1681), 'grid.Grid', 'Grid', (['param'], {}), '(param)\n', (1674, 1681), False, 'from grid import Grid\n'), ((2456, 2476), 'fluid2d.Fluid2d', 'Fluid2d', (['param', 'grid'], {})... |
# Generated by Django 2.1.5 on 2019-05-05 08:42
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('rankings', '0032_individualresult_round'),
]
operations = [
migrations.Alt... | [
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"django.db.models.ManyToManyField",
"django.db.migrations.AlterModelOptions",
"django.db.models.CharField"
] | [((306, 395), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""individualresult"""', 'options': "{'ordering': ['time']}"}), "(name='individualresult', options={'ordering':\n ['time']})\n", (334, 395), False, 'from django.db import migrations, models\n'), ((542, 610), 'djang... |
"""import pywt
import numpy as np
import matplotlib.pyplot as plt
t = np.linspace(-1, 1, 200, endpoint=False)
sig = np.cos(2 * np.pi * 7 * t) + np.real(np.exp(-7*(t-0.4)**2)*np.exp(1j*2*np.pi*2*(t-0.4)))
plt.plot(t, sig)
plt.show()
widths = np.arange(1, 31)
cwtmatr, freqs = pywt.cwt(sig, widths, 'mexh')
print(cwtmatr)... | [
"pywt.wavelist",
"matplotlib.pyplot.plot",
"numpy.asarray",
"numpy.cos",
"pywt.wavedec",
"pywt.waverec",
"matplotlib.pyplot.show"
] | [((631, 644), 'numpy.asarray', 'np.asarray', (['t'], {}), '(t)\n', (641, 644), True, 'import numpy as np\n'), ((967, 1004), 'pywt.wavedec', 'pywt.wavedec', (['sig', '"""rbio6.8"""'], {'level': '(3)'}), "(sig, 'rbio6.8', level=3)\n", (979, 1004), False, 'import pywt\n'), ((1301, 1332), 'pywt.waverec', 'pywt.waverec', ([... |
import numpy as np
class user:
def __init__(self):
self.planned_channel = -1
self.transmission_success = False
print('user creation success')
def choose_channel(self, method, num_channels):
if method == 'uniform':
self.planned_channel = np.random.randint(0, num_chan... | [
"numpy.random.randint"
] | [((291, 325), 'numpy.random.randint', 'np.random.randint', (['(0)', 'num_channels'], {}), '(0, num_channels)\n', (308, 325), True, 'import numpy as np\n')] |
import torch
import torch.nn as nn
from dfw.losses import MultiClassHingeLoss, set_smoothing_enabled
def get_loss(args):
if args.opt == 'dfw':
loss_fn = MultiClassHingeLoss()
if 'cifar' in args.dataset:
args.smooth_svm = True
elif args.dataset == 'imagenet':
return EntrLoss... | [
"dfw.losses.MultiClassHingeLoss",
"torch.nn.CrossEntropyLoss",
"torch.clamp"
] | [((167, 188), 'dfw.losses.MultiClassHingeLoss', 'MultiClassHingeLoss', ([], {}), '()\n', (186, 188), False, 'from dfw.losses import MultiClassHingeLoss, set_smoothing_enabled\n'), ((2471, 2510), 'torch.clamp', 'torch.clamp', (['(x_sorted_last - fy)'], {'max': '(80)'}), '(x_sorted_last - fy, max=80)\n', (2482, 2510), Fa... |
from _seidel import Edge
from hypothesis import given
from tests.utils import (equivalence,
implication)
from . import strategies
@given(strategies.edges)
def test_reflexivity(edge: Edge) -> None:
assert edge == edge
@given(strategies.edges, strategies.edges)
def test_symmetry(first_ed... | [
"hypothesis.given",
"tests.utils.implication",
"tests.utils.equivalence"
] | [((159, 182), 'hypothesis.given', 'given', (['strategies.edges'], {}), '(strategies.edges)\n', (164, 182), False, 'from hypothesis import given\n'), ((252, 293), 'hypothesis.given', 'given', (['strategies.edges', 'strategies.edges'], {}), '(strategies.edges, strategies.edges)\n', (257, 293), False, 'from hypothesis imp... |
# -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
import hashlib
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.... | [
"ccxt.base.errors.InvalidOrder",
"math.floor",
"ccxt.base.precise.Precise.string_gt",
"ccxt.base.errors.ArgumentsRequired",
"ccxt.base.errors.ExchangeError"
] | [((31664, 31697), 'ccxt.base.precise.Precise.string_gt', 'Precise.string_gt', (['feeAmount', '"""0"""'], {}), "(feeAmount, '0')\n", (31681, 31697), False, 'from ccxt.base.precise import Precise\n'), ((52397, 52420), 'ccxt.base.errors.ExchangeError', 'ExchangeError', (['feedback'], {}), '(feedback)\n', (52410, 52420), F... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
'''This examples shows how to copy a file to a remote
host via SRM using a custom security context.
If something doesn't work as expected, try to set
SAGA_VERBOSE=3 in your environment before you run the
sc... | [
"radical.saga.filesystem.File",
"sys.exit"
] | [((664, 771), 'radical.saga.filesystem.File', 'rs.filesystem.File', (['"""srm://tbn18.nikhef.nl/dpm/nikhef.nl/home/vlemed/mark/radical.saga/input.txt"""'], {}), "(\n 'srm://tbn18.nikhef.nl/dpm/nikhef.nl/home/vlemed/mark/radical.saga/input.txt'\n )\n", (682, 771), True, 'import radical.saga as rs\n'), ((1408, 1420... |
# python -m bin.spec_12
from lib.maths_textbook import (
Chapter as C,
ChapterAnswers as CA,
Exercise as E,
ExercisesAnswer as EA,
ExercisesChapter as EC,
RevisionChapter as RC,
REVIEW as R,
)
from lib.private import VCEUnits, add_maths_textbook_outlines
# fmt: off
chapters = [
C(15, E... | [
"lib.maths_textbook.ExercisesAnswer",
"lib.private.add_maths_textbook_outlines",
"lib.maths_textbook.ChapterAnswers",
"lib.maths_textbook.RevisionChapter",
"lib.maths_textbook.Exercise"
] | [((9164, 9408), 'lib.private.add_maths_textbook_outlines', 'add_maths_textbook_outlines', ([], {'name': '"""Specialist Mathematics"""', 'subject': '"""Specialist Maths"""', 'units': 'VCEUnits.one_two', 'introduction': '(9)', 'acknowledgments': '(11)', 'overview': '(12)', 'glossary': '(699)', 'chapters': 'chapters', 'an... |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("cases", "0012_auto_20150311_0434")]
operations = [
migrations.RemoveField(model_name="case", name="created_by"),
migrations.RemoveField(model_name="case", name="created_on"),
migrations.RemoveFi... | [
"django.db.migrations.RemoveField"
] | [((161, 221), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""case"""', 'name': '"""created_by"""'}), "(model_name='case', name='created_by')\n", (183, 221), False, 'from django.db import migrations\n'), ((231, 291), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([]... |
from huey import SqliteHuey
from cloudcopy.server.config import settings
# if ASYNC_TASKS is False (e.g. in testing)
# async tasks will be executed immediately
# or added to an in-memory schedule registry
app = SqliteHuey(
'tasks',
filename=settings.INTERNAL_DATABASE_FILE,
immediate=not settings.ASYNC_TASK... | [
"huey.SqliteHuey"
] | [((212, 313), 'huey.SqliteHuey', 'SqliteHuey', (['"""tasks"""'], {'filename': 'settings.INTERNAL_DATABASE_FILE', 'immediate': '(not settings.ASYNC_TASKS)'}), "('tasks', filename=settings.INTERNAL_DATABASE_FILE, immediate=not\n settings.ASYNC_TASKS)\n", (222, 313), False, 'from huey import SqliteHuey\n')] |
from channels.auth import AuthMiddlewareStack
from channels.routing import URLRouter, ChannelNameRouter
from django.urls import path
from config.api import GraphQLConsumer
__all__ = (
"router",
"channels",
"application"
)
urls = [
path("graphql", GraphQLConsumer.as_asgi())
]
router = URLRouter(urls)... | [
"channels.routing.URLRouter",
"channels.auth.AuthMiddlewareStack",
"channels.routing.ChannelNameRouter",
"config.api.GraphQLConsumer.as_asgi"
] | [((305, 320), 'channels.routing.URLRouter', 'URLRouter', (['urls'], {}), '(urls)\n', (314, 320), False, 'from channels.routing import URLRouter, ChannelNameRouter\n'), ((333, 354), 'channels.routing.ChannelNameRouter', 'ChannelNameRouter', (['{}'], {}), '({})\n', (350, 354), False, 'from channels.routing import URLRout... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Wrapper for visualize.py
@author: thomas
"""
if __name__ == '__main__' and __package__ is None:
from os import sys, path
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
import os
import argparse
from common.visualize import loop_directori... | [
"os.path.exists",
"common.visualize.loop_directories",
"os.makedirs",
"argparse.ArgumentParser",
"os.getcwd",
"os.path.abspath"
] | [((393, 418), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (416, 418), False, 'import argparse\n'), ((1984, 2337), 'common.visualize.loop_directories', 'loop_directories', ([], {'result_folder': 'result_folder', 'overview_dir': 'overview_dir', 'game': 'args.game', 'name': 'args.name', 'subind... |
import random
import numpy as np
import pynmmso as nmmso
class Swarm:
"""
Represents a swarm in the NMMSO algorithm.
Arguments
---------
id : int
Id used to refer to the swarm
swarm_size : int
Maximum number of particles in the swarm
problem :
Instance of the prob... | [
"numpy.sqrt",
"numpy.isscalar",
"numpy.random.rand",
"random.randrange",
"pynmmso.Nmmso.uniform_sphere_points",
"numpy.asarray",
"numpy.min",
"numpy.argsort",
"numpy.sum",
"numpy.zeros",
"numpy.random.randint",
"numpy.concatenate",
"numpy.linalg.norm",
"numpy.full"
] | [((2052, 2100), 'numpy.zeros', 'np.zeros', (['(self.swarm_size, self.num_dimensions)'], {}), '((self.swarm_size, self.num_dimensions))\n', (2060, 2100), True, 'import numpy as np\n'), ((2165, 2198), 'numpy.full', 'np.full', (['self.swarm_size', '(-np.inf)'], {}), '(self.swarm_size, -np.inf)\n', (2172, 2198), True, 'imp... |