code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
#!/usr/bin/env python
#
# ----------------------------------------------------------------------
#
# <NAME>, U.S. Geological Survey
# <NAME>, GNS Science
# <NAME>, University of Chicago
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://geodynamics.org).
#
# Copyright (c) ... | [
"Fault.Fault._configure",
"Fault.Fault.__init__",
"faults.FaultCohesive.useFaultMesh"
] | [((2233, 2259), 'Fault.Fault.__init__', 'Fault.__init__', (['self', 'name'], {}), '(self, name)\n', (2247, 2259), False, 'from Fault import Fault\n'), ((2426, 2448), 'Fault.Fault._configure', 'Fault._configure', (['self'], {}), '(self)\n', (2442, 2448), False, 'from Fault import Fault\n'), ((2453, 2515), 'faults.FaultC... |
#
#
# Copyright 2019 Asylo 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 applicable law or agreed to in wri... | [
"collections.defaultdict",
"re.match"
] | [((1960, 1989), 'collections.defaultdict', 'collections.defaultdict', (['dict'], {}), '(dict)\n', (1983, 1989), False, 'import collections\n'), ((2081, 2110), 'collections.defaultdict', 'collections.defaultdict', (['dict'], {}), '(dict)\n', (2104, 2110), False, 'import collections\n'), ((5884, 5930), 're.match', 're.ma... |
#!/usr/bin/env python
import os
import sys
from io import BytesIO, IOBase
import math
from collections import Counter
M1_ROOT_CACHES = {}
M2_ROOT_CACHES = {}
def update_node(node, val, edges, root_caches):
while True:
tmp = edges[node]
edges[node] = find_root(val, edges, root_caches)
if n... | [
"sys.stdin.readline",
"io.BytesIO",
"os.fstat"
] | [((2826, 2835), 'io.BytesIO', 'BytesIO', ([], {}), '()\n', (2833, 2835), False, 'from io import BytesIO, IOBase\n'), ((4305, 4325), 'sys.stdin.readline', 'sys.stdin.readline', ([], {}), '()\n', (4323, 4325), False, 'import sys\n'), ((3046, 3064), 'os.fstat', 'os.fstat', (['self._fd'], {}), '(self._fd)\n', (3054, 3064),... |
import copy
import logging
from collections.abc import Collection, Mapping
from dataclasses import FrozenInstanceError, asdict, dataclass, field, replace
from typing import List, Optional, Union
from . import __version__
from .composition import AdapterCompositionBlock
from .utils import get_adapter_config_hash, resol... | [
"logging.getLogger",
"dataclasses.asdict",
"dataclasses.dataclass",
"dataclasses.replace",
"copy.deepcopy",
"dataclasses.FrozenInstanceError",
"dataclasses.field"
] | [((349, 376), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (366, 376), False, 'import logging\n'), ((4537, 4556), 'dataclasses.dataclass', 'dataclass', ([], {'eq': '(False)'}), '(eq=False)\n', (4546, 4556), False, 'from dataclasses import FrozenInstanceError, asdict, dataclass, field, r... |
import os
import sys
import screenshot
import tweetMedia
import config
import sqlite3
# TODO:
# Fix error 413 on linux (fixed?)
# Fix gif outside time limit
# remake code to no longer use itsoffset (done on hdmv)
# frame selection is accurate on no_subtitles and hdmv, ass is off by nearly 4 seconds on index 297
# f... | [
"tweetMedia.TWEET",
"os.path.isdir",
"sqlite3.connect",
"screenshot.SCREENSHOT"
] | [((994, 1046), 'sqlite3.connect', 'sqlite3.connect', (["(config.Text_Location + 'history.db')"], {}), "(config.Text_Location + 'history.db')\n", (1009, 1046), False, 'import sqlite3\n'), ((1465, 1501), 'os.path.isdir', 'os.path.isdir', (['config.Media_Location'], {}), '(config.Media_Location)\n', (1478, 1501), False, '... |
# ----------------------------------------------------------------------
# vc domain selector
# ----------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
# Third-par... | [
"django.db.models.ForeignKey"
] | [((719, 837), 'django.db.models.ForeignKey', 'models.ForeignKey', (['ManagedObjectSelector'], {'verbose_name': '"""Selector"""', 'null': '(True)', 'blank': '(True)', 'on_delete': 'models.CASCADE'}), "(ManagedObjectSelector, verbose_name='Selector', null=True,\n blank=True, on_delete=models.CASCADE)\n", (736, 837), F... |
import matplotlib.pyplot as plt
import numpy as np
from scipy import stats
from scipy.stats import spearmanr
import scipy
import statistics
#####################################
#多読図書の誤差
gosa_t = [2.5936085940242886, 0.3649609355211716, -1.5684807178864082, 0.08092297493428235, 0.22543171481307445, -1.3691957161909... | [
"statistics.mean",
"scipy.stats.bartlett",
"scipy.stats.t.interval",
"numpy.array",
"scipy.stats.ttest_ind",
"scipy.stats.mannwhitneyu",
"scipy.stats.shapiro"
] | [((897, 913), 'numpy.array', 'np.array', (['gosa_t'], {}), '(gosa_t)\n', (905, 913), True, 'import numpy as np\n'), ((925, 941), 'numpy.array', 'np.array', (['gosa_i'], {}), '(gosa_i)\n', (933, 941), True, 'import numpy as np\n'), ((1015, 1039), 'scipy.stats.shapiro', 'stats.shapiro', (['tadoku_np'], {}), '(tadoku_np)\... |
import pickle
import json
import argparse
import cv2
import os
import numpy as np
import torch
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import matplotlib.patches as patches
import matplotlib.lines as lines
from tqdm import tqdm
import _init_paths
from core.config import cfg
from datasets_rel.p... | [
"matplotlib.pyplot.imshow",
"argparse.ArgumentParser",
"numpy.where",
"matplotlib.pyplot.gca",
"pickle.load",
"os.path.join",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"os.mkdir",
"graphviz.Graph",
"matplotlib.pyplot.Rectangle",
"matplotlib.pyplot.axis"
] | [((567, 631), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Test a Fast R-CNN network"""'}), "(description='Test a Fast R-CNN network')\n", (590, 631), False, 'import argparse\n'), ((1142, 1154), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1152, 1154), True, 'import mat... |
#!/usr/bin/env python
import contextlib
import os
import os.path
import subprocess
import util
#
# Utility Functions
#
@contextlib.contextmanager
def _data_test(filename, *args, **kwargs):
with util.directory_created("data_scratch") as directory:
yield directory
# Files are now created
with util.archive_... | [
"subprocess.check_call",
"os.path.join",
"util.directory_created",
"sys.exc_info",
"os.unlink",
"util.archive_created",
"util.skip_if_no_compression_support"
] | [((663, 740), 'subprocess.check_call', 'subprocess.check_call', (["['xar', '-f', archive_path, '--dump-toc=data_toc.xml']"], {}), "(['xar', '-f', archive_path, '--dump-toc=data_toc.xml'])\n", (684, 740), False, 'import subprocess\n'), ((1389, 1432), 'util.skip_if_no_compression_support', 'util.skip_if_no_compression_su... |
"""
Implements the base class for the cost function class.
"""
from abc import ABCMeta, abstractmethod
from fitbenchmarking.utils.exceptions import IncompatibleMinimizerError
class CostFunc:
"""
Base class for the cost functions.
"""
__metaclass__ = ABCMeta
def __init__(self, problem):
... | [
"fitbenchmarking.utils.exceptions.IncompatibleMinimizerError"
] | [((4141, 4176), 'fitbenchmarking.utils.exceptions.IncompatibleMinimizerError', 'IncompatibleMinimizerError', (['message'], {}), '(message)\n', (4167, 4176), False, 'from fitbenchmarking.utils.exceptions import IncompatibleMinimizerError\n')] |
from flask import Flask, request, abort
from flask_cors import CORS
from utils import validate_data, suggested_links, update_classifier
app = Flask(__name__)
CORS(app)
@app.route("/")
def index():
"""Returns the version number of the application.
:return: Application version
:rtype: string
"""
r... | [
"utils.suggested_links",
"utils.validate_data",
"utils.update_classifier",
"flask_cors.CORS",
"flask.Flask",
"flask.abort"
] | [((143, 158), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (148, 158), False, 'from flask import Flask, request, abort\n'), ((159, 168), 'flask_cors.CORS', 'CORS', (['app'], {}), '(app)\n', (163, 168), False, 'from flask_cors import CORS\n'), ((945, 985), 'utils.update_classifier', 'update_classifier', (... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-07-17 10:21
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_initial'),
]
operations = [
migrations.RemoveField(
... | [
"django.db.models.DateTimeField",
"django.db.migrations.RemoveField"
] | [((286, 351), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""article"""', 'name': '"""release_time"""'}), "(model_name='article', name='release_time')\n", (308, 351), False, 'from django.db import migrations, models\n'), ((502, 537), 'django.db.models.DateTimeField', 'models.DateT... |
from setuptools import setup, find_packages
from design_nest import __version__
with open("README.md", "r") as fh:
long_description = fh.read()
setup(name='design_nest',
version=__version__,
description='Python library which allows to read, modify, create and run EnergyPlus files and simulations.',
... | [
"setuptools.find_packages"
] | [((717, 732), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (730, 732), False, 'from setuptools import setup, find_packages\n')] |
import sys, os
import praw
import redditAPI, twitterAPI
def searchHandle(query, apiSelectArray):
redditResults = ""
twitterResults = ""
print(apiSelectArray)
#Logic chunk to call API's based on selected social media site.
if 'reddit' in apiSelectArray:
redditResults = redditAPI.search(query)
if 'twitter... | [
"twitterAPI.search",
"redditAPI.search"
] | [((283, 306), 'redditAPI.search', 'redditAPI.search', (['query'], {}), '(query)\n', (299, 306), False, 'import redditAPI, twitterAPI\n'), ((361, 385), 'twitterAPI.search', 'twitterAPI.search', (['query'], {}), '(query)\n', (378, 385), False, 'import redditAPI, twitterAPI\n')] |
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import sklearn.linear_model
oecd = pd.read_csv(r'/Users/pariszhang/Desktop/Data/oecd/OECDBLI2017cleanedcsv.csv')
life_satisfaction = oecd['Life satisfaction as avg score']
personal_earnings = oecd['Personal earnings in usd']
d = {'Life Satisfacti... | [
"pandas.DataFrame",
"numpy.array",
"pandas.read_csv"
] | [((107, 183), 'pandas.read_csv', 'pd.read_csv', (['"""/Users/pariszhang/Desktop/Data/oecd/OECDBLI2017cleanedcsv.csv"""'], {}), "('/Users/pariszhang/Desktop/Data/oecd/OECDBLI2017cleanedcsv.csv')\n", (118, 183), True, 'import pandas as pd\n'), ((438, 458), 'pandas.DataFrame', 'pd.DataFrame', ([], {'data': 'd'}), '(data=d... |
# stdlib
import math
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from typing import Type
# third party
import boto3
from nacl.signing import VerifyKey
from typing_extensions import final
# relative
from ......grid import GridURL
from .....common.serde.serializabl... | [
"math.ceil"
] | [((2175, 2234), 'math.ceil', 'math.ceil', (['(self.payload.file_size / self.payload.chunk_size)'], {}), '(self.payload.file_size / self.payload.chunk_size)\n', (2184, 2234), False, 'import math\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# <NAME> <http://maxwu.me>
import os
import yaml
try:
# Python 3
from collections import ChainMap
except ImportError:
# Python 2.7
from chainmap import ChainMap
from cistat.logger import Logger
logger = Logger(name=__name__).get_logger()
ME_ROOT_DIR = os... | [
"cistat.logger.Logger",
"yaml.load",
"os.path.dirname",
"os.path.abspath",
"chainmap.ChainMap",
"os.path.expanduser"
] | [((431, 454), 'os.path.expanduser', 'os.path.expanduser', (['"""~"""'], {}), "('~')\n", (449, 454), False, 'import os\n'), ((334, 359), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (349, 359), False, 'import os\n'), ((388, 416), 'os.path.dirname', 'os.path.dirname', (['ME_ROOT_DIR'], {}), '... |
# Generated by Django 3.1.6 on 2021-02-18 01:18
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('exercises', '0001_initial'),
]
operations = [
migrations.CreateModel(
name=... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"django.db.models.AutoField",
"django.db.models.CharField"
] | [((375, 468), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (391, 468), False, 'from django.db import migrations, models\... |
from sqlalchemy import Column, Integer, ForeignKey
from sqlalchemy.orm import relationship
from db.classes.Base import Base
class ProblemTag(Base):
""" many 2 many relationship between problems and tags """
__tablename__ = 'problems_tags'
problemId = Column(Integer, ForeignKey('problems.id'), primary_ke... | [
"sqlalchemy.orm.relationship",
"sqlalchemy.ForeignKey"
] | [((412, 458), 'sqlalchemy.orm.relationship', 'relationship', (['"""Problem"""'], {'back_populates': '"""tags"""'}), "('Problem', back_populates='tags')\n", (424, 458), False, 'from sqlalchemy.orm import relationship\n'), ((469, 515), 'sqlalchemy.orm.relationship', 'relationship', (['"""Tag"""'], {'back_populates': '"""... |
import random
from app import app
from flask import jsonify, send_from_directory, request, url_for, redirect, flash
from utils import execute_sql, generate
# serve site assets
@app.route('/public/<path:path>')
def serve_static_assets(path):
return send_from_directory('public', path)
@app.route('/r/create', metho... | [
"flask.request.args.get",
"flask.send_from_directory",
"flask.url_for",
"app.app.route",
"utils.execute_sql",
"random.randint",
"flask.jsonify"
] | [((179, 211), 'app.app.route', 'app.route', (['"""/public/<path:path>"""'], {}), "('/public/<path:path>')\n", (188, 211), False, 'from app import app\n'), ((292, 332), 'app.app.route', 'app.route', (['"""/r/create"""'], {'methods': "['POST']"}), "('/r/create', methods=['POST'])\n", (301, 332), False, 'from app import a... |
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
points = IN[0]
almostzero = IN[1]
struts = list()
# this function recursively finds all the pairs of points of the buckyball struts
def BuckyballStruts(points,struts):
firstpoint = points[0]
restofpoints = points[1:]
# measur... | [
"clr.AddReference"
] | [((11, 44), 'clr.AddReference', 'clr.AddReference', (['"""ProtoGeometry"""'], {}), "('ProtoGeometry')\n", (27, 44), False, 'import clr\n'), ((1261, 1294), 'clr.AddReference', 'clr.AddReference', (['"""ProtoGeometry"""'], {}), "('ProtoGeometry')\n", (1277, 1294), False, 'import clr\n')] |
import math
import numpy as np
from ... import IntegerProgram, LinearProgram
from unittest import TestCase, main
class TestRelax(TestCase):
def test_relax(self) -> None:
A = np.array([
[1, 2, 3, 4],
[3, 5, 7, 9]
])
b = np.array([-9, 7])
c = np.array([1, 7, 1... | [
"unittest.main",
"numpy.array",
"numpy.allclose",
"math.isclose"
] | [((1302, 1308), 'unittest.main', 'main', ([], {}), '()\n', (1306, 1308), False, 'from unittest import TestCase, main\n'), ((188, 226), 'numpy.array', 'np.array', (['[[1, 2, 3, 4], [3, 5, 7, 9]]'], {}), '([[1, 2, 3, 4], [3, 5, 7, 9]])\n', (196, 226), True, 'import numpy as np\n'), ((273, 290), 'numpy.array', 'np.array',... |
#!/usr/bin/env python
"""
The Monty Hall problem simulator parameterizable with soops.
https://en.wikipedia.org/wiki/Monty_Hall_problem
Examples
--------
- Direct runs::
python examples/monty_hall.py -h
python examples/monty_hall.py output
python examples/monty_hall.py --switch output
python examples/monty_... | [
"numpy.array",
"soops.output",
"soops.plot_selected.setup_plot_styles",
"soops.parse_as_dict",
"itertools.product",
"numpy.linspace",
"numpy.random.seed",
"soops.output.set_output",
"soops.ensure_path",
"soops.scoop_outputs.get_uniques",
"soops.Timer",
"matplotlib.pyplot.show",
"soops.plot_s... | [((4366, 4456), 'soops.scoop_outputs.get_uniques', 'sc.get_uniques', (['df', "[key for key in data.multi_par_keys if key not in ['output_dir']]"], {}), "(df, [key for key in data.multi_par_keys if key not in [\n 'output_dir']])\n", (4380, 4456), True, 'import soops.scoop_outputs as sc\n'), ((4490, 4517), 'soops.outp... |
""" Plot error analysis statistics. """
from __future__ import division
from matplotlib import pyplot
from matplotlib import cm
import numpy
from pylab import rcParams
__author__ = 'martscsn'
def plot(data,
title,
xlabel,
ylabel,
filename=None):
""" Plot error analysis s... | [
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplots"
] | [((1398, 1415), 'matplotlib.pyplot.subplots', 'pyplot.subplots', ([], {}), '()\n', (1413, 1415), False, 'from matplotlib import pyplot\n'), ((2149, 2181), 'matplotlib.pyplot.title', 'pyplot.title', (['title'], {'fontsize': '(28)'}), '(title, fontsize=28)\n', (2161, 2181), False, 'from matplotlib import pyplot\n'), ((21... |
from django.db import models
from .base_workflow import Ticket, TicketHistory
class ServiceRequest(Ticket):
AC_STATUS = (
('aog', 'AOG'),
('mtx', 'Scheduled Maintenance'),
('other', 'Other (Provide in Description)')
)
CERTS = (
('far91', 'FAR 91'),
('far121', 'F... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.PositiveIntegerField",
"django.db.models.DateTimeField",
"django.db.models.DecimalField",
"django.db.models.CharField"
] | [((1849, 1903), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(64)', 'blank': '(True)', 'null': '(True)'}), '(max_length=64, blank=True, null=True)\n', (1865, 1903), False, 'from django.db import models\n'), ((1924, 1978), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(... |
"""Isilon Hadoop Tools"""
from pkg_resources import get_distribution
__all__ = [
# Constants
'__version__',
# Exceptions
'IsilonHadoopToolError',
]
__version__ = get_distribution(__name__).version
class IsilonHadoopToolError(Exception):
"""All Exceptions emitted from this package inherit from ... | [
"pkg_resources.get_distribution"
] | [((182, 208), 'pkg_resources.get_distribution', 'get_distribution', (['__name__'], {}), '(__name__)\n', (198, 208), False, 'from pkg_resources import get_distribution\n')] |
import csv
"""
'info' : {
'{province_key}': {
{attrs_key}: {attrs_value},
cities: {}
}
}
"""
info = {}
with open('./data/provinces_cleaned.csv', mode='r') as provinces_file:
provinces_reader = csv.DictReader(provinces_file)
for province in provinces_reader:
... | [
"csv.DictWriter",
"csv.DictReader"
] | [((1170, 1188), 'csv.DictReader', 'csv.DictReader', (['op'], {}), '(op)\n', (1184, 1188), False, 'import csv\n'), ((2031, 2084), 'csv.DictWriter', 'csv.DictWriter', (['op'], {'delimiter': '""","""', 'fieldnames': 'headers'}), "(op, delimiter=',', fieldnames=headers)\n", (2045, 2084), False, 'import csv\n'), ((246, 276)... |
# Copyright 2018 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | [
"subprocess.run",
"optparse.OptionParser",
"multiprocessing.cpu_count",
"fnmatch.fnmatch",
"json.load"
] | [((1356, 1375), 'subprocess.run', 'subprocess.run', (['cmd'], {}), '(cmd)\n', (1370, 1375), False, 'import subprocess\n'), ((1628, 1651), 'optparse.OptionParser', 'optparse.OptionParser', ([], {}), '()\n', (1649, 1651), False, 'import optparse\n'), ((2175, 2187), 'json.load', 'json.load', (['f'], {}), '(f)\n', (2184, 2... |
import unittest
import stop
import datetime
from datetime import date
from freezegun import freeze_time
class TestStopRoutes(unittest.TestCase):
def setUp(self):
stop.app.config['TESTING'] = True
self.app = stop.app.test_client()
def test_stops_get(self):
response = self.app.get('/st... | [
"unittest.main",
"datetime.date.today",
"stop.app.test_client"
] | [((1031, 1046), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1044, 1046), False, 'import unittest\n'), ((230, 252), 'stop.app.test_client', 'stop.app.test_client', ([], {}), '()\n', (250, 252), False, 'import stop\n'), ((434, 446), 'datetime.date.today', 'date.today', ([], {}), '()\n', (444, 446), False, 'from ... |
# -*- coding: utf-8 -*-
import random
import factory.django
import factory.fuzzy
from access.models import AccessType, TokenType
from members.models import Member
from members.tests.fixtures.memberlikes import MemberFactory
from asylum.tests.utils import FuzzyLoremipsum
class GrantFactory(factory.django.DjangoModel... | [
"access.models.AccessType.objects.all",
"access.models.TokenType.objects.all"
] | [((466, 490), 'access.models.AccessType.objects.all', 'AccessType.objects.all', ([], {}), '()\n', (488, 490), False, 'from access.models import AccessType, TokenType\n'), ((577, 600), 'access.models.TokenType.objects.all', 'TokenType.objects.all', ([], {}), '()\n', (598, 600), False, 'from access.models import AccessTy... |
from argparse import ArgumentParser
import torch
import pytorch_lightning as pl
from torch.nn import functional as F
from torch.nn import Sequential, Conv2d, BatchNorm2d, ReLU, MaxPool2d, Softmax, AvgPool2d
from project.AVRecognition.PersonDataModule import PersonDataModule
import torchvision.models as models
from col... | [
"torch.nn.ReLU",
"torch.nn.Dropout",
"pytorch_lightning.Trainer.add_argparse_args",
"argparse.ArgumentParser",
"torch.nn.Softmax",
"pytorch_lightning.seed_everything",
"pytorch_lightning.metrics.Accuracy",
"torch.nn.Linear",
"torch.nn.functional.cross_entropy",
"project.AVRecognition.PersonDataMod... | [((3194, 3218), 'pytorch_lightning.seed_everything', 'pl.seed_everything', (['(1234)'], {}), '(1234)\n', (3212, 3218), True, 'import pytorch_lightning as pl\n'), ((3282, 3298), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (3296, 3298), False, 'from argparse import ArgumentParser\n'), ((3375, 3411), 'p... |
# -*- coding: utf-8 -*-
"""
Loading modules from a string representing the class name
or a short name that matches the dictionary item defined
in this module
all classes and docs are taken from
https://github.com/tensorflow/tensorflow/blob/r1.3/tensorflow/python/ops/init_ops.py
"""
import tensorflow as tf
SEED = 42
... | [
"tensorflow.glorot_uniform_initializer",
"tensorflow.variance_scaling_initializer",
"tensorflow.orthogonal_initializer",
"tensorflow.uniform_unit_scaling_initializer",
"tensorflow.constant_initializer",
"tensorflow.glorot_normal_initializer"
] | [((576, 606), 'tensorflow.constant_initializer', 'tf.constant_initializer', (['value'], {}), '(value)\n', (599, 606), True, 'import tensorflow as tf\n'), ((846, 874), 'tensorflow.constant_initializer', 'tf.constant_initializer', (['(0.0)'], {}), '(0.0)\n', (869, 874), True, 'import tensorflow as tf\n'), ((1112, 1140), ... |
#!/usr/bin/env python
#
# https://github.com/dbrandt/rerun
#
# A simple script that tries to recreate an approximate docker run
# command from the metadata of a running container. It's not complete
# and it's not tested in very many situations. If you want to extend it,
# please do. I'll accept any pull request within ... | [
"shlex.quote",
"docker.APIClient",
"sys.exit"
] | [((1442, 1460), 'docker.APIClient', 'docker.APIClient', ([], {}), '()\n', (1458, 1460), False, 'import docker\n'), ((1390, 1401), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (1398, 1401), False, 'import sys\n'), ((1002, 1018), 'shlex.quote', 'shlex.quote', (['val'], {}), '(val)\n', (1013, 1018), False, 'import shle... |
import web
from models import RegisterModel
from models import LoginModel
from models import Posts
web.config.debug = False
urls =(
'/', 'home',
'/register', 'register',
'/login', 'login',
'/logout', 'logout',
'/postregistration', 'postregistration',
'/checklogin', 'checklogin',
'/postacti... | [
"web.session.DiskStore",
"models.Posts.Posts",
"models.LoginModel.LoginModel",
"web.input",
"web.template.render",
"models.RegisterModel.RegisterModel"
] | [((531, 666), 'web.template.render', 'web.template.render', (['"""views/templates"""'], {'base': '"""MainLayout"""', 'globals': "{'session': session_data, 'current_user': session_data['user']}"}), "('views/templates', base='MainLayout', globals={\n 'session': session_data, 'current_user': session_data['user']})\n", ... |
"""
Created on 08 Okt. 2021
@author: <NAME>
This example shows how you can use MiP-EGO in order to perform hyper-parameter optimization for machine learning tasks.
"""
#import packages
from sklearn.datasets import load_iris
from sklearn.svm import SVC
from sklearn.model_selection import cross_val_score, KFold
import... | [
"sklearn.datasets.load_iris",
"mipego.ParallelBO",
"sklearn.svm.SVC",
"numpy.mean",
"mipego.SearchSpace.NominalSpace",
"sklearn.model_selection.cross_val_score",
"mipego.SearchSpace.ContinuousSpace",
"sklearn.model_selection.KFold",
"mipego.Surrogate.RandomForest",
"mipego.SearchSpace.OrdinalSpace... | [((578, 589), 'sklearn.datasets.load_iris', 'load_iris', ([], {}), '()\n', (587, 589), False, 'from sklearn.datasets import load_iris\n'), ((811, 844), 'mipego.SearchSpace.ContinuousSpace', 'ContinuousSpace', (['[1.0, 20.0]', '"""C"""'], {}), "([1.0, 20.0], 'C')\n", (826, 844), False, 'from mipego.SearchSpace import Co... |
#https://www.acmicpc.net/problem/15651
import sys
s = []
n, m = map(int, sys.stdin.readline().split())
def dfs():
if len(s)==m:
print(' '.join(map(str,s)))
return
for i in range(1, n+1):
# 첫 수 넣기
s.append(i)
dfs()
# 첫 수를 제외한 마지막 수 pop
s.pop()
dfs()
| [
"sys.stdin.readline"
] | [((74, 94), 'sys.stdin.readline', 'sys.stdin.readline', ([], {}), '()\n', (92, 94), False, 'import sys\n')] |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from rasa_nlu.training_data import TrainingData
def test_crf_extractor(spacy_nlp):
from rasa_nlu.extractors.crf_entity_extractor import CRFEntityExtractor
ext =... | [
"rasa_nlu.training_data.TrainingData",
"rasa_nlu.extractors.crf_entity_extractor.CRFEntityExtractor"
] | [((321, 341), 'rasa_nlu.extractors.crf_entity_extractor.CRFEntityExtractor', 'CRFEntityExtractor', ([], {}), '()\n', (339, 341), False, 'from rasa_nlu.extractors.crf_entity_extractor import CRFEntityExtractor\n'), ((1347, 1367), 'rasa_nlu.extractors.crf_entity_extractor.CRFEntityExtractor', 'CRFEntityExtractor', ([], {... |
from flask import Flask, jsonify, request
import urllib, string
from lid_utils import *
app = Flask(__name__)
@app.route('/')
def hello():
return 'This is a language id checker server. Go to /help to see more.'
@app.route('/help')
def explanation():
explanation_dict = {
'How to use': '... | [
"flask.jsonify",
"flask.request.form.get",
"flask.Flask"
] | [((95, 110), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (100, 110), False, 'from flask import Flask, jsonify, request\n'), ((442, 467), 'flask.jsonify', 'jsonify', (['explanation_dict'], {}), '(explanation_dict)\n', (449, 467), False, 'from flask import Flask, jsonify, request\n'), ((1203, 1262), 'flas... |
# -*- coding: utf-8 -*-
#
# (https://github.com/makotoon/DataSorter)
#
# ======================================================================================
# Copyright (c) 2021 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software
# and associated documentation f... | [
"csv.writer",
"csv.reader",
"copy.deepcopy"
] | [((1516, 1540), 'copy.deepcopy', 'copy.deepcopy', (['list_data'], {}), '(list_data)\n', (1529, 1540), False, 'import copy\n'), ((1786, 1799), 'csv.reader', 'csv.reader', (['f'], {}), '(f)\n', (1796, 1799), False, 'import csv\n'), ((2922, 2935), 'csv.writer', 'csv.writer', (['f'], {}), '(f)\n', (2932, 2935), False, 'imp... |
import pyglet
from pyglet_utils import game
debug = True
main_window = game.GameWindow(debug)
pyglet.app.run()
| [
"pyglet.app.run",
"pyglet_utils.game.GameWindow"
] | [((73, 95), 'pyglet_utils.game.GameWindow', 'game.GameWindow', (['debug'], {}), '(debug)\n', (88, 95), False, 'from pyglet_utils import game\n'), ((96, 112), 'pyglet.app.run', 'pyglet.app.run', ([], {}), '()\n', (110, 112), False, 'import pyglet\n')] |
from model.group import Group
class GroupHelper:
def __init__(self, application):
self.app = application
def create(self, group):
wd = self.app.wd
self.app.navigation.open_groups_page()
wd.find_element_by_name("new").click()
self.fill_form(group)
wd.find_eleme... | [
"model.group.Group"
] | [((2308, 2331), 'model.group.Group', 'Group', ([], {'name': 'name', 'id': 'id'}), '(name=name, id=id)\n', (2313, 2331), False, 'from model.group import Group\n')] |
"""
=========
Plot Mesh
=========
This example shows how to load an STL mesh. This example must be
run from within the main folder because it uses a
hard-coded path to the STL file.
"""
print(__doc__)
import os
import numpy as np
import matplotlib.pyplot as plt
from pytransform3d.transformations import plot_transfor... | [
"os.path.exists",
"numpy.eye",
"numpy.ones",
"os.path.join",
"os.path.dirname",
"matplotlib.pyplot.show"
] | [((785, 795), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (793, 795), True, 'import matplotlib.pyplot as plt\n'), ((553, 584), 'os.path.join', 'os.path.join', (['search_path', '""".."""'], {}), "(search_path, '..')\n", (565, 584), False, 'import os\n'), ((600, 635), 'os.path.join', 'os.path.join', (['search... |
##############################################################################
# Author: <NAME> <<EMAIL>>
# Copyright (c) 2016, Salesforce.com, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:... | [
"datetime.datetime.now",
"json.dumps",
"requests.get",
"requests.delete"
] | [((2194, 2292), 'requests.get', 'requests.get', (['self.query_endpoint'], {'params': 'params', 'headers': "{'Content-Type': 'application/json'}"}), "(self.query_endpoint, params=params, headers={'Content-Type':\n 'application/json'})\n", (2206, 2292), False, 'import requests\n'), ((3689, 3790), 'requests.delete', 'r... |
# Keypirinha launcher (keypirinha.<EMAIL>)
# Copyright 2013-2018 <NAME> <<EMAIL>>
import os
import stat
from . import _glob
__all__ = ["FsEntry", "globscan", "iglobscan"]
_IS_WINDOWS = os.name.lower() == "nt"
class FsEntry:
"""A :py:class:`os.DirEntry` compatible class."""
def is_hidden(self, f... | [
"os.path.exists",
"os.name.lower",
"os.scandir",
"os.path.join",
"os.getcwd",
"os.path.normpath",
"os.chdir",
"os.path.realpath",
"os.path.isdir",
"os.path.dirname",
"os.path.basename",
"os.stat",
"os.path.relpath"
] | [((197, 212), 'os.name.lower', 'os.name.lower', ([], {}), '()\n', (210, 212), False, 'import os\n'), ((840, 871), 'os.path.normpath', 'os.path.normpath', (['direntry.path'], {}), '(direntry.path)\n', (856, 871), False, 'import os\n'), ((928, 968), 'os.path.join', 'os.path.join', (['self.basedir', 'self.relpath'], {}), ... |
from matcher.server.main.matcher import Matcher
DEFAULT_STRATEGIES = [
[['ror_name', 'ror_acronym', 'ror_city', 'ror_country']],
[['ror_name', 'ror_city', 'ror_country']]
]
def match_ror(conditions: dict) -> dict:
strategies = conditions.get('strategies', DEFAULT_STRATEGIES)
matcher = Matcher()
r... | [
"matcher.server.main.matcher.Matcher"
] | [((305, 314), 'matcher.server.main.matcher.Matcher', 'Matcher', ([], {}), '()\n', (312, 314), False, 'from matcher.server.main.matcher import Matcher\n')] |
import re
class Extension(object):
"""
Base class and helper functions for TossimBase extensions.
Extensions allow adding extra information and methods to
L{TossimBase} and associated L{Node} objects. Some examples are
advanced topology configuration (see L{simx.fluid}) and sensor
readings (s... | [
"re.match"
] | [((1463, 1489), 're.match', 're.match', (['"""^__.*__$"""', 'name'], {}), "('^__.*__$', name)\n", (1471, 1489), False, 'import re\n')] |
import tensorflow as tf
from active_learning_ts.query_selection.query_optimizer import QueryOptimizer
from active_learning_ts.query_selection.query_optimizers.generic_max_query_optimizer import GenericMaximumQueryOptimizer
class MaximumEntropyQueryOptimizer(QueryOptimizer):
"""
Selects the best queries from ... | [
"tensorflow.math.log"
] | [((506, 520), 'tensorflow.math.log', 'tf.math.log', (['x'], {}), '(x)\n', (517, 520), True, 'import tensorflow as tf\n')] |
import pytest
import tempfile
import os
from prefect.utilities import configuration
@pytest.fixture()
def server_api():
"""
backend settings don't seem to be getting respected. As a work-around
set export PREFECT__BACKEND=server where running the tests to enforce
use of the server endpoint
"""
... | [
"tempfile.TemporaryDirectory",
"os.makedirs",
"os.path.join",
"prefect.utilities.configuration.set_temporary_config",
"pytest.fixture"
] | [((88, 104), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (102, 104), False, 'import pytest\n'), ((328, 357), 'tempfile.TemporaryDirectory', 'tempfile.TemporaryDirectory', ([], {}), '()\n', (355, 357), False, 'import tempfile\n'), ((380, 409), 'os.path.join', 'os.path.join', (['tmp', '""".prefect"""'], {}), "(... |
import glob
import cv2
files = glob.glob('result_images/Eigen_pretrain/*pred*')
for fn in files:
img = cv2.imread(fn)
imgre = cv2.resize(img, (80, 60))
imgre = cv2.medianBlur(imgre,2)
img = cv2.resize(imgre, (320, 240))
cv2.imshow('res', img)
cv2.waitKey(0)
cv2.imwrite( fn.replace('predicte... | [
"cv2.medianBlur",
"cv2.imshow",
"cv2.waitKey",
"cv2.resize",
"cv2.imread",
"glob.glob"
] | [((32, 80), 'glob.glob', 'glob.glob', (['"""result_images/Eigen_pretrain/*pred*"""'], {}), "('result_images/Eigen_pretrain/*pred*')\n", (41, 80), False, 'import glob\n'), ((108, 122), 'cv2.imread', 'cv2.imread', (['fn'], {}), '(fn)\n', (118, 122), False, 'import cv2\n'), ((135, 160), 'cv2.resize', 'cv2.resize', (['img'... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... | [
"os.path.exists",
"codecs.open"
] | [((902, 933), 'os.path.exists', 'os.path.exists', (['vocabulary_path'], {}), '(vocabulary_path)\n', (916, 933), False, 'import os\n'), ((3363, 3411), 'codecs.open', 'codecs.open', (['correct_file', '"""w"""'], {'encoding': '"""utf-8"""'}), "(correct_file, 'w', encoding='utf-8')\n", (3374, 3411), False, 'import codecs\n... |
import os
import os.path
import subprocess
import sys
if __name__ == '__main__':
if 'JAVA_HOME' in os.environ:
java = os.path.join(os.environ['JAVA_HOME'],'bin','java')
else:
sys.exit('please set the JAVA_HOME environment variable')
here = os.path.dirname(os.path.abspath(sys.argv[0]))
pa... | [
"os.path.abspath",
"os.path.join",
"sys.exit",
"subprocess.check_call"
] | [((678, 708), 'subprocess.check_call', 'subprocess.check_call', (['cmdLine'], {}), '(cmdLine)\n', (699, 708), False, 'import subprocess\n'), ((128, 180), 'os.path.join', 'os.path.join', (["os.environ['JAVA_HOME']", '"""bin"""', '"""java"""'], {}), "(os.environ['JAVA_HOME'], 'bin', 'java')\n", (140, 180), False, 'import... |
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class BaseConfig:
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
'sqlite:///' + os.path.join(basedir, 'app.db')
SQLALCHEMY_TRACK_MODIFICATIONS = False
SECRET_KEY = os.environ.get('SECRET_KEY') or '... | [
"os.path.join",
"os.path.dirname",
"os.environ.get"
] | [((36, 61), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (51, 61), False, 'import os\n'), ((827, 862), 'os.environ.get', 'os.environ.get', (['"""ELASTICSEARCH_URL"""'], {}), "('ELASTICSEARCH_URL')\n", (841, 862), False, 'import os\n'), ((907, 938), 'os.environ.get', 'os.environ.get', (['"""... |
"""
Code based on random_transform in keras.processing.image from 2016.
(https://github.com/fchollet/keras)
Keras copyright:
All contributions by <NAME>: Copyright (c) 2015, <NAME>.
All contributions by Google: Copyright (c) 2015, Google, Inc.
All contributions by Microsoft: Copyright (c) 2017, Microsoft, Inc.
All oth... | [
"SimpleITK.BSplineTransformInitializer",
"numpy.rollaxis",
"numpy.array",
"os.cpu_count",
"numpy.moveaxis",
"numpy.sin",
"numpy.random.RandomState",
"numpy.isscalar",
"numpy.asarray",
"SimpleITK.GetArrayFromImage",
"numpy.max",
"numpy.stack",
"numpy.dot",
"numpy.min",
"numpy.abs",
"num... | [((964, 975), 'numpy.array', 'np.array', (['x'], {}), '(x)\n', (972, 975), True, 'import numpy as np\n'), ((1970, 1998), 'numpy.ndindex', 'np.ndindex', (['x_arr.shape[:-3]'], {}), '(x_arr.shape[:-3])\n', (1980, 1998), True, 'import numpy as np\n'), ((8003, 8026), 'numpy.isscalar', 'np.isscalar', (['zoom_range'], {}), '... |
import pkgutil
import sys
__all__ = ["__version__", "version_info"]
__version__ = pkgutil.get_data(__package__, "VERSION").decode("ascii").strip()
version_info = tuple(int(v) if v.isdigit() else v for v in __version__.split("."))
if sys.version_info < (3, 6):
sys.exit("os-aiohttp-utils %s requires Python 3.6+" ... | [
"pkgutil.get_data",
"sys.exit"
] | [((268, 334), 'sys.exit', 'sys.exit', (["('os-aiohttp-utils %s requires Python 3.6+' % __version__)"], {}), "('os-aiohttp-utils %s requires Python 3.6+' % __version__)\n", (276, 334), False, 'import sys\n'), ((85, 125), 'pkgutil.get_data', 'pkgutil.get_data', (['__package__', '"""VERSION"""'], {}), "(__package__, 'VERS... |
from rts.core.task import Task
from rts.core.ts import TaskSet
import random
class Gen(object):
'Basic generator class'
def __init__(self, **kwargs):
self.seed = kwargs.get('seed', 0)
random.seed(self.seed)
self.num_task = kwargs.get('num_task', 0)
self.min_num_task = kwargs.... | [
"rts.core.task.Task",
"rts.core.ts.TaskSet",
"random.randint",
"random.seed"
] | [((212, 234), 'random.seed', 'random.seed', (['self.seed'], {}), '(self.seed)\n', (223, 234), False, 'import random\n'), ((2087, 2105), 'rts.core.task.Task', 'Task', ([], {}), '(**task_param)\n', (2091, 2105), False, 'from rts.core.task import Task\n'), ((2166, 2175), 'rts.core.ts.TaskSet', 'TaskSet', ([], {}), '()\n',... |
# -*- coding: utf-8 -*-
from Zernike import *
import matplotlib.pyplot as plt
def np_analytic_polynomial(x, n, m ):
y = np.array( [ analytic_polynomial(n, m, rho) for rho in x ] )
return y
pass # -- np_analytic_polynomial
def analytic_polynomial(n, m, rho):
m = abs( m )
R =... | [
"matplotlib.pyplot.get_current_fig_manager",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.show"
] | [((2234, 2272), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'nrows': 'nrows', 'ncols': 'ncols'}), '(nrows=nrows, ncols=ncols)\n', (2246, 2272), True, 'import matplotlib.pyplot as plt\n'), ((3315, 3333), 'matplotlib.pyplot.tight_layout', 'plt.tight_layout', ([], {}), '()\n', (3331, 3333), True, 'import matplotli... |
__doc__ = """Check the get_key method works as expected"""
import itertools
import re
import pytest
import panflute
import pandocacro
import pandocacro.keys
key = "mwe"
acronyms = {
"short": "short",
"long": "long"
}
markups = (
f"+{key}",
f"[+{key}]{{}}",
f"[+{key}]{{.sh... | [
"pandocacro.prepare",
"itertools.product",
"pytest.fail",
"panflute.stringify",
"re.sub",
"pandocacro.keys.get"
] | [((805, 845), 'itertools.product', 'itertools.product', (['markups', 'punctuations'], {}), '(markups, punctuations)\n', (822, 845), False, 'import itertools\n'), ((961, 984), 'pandocacro.prepare', 'pandocacro.prepare', (['doc'], {}), '(doc)\n', (979, 984), False, 'import pandocacro\n'), ((1043, 1073), 'pandocacro.keys.... |
import http.client, urllib.request, urllib.parse, urllib.error, base64, requests, json
# Subscription Key to identify my Service in Azure
subscription_key = '<KEY>'
persongroup = 'microsoft'
# Azure Data Center End Point
detect_api_url = 'https://westus.api.cognitive.microsoft.com/face/v1.0/detect'
# Azur... | [
"json.loads",
"requests.post"
] | [((1014, 1112), 'requests.post', 'requests.post', (['detect_api_url'], {'params': 'params_detect', 'headers': 'headers', 'json': "{'url': image_url}"}), "(detect_api_url, params=params_detect, headers=headers, json={\n 'url': image_url})\n", (1027, 1112), False, 'import http.client, urllib.request, urllib.parse, url... |
N, K = map(int, input().split())
from collections import defaultdict
graph = defaultdict(list)
for i in range(N - 1):
a, b = map(int, input().split())
graph[a - 1].append(b - 1)
graph[b - 1].append(a - 1)
mod = 10 ** 9 + 7
import sys
sys.setrecursionlimit(10 ** 9)
def dfs(prev, now, graph):
if pre... | [
"sys.setrecursionlimit",
"collections.defaultdict"
] | [((78, 95), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (89, 95), False, 'from collections import defaultdict\n'), ((250, 280), 'sys.setrecursionlimit', 'sys.setrecursionlimit', (['(10 ** 9)'], {}), '(10 ** 9)\n', (271, 280), False, 'import sys\n')] |
import pyglet
from pyglet.window import key, mouse
from util.camera import CenteredCamera
from util.pyglethelper import draw_polygon
from worldgen import (CircleBasedTriangleStrategy, DistanceBasedOffsetStrategy,
ExponentialSplitsStrategy, LongestEdgeSplitStrategy)
WINDOW_WIDTH = 500
WINDOW_HEIG... | [
"pyglet.resource.image",
"pyglet.app.run",
"util.pyglethelper.draw_polygon",
"pyglet.text.Label",
"worldgen.DistanceBasedOffsetStrategy",
"worldgen.CircleBasedTriangleStrategy",
"util.camera.CenteredCamera"
] | [((2529, 2558), 'worldgen.CircleBasedTriangleStrategy', 'CircleBasedTriangleStrategy', ([], {}), '()\n', (2556, 2558), False, 'from worldgen import CircleBasedTriangleStrategy, DistanceBasedOffsetStrategy, ExponentialSplitsStrategy, LongestEdgeSplitStrategy\n'), ((606, 639), 'pyglet.resource.image', 'pyglet.resource.im... |
# Generated by Django 2.2.3 on 2019-08-27 18:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('reporting', '0003_findingnote'),
]
operations = [
migrations.AddField(
model_name='report',
name='delivered',
... | [
"django.db.models.BooleanField"
] | [((332, 440), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)', 'help_text': '"""Delivery status of the report"""', 'verbose_name': '"""Delivered"""'}), "(default=False, help_text=\n 'Delivery status of the report', verbose_name='Delivered')\n", (351, 440), False, 'from django.db im... |
# Generated by Django 3.1.6 on 2021-02-15 01:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('stock', '0016_incomestatement_basic_eps'),
]
operations = [
migrations.CreateModel(
name='Balan... | [
"django.db.models.FloatField",
"django.db.models.DateField",
"django.db.models.AutoField",
"django.db.models.ForeignKey"
] | [((374, 467), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (390, 467), False, 'from django.db import migrations, models\... |
#!/usr/bin/env python
# coding=utf-8
# aeneas is a Python/C library and a set of tools
# to automagically synchronize audio and text (aka forced alignment)
#
# Copyright (C) 2012-2013, <NAME> (www.albertopettarin.it)
# Copyright (C) 2013-2015, ReadBeyond Srl (www.readbeyond.it)
# Copyright (C) 2015-2017, <NAME> (www... | [
"aeneas.globalfunctions.file_can_be_read",
"aeneas.ttswrappers.espeakngttswrapper.ESPEAKNGTTSWrapper",
"aeneas.ttswrappers.festivalttswrapper.FESTIVALTTSWrapper",
"CustomTTSWrapperModule.CustomTTSWrapper",
"aeneas.ttswrappers.macosttswrapper.MacOSTTSWrapper",
"imp.load_source",
"aeneas.ttswrappers.espea... | [((8337, 8376), 'aeneas.globalfunctions.file_can_be_written', 'gf.file_can_be_written', (['audio_file_path'], {}), '(audio_file_path)\n', (8359, 8376), True, 'import aeneas.globalfunctions as gf\n'), ((8996, 9027), 'aeneas.globalfunctions.file_exists', 'gf.file_exists', (['audio_file_path'], {}), '(audio_file_path)\n',... |
# To download ERA Interim data from the ECMWF data server
# Download all the files for a year or selected months
# Timestep is 6hrs
# Resolution is 0.75X0.75 degree, area is global
# to change them change the relative fields
# Use: change year and adjust mntlist if necessary
# python erai_download_full.py
# depend... | [
"ecmwfapi.ECMWFDataServer",
"pickle.load",
"argparse.ArgumentParser"
] | [((863, 1347), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '""" Download ERA Interim grib files from ECMWF MARS server using ecmwfapi.py.\n Output file format changes depending on selected stream, can download more than one month\n at one time but only one year. If month is not sp... |
from flask import Flask
from streamlit import cache
import pickle
from flask import request, jsonify
app = Flask(__name__)
@cache(allow_output_mutation=True)
def predict_wine(tipo, fixed, volatile, citric, residual, chlorides, freesulfur, totalsulfur, density, ph, sulphates, alcohol):
"""
This function im... | [
"flask.jsonify",
"streamlit.cache",
"pickle.load",
"flask.Flask"
] | [((108, 123), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (113, 123), False, 'from flask import Flask\n'), ((126, 159), 'streamlit.cache', 'cache', ([], {'allow_output_mutation': '(True)'}), '(allow_output_mutation=True)\n', (131, 159), False, 'from streamlit import cache\n'), ((752, 776), 'pickle.load'... |
import gzip
from typing import List
from typing import Set
import grequests
import progressbar as pb
import requests
import spacy
from bs4 import BeautifulSoup
MAIN_WIKI = 'https://en.wikipedia.org/wiki/Lists_of_people_by_nationality'
BASE_WIKI = 'https://en.wikipedia.org'
NLP_MODEL = spacy.load('en_core_web_lg')
d... | [
"gzip.open",
"spacy.load",
"grequests.get",
"requests.get",
"progressbar.RotatingMarker",
"bs4.BeautifulSoup",
"grequests.map",
"progressbar.Percentage",
"progressbar.ETA"
] | [((288, 316), 'spacy.load', 'spacy.load', (['"""en_core_web_lg"""'], {}), "('en_core_web_lg')\n", (298, 316), False, 'import spacy\n'), ((605, 628), 'requests.get', 'requests.get', (['MAIN_WIKI'], {}), '(MAIN_WIKI)\n', (617, 628), False, 'import requests\n'), ((640, 684), 'bs4.BeautifulSoup', 'BeautifulSoup', (['result... |
"""The clean lambda is used to remove all traces of the specified ipppssoots.
If clean-all is specified, then all files related to processing any ipppssoot
are deleted.
"""
from calcloud import io
from calcloud import s3
def lambda_handler(event, context):
bucket_name, ipst = s3.parse_s3_event(event)
com... | [
"calcloud.s3.parse_s3_event",
"calcloud.io.get_io_bundle"
] | [((287, 311), 'calcloud.s3.parse_s3_event', 's3.parse_s3_event', (['event'], {}), '(event)\n', (304, 311), False, 'from calcloud import s3\n'), ((324, 353), 'calcloud.io.get_io_bundle', 'io.get_io_bundle', (['bucket_name'], {}), '(bucket_name)\n', (340, 353), False, 'from calcloud import io\n')] |
# -*- coding: utf-8 -*-
from django.core.files.temp import NamedTemporaryFile
from django.core.files import File
from django.db import models
from django.utils.translation import ugettext_lazy as _
from apps.about.models import Skill
from .thumbnail import Thumbnail
class Project(models.Model):
name = models.Ch... | [
"django.utils.translation.ugettext_lazy",
"django.core.files.File",
"django.core.files.temp.NamedTemporaryFile"
] | [((356, 365), 'django.utils.translation.ugettext_lazy', '_', (['"""Name"""'], {}), "('Name')\n", (357, 365), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((406, 414), 'django.utils.translation.ugettext_lazy', '_', (['"""URL"""'], {}), "('URL')\n", (407, 414), True, 'from django.utils.translation ... |
from core.advbase import *
from slot.a import *
from slot.d import *
def module():
return Summer_Patia
class Summer_Patia(Adv):
comment = 'cannot build combo for Cat Sith; uses up 15 stacks by 46.94s'
a3 = [('antiaffself_poison', 0.15, 10, 5), ('edge_poison', 60, 'hp50')]
conf = {}
conf['slots.po... | [
"core.simulate.test_with_argv"
] | [((3219, 3250), 'core.simulate.test_with_argv', 'test_with_argv', (['None', '*sys.argv'], {}), '(None, *sys.argv)\n', (3233, 3250), False, 'from core.simulate import test_with_argv\n')] |
import wx
import matplotlib.cm
import numpy as np
from . import properties
slider_width = 30
s_off = slider_width/2
class ColorBarPanel(wx.Panel):
'''
A HORIZONTAL color bar and value axis drawn on a panel.
'''
def __init__(self, parent, map, local_extents=[0.,1.], global_extents=None,
... | [
"wx.Button",
"wx.PaintDC",
"numpy.ones",
"numpy.hstack",
"numpy.array",
"wx.MenuItem",
"numpy.zeros",
"wx.Pen",
"wx.Menu",
"wx.Panel.__init__",
"numpy.arange"
] | [((775, 816), 'wx.Panel.__init__', 'wx.Panel.__init__', (['self', 'parent'], {}), '(self, parent, **kwargs)\n', (792, 816), False, 'import wx\n'), ((904, 966), 'wx.Button', 'wx.Button', (['self', '(-1)', '"""["""'], {'pos': '(0, -1)', 'size': '(slider_width, -1)'}), "(self, -1, '[', pos=(0, -1), size=(slider_width, -1)... |
import os
import time
import sys
if __name__ == "__main__":
exe = sys.argv[1]
num_times = int(sys.argv[2])
s = time.time()
for i in range(num_times):
os.system("{}".format(exe))
e = time.time()
print("Average time it took for this executable is {:.3f}".format((e-s)/num_times))
| [
"time.time"
] | [((130, 141), 'time.time', 'time.time', ([], {}), '()\n', (139, 141), False, 'import time\n'), ((217, 228), 'time.time', 'time.time', ([], {}), '()\n', (226, 228), False, 'import time\n')] |
# Generated by Django 3.1.2 on 2020-10-28 20:29
import cloudinary.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'... | [
"django.db.models.OneToOneField",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"django.db.models.SlugField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.migrations.swappable_dependency",
"django.db.models.CharField"
] | [((331, 388), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (362, 388), False, 'from django.db import migrations, models\n'), ((2763, 2854), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delete': 'djang... |
import cv2
import numpy as np
import os
import glob
from random import shuffle
#from tqdm import tqdm
import os, fnmatch
import torch
from torch import autograd, nn, optim
import torch.nn.functional as F
from time import time
#input = autograd.Variable(torch.rand(batch_size, input_size))-0.5
#target = autograd.Variab... | [
"cv2.imread",
"random.shuffle",
"torch.nn.functional.nll_loss",
"os.walk",
"os.path.join",
"torch.nn.Conv2d",
"torch.tensor",
"numpy.array",
"fnmatch.fnmatch",
"torch.nn.Linear",
"cv2.resize",
"torch.autograd.Variable",
"time.time",
"numpy.save",
"numpy.load"
] | [((760, 778), 'os.walk', 'os.walk', (['directory'], {}), '(directory)\n', (767, 778), False, 'import os, fnmatch\n'), ((1513, 1532), 'random.shuffle', 'shuffle', (['train_data'], {}), '(train_data)\n', (1520, 1532), False, 'from random import shuffle\n'), ((1537, 1574), 'numpy.save', 'np.save', (['"""train_data.npy"""'... |
from csdl import Model
import csdl
import numpy as np
class ExampleScalarRotX(Model):
"""
:param var: scalar
:param var: scalar_Rot_x
"""
def define(self):
angle_val3 = np.pi / 3
angle_scalar = self.declare_variable('scalar', val=angle_val3)
# Rotation in the x-axis for s... | [
"numpy.prod",
"csdl.rotmat",
"numpy.repeat",
"numpy.arange"
] | [((1112, 1126), 'numpy.prod', 'np.prod', (['shape'], {}), '(shape)\n', (1119, 1126), True, 'import numpy as np\n'), ((1744, 1758), 'numpy.prod', 'np.prod', (['shape'], {}), '(shape)\n', (1751, 1758), True, 'import numpy as np\n'), ((371, 406), 'csdl.rotmat', 'csdl.rotmat', (['angle_scalar'], {'axis': '"""x"""'}), "(ang... |
# Landmark extraction
# Steps
# Add new fields
# Check if fields exists
# Visual
# 3D Visibility 0.5 * 0.5 = 0.25
# Facade area 0.3 * 0.5 = 0.15
# Height 0.2 * 0.5 = 0.1
# Structural
# Area 0.3 * 0.3 = 0.09
# 2D-Advance visibility 0.3 * 0.3 = 0.09
# Neighbours 0.2 * 0.3 = 0.06
# Road dist... | [
"argparse.ArgumentParser",
"qgis.core.QgsVectorLayer",
"qgis_utils.create_spatial_index",
"datetime.datetime.now",
"qgis.core.QgsApplication.setPrefixPath",
"qgis.core.QgsApplication",
"qgis.core.QgsField"
] | [((721, 763), 'qgis.core.QgsApplication.setPrefixPath', 'QgsApplication.setPrefixPath', (['"""/usr"""', '(True)'], {}), "('/usr', True)\n", (749, 763), False, 'from qgis.core import QgsApplication, QgsVectorLayer, QgsProject, QgsField, QgsSpatialIndex, QgsGeometry\n'), ((770, 795), 'qgis.core.QgsApplication', 'QgsAppli... |
from .Workbook import Workbook
from .Style import Style
from .Fill import Fill
from .Font import Font
from .Format import Format
from .Alignment import Alignment
try:
import pkg_resources
__version__ = pkg_resources.require('PyExcelerate')[0].version
except:
__version__ = 'unknown'
| [
"pkg_resources.require"
] | [((205, 242), 'pkg_resources.require', 'pkg_resources.require', (['"""PyExcelerate"""'], {}), "('PyExcelerate')\n", (226, 242), False, 'import pkg_resources\n')] |
# -*- encoding: utf8 -*-
# Some code used in this module was taken from the python documentation and
# can be found in http://docs.python.org/2/library/csv.html
# Modified by Caktus.
from __future__ import unicode_literals, absolute_import
import codecs
import six
from .utils import encode_list, decode_list, change_en... | [
"csv.writer",
"six.BytesIO",
"six.StringIO",
"six.next"
] | [((2410, 2435), 'six.next', 'six.next', (['self.csv_reader'], {}), '(self.csv_reader)\n', (2418, 2435), False, 'import six\n'), ((2787, 2831), 'csv.writer', 'csv.writer', (['self.queue', 'dialect'], {}), '(self.queue, dialect, **fmtparams)\n', (2797, 2831), False, 'import csv\n'), ((2720, 2733), 'six.BytesIO', 'six.Byt... |
# coding=utf-8
__author__ = 'stefano'
import logging
from pprint import pprint
from optparse import make_option
from datetime import datetime
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from openpyxl import load_workbook, Workbook
from django.core.management.base import BaseCommand
fr... | [
"logging.getLogger",
"openaid.projects.models.Initiative.objects.get",
"openaid.projects.models.Project.objects.get",
"openpyxl.load_workbook",
"openaid.projects.models.Activity.objects.filter",
"datetime.datetime.now",
"optparse.make_option",
"openpyxl.Workbook",
"datetime.datetime.strftime"
] | [((786, 814), 'logging.getLogger', 'logging.getLogger', (['"""openaid"""'], {}), "('openaid')\n", (803, 814), False, 'import logging\n'), ((2153, 2163), 'openpyxl.Workbook', 'Workbook', ([], {}), '()\n', (2161, 2163), False, 'from openpyxl import load_workbook, Workbook\n'), ((2604, 2645), 'openpyxl.load_workbook', 'lo... |
# -*- coding: utf-8 -*-
import scrapy
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
from scrapy.http import Request
class SteamSpider(CrawlSpider):
name = 'steam'
#allowed_domains = ['https://store.steampowered.com/']
start_urls = ['https://store.steampowered... | [
"scrapy.linkextractors.LinkExtractor"
] | [((399, 449), 'scrapy.linkextractors.LinkExtractor', 'LinkExtractor', ([], {'restrict_css': "['.search_result_row']"}), "(restrict_css=['.search_result_row'])\n", (412, 449), False, 'from scrapy.linkextractors import LinkExtractor\n')] |
import discord
from config import ICON_URL
def embed_factory(member: discord.Member, channel_name: str, is_join: bool) -> discord.Embed:
if is_join:
return get_in_embed(member, channel_name)
else:
return get_out_embed(member, channel_name)
def make_base_embed(member_icon_url: str) -> discor... | [
"discord.Embed"
] | [((341, 369), 'discord.Embed', 'discord.Embed', ([], {'color': '(1991657)'}), '(color=1991657)\n', (354, 369), False, 'import discord\n')] |
"""Sets a consistent plotting settings across the project.
Example:
Usage with simple plots::
from src.plot_settings import (
ps_defaults,
label_subplots,
get_dim,
set_dim,
PALETTE,
STD_CLR_LIST,
CAM_BLUE,
BRIC... | [
"itertools.cycle",
"distutils.spawn.find_executable",
"matplotlib.rcParams.update",
"seaborn.color_palette",
"matplotlib.use",
"numpy.asarray",
"matplotlib.style.use"
] | [((7616, 7647), 'seaborn.color_palette', 'sns.color_palette', (['STD_CLR_LIST'], {}), '(STD_CLR_LIST)\n', (7633, 7647), True, 'import seaborn as sns\n'), ((7719, 7749), 'itertools.cycle', 'itertools.cycle', (['_paper_colors'], {}), '(_paper_colors)\n', (7734, 7749), False, 'import itertools\n'), ((2677, 2714), 'matplot... |
import os
import sys
def process(input_file, output_file):
output_text = ""
if input_file.endswith("abstract.summary.txt") or input_file.endswith("community.summary.txt") or input_file.endswith("combined.summary.txt") or input_file.endswith("human.summary.txt"):
input_text = []
with open(input_... | [
"os.path.exists",
"os.listdir",
"os.path.join"
] | [((1120, 1141), 'os.listdir', 'os.listdir', (['input_dir'], {}), '(input_dir)\n', (1130, 1141), False, 'import os\n'), ((924, 949), 'os.path.exists', 'os.path.exists', (['input_dir'], {}), '(input_dir)\n', (938, 949), False, 'import os\n'), ((1016, 1042), 'os.path.exists', 'os.path.exists', (['output_dir'], {}), '(outp... |
from django.conf import settings
from django.urls import include, path
from . import views
urlpatterns = [
path("", views.index, name="index"),
path("login", views.login_view, name="login"),
path("logout", views.logout_view, name="logout"),
path("register", views.register, name="register"),
path("... | [
"django.urls.path"
] | [((113, 148), 'django.urls.path', 'path', (['""""""', 'views.index'], {'name': '"""index"""'}), "('', views.index, name='index')\n", (117, 148), False, 'from django.urls import include, path\n'), ((154, 199), 'django.urls.path', 'path', (['"""login"""', 'views.login_view'], {'name': '"""login"""'}), "('login', views.lo... |
# Copyright 2020 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 ... | [
"json.dumps",
"functools.wraps",
"time.sleep",
"random.random",
"google.api_core.retry.Retry",
"common.crmint_logging.logger.log_struct"
] | [((1920, 1927), 'google.api_core.retry.Retry', 'Retry', ([], {}), '()\n', (1925, 1927), False, 'from google.api_core.retry import Retry\n'), ((1975, 2179), 'common.crmint_logging.logger.log_struct', 'crmint_logging.logger.log_struct', (["{'labels': {'pipeline_id': self._pipeline_id, 'job_id': self._job_id,\n 'worker... |
import numpy as np
import cv2
from flask import Flask
from flask import jsonify
from flask import request
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker,relationship,scoped_session
from flask_sqlalchemy_session import flask_scoped_session
from sqlalchemy import create_e... | [
"dateutil.parser.parse",
"sqlalchemy.orm.sessionmaker",
"flask.Flask",
"flask.jsonify",
"sqlalchemy.create_engine",
"cv2.imdecode",
"sqlalchemy.ext.declarative.declarative_base",
"numpy.fromstring",
"sqlalchemy.Column",
"ripeness_predictor.is_ripe"
] | [((457, 472), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (462, 472), False, 'from flask import Flask\n'), ((480, 498), 'sqlalchemy.ext.declarative.declarative_base', 'declarative_base', ([], {}), '()\n', (496, 498), False, 'from sqlalchemy.ext.declarative import declarative_base\n'), ((565, 598), 'sqla... |
#copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable l... | [
"paddle.fluid.layers.topk",
"paddle.fluid.layers.reduce_mean",
"paddle.fluid.layers.square",
"paddle.fluid.layers.cross_entropy",
"paddle.fluid.layers.cast",
"paddle.fluid.layers.reduce_sum",
"paddle.fluid.layers.abs",
"paddle.fluid.layers.sigmoid_cross_entropy_with_logits",
"paddle.fluid.layers.res... | [((1753, 1786), 'paddle.fluid.layers.reduce_sum', 'fluid.layers.reduce_sum', (['positive'], {}), '(positive)\n', (1776, 1786), True, 'import paddle.fluid as fluid\n'), ((1812, 1861), 'paddle.fluid.layers.cast', 'fluid.layers.cast', (['positive_count'], {'dtype': 'np.int32'}), '(positive_count, dtype=np.int32)\n', (1829... |
# Generated from /home/hpcc/ppl-course/assignment/assignment2/main/mc/parser/MC.g4 by ANTLR 4.7.1
# encoding: utf-8
from antlr4 import *
from io import StringIO
from typing.io import TextIO
import sys
def serializedATN():
with StringIO() as buf:
buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964... | [
"io.StringIO",
"antlr4.error.Errors.FailedPredicateException"
] | [((232, 242), 'io.StringIO', 'StringIO', ([], {}), '()\n', (240, 242), False, 'from io import StringIO\n'), ((52844, 52905), 'antlr4.error.Errors.FailedPredicateException', 'FailedPredicateException', (['self', '"""self.precpred(self._ctx, 2)"""'], {}), "(self, 'self.precpred(self._ctx, 2)')\n", (52868, 52905), False, ... |
import Spheral
import distributeNodesGeneric
#-------------------------------------------------------------------------------
# Domain decompose using PeanoHilbert ordering (1d method).
#-------------------------------------------------------------------------------
def distributeNodes1d(*listOfNodeTuples):
distri... | [
"distributeNodesGeneric.distributeNodesGeneric"
] | [((314, 481), 'distributeNodesGeneric.distributeNodesGeneric', 'distributeNodesGeneric.distributeNodesGeneric', (['listOfNodeTuples', 'Spheral.DataBase1d', 'Spheral.globalNodeIDsAll1d', 'Spheral.PeanoHilbertOrderRedistributeNodes1d'], {}), '(listOfNodeTuples, Spheral.\n DataBase1d, Spheral.globalNodeIDsAll1d, Sphera... |
import contextlib
import logging
import rasterio.crs
import rasterio.vrt
import rasterio.windows
import affine
import numpy as np
import xarray as xr
logger = logging.getLogger(__name__)
CRS_WGS = rasterio.crs.CRS({'init': 'epsg:4326'})
def _datasets_are_congruent(datasets):
"""Determine whether datasets are c... | [
"logging.getLogger",
"numpy.where",
"numpy.ma.zeros",
"xarray.Dataset",
"numpy.any",
"numpy.sum",
"contextlib.ExitStack",
"affine.Affine",
"xarray.DataArray",
"numpy.full",
"numpy.arange"
] | [((161, 188), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (178, 188), False, 'import logging\n'), ((5016, 5057), 'affine.Affine', 'affine.Affine', (["*ds.attrs['transform'][:6]"], {}), "(*ds.attrs['transform'][:6])\n", (5029, 5057), False, 'import affine\n'), ((5444, 5476), 'xarray.Dat... |
# %% [markdown]
# ## 0 | Import packages and load data
# %%
# Import packages
import os
import tkinter
from tkinter.filedialog import askopenfilename, askopenfilenames, askdirectory
import h5py
from collections import defaultdict
from nptdms import TdmsFile
import numpy as np
import pandas as pd
import seaborn as sns
... | [
"os.path.join"
] | [((4244, 4352), 'os.path.join', 'os.path.join', (['vgat_ctrl_save_path', '"""dlpag_vgat_171113_c5_LIAI_OP_clear_VC_1_df_interspike_interval.json"""'], {}), "(vgat_ctrl_save_path,\n 'dlpag_vgat_171113_c5_LIAI_OP_clear_VC_1_df_interspike_interval.json')\n", (4256, 4352), False, 'import os\n')] |
from tpot import TPOTRegressor
from tpot import TPOTClassifier
from sklearn.model_selection import train_test_split
import numpy as np
from models.classes import prepare as prepare
from models.classes import randomforest as randomforest
from models.classes import randomforestc as randomforestc
from sklearn.metrics.scor... | [
"pandas.DataFrame",
"models.classes.prepare.cleanSMILES",
"timeit.default_timer",
"models.classes.prepare.partition",
"models.classes.prepare.createdescriptors",
"json.load",
"numpy.max",
"tpot.TPOTClassifier",
"os.mkdir",
"numpy.min",
"sklearn.metrics.scorer.make_scorer",
"sklearn.metrics.r2_... | [((1386, 1576), 'models.classes.prepare.isolate', 'prepare.isolate', ([], {'structname': "datastore['column_SMILES']['content']", 'activityname': "datastore['column_activity']['content']", 'filelocation': 'filename', 'chemID': "datastore['chemID']['content']"}), "(structname=datastore['column_SMILES']['content'],\n ... |
from office365.entity import Entity
from office365.onedrive.workbookNamedItem import WorkbookNamedItemCollection
from office365.onedrive.workbookWorksheet import WorkbookWorksheetCollection
from office365.runtime.resource_path import ResourcePath
class Workbook(Entity):
"""The top-level object that contains relat... | [
"office365.runtime.resource_path.ResourcePath"
] | [((650, 691), 'office365.runtime.resource_path.ResourcePath', 'ResourcePath', (['"""names"""', 'self.resource_path'], {}), "('names', self.resource_path)\n", (662, 691), False, 'from office365.runtime.resource_path import ResourcePath\n'), ((1017, 1063), 'office365.runtime.resource_path.ResourcePath', 'ResourcePath', (... |
from bameditor.common.methods import getKeyName
def merge_edit_reads(total_modify_reads, total_add_reads, total_delete_reads):
total_modify_readname_list, total_add_readname_list, total_delete_readname_list = [], [], []
total_modify_reads_list, total_add_reads_list, total_delete_reads_list = [], [], []
... | [
"bameditor.common.methods.getKeyName"
] | [((420, 436), 'bameditor.common.methods.getKeyName', 'getKeyName', (['read'], {}), '(read)\n', (430, 436), False, 'from bameditor.common.methods import getKeyName\n'), ((641, 657), 'bameditor.common.methods.getKeyName', 'getKeyName', (['read'], {}), '(read)\n', (651, 657), False, 'from bameditor.common.methods import g... |
import functools
from opt_einsum.paths import ssa_greedy_optimize, register_path_fn
from opt_einsum.path_random import thermal_chooser
from .core import (
jitter_dict,
ContractionTree,
)
from .hyper import register_hyper_function
# ------------------------------ GREEDY HYPER ------------------------------- ... | [
"functools.partial",
"opt_einsum.paths.register_path_fn",
"opt_einsum.paths.ssa_greedy_optimize"
] | [((2169, 2210), 'opt_einsum.paths.register_path_fn', 'register_path_fn', (['"""greedy-rf"""', 'greconf_rf'], {}), "('greedy-rf', greconf_rf)\n", (2185, 2210), False, 'from opt_einsum.paths import ssa_greedy_optimize, register_path_fn\n'), ((2656, 2697), 'opt_einsum.paths.register_path_fn', 'register_path_fn', (['"""gre... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
aux = {
'get_server': 'Get server delay',
'start_session': 'Start session delay',
'stop_session': 'Stop session delay',
'srv_request': 'Service request delay',
}
def plot_ue_service_delay(time, delay, ue_id=None, service_id=None,... | [
"numpy.mean",
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.max",
"numpy.sum",
"numpy.zeros",
"matplotlib.pyplot.title",
"matplotlib.pyplot.step",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show"
] | [((385, 407), 'matplotlib.pyplot.plot', 'plt.plot', (['time', 'delay_'], {}), '(time, delay_)\n', (393, 407), True, 'import matplotlib.pyplot as plt\n'), ((412, 447), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""time [s]"""'], {'fontsize': '(12)'}), "('time [s]', fontsize=12)\n", (422, 447), True, 'import matplotlib... |
from django.contrib import admin
from devilry.devilry_group import models
class FeedbackSetAdmin(admin.ModelAdmin):
list_display = [
'id',
'group_id',
'get_students',
'deadline_datetime',
'feedbackset_type',
'grading_published_datetime',
'grading_points'
... | [
"django.contrib.admin.site.register"
] | [((1229, 1286), 'django.contrib.admin.site.register', 'admin.site.register', (['models.FeedbackSet', 'FeedbackSetAdmin'], {}), '(models.FeedbackSet, FeedbackSetAdmin)\n', (1248, 1286), False, 'from django.contrib import admin\n'), ((1469, 1528), 'django.contrib.admin.site.register', 'admin.site.register', (['models.Gro... |
from flask_sqlite import app
import os
def test_files():
path = os.getcwd()
files = os.listdir(os.path.join(path, 'src', 'flask_sqlite', 'data'))
assert 'deniro.csv' in files and 'zillow.csv' in files and 'biostats.csv' in files
def test_db():
path = os.getcwd()
path = os.path.join(path, 'src', 'f... | [
"flask_sqlite.app.read",
"flask_sqlite.app.connect",
"os.path.join",
"os.getcwd"
] | [((69, 80), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (78, 80), False, 'import os\n'), ((269, 280), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (278, 280), False, 'import os\n'), ((292, 333), 'os.path.join', 'os.path.join', (['path', '"""src"""', '"""flask_sqlite"""'], {}), "(path, 'src', 'flask_sqlite')\n", (304, 33... |
from datetime import datetime, timedelta
import pytz
def datetime_jakarta():
waktu_jakarta = datetime.now()+timedelta(hours=7)
return waktu_jakarta | [
"datetime.datetime.now",
"datetime.timedelta"
] | [((98, 112), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (110, 112), False, 'from datetime import datetime, timedelta\n'), ((113, 131), 'datetime.timedelta', 'timedelta', ([], {'hours': '(7)'}), '(hours=7)\n', (122, 131), False, 'from datetime import datetime, timedelta\n')] |
from typing import Any, Union
from unittest.mock import Mock
import pystac
class MockStacIO(pystac.StacIO):
"""Creates a mock that records StacIO calls for testing and allows
clients to replace StacIO functionality, all within a context scope.
"""
def __init__(self) -> None:
self.mock = Mock... | [
"pystac.StacIO.default",
"unittest.mock.Mock"
] | [((316, 322), 'unittest.mock.Mock', 'Mock', ([], {}), '()\n', (320, 322), False, 'from unittest.mock import Mock\n'), ((481, 504), 'pystac.StacIO.default', 'pystac.StacIO.default', ([], {}), '()\n', (502, 504), False, 'import pystac\n'), ((688, 711), 'pystac.StacIO.default', 'pystac.StacIO.default', ([], {}), '()\n', (... |
import pytest
from qtoggleserver.core.expressions import parse
from qtoggleserver.core.expressions import UnknownFunction, UnbalancedParentheses, UnexpectedEnd, UnexpectedCharacter
from qtoggleserver.core.expressions import EmptyExpression
async def test_parse_complex_expression(num_mock_port1, num_mock_port2):
... | [
"pytest.raises",
"qtoggleserver.core.expressions.parse"
] | [((584, 629), 'qtoggleserver.core.expressions.parse', 'parse', (['"""nid1"""', '"""ADD(10, MUL($, 3.14), $nid2)"""'], {}), "('nid1', 'ADD(10, MUL($, 3.14), $nid2)')\n", (589, 629), False, 'from qtoggleserver.core.expressions import parse\n'), ((698, 767), 'qtoggleserver.core.expressions.parse', 'parse', (['"""nid1"""',... |