code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
#!/usr/bin/env python3
import sys
from pathlib import Path
from build import VARIANTS
DOCKER_TEST="""version: '2'
services:
mailman-core:
image: core-{variant}
mailman-web:
image: web-{variant}
environment:
- SECRET_KEY=<KEY>
"""
def test_setup(variant):
Path('docker-... | [
"pathlib.Path",
"sys.exit"
] | [((535, 546), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (543, 546), False, 'import sys\n'), ((630, 641), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (638, 641), False, 'import sys\n'), ((307, 331), 'pathlib.Path', 'Path', (['"""docker-test.yaml"""'], {}), "('docker-test.yaml')\n", (311, 331), False, 'from pat... |
import sys
import numpy
from scipy import special
import statsmodels.api as sm
from galpy.util import bovy_plot
import define_rcsample
def plot_rcdistancecomparison(plotfilename):
# Get the sample
rcdata= define_rcsample.get_rcsample()
# Now plot the differece
bovy_plot.bovy_print()
levels= special.... | [
"galpy.util.bovy_plot.bovy_plot",
"define_rcsample.get_rcsample",
"galpy.util.bovy_plot.bovy_end_print",
"galpy.util.bovy_plot.bovy_print",
"galpy.util.bovy_plot.scatterplot",
"numpy.arange",
"numpy.sqrt"
] | [((213, 243), 'define_rcsample.get_rcsample', 'define_rcsample.get_rcsample', ([], {}), '()\n', (241, 243), False, 'import define_rcsample\n'), ((277, 299), 'galpy.util.bovy_plot.bovy_print', 'bovy_plot.bovy_print', ([], {}), '()\n', (297, 299), False, 'from galpy.util import bovy_plot\n'), ((362, 780), 'galpy.util.bov... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# is_equal_as_previous.py
"""
is_equal_as_previous is made to be called multiple times
is_equal_as_previous saves the previous value and compares it with the current value
thus is_equal_as_previous can detect changes in sequences
when is_equal_as_previous is called for t... | [
"itertools.cycle",
"time.sleep"
] | [((5528, 5550), 'itertools.cycle', 'cycle', (['[1, 1, 2, 2, 3]'], {}), '([1, 1, 2, 2, 3])\n', (5533, 5550), False, 'from itertools import cycle\n'), ((5757, 5770), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (5767, 5770), False, 'import time\n')] |
#!/usr/bin/env python
"""
Given the output of fconv_slopes, plot the thermodynamic
gradients corresponding to an initial model.
<NAME>
"""
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('infile', type=str... | [
"matplotlib.pyplot.yscale",
"matplotlib.pyplot.show",
"argparse.ArgumentParser",
"numpy.amin",
"matplotlib.pyplot.close",
"matplotlib.pyplot.legend",
"numpy.amax",
"matplotlib.pyplot.figure",
"numpy.where",
"numpy.loadtxt",
"matplotlib.pyplot.savefig"
] | [((256, 281), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (279, 281), False, 'import argparse\n'), ((1303, 1315), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1313, 1315), True, 'import matplotlib.pyplot as plt\n'), ((3213, 3256), 'matplotlib.pyplot.yscale', 'plt.yscale', (['... |
from os import unlink
from os.path import join, isfile
from contextlib import contextmanager
from functools import partial
from itertools import chain, combinations
from git import Repo, Head, Commit
from mock import patch, MagicMock
from jig.tests.testcase import JigTestCase
from jig.exc import (
GitRevListMissi... | [
"functools.partial",
"jig.gitutils.branches.prepare_working_directory",
"os.path.join",
"jig.gitutils.branches.parse_rev_range",
"git.Repo",
"jig.gitutils.branches._prepare_with_rev_range",
"mock.patch",
"jig.gitutils.branches._prepare_against_staged_index",
"mock.MagicMock",
"jig.gitutils.branche... | [((1679, 1700), 'git.Repo', 'Repo', (['self.gitrepodir'], {}), '(self.gitrepodir)\n', (1683, 1700), False, 'from git import Repo, Head, Commit\n'), ((3993, 4033), 'jig.gitutils.branches._prepare_against_staged_index', '_prepare_against_staged_index', (['self.repo'], {}), '(self.repo)\n', (4022, 4033), False, 'from jig.... |
import obs,parenty,socket_controller,threading
def callObs():
obs.main()
socket_controller.init_comm_file()
t = threading.Thread(target = callObs, args=())
t.start()
| [
"obs.main",
"threading.Thread",
"socket_controller.init_comm_file"
] | [((79, 113), 'socket_controller.init_comm_file', 'socket_controller.init_comm_file', ([], {}), '()\n', (111, 113), False, 'import obs, parenty, socket_controller, threading\n'), ((118, 159), 'threading.Thread', 'threading.Thread', ([], {'target': 'callObs', 'args': '()'}), '(target=callObs, args=())\n', (134, 159), Fal... |
import csv
import pandas as pd
import matplotlib.pyplot as plt
games = []
with open("outputs/games_output.csv", 'r') as data:
for line in csv.DictReader(data):
games.append(line)
teams = []
with open("inputs/VBelo - teams.csv", 'r') as data:
for line in csv.DictReader(data):
teams.append(line)... | [
"pandas.DataFrame",
"csv.DictReader",
"pandas.set_option"
] | [((1004, 1028), 'pandas.DataFrame', 'pd.DataFrame', (['start_data'], {}), '(start_data)\n', (1016, 1028), True, 'import pandas as pd\n'), ((143, 163), 'csv.DictReader', 'csv.DictReader', (['data'], {}), '(data)\n', (157, 163), False, 'import csv\n'), ((272, 292), 'csv.DictReader', 'csv.DictReader', (['data'], {}), '(da... |
from __future__ import print_function
import random
import nltk
from nltk.corpus import treebank
import numpy as np
from sklearn.feature_extraction import DictVectorizer
from sklearn.preprocessing import LabelEncoder
from sklearn.metrics import classification_report
from keras.layers import Dense, Dropout, ... | [
"nltk.corpus.treebank.tagged_sents",
"keras.wrappers.scikit_learn.KerasClassifier",
"numpy.random.seed",
"matplotlib.pyplot.show",
"keras.layers.Activation",
"keras.layers.Dropout",
"random.choice",
"sklearn.preprocessing.LabelEncoder",
"sklearn.metrics.classification_report",
"matplotlib.pyplot.s... | [((4196, 4214), 'matplotlib.pyplot.tight_layout', 'plt.tight_layout', ([], {}), '()\n', (4212, 4214), True, 'import matplotlib.pyplot as plt\n'), ((4220, 4230), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (4228, 4230), True, 'import matplotlib.pyplot as plt\n'), ((4322, 4349), 'numpy.random.seed', 'np.rando... |
import pandas as pd
import numpy as np
from .QCBase import VarNames
class Exporter(object):
""" Export class which writes parsed data to a certain format"""
valid_formats = ["pdf", "xlsx", "txt", "csv", "dataframe"]
def __init__(self, data=None):
self.data = data
# for later: add pand... | [
"pandas.DataFrame",
"pandas.MultiIndex.from_tuples",
"numpy.linalg.inv",
"pandas.Series",
"re.search",
"pandas.ExcelWriter",
"pandas.concat"
] | [((2617, 2632), 'pandas.DataFrame', 'pd.DataFrame', (['d'], {}), '(d)\n', (2629, 2632), True, 'import pandas as pd\n'), ((2653, 2713), 'pandas.MultiIndex.from_tuples', 'pd.MultiIndex.from_tuples', (['tuples'], {'names': "['State', 'Row ID']"}), "(tuples, names=['State', 'Row ID'])\n", (2678, 2713), True, 'import pandas... |
#
# Copyright <NAME>, 2012-2014
#
import miner_globals
import m.common as common
from base import *
def p_accumulate_coals(p):
'''command :
| ACCUMULATE'''
p[0] = DefaultAccumulateCommand()
def p_accumulate_command(p):
'''command : ACCUMULATE id_list BY expression'''
p[0... | [
"miner_globals.addKeyWord",
"m.common.CompilationError",
"miner_globals.addHelpClass"
] | [((2793, 2838), 'miner_globals.addHelpClass', 'miner_globals.addHelpClass', (['AccumulateCommand'], {}), '(AccumulateCommand)\n', (2819, 2838), False, 'import miner_globals\n'), ((2840, 2892), 'miner_globals.addHelpClass', 'miner_globals.addHelpClass', (['DefaultAccumulateCommand'], {}), '(DefaultAccumulateCommand)\n',... |
"""
2016 Day 10
https://adventofcode.com/2016/day/10
"""
from dataclasses import dataclass
from typing import Dict, List, Sequence, Tuple
import re
import aocd # type: ignore
re_value = re.compile(r"value (\d+) goes to (\w+) (\d+)")
re_robot = re.compile(r"bot (\d+) gives low to (\w+) (\d+) and high to (\w+) (\d+)")... | [
"aocd.get_data",
"dataclasses.dataclass",
"re.compile"
] | [((189, 237), 're.compile', 're.compile', (['"""value (\\\\d+) goes to (\\\\w+) (\\\\d+)"""'], {}), "('value (\\\\d+) goes to (\\\\w+) (\\\\d+)')\n", (199, 237), False, 'import re\n'), ((247, 324), 're.compile', 're.compile', (['"""bot (\\\\d+) gives low to (\\\\w+) (\\\\d+) and high to (\\\\w+) (\\\\d+)"""'], {}), "('... |
#!/usr/bin/env python3
from gunicorn_server import StandaloneApplication
from flask import Flask
import multiprocessing
app = Flask(__name__)
@app.route("/")
def ok():
return "OK"
if __name__ == "__main__":
gunicorn_app = StandaloneApplication(app, options={
'bind': '127.0.0.1:8080',
'worke... | [
"flask.Flask",
"multiprocessing.cpu_count"
] | [((128, 143), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (133, 143), False, 'from flask import Flask\n'), ((326, 353), 'multiprocessing.cpu_count', 'multiprocessing.cpu_count', ([], {}), '()\n', (351, 353), False, 'import multiprocessing\n')] |
# Copyright © 2019 National Institute of Advanced Industrial Science and Technology (AIST). All rights reserved.
from datetime import datetime, timedelta, timezone
from requests import post, get
from pathlib import Path
import json
from injector import singleton
import os
import shutil
from distutils.dir_util import re... | [
"json.dump",
"qlib.utils.logging.log",
"pathlib.Path",
"datetime.timedelta",
"sqlalchemy.asc",
"qlib.utils.logging.get_logger"
] | [((1336, 1348), 'qlib.utils.logging.get_logger', 'get_logger', ([], {}), '()\n', (1346, 1348), False, 'from qlib.utils.logging import get_logger, log\n'), ((1538, 1549), 'qlib.utils.logging.log', 'log', (['logger'], {}), '(logger)\n', (1541, 1549), False, 'from qlib.utils.logging import get_logger, log\n'), ((5596, 560... |
import nmap
import requests
def nScan(ip):
nm = nmap.PortScanner()
nm.scan(ip, arguments="-F")
for host in nm.all_hosts():
ports = []
protocols = []
states = []
for proto in nm[host].all_protocols():
protocols.append(proto)
lport = nm[host][proto].key... | [
"nmap.PortScanner"
] | [((53, 71), 'nmap.PortScanner', 'nmap.PortScanner', ([], {}), '()\n', (69, 71), False, 'import nmap\n')] |
from flask import render_template
from app import app
@app.route('/')
@app.route('/index')
def index():
return render_template('config.html')
@app.route('/dashboard')
def dashboard():
return render_template('dashboard.html')
| [
"app.app.route",
"flask.render_template"
] | [((57, 71), 'app.app.route', 'app.route', (['"""/"""'], {}), "('/')\n", (66, 71), False, 'from app import app\n'), ((73, 92), 'app.app.route', 'app.route', (['"""/index"""'], {}), "('/index')\n", (82, 92), False, 'from app import app\n'), ((150, 173), 'app.app.route', 'app.route', (['"""/dashboard"""'], {}), "('/dashbo... |
# 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 the Li... | [
"sqlalchemy.CheckConstraint",
"warehouse.utils.attrs.make_repr",
"sqlalchemy.Column"
] | [((768, 875), 'sqlalchemy.CheckConstraint', 'CheckConstraint', (['"""classifier not ilike \'private ::%\'"""'], {'name': '"""ck_disallow_private_top_level_classifier"""'}), '("classifier not ilike \'private ::%\'", name=\n \'ck_disallow_private_top_level_classifier\')\n', (783, 875), False, 'from sqlalchemy import C... |
# Generated from /Users/tom/Code/soda-core/soda/core/soda/sodacl/antlr/SodaCLAntlr.g4 by ANTLR 4.9.3
from antlr4 import *
from io import StringIO
import sys
if sys.version_info[1] > 5:
from typing import TextIO
else:
from typing.io import TextIO
def serializedATN():
with StringIO() as buf:
buf.wr... | [
"io.StringIO"
] | [((287, 297), 'io.StringIO', 'StringIO', ([], {}), '()\n', (295, 297), False, 'from io import StringIO\n')] |
"""
4) Sinkhorn vs. blurred Wasserstein distances
==========================================================
Sinkhorn divergences rely on a simple idea:
by **blurring** the transport plan through the addition of
an entropic penalty, we can reduce the effective dimensionality
of the transportation problem and compute *... | [
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"geomloss.SamplesLoss",
"sklearn.neighbors.KernelDensity",
"matplotlib.pyplot.axis",
"torch.cat",
"torch.randn",
"matplotlib.pyplot.figure",
"torch.cuda.is_available",
"numpy.linspace",
"torch.rand",
"matplotlib... | [((3677, 3702), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (3700, 3702), False, 'import torch\n'), ((3923, 3951), 'numpy.linspace', 'np.linspace', (['(-0.5)', '(1.5)', '(1000)'], {}), '(-0.5, 1.5, 1000)\n', (3934, 3951), True, 'import numpy as np\n'), ((6170, 6197), 'matplotlib.pyplot.figur... |
from dataclasses import dataclass
from typing import Callable, Any, Dict, Set
from PyQt5 import QtCore
from PyQt5.QtGui import QKeyEvent, QKeySequence
from piafedit.gui.common.handler.keyboard_handler import KeyboardHandler
@dataclass
class UIAction:
name: str
tooltip: str
shortcut: str
action: Call... | [
"piafedit.editor_api.P.log.debug",
"PyQt5.QtGui.QKeySequence"
] | [((1709, 1731), 'PyQt5.QtGui.QKeySequence', 'QKeySequence', (['shortcut'], {}), '(shortcut)\n', (1721, 1731), False, 'from PyQt5.QtGui import QKeyEvent, QKeySequence\n'), ((1783, 1804), 'piafedit.editor_api.P.log.debug', 'P.log.debug', (['sequence'], {}), '(sequence)\n', (1794, 1804), False, 'from piafedit.editor_api i... |
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from .models import Profile, Neighbourhood, Business, Post
from cloudinary.models import CloudinaryField
class SignupForm(UserCreationForm):
email = forms.EmailField(max_length=254)
clas... | [
"django.forms.EmailField",
"cloudinary.models.CloudinaryField"
] | [((278, 310), 'django.forms.EmailField', 'forms.EmailField', ([], {'max_length': '(254)'}), '(max_length=254)\n', (294, 310), False, 'from django import forms\n'), ((469, 501), 'django.forms.EmailField', 'forms.EmailField', ([], {'max_length': '(254)'}), '(max_length=254)\n', (485, 501), False, 'from django import form... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2016, <NAME> <<EMAIL>>
#
# Permission to use, copy, modify, and/or distribute this software for any purpose
# with or without fee is hereby granted, provided that the above copyright notice
# and this permission notice appear in all copies.
#
# THE SOFTWARE IS P... | [
"re.search",
"oc_ocdm.decorators.accepts_only",
"re.sub"
] | [((1351, 1369), 'oc_ocdm.decorators.accepts_only', 'accepts_only', (['"""re"""'], {}), "('re')\n", (1363, 1369), False, 'from oc_ocdm.decorators import accepts_only\n'), ((2203, 2224), 'oc_ocdm.decorators.accepts_only', 'accepts_only', (['"""thing"""'], {}), "('thing')\n", (2215, 2224), False, 'from oc_ocdm.decorators ... |
from setuptools import setup, find_packages
from collections import OrderedDict
long_description="""
This is a minimal engine for the Battlehack20 game.
It lacks the secure of the original engine, but makes up for it
by running 30 times faster.
Read more at the Battlehack website: https://bh2020.battlecode.org.
"""
s... | [
"collections.OrderedDict",
"setuptools.find_packages"
] | [((633, 648), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (646, 648), False, 'from setuptools import setup, find_packages\n'), ((669, 830), 'collections.OrderedDict', 'OrderedDict', (["(('Code', 'https://github.com/cooljoseph1/battlehack20-minimal'), (\n 'Documentation', 'https://github.com/cooljo... |
# Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | [
"tensorflow.range",
"tensorflow.math.mod",
"tensorflow.logical_and",
"tensorflow.math.floordiv",
"tensorflow.gather",
"tensorflow.math.reduce_max",
"tensorflow.math.reduce_any",
"tensorflow.reshape",
"tensorflow.pad",
"tensorflow.transpose",
"tensorflow.minimum",
"tensorflow.strings.length",
... | [((1447, 1478), 'tensorflow.transpose', 'tf.transpose', (['logits', '[0, 2, 1]'], {}), '(logits, [0, 2, 1])\n', (1459, 1478), True, 'import tensorflow as tf\n'), ((1500, 1528), 'tensorflow.math.top_k', 'tf.math.top_k', (['logits', 'top_k'], {}), '(logits, top_k)\n', (1513, 1528), True, 'import tensorflow as tf\n'), ((1... |
#!/usr/bin/env python3
import cv2 as cv
import json
import math
import numpy as np
import os
import sys
from requests.utils import requote_uri
from geojson import FeatureCollection, Feature, Polygon, dumps
config = json.load(open("config.json","r"))
target = config.get('target')
tilesize = config.get('tilesize')
ma... | [
"cv2.resize",
"geojson.Polygon",
"os.makedirs",
"math.pow",
"geojson.dumps",
"math.ceil",
"cv2.cvtColor",
"cv2.imwrite",
"math.floor",
"geojson.Feature",
"numpy.zeros",
"cv2.imread",
"geojson.FeatureCollection",
"requests.utils.requote_uri"
] | [((6720, 6747), 'geojson.FeatureCollection', 'FeatureCollection', (['features'], {}), '(features)\n', (6737, 6747), False, 'from geojson import FeatureCollection, Feature, Polygon, dumps\n'), ((1462, 1502), 'cv2.imread', 'cv.imread', (['filename', 'cv.IMREAD_UNCHANGED'], {}), '(filename, cv.IMREAD_UNCHANGED)\n', (1471,... |
import math
import numpy as np
import basis.robot_math as rm
import visualization.panda.world as wd
import modeling.geometric_model as gm
import modeling.collision_model as cm
import robot_sim.end_effectors.gripper.robotiq85.robotiq85 as rtq85
import grasping.annotation.utils as gu
import pickle
base = wd.World(cam_po... | [
"modeling.geometric_model.gen_arrow",
"math.radians",
"modeling.collision_model.CollisionModel",
"basis.robot_math.orthogonal_vector",
"modeling.geometric_model.gen_frame",
"robot_sim.end_effectors.gripper.robotiq85.robotiq85.Robotiq85",
"modeling.geometric_model.gen_sphere",
"numpy.linalg.norm",
"v... | [((305, 360), 'visualization.panda.world.World', 'wd.World', ([], {'cam_pos': '[0.3, 0.3, 0.3]', 'lookat_pos': '[0, 0, 0]'}), '(cam_pos=[0.3, 0.3, 0.3], lookat_pos=[0, 0, 0])\n', (313, 360), True, 'import visualization.panda.world as wd\n'), ((440, 481), 'modeling.collision_model.CollisionModel', 'cm.CollisionModel', (... |
"""A CarController Module."""
from masonite.request import Request
from masonite.view import View
from masonite.controllers import Controller
from app.Car import Car
class CarController(Controller):
"""CarController Controller Class."""
def __init__(self, request: Request):
"""CarController Initiali... | [
"app.Car.Car.all",
"app.Car.Car.find"
] | [((531, 540), 'app.Car.Car.all', 'Car.all', ([], {}), '()\n', (538, 540), False, 'from app.Car import Car\n'), ((696, 711), 'app.Car.Car.find', 'Car.find', (['param'], {}), '(param)\n', (704, 711), False, 'from app.Car import Car\n')] |
import logging
from xwing.mailbox import initialize, spawn, start
initialize()
logging.basicConfig(level='INFO')
async def run_server(mailbox):
while True:
data = await mailbox.recv()
if not data:
break
sender, message = data
await mailbox.send(sender, message)
if ... | [
"xwing.mailbox.spawn",
"xwing.mailbox.initialize",
"xwing.mailbox.start",
"logging.basicConfig"
] | [((67, 79), 'xwing.mailbox.initialize', 'initialize', ([], {}), '()\n', (77, 79), False, 'from xwing.mailbox import initialize, spawn, start\n'), ((81, 114), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': '"""INFO"""'}), "(level='INFO')\n", (100, 114), False, 'import logging\n'), ((348, 380), 'xwing.mailb... |
from snuba.clickhouse.columns import (
UUID,
Array,
ColumnSet,
DateTime,
Float,
IPv4,
IPv6,
Nested,
)
from snuba.clickhouse.columns import SchemaModifiers as Modifiers
from snuba.clickhouse.columns import String, UInt
from snuba.clusters.storage_sets import StorageSetKey
from snuba.datas... | [
"snuba.query.processors.mapping_optimizer.MappingOptimizer",
"snuba.query.processors.prewhere.PrewhereProcessor",
"snuba.query.processors.arrayjoin_keyvalue_optimizer.ArrayJoinKeyValueOptimizer",
"snuba.datasets.schemas.tables.WritableTableSchema",
"snuba.web.split.TimeSplitQueryStrategy",
"snuba.clickhou... | [((2817, 3089), 'snuba.datasets.schemas.tables.WritableTableSchema', 'WritableTableSchema', ([], {'columns': 'columns', 'local_table_name': '"""transactions_local"""', 'dist_table_name': '"""transactions_dist"""', 'storage_set_key': 'StorageSetKey.TRANSACTIONS', 'mandatory_conditions': '[]', 'prewhere_candidates': "['e... |
# Copyright 2012, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | [
"oslo_utils.excutils.raise_with_cause",
"mock.patch",
"oslotest.moxstubout.MoxStubout",
"oslo_utils.excutils.save_and_reraise_exception",
"mock.MagicMock",
"oslo_utils.timeutils.now"
] | [((2221, 2252), 'mock.patch', 'mock.patch', (['"""logging.getLogger"""'], {}), "('logging.getLogger')\n", (2231, 2252), False, 'import mock\n'), ((3043, 3074), 'mock.patch', 'mock.patch', (['"""logging.getLogger"""'], {}), "('logging.getLogger')\n", (3053, 3074), False, 'import mock\n'), ((3740, 3756), 'mock.MagicMock'... |
#!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
"""Common functions used across the UI tabs.
The UI shares several common functions across its tabs. Unlike ... | [
"dep_util.preview_file",
"dep_util.write_flagfile",
"os.path.isfile",
"dep_util.remove_prefix",
"dep_util.get_first_file_path",
"dep_util.get_timestamp",
"glob.iglob",
"os.path.join",
"sys.path.append",
"os.path.abspath",
"dep_util.update_qt_dropdown",
"scripts.util.system_util.run_command",
... | [((852, 880), 'os.path.dirname', 'os.path.dirname', (['dir_scripts'], {}), '(dir_scripts)\n', (867, 880), False, 'import os\n'), ((881, 906), 'sys.path.append', 'sys.path.append', (['dir_root'], {}), '(dir_root)\n', (896, 906), False, 'import sys\n'), ((1679, 1715), 'os.path.join', 'os.path.join', (['scripts_dir', 'os.... |
from flask import Flask
app = Flask(__name__)
app.secret_key = 'my secret key 123'
from .views import *
| [
"flask.Flask"
] | [((31, 46), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (36, 46), False, 'from flask import Flask\n')] |
# This file is licensed under the terms of the MIT license.
# See the LICENSE file in the root of this repository for complete details.
"""Data structure for representing string diagrams"""
from collections import namedtuple
from copy import deepcopy
__all__ = [
'Ntext',
'Composition',
'NotComposable',
... | [
"copy.deepcopy",
"collections.namedtuple"
] | [((390, 463), 'collections.namedtuple', 'namedtuple', (['"""Ntext"""', "['cells', 'dim', 'source', 'target', 'smap', 'tmap']"], {}), "('Ntext', ['cells', 'dim', 'source', 'target', 'smap', 'tmap'])\n", (400, 463), False, 'from collections import namedtuple\n'), ((2964, 3009), 'collections.namedtuple', 'namedtuple', (['... |
from common import unittest2
import pyuv
class PrepareTest(unittest2.TestCase):
def test_prepare1(self):
self.prepare_cb_called = 0
def prepare_cb(prepare):
self.prepare_cb_called += 1
prepare.stop()
prepare.close()
loop = pyuv.Loop.default_loop()
... | [
"pyuv.Loop.default_loop",
"pyuv.Prepare",
"common.unittest2.main"
] | [((491, 518), 'common.unittest2.main', 'unittest2.main', ([], {'verbosity': '(2)'}), '(verbosity=2)\n', (505, 518), False, 'from common import unittest2\n'), ((291, 315), 'pyuv.Loop.default_loop', 'pyuv.Loop.default_loop', ([], {}), '()\n', (313, 315), False, 'import pyuv\n'), ((334, 352), 'pyuv.Prepare', 'pyuv.Prepare... |
#!/usr/bin/env python
"""
Generate visualisations for the main script
"""
from io import BytesIO
import sys
from PIL import Image, ImageDraw
import dailyprogrammer.challenges.c20170904e2 as challenge
from dailyprogrammer.utils.logging import moduleLogger
logger = moduleLogger(__name__)
INF = float('inf')
def getY... | [
"dailyprogrammer.challenges.c20170904e2.convexHullDisks",
"PIL.Image.new",
"io.BytesIO",
"dailyprogrammer.utils.logging.moduleLogger",
"dailyprogrammer.challenges.c20170904e2.minimumBounding",
"PIL.ImageDraw.Draw",
"sys.stdout.buffer.write"
] | [((268, 290), 'dailyprogrammer.utils.logging.moduleLogger', 'moduleLogger', (['__name__'], {}), '(__name__)\n', (280, 290), False, 'from dailyprogrammer.utils.logging import moduleLogger\n'), ((689, 734), 'PIL.Image.new', 'Image.new', (['"""RGB"""', 'dimensions', '(255, 255, 255)'], {}), "('RGB', dimensions, (255, 255,... |
import cv2
def color_detector():
def setValues(x):
print("")
# creating a window for HUE selector
cv2.namedWindow("Color detectors")
cv2.createTrackbar("Upper Hue", "Color detectors", 153, 180, setValues)
cv2.createTrackbar("Upper Saturation", "Color detectors", 255, 255, setValues)
... | [
"cv2.createTrackbar",
"cv2.namedWindow"
] | [((120, 154), 'cv2.namedWindow', 'cv2.namedWindow', (['"""Color detectors"""'], {}), "('Color detectors')\n", (135, 154), False, 'import cv2\n'), ((160, 231), 'cv2.createTrackbar', 'cv2.createTrackbar', (['"""Upper Hue"""', '"""Color detectors"""', '(153)', '(180)', 'setValues'], {}), "('Upper Hue', 'Color detectors', ... |
import two
two.ct().fun() | [
"two.ct"
] | [((11, 19), 'two.ct', 'two.ct', ([], {}), '()\n', (17, 19), False, 'import two\n')] |
#######################
# <NAME> #
# perform.py #
# Copyright 2018-2020 #
# <NAME> #
#######################
# **********
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software ... | [
"random.randint"
] | [((11296, 11336), 'random.randint', 'random.randint', (['(1)', "dexits[dex]['chance']"], {}), "(1, dexits[dex]['chance'])\n", (11310, 11336), False, 'import random\n'), ((11813, 11845), 'random.randint', 'random.randint', (['(1)', "dit['chance']"], {}), "(1, dit['chance'])\n", (11827, 11845), False, 'import random\n')] |
# Copyright 2021 Adobe
# All Rights Reserved.
# NOTICE: Adobe permits you to use, modify, and distribute this file in
# accordance with the terms of the Adobe license agreement accompanying
# it.
import random
import numpy as np
import cv2
import matplotlib.pyplot as plt
import matplotlib
# matplotlib.use('TkAgg')
im... | [
"skimage.data.astronaut",
"os.path.isfile",
"matplotlib.pyplot.imsave",
"cv2.rectangle",
"os.path.join",
"albumentations.RGBShift",
"albumentations.from_dict",
"cv2.cvtColor",
"matplotlib.pyplot.subplots",
"albumentations.to_dict",
"copy.deepcopy",
"numpy.hstack",
"os.makedirs",
"skimage.c... | [((1124, 1146), 'albumentations.to_dict', 'A.to_dict', (['augPipeline'], {}), '(augPipeline)\n', (1133, 1146), True, 'import albumentations as A\n'), ((1672, 1765), 'matplotlib.pyplot.subplots', 'plt.subplots', (['numOfOperation', '(3)'], {'figsize': '(6, 2 * numOfOperation)', 'constrained_layout': '(True)'}), '(numOfO... |
'''
Vortex OpenSplice
This software and documentation are Copyright 2006 to TO_YEAR ADLINK
Technology Limited, its affiliated companies and licensors. All rights
reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the Lice... | [
"redis.StrictRedis",
"json.dumps",
"time.sleep"
] | [((990, 1134), 'redis.StrictRedis', 'redis.StrictRedis', ([], {'host': 'Config.FRONTEND_IP', 'port': 'Config.REDIS_PORT', 'password': 'Config.REDIS_PASSWORD', 'encoding': '"""utf-8"""', 'decode_responses': '(True)'}), "(host=Config.FRONTEND_IP, port=Config.REDIS_PORT, password\n =Config.REDIS_PASSWORD, encoding='utf... |
from pandas import *
from ggplot import *
from datetime import datetime
def get_day(date):
return datetime.strftime(datetime.strptime(date,'%Y-%m-%d').date(),'%a')
def plot_weather_data(turnstile_weather):
'''
You are passed in a dataframe called turnstile_weather.
Use turnstile_weather along... | [
"datetime.datetime.strptime"
] | [((121, 156), 'datetime.datetime.strptime', 'datetime.strptime', (['date', '"""%Y-%m-%d"""'], {}), "(date, '%Y-%m-%d')\n", (138, 156), False, 'from datetime import datetime\n')] |
from typing import Optional, Any, Tuple, Union, Sequence
from torch.distributions import Distribution
import torch
class JointDistribution(Distribution):
"""
Defines an object for combining multiple distributions by assuming independence, i.e. we define:
.. math::
p(x_1, x_2, ..., x_n) = p... | [
"torch.cat",
"torch.Size"
] | [((4485, 4497), 'torch.Size', 'torch.Size', ([], {}), '()\n', (4495, 4497), False, 'import torch\n'), ((4692, 4714), 'torch.cat', 'torch.cat', (['res'], {'dim': '(-1)'}), '(res, dim=-1)\n', (4701, 4714), False, 'import torch\n')] |
import streamlit as st
import numpy as np
from tensorflow.keras.models import load_model
import librosa
import time
import matplotlib.pyplot as plt
def wav2mfcc(wave, sr=22050,n_mfcc=20, max_len=170):
'''wave is a np array'''
wave = np.asfortranarray(wave)
mfcc = librosa.feature.mfcc(wave, sr=sr, n_mfcc=... | [
"streamlit.title",
"numpy.arange",
"streamlit.sidebar.radio",
"librosa.feature.mfcc",
"librosa.get_duration",
"numpy.pad",
"streamlit.audio",
"streamlit.spinner",
"streamlit.text",
"streamlit.sidebar.markdown",
"streamlit.button",
"numpy.reshape",
"matplotlib.pyplot.subplots",
"streamlit.s... | [((889, 959), 'tensorflow.keras.models.load_model', 'load_model', (["(model_path + 'bal_cnn_model_accuracy_98.2_alpha_0.0001.h5')"], {}), "(model_path + 'bal_cnn_model_accuracy_98.2_alpha_0.0001.h5')\n", (899, 959), False, 'from tensorflow.keras.models import load_model\n'), ((1011, 1036), 'streamlit.title', 'st.title'... |
# -*- coding: utf-8 -*-
import os
JLDCF_root = "<your_methods_path>/CVPR2020_JL-DCF"
JLDCF = {
"LFSD": dict(path=os.path.join(JLDCF_root, "LFSD"), suffix=".png"),
"NJUD": dict(path=os.path.join(JLDCF_root, "NJU2K"), suffix=".png"),
"NLPR": dict(path=os.path.join(JLDCF_root, "NLPR"), suffix=".png"),
"RG... | [
"os.path.join"
] | [((118, 150), 'os.path.join', 'os.path.join', (['JLDCF_root', '"""LFSD"""'], {}), "(JLDCF_root, 'LFSD')\n", (130, 150), False, 'import os\n'), ((190, 223), 'os.path.join', 'os.path.join', (['JLDCF_root', '"""NJU2K"""'], {}), "(JLDCF_root, 'NJU2K')\n", (202, 223), False, 'import os\n'), ((263, 295), 'os.path.join', 'os.... |
"""
Extract MNI coordinates for all brain maps.
Created on Fri May 24 11:26:07 2019
@author: <NAME> <<EMAIL>>
"""
import mne
import numpy as np
from summarize_clusters_stc_AT import summarize_clusters_stc_AT
import csv
#%% for one-sample T-test whether ISCs are significant
results_path = '/media/cbru/SMEDY/results/I... | [
"numpy.isin",
"numpy.load",
"numpy.absolute",
"csv.writer",
"summarize_clusters_stc_AT.summarize_clusters_stc_AT",
"mne.vertex_to_mni",
"numpy.where",
"numpy.arange"
] | [((524, 540), 'numpy.arange', 'np.arange', (['(10242)'], {}), '(10242)\n', (533, 540), True, 'import numpy as np\n'), ((542, 558), 'numpy.arange', 'np.arange', (['(10242)'], {}), '(10242)\n', (551, 558), True, 'import numpy as np\n'), ((2864, 2941), 'csv.writer', 'csv.writer', (['file_out'], {'delimiter': '""","""', 'q... |
# !/usr/bin/env python
'''
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"... | [
"resource_management.libraries.functions.stack_features.check_stack_feature",
"resource_management.libraries.functions.stack_features.get_stack_feature_version",
"resource_management.libraries.script.Script.config.update",
"resource_management.core.logger.Logger.initialize_logger"
] | [((1174, 1200), 'resource_management.core.logger.Logger.initialize_logger', 'Logger.initialize_logger', ([], {}), '()\n', (1198, 1200), False, 'from resource_management.core.logger import Logger\n'), ((2512, 2551), 'resource_management.libraries.functions.stack_features.get_stack_feature_version', 'get_stack_feature_ve... |
import boto3
class Graph:
"""
Represents a Graph object in a DynamoDB table
"""
def __init__(self, table_name, graph_id):
dynamodb = boto3.resource("dynamodb")
self.table = dynamodb.Table(table_name)
self.graph_id = graph_id
def check_status(self, expected_status):
... | [
"boto3.resource"
] | [((158, 184), 'boto3.resource', 'boto3.resource', (['"""dynamodb"""'], {}), "('dynamodb')\n", (172, 184), False, 'import boto3\n')] |
from .dot_product import DotProduct
import os
from numpy import log2
filedir = os.path.dirname(os.path.realpath(__file__))
dot_product_tb_module_path = os.path.join(filedir, '..', 'src')
dot_product_module_path = os.path.join(filedir, '..', 'src', 'dot_prod_pip.v')
class DotProdPip(DotProduct):
"""
"""
... | [
"numpy.log2",
"os.path.realpath",
"os.path.join"
] | [((153, 187), 'os.path.join', 'os.path.join', (['filedir', '""".."""', '"""src"""'], {}), "(filedir, '..', 'src')\n", (165, 187), False, 'import os\n'), ((214, 266), 'os.path.join', 'os.path.join', (['filedir', '""".."""', '"""src"""', '"""dot_prod_pip.v"""'], {}), "(filedir, '..', 'src', 'dot_prod_pip.v')\n", (226, 26... |
from typing import Tuple
from pdfminer.pdfdocument import PDFDocument
from pdfminer.pdfpage import PDFPage
from pdfminer.pdfparser import PDFParser
try:
from IPython import get_ipython
if "IPKernelApp" not in get_ipython().config:
raise ImportError("console")
except (AttributeError, ImportError):
... | [
"pdfminer.pdfdocument.PDFDocument",
"wand.display.display",
"pdfminer.pdfpage.PDFPage.create_pages",
"wand.color.Color",
"IPython.get_ipython",
"wand.drawing.Drawing",
"pdfminer.pdfparser.PDFParser"
] | [((2775, 2789), 'wand.display.display', 'display', (['*imgs'], {}), '(*imgs)\n', (2782, 2789), False, 'from wand.display import display\n'), ((3407, 3419), 'pdfminer.pdfparser.PDFParser', 'PDFParser', (['f'], {}), '(f)\n', (3416, 3419), False, 'from pdfminer.pdfparser import PDFParser\n'), ((3434, 3453), 'pdfminer.pdfd... |
#%%
import numpy as np
import pandas as pd
import pickle
import matplotlib.pyplot as plt
TRAIN_UPDATE_FILE = "C:/kaggle/kaggle_keypoints/pickle/cleandata_updates_augment.pkl"
train = pickle.load(open(TRAIN_UPDATE_FILE, "rb")).reset_index()
print("Size of 'augmentation' set: %d" % train.shape[0])
# %%
fig = plt.fi... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.axis",
"numpy.clip",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout"
] | [((314, 342), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(20, 20)'}), '(figsize=(20, 20))\n', (324, 342), True, 'import matplotlib.pyplot as plt\n'), ((411, 441), 'numpy.clip', 'np.clip', (['train.shape[0]', '(0)', '(60)'], {}), '(train.shape[0], 0, 60)\n', (418, 441), True, 'import numpy as np\n'), ((... |
from tkinter import Tk,scrolledtext,Menu,filedialog,END,messagebox
import tkinter.scrolledtext as ScrolledText
from tkinter import *
from PIL import ImageTk
#root is the root window into which all other widgets go. It is an instance of the class Tk, and every tkinter application must have exactly one instance of th... | [
"tkinter.Menu",
"tkinter.messagebox.showinfo",
"tkinter.filedialog.asksaveasfile",
"tkinter.messagebox.askyesno",
"tkinter.filedialog.askopenfile",
"tkinter.Tk",
"tkinter.scrolledtext.ScrolledText"
] | [((403, 434), 'tkinter.Tk', 'Tk', ([], {'className': '""" AJ Text Editor"""'}), "(className=' AJ Text Editor')\n", (405, 434), False, 'from tkinter import Tk, scrolledtext, Menu, filedialog, END, messagebox\n'), ((445, 510), 'tkinter.scrolledtext.ScrolledText', 'ScrolledText.ScrolledText', (['root'], {'width': '(100)',... |
# OBSOLETE
import os
from directory_cache import DirectoryCache
from loguru import logger
from typing import List
from lxml import html, etree
from unidecode import unidecode
import re
class ContentTable():
"""
ContentTable represents from an HTML table
contains both a simplied HTML table (new_element) an... | [
"lxml.html.tostring",
"unidecode.unidecode",
"lxml.etree.Comment",
"lxml.html.Element",
"re.search"
] | [((636, 657), 'lxml.html.Element', 'html.Element', (['"""table"""'], {}), "('table')\n", (648, 657), False, 'from lxml import html, etree\n'), ((1789, 1807), 'lxml.html.Element', 'html.Element', (['"""tr"""'], {}), "('tr')\n", (1801, 1807), False, 'from lxml import html, etree\n'), ((3709, 3727), 'lxml.html.Element', '... |
from django.test import TestCase
from rapidsms.tests.harness import CreateDataMixin
from rtwilio.forms import TwilioForm
class TwilioFormTest(CreateDataMixin, TestCase):
def test_valid_form(self):
"""Form should be valid if GET keys match configuration."""
data = {"From": "+12223334444",
... | [
"rtwilio.forms.TwilioForm"
] | [((519, 567), 'rtwilio.forms.TwilioForm', 'TwilioForm', (['data'], {'backend_name': '"""rtwilio-backend"""'}), "(data, backend_name='rtwilio-backend')\n", (529, 567), False, 'from rtwilio.forms import TwilioForm\n'), ((806, 854), 'rtwilio.forms.TwilioForm', 'TwilioForm', (['data'], {'backend_name': '"""rtwilio-backend"... |
#!/usr/bin/env python3
#-*- coding:utf-8 -*-
import sys
import time
import getopt
import requests
import sqlite3
import math
import re
import os
from lxml import etree
'''
未启用的两个函数
data_check()
按照主表检查缺少数据,时间非常长,需手动配置
test_page() 输出单页数据
图片服务器:
https://jp.netcdn.space/digital/video/miae00056/miae00056jp-10.jpg
https://... | [
"getopt.getopt",
"math.ceil",
"requests.Session",
"os.path.exists",
"time.sleep",
"re.findall",
"sqlite3.connect",
"time.localtime",
"lxml.etree.HTML",
"sys.exit"
] | [((978, 1005), 'os.path.exists', 'os.path.exists', (['"""avmoo_.db"""'], {}), "('avmoo_.db')\n", (992, 1005), False, 'import os\n'), ((5027, 5045), 'requests.Session', 'requests.Session', ([], {}), '()\n', (5043, 5045), False, 'import requests\n'), ((12199, 12224), 'lxml.etree.HTML', 'etree.HTML', (['response.text'], {... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from .norm_module import *
from .mask_regression import *
from .sync_batchnorm import SynchronizedBatchNorm2d
BatchNorm = SynchronizedBatchNorm2d
class ResnetGenerator128(nn.Module):
def __init__(self, ch=64, z_dim=128, num_classes=10, output_dim... | [
"torch.nn.Embedding",
"torch.randn",
"torch.cat",
"torch.nn.init.constant_",
"torch.gather",
"torch.nn.Linear",
"torch.zeros",
"torch.nn.Dropout2d",
"torch.nn.Tanh",
"torch.nn.Conv2d",
"torch.nn.BatchNorm2d",
"torch.nn.Sigmoid",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.ReLU",
"torch.nn.Se... | [((12548, 12602), 'torch.nn.Conv2d', 'nn.Conv2d', (['in_feat', 'out_feat', 'kernel_size', 'stride', 'pad'], {}), '(in_feat, out_feat, kernel_size, stride, pad)\n', (12557, 12602), True, 'import torch.nn as nn\n'), ((12875, 12906), 'torch.gather', 'torch.gather', (['input', 'dim', 'index'], {}), '(input, dim, index)\n',... |
# Separate script, to use python multiprocessing, that utilizes pickle #
import sys
from multiprocessing import Pool, cpu_count
import lasagne as nn
import numpy as np
import theano
import theano.tensor as T
from scipy import optimize
from python.util import get_model_params, model_path, model_epoch
from python.model.... | [
"numpy.load",
"numpy.save",
"scipy.optimize.minimize",
"python.util.model_path",
"theano.function",
"multiprocessing.cpu_count",
"python.util.get_model_params",
"lasagne.layers.get_output",
"numpy.linalg.norm",
"python.model.vae.build_vae",
"theano.tensor.vector",
"python.util.model_epoch",
... | [((491, 514), 'python.util.get_model_params', 'get_model_params', (['model'], {}), '(model)\n', (507, 514), False, 'from python.util import get_model_params, model_path, model_epoch\n'), ((527, 550), 'numpy.load', 'np.load', (['test_data_path'], {}), '(test_data_path)\n', (534, 550), True, 'import numpy as np\n'), ((58... |
"""User management."""
from functools import lru_cache
from typing import Any
from httpx import Client
from .base import Base
from .database import Database
from .errors import EmailError, LoginError
from .forms import Form
from .storage import Storage
class LoginState(Base):
def __init__(self, client: Client,... | [
"functools.lru_cache"
] | [((445, 456), 'functools.lru_cache', 'lru_cache', ([], {}), '()\n', (454, 456), False, 'from functools import lru_cache\n'), ((594, 605), 'functools.lru_cache', 'lru_cache', ([], {}), '()\n', (603, 605), False, 'from functools import lru_cache\n'), ((732, 743), 'functools.lru_cache', 'lru_cache', ([], {}), '()\n', (741... |
from . import Constant
from datetime import date
import os.path
import time
class Clock:
def __init__(self):
self.cached_today = date.today()
self.cached_time = int(time.time() * Constant.Clock.MILLIS_IN_SECOND)
def get_timestamped_directory_name(self, dirname):
return "{}-{}".format(dirname, self.... | [
"datetime.date.today",
"time.time"
] | [((138, 150), 'datetime.date.today', 'date.today', ([], {}), '()\n', (148, 150), False, 'from datetime import date\n'), ((178, 189), 'time.time', 'time.time', ([], {}), '()\n', (187, 189), False, 'import time\n')] |
import datetime
from django.db import models
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse as url_reverse
from django.template.defaultfilters import slugify
from django.utils.translation import gett... | [
"django.contrib.sites.models.Site.objects.get_current",
"django.template.defaultfilters.slugify",
"django.utils.translation.gettext_lazy"
] | [((948, 958), 'django.utils.translation.gettext_lazy', '_', (['"""Title"""'], {}), "('Title')\n", (949, 958), True, 'from django.utils.translation import gettext_lazy as _\n'), ((1017, 1026), 'django.utils.translation.gettext_lazy', '_', (['"""Slug"""'], {}), "('Slug')\n", (1018, 1026), True, 'from django.utils.transla... |
from datetime import datetime
from enum import Enum
from flask import current_app
from itsdangerous import Signer
DATE_FORMAT = '%Y-%m-%d'
DATETIME_FORMAT = '%Y-%m-%dT%H:%M'
class AutoNameEnum(Enum):
def _generate_next_value_(name, start, count, last_values):
return name
def parse_dt(text):
retur... | [
"itsdangerous.Signer",
"datetime.datetime.strptime"
] | [((322, 362), 'datetime.datetime.strptime', 'datetime.strptime', (['text', 'DATETIME_FORMAT'], {}), '(text, DATETIME_FORMAT)\n', (339, 362), False, 'from datetime import datetime\n'), ((1357, 1416), 'itsdangerous.Signer', 'Signer', (["current_app.config['SECRET_KEY']"], {'salt': '"""<PASSWORD>"""'}), "(current_app.conf... |
from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import Hello, HelloViewSets, UserProfileViewSet, UserLoginApiView, UserProfileFeedViewSet
router = DefaultRouter()
router.register('hello', HelloViewSets, base_name='hello')
router.register('profile', UserProfileViewSe... | [
"rest_framework.routers.DefaultRouter",
"django.urls.include"
] | [((201, 216), 'rest_framework.routers.DefaultRouter', 'DefaultRouter', ([], {}), '()\n', (214, 216), False, 'from rest_framework.routers import DefaultRouter\n'), ((448, 468), 'django.urls.include', 'include', (['router.urls'], {}), '(router.urls)\n', (455, 468), False, 'from django.urls import path, include\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... | [
"pypsrp.serializer.TaggedValue",
"airflow.exceptions.AirflowException",
"airflow.settings.json.loads",
"airflow.providers.microsoft.psrp.hooks.psrp.PsrpHook"
] | [((5067, 5275), 'airflow.providers.microsoft.psrp.hooks.psrp.PsrpHook', 'PsrpHook', (['self.conn_id'], {'logging_level': 'self.logging_level', 'runspace_options': 'self.runspace_options', 'wsman_options': 'self.wsman_options', 'on_output_callback': '(self.log.info if not self.do_xcom_push else None)'}), '(self.conn_id,... |
#
# Created by: <NAME>, September 2002
#
from __future__ import division, print_function, absolute_import
import sys
import subprocess
import time
from numpy.testing import (assert_equal, assert_array_almost_equal, assert_,
assert_allclose, assert_almost_equal,
a... | [
"numpy.random.seed",
"numpy.triu",
"numpy.abs",
"numpy.ones",
"numpy.isnan",
"numpy.linalg.cond",
"scipy.linalg.svd",
"numpy.linalg.norm",
"scipy.linalg.blas.get_blas_funcs",
"numpy.arange",
"numpy.random.normal",
"numpy.diag",
"numpy.testing.assert_array_almost_equal",
"numpy.zeros_like",... | [((18500, 18520), 'numpy.random.seed', 'np.random.seed', (['(1234)'], {}), '(1234)\n', (18514, 18520), True, 'import numpy as np\n'), ((18530, 18554), 'numpy.random.random', 'np.random.random', (['(4, 4)'], {}), '((4, 4))\n', (18546, 18554), True, 'import numpy as np\n'), ((19988, 20193), 'subprocess.Popen', 'subproces... |
import pathlib
import subprocess as sp
import tempfile
def blacking(source_code: str):
with tempfile.NamedTemporaryFile("w", delete=False) as f:
f.write(source_code)
fname = f.name
p = sp.Popen(f"cat {fname}".split(), stdout=sp.PIPE)
out = sp.check_output("black -q -".split(), stdin=p.s... | [
"tempfile.NamedTemporaryFile",
"pathlib.Path"
] | [((99, 145), 'tempfile.NamedTemporaryFile', 'tempfile.NamedTemporaryFile', (['"""w"""'], {'delete': '(False)'}), "('w', delete=False)\n", (126, 145), False, 'import tempfile\n'), ((500, 546), 'tempfile.NamedTemporaryFile', 'tempfile.NamedTemporaryFile', (['"""w"""'], {'delete': '(False)'}), "('w', delete=False)\n", (52... |
# Copyright MelisaDev 2022 - Present
# Full MIT License can be found in `LICENSE.txt` at the project root.
from __future__ import annotations
from enum import IntEnum
from dataclasses import dataclass
from typing import Optional, Dict, Any
from ...utils.conversion import try_enum
from ...utils.api_model import APIMo... | [
"dataclasses.dataclass"
] | [((2507, 2528), 'dataclasses.dataclass', 'dataclass', ([], {'repr': '(False)'}), '(repr=False)\n', (2516, 2528), False, 'from dataclasses import dataclass\n')] |
import sentry_sdk
from sentry_sdk.integrations.flask import FlaskIntegration
from werkzeug.exceptions import (
NotFound,
MethodNotAllowed,
HTTPVersionNotSupported,
)
import re
from app import app
from app.helpers.errors import EmailAlreadyRegisteredError, MobilicError
from app.helpers.mail import InvalidEm... | [
"sentry_sdk.integrations.flask.FlaskIntegration",
"re.compile"
] | [((659, 706), 're.compile', 're.compile', (['"""^Wrong email/password combination"""'], {}), "('^Wrong email/password combination')\n", (669, 706), False, 'import re\n'), ((1390, 1408), 'sentry_sdk.integrations.flask.FlaskIntegration', 'FlaskIntegration', ([], {}), '()\n', (1406, 1408), False, 'from sentry_sdk.integrat... |
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 30 15:21:02 2018
@author: zbj
"""
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import train_test_split
from sklearn import metrics
from xgboost import XGBClassifier
import pandas as pd
from sklearn.metrics import accuracy_score
## 总样本
r... | [
"sklearn.model_selection.train_test_split",
"sklearn.metrics.accuracy_score",
"sklearn.metrics.roc_auc_score",
"xgboost.XGBClassifier",
"pandas.read_table"
] | [((429, 479), 'pandas.read_table', 'pd.read_table', (["(root + 'train_sample.txt')"], {'sep': '"""\t"""'}), "(root + 'train_sample.txt', sep='\\t')\n", (442, 479), True, 'import pandas as pd\n'), ((571, 624), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'Y'], {'test_size': '(0.3)', 'random_sta... |
import json
import sys
sys.path.append('.')
import argparse
import logging
from tqdm import tqdm
from easydict import EasyDict as edict
from evaluate_metric import TransformationLoss, ClassificationLoss
from dataset import ThreeDLoMatchLoader
from benchmark_utils import set_seed, icp_refine
from benchmark_utils_predato... | [
"sys.path.append",
"os.listdir",
"argparse.ArgumentParser",
"logging.basicConfig",
"os.makedirs",
"evaluate_metric.TransformationLoss",
"logging.StreamHandler",
"dataset.ThreeDLoMatchLoader",
"os.path.exists",
"logging.getLogger",
"collections.defaultdict",
"logging.info",
"benchmark_utils.s... | [((23, 43), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (38, 43), False, 'import sys\n'), ((389, 399), 'benchmark_utils.set_seed', 'set_seed', ([], {}), '()\n', (397, 399), False, 'from benchmark_utils import set_seed, icp_refine\n'), ((3683, 3861), 'dataset.ThreeDLoMatchLoader', 'ThreeDLoMatchL... |
"""
文件夹相关
"""
import os
class Directory:
def __init__(self, path:str) -> None:
"""
path: 文件夹路径
"""
self.path = path
def disk_usage(self):
"""
查看文件夹的占用量
"""
# 使用内部函数避开递归函数self问题
def inner_disk_usage(path):
total = os.path.g... | [
"os.path.isdir",
"os.path.getsize",
"os.path.join",
"os.listdir"
] | [((311, 332), 'os.path.getsize', 'os.path.getsize', (['path'], {}), '(path)\n', (326, 332), False, 'import os\n'), ((348, 367), 'os.path.isdir', 'os.path.isdir', (['path'], {}), '(path)\n', (361, 367), False, 'import os\n'), ((412, 428), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (422, 428), False, 'import... |
import os
from os.path import expanduser
import altair as alt
import numpy as np
import pandas as pd
from scipy.stats.stats import pearsonr
import sqlite3
from util import to_day, to_month, to_year, to_local, allocate_ys, save_plot
from config import dummy_start_date, dummy_end_date, cutoff_date
# %matplotlib inline... | [
"pandas.DataFrame",
"os.makedirs",
"altair.Y",
"scipy.stats.stats.pearsonr",
"util.save_plot",
"altair.Chart",
"altair.Axis",
"altair.X",
"numpy.timedelta64",
"sqlite3.connect",
"pandas.read_sql_query",
"altair.Scale",
"os.path.expanduser",
"pandas.to_numeric",
"altair.Color"
] | [((458, 480), 'numpy.timedelta64', 'np.timedelta64', (['(1)', '"""D"""'], {}), "(1, 'D')\n", (472, 480), True, 'import numpy as np\n'), ((497, 528), 'altair.Scale', 'alt.Scale', ([], {'domain': '[True, False]'}), '(domain=[True, False])\n', (506, 528), True, 'import altair as alt\n'), ((10515, 10551), 'os.makedirs', 'o... |
#########################################################################################
#
# Python Run script for Parallel Open MP execution of the MCE / CCS program
# Written by <NAME> 07/10/2020
#
# This script is based of a similar script witted by <NAME> using bash. This ... | [
"os.mkdir",
"os.remove",
"getpass.getuser",
"inputs.paramz.values",
"glob.glob",
"shutil.rmtree",
"inputs.parameters.values",
"os.chdir",
"inham.SB.values",
"random.randint",
"inham.MP.values",
"os.path.exists",
"socket.gethostname",
"inputs.prop.values",
"subprocess.Popen",
"inputs.cl... | [((3155, 3203), 'sys.exit', 'sys.exit', (['"""Number of repeats must be an integer"""'], {}), "('Number of repeats must be an integer')\n", (3163, 3203), False, 'import sys\n'), ((5526, 5565), 'os.path.exists', 'os.path.exists', (["(EXDIR + '/' + Runfolder)"], {}), "(EXDIR + '/' + Runfolder)\n", (5540, 5565), False, 'i... |
# Chip: ESP32-WROOM-32 (ESP32-D0WDQ6)
# Microprocessor: Dual-Core Xtensa® 32-bit LX6
# Clock: 80MHz to 240Mhz
# Crystal: 40MHz
# SPÍ flash: 4 MB
# Operating voltage: 3.0V-3.6V
# Operating current: 80mA
# Purpose: Read temperature and humidity from DHT sensors
# Notes: The DHT driver is implemented in software and work... | [
"machine.Pin"
] | [((376, 390), 'machine.Pin', 'machine.Pin', (['(4)'], {}), '(4)\n', (387, 390), False, 'import machine\n'), ((448, 462), 'machine.Pin', 'machine.Pin', (['(4)'], {}), '(4)\n', (459, 462), False, 'import machine\n')] |
from django.db import models
from decimal import Decimal
from uuid import uuid4
from django.contrib.auth.models import User
from django.dispatch import receiver
from django.db.models.signals import post_save
def random_cover_filename(instance, filename):
ext = filename.split('.')[-1]
filename = '{}.{}'.format(... | [
"django.db.models.URLField",
"django.db.models.TextField",
"django.db.models.ManyToManyField",
"django.db.models.OneToOneField",
"uuid.uuid4",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.dispatch.receiver",
"django.db.models.BooleanField",
"django.db.models.ImageField",
... | [((3406, 3438), 'django.dispatch.receiver', 'receiver', (['post_save'], {'sender': 'User'}), '(post_save, sender=User)\n', (3414, 3438), False, 'from django.dispatch import receiver\n'), ((744, 775), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(50)'}), '(max_length=50)\n', (760, 775), False, ... |
import torch
from torch import nn
class Tacotron2Loss(nn.Module):
def __init__(self):
super(Tacotron2Loss, self).__init__()
def forward(self, model_output, targets):
mel_target, gate_target = targets[0], targets[1]
mel_target.requires_grad = False
gate_target.requires_grad = F... | [
"torch.nn.MSELoss",
"torch.nn.BCEWithLogitsLoss",
"torch.log",
"torch.nn.L1Loss"
] | [((2029, 2040), 'torch.nn.L1Loss', 'nn.L1Loss', ([], {}), '()\n', (2038, 2040), False, 'from torch import nn\n'), ((604, 626), 'torch.nn.BCEWithLogitsLoss', 'nn.BCEWithLogitsLoss', ([], {}), '()\n', (624, 626), False, 'from torch import nn\n'), ((492, 504), 'torch.nn.MSELoss', 'nn.MSELoss', ([], {}), '()\n', (502, 504)... |
import xlrd
import xlwt
import pylightxl as xl
import os
import sys
import re
import PySimpleGUI as sg
from collections import OrderedDict
class SalaryCounter:
def __init__(self, values):
self.values = values
self.payrolls = {}
self.headers = []
self.counter = False
self.m... | [
"PySimpleGUI.Button",
"PySimpleGUI.Checkbox",
"os.path.abspath",
"xlwt.Workbook",
"PySimpleGUI.theme",
"os.path.dirname",
"os.walk",
"xlrd.open_workbook",
"PySimpleGUI.Text",
"PySimpleGUI.Window",
"pylightxl.writexl",
"collections.OrderedDict",
"pylightxl.readxl",
"pylightxl.Database",
"... | [((837, 862), 'os.walk', 'os.walk', (['application_path'], {}), '(application_path)\n', (844, 862), False, 'import os\n'), ((1076, 1118), 're.compile', 're.compile', (['"""^([^\\\\\\\\]{1,50}).(xls|xlsx)$"""'], {}), "('^([^\\\\\\\\]{1,50}).(xls|xlsx)$')\n", (1086, 1118), False, 'import re\n'), ((1135, 1179), 're.search... |
#!/usr/bin/env python
# coding=utf-8
__author__ = 'zhaoliang'
__email__ = '<EMAIL>'
__created__ = '15/12/19'
import os
CSRF_ENABLED = True
SECRET_KEY = 'guess what you can and try it'
DATABASE_URI = {
'host': 'localhost',
'user': 'root',
'passwd': '<PASSWORD>',
'port': 3306,
'db': 'vansel',
... | [
"os.path.dirname",
"os.path.join"
] | [((412, 452), 'os.path.join', 'os.path.join', (['ROOT_PATH', '"""cache/protype"""'], {}), "(ROOT_PATH, 'cache/protype')\n", (424, 452), False, 'import os\n'), ((470, 508), 'os.path.join', 'os.path.join', (['ROOT_PATH', '"""cache/data/"""'], {}), "(ROOT_PATH, 'cache/data/')\n", (482, 508), False, 'import os\n'), ((370, ... |
from selenium.webdriver.support import expected_conditions as EC
from pages.page import Page
class HomePage(Page):
PAGE_URL = "https://www.wikipedia.org"
def visit(self):
self.selenium.driver.get(HomePage.PAGE_URL)
self.verify_is_loaded()
def verify_is_loaded(self):
self.selenium... | [
"selenium.webdriver.support.expected_conditions.title_is"
] | [((350, 374), 'selenium.webdriver.support.expected_conditions.title_is', 'EC.title_is', (['"""Wikipedia"""'], {}), "('Wikipedia')\n", (361, 374), True, 'from selenium.webdriver.support import expected_conditions as EC\n')] |
# Generated by Django 3.1.1 on 2020-10-16 14:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('BlogApp', '0009_newsletter'),
]
operations = [
migrations.AlterField(
model_name='newsletter',
name='e... | [
"django.db.models.EmailField"
] | [((346, 392), 'django.db.models.EmailField', 'models.EmailField', ([], {'max_length': '(254)', 'unique': '(True)'}), '(max_length=254, unique=True)\n', (363, 392), False, 'from django.db import migrations, models\n')] |
import kakao_reviews as kr
import naverv4_blog as nv4
import gocamp_crawl as gc
import gocamp_link_crawl as gl
import datetime
from camping_server2.bot import slackbot
import camping_server2.config as config
import time
import naverv5_category as nv5
import camping_server2.scraping.ogcamp_crawl as oc
import pandas as p... | [
"pandas.read_csv",
"gocamp_link_crawl.CampLink",
"time.sleep",
"naverv5_category.CategoryScraping",
"datetime.datetime.now"
] | [((433, 485), 'pandas.read_csv', 'pd.read_csv', (["(config.Config.PATH + '/target_list.csv')"], {}), "(config.Config.PATH + '/target_list.csv')\n", (444, 485), True, 'import pandas as pd\n'), ((2802, 2815), 'gocamp_link_crawl.CampLink', 'gl.CampLink', ([], {}), '()\n', (2813, 2815), True, 'import gocamp_link_crawl as g... |
import setuptools
with open('README.rst') as f:
readme = f.read()
setuptools.setup(
name='mkepub-fork',
version='1.2',
description='Simple minimalistic library for creating EPUB3 files',
long_description=readme,
url='https://github.com/ivanleopoldo/mkepub-fork/',
author='anqxyr, ivanleopol... | [
"setuptools.setup"
] | [((72, 846), 'setuptools.setup', 'setuptools.setup', ([], {'name': '"""mkepub-fork"""', 'version': '"""1.2"""', 'description': '"""Simple minimalistic library for creating EPUB3 files"""', 'long_description': 'readme', 'url': '"""https://github.com/ivanleopoldo/mkepub-fork/"""', 'author': '"""anqxyr, ivanleopoldo"""', ... |
# _*_coding:utf-8_*_
__author__ = 'song'
__date__ = '2017/10/24 23:03'
import xadmin
from .models import CityDict,CourseOrg,Teacher
class CityDictAdmin(object):
list_display = ['name', 'desc', 'add_time']
search_fields = ['name', 'desc', 'add_time']
list_filter = ['name', 'desc', 'add_time']
... | [
"xadmin.site.register"
] | [((931, 976), 'xadmin.site.register', 'xadmin.site.register', (['CityDict', 'CityDictAdmin'], {}), '(CityDict, CityDictAdmin)\n', (951, 976), False, 'import xadmin\n'), ((977, 1024), 'xadmin.site.register', 'xadmin.site.register', (['CourseOrg', 'CourseOrgAdmin'], {}), '(CourseOrg, CourseOrgAdmin)\n', (997, 1024), Fals... |
# -*- coding: utf-8 -*-
"""Console script for srgssr_publication_data_api."""
import sys
import json
import click
from dotenv import load_dotenv
from sgqlc.types import Variable, non_null
from srgssr_publication_data_api import PublicationDataApi
@click.command()
@click.option('--size', help='number of items', defau... | [
"sgqlc.types.non_null",
"sgqlc.types.Variable",
"click.option",
"srgssr_publication_data_api.PublicationDataApi",
"click.command"
] | [((251, 266), 'click.command', 'click.command', ([], {}), '()\n', (264, 266), False, 'import click\n'), ((268, 336), 'click.option', 'click.option', (['"""--size"""'], {'help': '"""number of items"""', 'default': '(10)', 'type': 'int'}), "('--size', help='number of items', default=10, type=int)\n", (280, 336), False, '... |
#!/usr/bin/env python
"""
Aiida interface for twinpy.
"""
import warnings
import numpy as np
from aiida.cmdline.utils.decorators import with_dbenv
from aiida.orm import (load_node,
Node,
QueryBuilder,
)
from aiida.plugins import WorkflowFactory
from... | [
"aiida.orm.QueryBuilder",
"twinpy.interfaces.aiida.base.check_process_class",
"aiida.orm.load_node",
"aiida.plugins.WorkflowFactory",
"twinpy.interfaces.aiida.twinboundary.AiidaTwinBoudnaryRelaxWorkChain",
"numpy.argsort",
"aiida_twinpy.common.utils.get_create_node",
"warnings.warn",
"aiida.cmdline.... | [((646, 658), 'aiida.cmdline.utils.decorators.with_dbenv', 'with_dbenv', ([], {}), '()\n', (656, 658), False, 'from aiida.cmdline.utils.decorators import with_dbenv\n'), ((991, 1031), 'twinpy.interfaces.aiida.base.check_process_class', 'check_process_class', (['node', 'process_class'], {}), '(node, process_class)\n', (... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# filename: rander_model.py
import os
from utils import txt_load, gzip_dump
OUTPUT_DIR = "../src/main/resources/"
fileList = [
"dict.big",
"dict.std",
"dict.small",
"idf.std",
]
for file in fileList:
txtFile = os.path.join(OUTPUT_DIR, file+".t... | [
"os.path.join",
"utils.txt_load"
] | [((287, 326), 'os.path.join', 'os.path.join', (['OUTPUT_DIR', "(file + '.txt')"], {}), "(OUTPUT_DIR, file + '.txt')\n", (299, 326), False, 'import os\n'), ((338, 376), 'os.path.join', 'os.path.join', (['OUTPUT_DIR', "(file + '.gz')"], {}), "(OUTPUT_DIR, file + '.gz')\n", (350, 376), False, 'import os\n'), ((389, 406), ... |
#!/usr/local/python3.4.6/bin/python3.4
# DISCLAIMER
#
# This is a sample script for demo and reference purpose only.
# It is subject to change for content updates without warning.
#
# DESCRIPTION
# This sample script uses two back-to-back Ixia ports.
# Supports both IxNetwork API server and Linux API serve... | [
"requests.packages.urllib3.disable_warnings",
"IxN_RestApiPy3.startAllProtocols",
"IxN_RestApiPy3.createIpv4Ngpf",
"IxN_RestApiPy3.createEthernetNgpf",
"IxN_RestApiPy3.assignPorts",
"IxN_RestApiPy3.getStats",
"IxN_RestApiPy3.newBlankConfig",
"IxN_RestApiPy3.regenerateTrafficItems",
"traceback.print_... | [((2751, 2841), 'IxN_RestApiPy3.newBlankConfig', 'IxN_RestApiPy3.newBlankConfig', (['sessionUrl'], {'apiKey': 'apiKey', 'verifySslCert': 'verifySslCert'}), '(sessionUrl, apiKey=apiKey, verifySslCert=\n verifySslCert)\n', (2780, 2841), False, 'import IxN_RestApiPy3\n'), ((2841, 2956), 'IxN_RestApiPy3.connectIxChassis... |
#!/usr/bin/env python
from distutils.core import setup
import os
from setuptools import find_packages
name = '<NAME>'
# I might be just a little bit too much afraid of those bots..
address = name.lower().replace(' ', '.')+chr(64)+'gmail.com'
setup(name='robpy',
version='0.1',
description='Test runner - R... | [
"os.path.join",
"setuptools.find_packages"
] | [((465, 480), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (478, 480), False, 'from setuptools import find_packages\n'), ((499, 531), 'os.path.join', 'os.path.join', (['"""scripts"""', '"""robpy"""'], {}), "('scripts', 'robpy')\n", (511, 531), False, 'import os\n'), ((533, 569), 'os.path.join', 'os.pa... |
import random
import stdio
a = random.randrange(1, 7)
b = random.randrange(1, 7)
stdio.writeln("Sum after rolling 2 dices: " + str(a) + " + " + str(b) + " = " + str(a + b))
| [
"random.randrange"
] | [((32, 54), 'random.randrange', 'random.randrange', (['(1)', '(7)'], {}), '(1, 7)\n', (48, 54), False, 'import random\n'), ((59, 81), 'random.randrange', 'random.randrange', (['(1)', '(7)'], {}), '(1, 7)\n', (75, 81), False, 'import random\n')] |
import re
from dataclasses import dataclass, field
from enum import Enum
from typing import Optional, Sequence, Union
from PyQt5.QtCore import QEventLoop, pyqtSignal, QTimer
from PyQt5.QtGui import QKeySequence
from PyQt5.QtWidgets import QDialog, QWidget, QApplication
from Cat.CatPythonGUI.GUI import CORNERS, Python... | [
"PyQt5.QtCore.pyqtSignal",
"Cat.CatPythonGUI.GUI.codeEditor.Position",
"model.pathUtils.loadTextFile",
"Cat.CatPythonGUI.GUI.Widgets.HTMLDelegate",
"session.session.getSession",
"PyQt5.QtGui.QKeySequence",
"Cat.utils.escapeForXml",
"Cat.utils.profiling.TimedMethod",
"PyQt5.QtCore.QTimer.singleShot",... | [((1041, 1068), 'dataclasses.dataclass', 'dataclass', ([], {'unsafe_hash': '(True)'}), '(unsafe_hash=True)\n', (1050, 1068), False, 'from dataclasses import dataclass, field\n'), ((1200, 1227), 'dataclasses.field', 'field', ([], {'default_factory': 'list'}), '(default_factory=list)\n', (1205, 1227), False, 'from datacl... |
from subprocess import call
import os
from sstcam_sandbox.d181123_tf_cell_check import TF_Storage, \
TF_Sampling, all_files
def process(file, tf):
r0_path = file.r0_path
r1_name = os.path.basename(r0_path).replace("_r0", "_r1")
r1_path = os.path.join(tf.r1_dir, r1_name)
ped_path = file.ped_path
... | [
"os.makedirs",
"os.path.basename",
"os.path.dirname",
"os.path.exists",
"subprocess.call",
"sstcam_sandbox.d181123_tf_cell_check.TF_Storage",
"os.path.join",
"sstcam_sandbox.d181123_tf_cell_check.TF_Sampling"
] | [((256, 288), 'os.path.join', 'os.path.join', (['tf.r1_dir', 'r1_name'], {}), '(tf.r1_dir, r1_name)\n', (268, 288), False, 'import os\n'), ((358, 382), 'os.path.dirname', 'os.path.dirname', (['r1_path'], {}), '(r1_path)\n', (373, 382), False, 'import os\n'), ((614, 635), 'subprocess.call', 'call', (['cmd'], {'shell': '... |
import os
import sys
import argparse
import json
import re
SCHEMA_PATH = os.path.abspath("../resources/schema")
def main():
parser = argparse.ArgumentParser(description="Do stuff")
parser.add_argument("--schema", default=None)
arguments = parser.parse_args()
schema_file = arguments.schema
schema_... | [
"os.path.abspath",
"re.sub",
"argparse.ArgumentParser",
"json.loads"
] | [((74, 112), 'os.path.abspath', 'os.path.abspath', (['"""../resources/schema"""'], {}), "('../resources/schema')\n", (89, 112), False, 'import os\n'), ((140, 187), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Do stuff"""'}), "(description='Do stuff')\n", (163, 187), False, 'import argp... |
# ######################################################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... | [
"aws_cdk.aws_stepfunctions.Choice",
"aws_cdk.core.Duration.seconds",
"aws_cdk.aws_stepfunctions.Condition.is_present",
"aws_cdk.aws_stepfunctions.Map",
"aws_cdk.aws_stepfunctions.Pass"
] | [((2179, 2308), 'aws_cdk.aws_stepfunctions.Pass', 'Pass', (['self', '"""Prepare Filter Input Data"""'], {'input_path': '"""$.datasetGroupArn"""', 'result_path': '"""$.filter.serviceConfig.datasetGroupArn"""'}), "(self, 'Prepare Filter Input Data', input_path='$.datasetGroupArn',\n result_path='$.filter.serviceConfig... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | [
"threading.Thread",
"functools.partial",
"uuid.uuid4",
"threading.RLock",
"time.sleep",
"logging.getLogger"
] | [((626, 653), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (643, 653), False, 'import logging\n'), ((2451, 2468), 'threading.RLock', 'threading.RLock', ([], {}), '()\n', (2466, 2468), False, 'import threading\n'), ((9490, 9535), 'threading.Thread', 'threading.Thread', ([], {'target': 's... |
#!/usr/bin/env python3
#
# Project homepage: https://github.com/mwoolweaver
# Licence: <http://unlicense.org/>
# Created by <NAME> <<EMAIL>>
# ================================================================================
import pandas
from lib.debug import debuginfo, debuginfoDBV, debuginfoDBVV, debuginfoDBVVV, sql... | [
"pandas.read_csv"
] | [((668, 729), 'pandas.read_csv', 'pandas.read_csv', (['fileNeeded'], {'delimiter': '"""\t"""', 'encoding': '"""utf-8"""'}), "(fileNeeded, delimiter='\\t', encoding='utf-8')\n", (683, 729), False, 'import pandas\n'), ((433, 494), 'pandas.read_csv', 'pandas.read_csv', (['fileNeeded'], {'delimiter': '"""\t"""', 'encoding'... |
# -*- coding: utf-8 -*-
import sys
import os
sys.path.insert(0, os.path.abspath('../..'))
# -- General configuration ----------------------------------------------------
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
]
# Add any paths that contain templates here, relative to this directory.... | [
"os.path.abspath"
] | [((66, 90), 'os.path.abspath', 'os.path.abspath', (['"""../.."""'], {}), "('../..')\n", (81, 90), False, 'import os\n')] |
import gym
import pybullet as p
import numpy as np
from gym_delta_robot_trampoline.resources.delta_robot_trampoline import Omnid_Simulator
import matplotlib.pyplot as plt
import os
import pybullet_data
"""
Action space (1,3) : [theta_1_torque, theta_2_torque, theta_3_torque]
Observation space (1,18) : [3 joint_positio... | [
"pybullet.setRealTimeSimulation",
"pybullet.resetSimulation",
"pybullet.stepSimulation",
"pybullet.setGravity",
"pybullet.configureDebugVisualizer",
"gym_delta_robot_trampoline.resources.delta_robot_trampoline.Omnid_Simulator",
"pybullet.resetDebugVisualizerCamera",
"pybullet.disconnect",
"numpy.arr... | [((716, 732), 'pybullet.connect', 'p.connect', (['p.GUI'], {}), '(p.GUI)\n', (725, 732), True, 'import pybullet as p\n'), ((741, 865), 'pybullet.resetDebugVisualizerCamera', 'p.resetDebugVisualizerCamera', ([], {'cameraDistance': '(1.5)', 'cameraYaw': '(0)', 'cameraPitch': '(-40)', 'cameraTargetPosition': '[0.05, -0.35... |
"""cc_licenses URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Clas... | [
"django.views.generic.TemplateView.as_view",
"django.conf.urls.static.static",
"django.conf.urls.url",
"django.urls.include"
] | [((1329, 1390), 'django.conf.urls.static.static', 'static', (['settings.MEDIA_URL'], {'document_root': 'settings.MEDIA_ROOT'}), '(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)\n', (1335, 1390), False, 'from django.conf.urls.static import static\n'), ((964, 995), 'django.conf.urls.url', 'url', (['"""^admin/"""'... |
from rpython.rlib.rbigint import BASE10
from typhon.nano import checkpoints
from typhon.quoting import quoteChar, quoteStr
def doNanoSmallCaps(expr):
expr = checkpoints.AddCheckpoints().visitExpr(expr)
expr = checkpoints.CollectCheckpoints().visitExpr(expr)
return expr
class PrettySmallCaps(checkpoints.C... | [
"typhon.nano.checkpoints.AddCheckpoints",
"typhon.nano.checkpoints.CollectCheckpoints",
"typhon.quoting.quoteStr",
"typhon.quoting.quoteChar",
"typhon.nano.checkpoints.CheckpointIR.makePassTo"
] | [((307, 348), 'typhon.nano.checkpoints.CheckpointIR.makePassTo', 'checkpoints.CheckpointIR.makePassTo', (['None'], {}), '(None)\n', (342, 348), False, 'from typhon.nano import checkpoints\n'), ((163, 191), 'typhon.nano.checkpoints.AddCheckpoints', 'checkpoints.AddCheckpoints', ([], {}), '()\n', (189, 191), False, 'from... |
from django.contrib import admin
from .models import CsvDownload
class CsvDownloadAdmin(admin.ModelAdmin):
list_display = ("user", "timestamp", "row_count", "filename")
list_filter = ("timestamp",)
search_fields = ("user", "filename")
raw_id_fields = ("user",)
readonly_fields = (
"user",
... | [
"django.contrib.admin.site.register"
] | [((409, 459), 'django.contrib.admin.site.register', 'admin.site.register', (['CsvDownload', 'CsvDownloadAdmin'], {}), '(CsvDownload, CsvDownloadAdmin)\n', (428, 459), False, 'from django.contrib import admin\n')] |
""" Default Runner & Worker components
Local Runner
Memmap Interface (numpy)
Template Preprocessor
JSON Postprocessor
NumpytxtPostprocessor
HDF5Postprocessor
"""
from .runner import Runner, RunnerInterface
from .worker import Interface, Preprocessor, Postprocessor, Worker
import subprocess
from multiprocessing impor... | [
"os.listdir",
"subprocess.Popen",
"numpy.save",
"numpy.load",
"os.remove",
"json.load",
"h5py.File",
"profit.pre.fill_run_dir_single",
"os.getcwd",
"os.path.dirname",
"numpy.zeros",
"os.path.exists",
"numpy.genfromtxt",
"time.sleep",
"shutil.rmtree",
"multiprocessing.Process",
"os.ch... | [((4409, 4486), 'numpy.zeros', 'np.zeros', (['size'], {'dtype': '(self.input_vars + self.internal_vars + self.output_vars)'}), '(size, dtype=self.input_vars + self.internal_vars + self.output_vars)\n', (4417, 4486), True, 'import numpy as np\n'), ((4495, 4534), 'numpy.save', 'np.save', (["self.config['path']", 'init_da... |
# <NAME> 3/5/20
import os
from time_stepping import *
num_sensors: int = 20
sensing_radius: float = 0.2
timestep_size: float = 0.01
unit_square: Boundary = RectangularDomain(spacing=sensing_radius)
# noinspection PyTypeChecker
billiard: MotionModel = BilliardMotion(dt=timestep_size, boundary=unit_square, vel=1, n_in... | [
"os.mkdir",
"os.path.exists"
] | [((1348, 1374), 'os.path.exists', 'os.path.exists', (['output_dir'], {}), '(output_dir)\n', (1362, 1374), False, 'import os\n'), ((1384, 1404), 'os.mkdir', 'os.mkdir', (['output_dir'], {}), '(output_dir)\n', (1392, 1404), False, 'import os\n')] |
from Bio import pairwise2
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio.pairwise2 import format_alignment
adjacency_list = {
"A": {"R", "W", "M"},
"G": {"R", "K", "S"},
"T": {"W", "K", "Y"},
"C": {"M", "S", "Y"},
"R": {"D", "V"},
"W": {"D", "H"},
"M": {"V", "H"},
... | [
"Bio.Seq.Seq",
"Bio.pairwise2.format_alignment"
] | [((2492, 2524), 'Bio.pairwise2.format_alignment', 'format_alignment', (['*alignments[0]'], {}), '(*alignments[0])\n', (2508, 2524), False, 'from Bio.pairwise2 import format_alignment\n'), ((2548, 2571), 'Bio.Seq.Seq', 'Seq', (['alignments[0].seqA'], {}), '(alignments[0].seqA)\n', (2551, 2571), False, 'from Bio.Seq impo... |