code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
"""
In this file, we introduce some algorithm in order to simplify the problem before solving it
"""
import sys
from optimizedGPS.structure.DriversStructure import DriversStructure
class PreSolver(object):
def __init__(self, graph, drivers_graph, drivers_structure=None, horizon=sys.maxint):
self.graph =... | [
"optimizedGPS.structure.DriversStructure.DriversStructure",
"optimizedGPS.problems.Heuristics.RealGPS"
] | [((1642, 1681), 'optimizedGPS.problems.Heuristics.RealGPS', 'RealGPS', (['self.graph', 'self.drivers_graph'], {}), '(self.graph, self.drivers_graph)\n', (1649, 1681), False, 'from optimizedGPS.problems.Heuristics import RealGPS\n'), ((424, 479), 'optimizedGPS.structure.DriversStructure.DriversStructure', 'DriversStruct... |
"""
nc2pd
~~~~~
A thin python-netCDF4 wrapper to turn netCDF files into pandas data
structures, with a focus on extracting time series from regularly
spatial gridded data (with the ability to interpolate spatially).
Copyright 2015 <NAME>
License: MIT (see LICENSE file)
"""
from __future__ import print_function
fro... | [
"pandas.Series",
"numpy.ones_like",
"numpy.abs",
"netCDF4.num2date",
"numpy.searchsorted",
"netCDF4.Dataset",
"numpy.argmax",
"pandas.Panel",
"pandas.datetools.parse_time_string",
"itertools.chain.from_iterable",
"pandas.DataFrame",
"pandas.concat",
"pandas.date_range"
] | [((17595, 17621), 'pandas.concat', 'pd.concat', (['results'], {'axis': '(1)'}), '(results, axis=1)\n', (17604, 17621), True, 'import pandas as pd\n'), ((637, 675), 'pandas.datetools.parse_time_string', 'pd.datetools.parse_time_string', (['string'], {}), '(string)\n', (667, 675), True, 'import pandas as pd\n'), ((858, 8... |
###############################################################################
# PyDial: Multi-domain Statistical Spoken Dialogue System Software
###############################################################################
#
# Copyright 2015 - 2019
# Cambridge University Engineering Department Dialogue Systems Grou... | [
"utils.Settings.load_config",
"wikipedia.WikipediaPage",
"wikipedia.page",
"utils.ContextLogger.createLoggingHandlers",
"utils.ContextLogger.getLogger",
"wikipedia.random",
"importlib.reload",
"wikipedia.summary"
] | [((1493, 1524), 'utils.ContextLogger.getLogger', 'ContextLogger.getLogger', (['"""wiki"""'], {}), "('wiki')\n", (1516, 1524), False, 'from utils import ContextLogger\n'), ((1537, 1558), 'importlib.reload', 'importlib.reload', (['sys'], {}), '(sys)\n', (1553, 1558), False, 'import importlib\n'), ((7594, 7650), 'utils.Se... |
import click
from barique.cli import pass_context, json_loads
from barique.decorators import custom_exception, list_output
@click.command('list')
@click.argument("path", type=str)
@click.option(
"--full",
help="List full information for each file (size (in bytes), mtime, etc..)",
is_flag=True
)
@click.opt... | [
"click.option",
"click.argument",
"click.command"
] | [((126, 147), 'click.command', 'click.command', (['"""list"""'], {}), "('list')\n", (139, 147), False, 'import click\n'), ((149, 181), 'click.argument', 'click.argument', (['"""path"""'], {'type': 'str'}), "('path', type=str)\n", (163, 181), False, 'import click\n'), ((183, 304), 'click.option', 'click.option', (['"""-... |
import sys
import yaml
import argparse
def load_yaml_config(path, skip_lines=0):
with open(path, 'r') as infile:
for i in range(skip_lines):
# Skip some lines (e.g., namespace at the first line)
_ = infile.readline()
return yaml.safe_load(infile)
def save_yaml_config(con... | [
"yaml.safe_load",
"argparse.ArgumentParser",
"yaml.dump"
] | [((461, 486), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (484, 486), False, 'import argparse\n'), ((271, 293), 'yaml.safe_load', 'yaml.safe_load', (['infile'], {}), '(infile)\n', (285, 293), False, 'import yaml\n'), ((377, 429), 'yaml.dump', 'yaml.dump', (['config', 'outfile'], {'default_fl... |
from django.conf.urls import include, url
from rest_framework_jwt.views import obtain_jwt_token, refresh_jwt_token
urlpatterns = [
url(r'^api-token-auth/', obtain_jwt_token),
url(r'^api-token-refresh/', refresh_jwt_token),
url(r'^api/v1/', include('{{cookiecutter.project_name}}.{{cookiecutter.django_app}}.... | [
"django.conf.urls.include",
"django.conf.urls.url"
] | [((136, 177), 'django.conf.urls.url', 'url', (['"""^api-token-auth/"""', 'obtain_jwt_token'], {}), "('^api-token-auth/', obtain_jwt_token)\n", (139, 177), False, 'from django.conf.urls import include, url\n'), ((184, 229), 'django.conf.urls.url', 'url', (['"""^api-token-refresh/"""', 'refresh_jwt_token'], {}), "('^api-... |
#!/usr/bin/env python3
#
# Copyright 2019 The usbmon-tools 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | [
"usbmon.pcapng.parse_stream",
"usbmon.support.extractors.find_device_in_session",
"click.File",
"usbmon.support.click_helpers.DeviceAddressType",
"usbmon.chatter.dump_bytes",
"usbmon.support.hid.select",
"click.command",
"logging.error",
"usbmon.support.cp2110.control_command_to_str"
] | [((963, 978), 'click.command', 'click.command', ([], {}), '()\n', (976, 978), False, 'import click\n'), ((1558, 1612), 'usbmon.pcapng.parse_stream', 'usbmon.pcapng.parse_stream', (['pcap_file'], {'retag_urbs': '(True)'}), '(pcap_file, retag_urbs=True)\n', (1584, 1612), False, 'import usbmon\n'), ((1964, 2029), 'usbmon.... |
'''
Industry Class
Model Operations Processing System
Copyright <NAME> 2009 Licenced under the EUPL. You may not use this
work except in compliance with the Licence. You may obtain a copy of the
Licence at http://ec.europa.eu/idabc/eupl or as attached with this application
(see Licence file). Unless requi... | [
"MOPS_Misc.format_data"
] | [((4414, 4526), 'MOPS_Misc.format_data', 'MOPS_Misc.format_data', ([], {'raw_data': 'message', 'position': '(0)', 'size': 'self.indysize', 'mode': 'change_mode', 'original_value': '""""""'}), "(raw_data=message, position=0, size=self.indysize,\n mode=change_mode, original_value='')\n", (4435, 4526), False, 'import M... |
# Generated by Django 3.2.4 on 2021-09-10 19:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0092_sitesettings_instance_short_description"),
]
operations = [
migrations.AlterField(
model_name="sitesettings",
... | [
"django.db.models.CharField"
] | [((384, 439), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(255)', 'null': '(True)'}), '(blank=True, max_length=255, null=True)\n', (400, 439), False, 'from django.db import migrations, models\n')] |
#===============================================================================
# Copyright 2020-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | [
"os.environ.keys",
"bench.load_data",
"xgboost.DMatrix",
"daal4py.gbt_regression_prediction",
"argparse.ArgumentParser",
"xgboost.train",
"numpy.unique",
"bench.parse_args",
"daal4py.gbt_classification_prediction",
"bench.measure_function_time",
"os.path.abspath",
"utils.print_output"
] | [((978, 1076), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""xgboost gbt + model transform + daal predict benchmark"""'}), "(description=\n 'xgboost gbt + model transform + daal predict benchmark')\n", (1001, 1076), False, 'import argparse\n'), ((3999, 4023), 'bench.parse_args', 'ben... |
# Copyright (c) 2020 VisualDL 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... | [
"threading.Thread.__init__",
"requests.post",
"hashlib.md5"
] | [((902, 915), 'hashlib.md5', 'hashlib.md5', ([], {}), '()\n', (913, 915), False, 'import hashlib\n'), ((1082, 1113), 'threading.Thread.__init__', 'threading.Thread.__init__', (['self'], {}), '(self)\n', (1107, 1113), False, 'import threading\n'), ((1519, 1555), 'requests.post', 'requests.post', ([], {'url': 'url', 'jso... |
import logging
import sys
from collections import defaultdict
from typing import List
from forte.data import DataPack
from forte.datasets.wikipedia.dbpedia import WikiPackReader
from forte.datasets.wikipedia.dbpedia.db_utils import state_type, \
get_resource_name
from forte.processors.base import PackProcessor
fro... | [
"flashtext.KeywordProcessor",
"ft.onto.wikipedia.WikiAnchor",
"collections.defaultdict",
"pdb.set_trace",
"sys.stdout.flush",
"ft.onto.wikipedia.WikiArticleTitle",
"logging.error",
"sys.stdout.write"
] | [((565, 586), 'sys.stdout.write', 'sys.stdout.write', (['"""."""'], {}), "('.')\n", (581, 586), False, 'import sys\n'), ((595, 613), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n', (611, 613), False, 'import sys\n'), ((924, 941), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (935, 941)... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
import torchvision.transforms as transforms
import numpy as np
print("GPU is", "available" if torch.cuda.is_available() else "NOT AVAILABLE")
print(torch.__version__)
# import images dataset
import os
from PIL import Image
#import c... | [
"random.sample",
"torchvision.models.vgg16",
"PIL.Image.open",
"random.shuffle",
"torch.gt",
"numpy.asarray",
"random.seed",
"json.load",
"torch.tensor",
"numpy.array",
"torch.cuda.is_available",
"importlib.reload",
"torch.utils.data.DataLoader",
"torch.nn.BCEWithLogitsLoss",
"torch.save... | [((1571, 1594), 'random.shuffle', 'random.shuffle', (['dataset'], {}), '(dataset)\n', (1585, 1594), False, 'import random\n'), ((1640, 1731), 'torch.utils.data.DataLoader', 'torch.utils.data.DataLoader', (['dataset[:train_size]'], {'shuffle': '(True)', 'batch_size': 'BATCH_SIZE'}), '(dataset[:train_size], shuffle=True,... |
import pytest
from ics import Calendar, ContentLine
def test_gh195_override_prodid():
lines = [
"BEGIN:VCALENDAR",
"VERSION:2.0",
"X-WR-CALNAME:<NAME>",
"X-APPLE-CALENDAR-COLOR:#996633",
"END:VCALENDAR"
]
with pytest.raises(ValueError, match="attribute PRODID is re... | [
"ics.Calendar",
"pytest.raises",
"ics.ContentLine"
] | [((387, 397), 'ics.Calendar', 'Calendar', ([], {}), '()\n', (395, 397), False, 'from ics import Calendar, ContentLine\n'), ((660, 675), 'ics.Calendar', 'Calendar', (['lines'], {}), '(lines)\n', (668, 675), False, 'from ics import Calendar, ContentLine\n'), ((265, 350), 'pytest.raises', 'pytest.raises', (['ValueError'],... |
#
# This file is part of CasADi.
#
# CasADi -- A symbolic framework for dynamic optimization.
# Copyright (C) 2010-2014 <NAME>, <NAME>, <NAME>,
# <NAME>. All rights reserved.
# Copyright (C) 2011-2014 <NAME>
#
# CasADi is free software; you can redistribute it and/or
# ... | [
"unittest.main",
"numpy.linspace"
] | [((3590, 3605), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3603, 3605), False, 'import unittest\n'), ((2125, 2154), 'numpy.linspace', 'n.linspace', (['(0)', "num['tend']", 'N'], {}), "(0, num['tend'], N)\n", (2135, 2154), True, 'import numpy as n\n'), ((2974, 3007), 'numpy.linspace', 'n.linspace', (['(0.7)', ... |
# Copyright (c) 2016-2018, University of Idaho
# All rights reserved.
#
# <NAME> (<EMAIL>)
#
# The project described was supported by NSF award number IIA-1301792
# from the NSF Idaho EPSCoR Program and by the National Science Foundation.
from os.path import join as _join
from os.path import exists as _exists
import ... | [
"os.path.exists",
"posixpath.join",
"os.path.join",
"wepppy.soils.ssurgo.SoilSummary"
] | [((1222, 1238), 'os.path.exists', '_exists', (['dst_dir'], {}), '(dst_dir)\n', (1229, 1238), True, 'from os.path import exists as _exists\n'), ((578, 621), 'posixpath.join', 'urljoin', (['_soilbuilder_url', '"""validatemukeys"""'], {}), "(_soilbuilder_url, 'validatemukeys')\n", (585, 621), True, 'from posixpath import ... |
# coding: utf8
# Copyright 2007 <NAME>. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditi... | [
"logging.getLogger",
"itertools.chain",
"re.escape",
"whoosh.compat.callable",
"collections.deque",
"whoosh.compat.next",
"re.compile",
"whoosh.compat.iteritems",
"whoosh.compat.text_type",
"whoosh.util.unbound_cache",
"whoosh.compat.u",
"whoosh.util.rcompile",
"whoosh.util.lru_cache",
"St... | [((4021, 4048), 'whoosh.util.rcompile', 'rcompile', (['"""\\\\w+(\\\\.?\\\\w+)*"""'], {}), "('\\\\w+(\\\\.?\\\\w+)*')\n", (4029, 4048), False, 'from whoosh.util import lru_cache, unbound_cache, rcompile\n'), ((4061, 4379), 'whoosh.util.rcompile', 'rcompile', (['"""\n(\n [A-Za-z+]+:// # URL protocol\n \\\... |
import os
import logging
from fastapi import FastAPI, Request
from fastapi.responses import HTMLResponse
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
from celery_tasks import run_imdb_user_watchlist_check, run_imdb_top_250_check, get_state_by_id,\
get_result_by_id
fro... | [
"logging.basicConfig",
"fastapi.FastAPI",
"celery_tasks.run_imdb_top_250_check.delay",
"logging.debug",
"celery_tasks.get_state_by_id",
"os.environ.get",
"fastapi.templating.Jinja2Templates",
"celery_tasks.run_imdb_user_watchlist_check.delay",
"fastapi.staticfiles.StaticFiles",
"logging.info",
"... | [((534, 638), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s - %(name)s - %(levelname)s - %(message)s"""', 'level': 'LOG_LEVEL'}), "(format=\n '%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=LOG_LEVEL)\n", (553, 638), False, 'import logging\n'), ((641, 650), 'fastapi.Fast... |
# This file is part of paramiko.
"""
Configuration file (aka ``ssh_config``) support.
"""
import fnmatch # filename match
import os
import re
import shlex # shell lexical analyzers
import socket
from retic import List,Void,String,Bool
SSH_PORT = 22
@fields({SETTINGS_REGEX: String, _config:List(Tuple(List(String),D... | [
"socket.getfqdn",
"os.getenv",
"shlex.split",
"re.match",
"retic.List",
"fnmatch.fnmatch",
"socket.getaddrinfo",
"socket.gethostname",
"os.path.expanduser"
] | [((7878, 7890), 'retic.List', 'List', (['String'], {}), '(String)\n', (7882, 7890), False, 'from retic import List, Void, String, Bool\n'), ((5887, 5904), 'os.getenv', 'os.getenv', (['"""USER"""'], {}), "('USER')\n", (5896, 5904), False, 'import os\n'), ((6125, 6148), 'os.path.expanduser', 'os.path.expanduser', (['"""~... |
__all__ = ['GridSearcher']
from .searcher import BaseSearcher
from sklearn.model_selection import ParameterGrid
class GridSearcher(BaseSearcher):
"""Grid Searcher that exhaustively tries all possible configurations.
This Searcher can only be used for discrete search spaces of type :class:`autogluon.space... | [
"sklearn.model_selection.ParameterGrid"
] | [((1311, 1336), 'sklearn.model_selection.ParameterGrid', 'ParameterGrid', (['param_grid'], {}), '(param_grid)\n', (1324, 1336), False, 'from sklearn.model_selection import ParameterGrid\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import session, render_template, redirect
from bson.objectid import ObjectId
from classroom import app
from classroom import db
# Rota para acessar página inicial da aplicação
@app.route("/classroom/", methods=["GET"])
def index():
# Verifica se o usuário... | [
"flask.render_template",
"classroom.db.questions.find",
"bson.objectid.ObjectId",
"flask.redirect",
"classroom.db.classes.find",
"classroom.app.route"
] | [((238, 279), 'classroom.app.route', 'app.route', (['"""/classroom/"""'], {'methods': "['GET']"}), "('/classroom/', methods=['GET'])\n", (247, 279), False, 'from classroom import app\n'), ((915, 961), 'classroom.app.route', 'app.route', (['"""/classroom/quiz/"""'], {'methods': "['GET']"}), "('/classroom/quiz/', methods... |
"""
CoNLL-X and CoNLL-U file readers and writers
"""
__author__ = "<NAME>"
import os
def get_files(dir, suffix):
"""
Returns all the files in a folder ending with suffix
Recursive version
:param dir:
:param suffix:
:return: the list of file names
"""
files = []
for file in os.list... | [
"os.path.isfile",
"os.listdir",
"os.path.isdir"
] | [((313, 328), 'os.listdir', 'os.listdir', (['dir'], {}), '(dir)\n', (323, 328), False, 'import os\n'), ((373, 392), 'os.path.isdir', 'os.path.isdir', (['path'], {}), '(path)\n', (386, 392), False, 'import os\n'), ((452, 472), 'os.path.isfile', 'os.path.isfile', (['path'], {}), '(path)\n', (466, 472), False, 'import os\... |
# Debian and Ubuntu system administration tools.
#
# Author: <NAME> <<EMAIL>>
# Last Change: May 20, 2020
# URL: https://debuntu-tools.readthedocs.io
"""
Usage: upgrade-remote-system [OPTIONS] [SSH_ALIAS]
Upgrade the system packages on a remote Debian or Ubuntu system, reboot the
system when this is required due to s... | [
"debuntu_tools.start_interactive_shell",
"coloredlogs.install",
"humanfriendly.terminal.warning",
"debuntu_tools.kernel_manager.KernelPackageManager",
"coloredlogs.decrease_verbosity",
"humanfriendly.terminal.usage",
"verboselogs.VerboseLogger",
"executor.contexts.RemoteContext",
"sys.exit",
"geto... | [((1643, 1666), 'verboselogs.VerboseLogger', 'VerboseLogger', (['__name__'], {}), '(__name__)\n', (1656, 1666), False, 'from verboselogs import VerboseLogger\n'), ((1806, 1838), 'coloredlogs.install', 'coloredlogs.install', ([], {'syslog': '(True)'}), '(syslog=True)\n', (1825, 1838), False, 'import coloredlogs\n'), ((4... |
'''
MacOS X Storage Path
--------------------
'''
import os.path
from plyer.facades import StoragePath
from plyer.platforms.macosx.libs import osx_paths
# Directory constants (NSSearchPathDirectory enumeration)
NSApplicationDirectory = 1
NSDocumentDirectory = 9
NSDownloadsDirectory = 15
NSMoviesDirectory = 17
NSMusic... | [
"plyer.platforms.macosx.libs.osx_paths.NSIterateSearchPaths"
] | [((668, 719), 'plyer.platforms.macosx.libs.osx_paths.NSIterateSearchPaths', 'osx_paths.NSIterateSearchPaths', (['NSDocumentDirectory'], {}), '(NSDocumentDirectory)\n', (698, 719), False, 'from plyer.platforms.macosx.libs import osx_paths\n'), ((770, 822), 'plyer.platforms.macosx.libs.osx_paths.NSIterateSearchPaths', 'o... |
"""
implement bayesian analysis of two diff pops, X1 and X2, called here x and y
"""
from math import sqrt, exp, log
import numpy as np
import matplotlib.pyplot as plt
from SciInf_utilities import *
import sys
#--------------------------------------
print("\n implement bayesian analysis of two diff population means")
... | [
"matplotlib.pyplot.boxplot",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"math.sqrt",
"math.log",
"numpy.exp",
"numpy.zeros",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.... | [((894, 905), 'math.sqrt', 'sqrt', (['var_x'], {}), '(var_x)\n', (898, 905), False, 'from math import sqrt, exp, log\n'), ((913, 924), 'math.sqrt', 'sqrt', (['var_y'], {}), '(var_y)\n', (917, 924), False, 'from math import sqrt, exp, log\n'), ((980, 1005), 'math.sqrt', 'sqrt', (['(var_x / (n_x - 1.0))'], {}), '(var_x /... |
import os
import cv2
import numpy as np
# Dataset from http://www.robots.ox.ac.uk/ActiveVision/Research/Projects/2009bbenfold_headpose/project.html#datasets
def video2im(src, train_path="images", test_path="test_images", factor=2):
"""
Extracts all frames from a video and saves them as jpgs
"""
os.m... | [
"cv2.resize",
"cv2.VideoCapture",
"os.makedirs"
] | [((316, 354), 'os.makedirs', 'os.makedirs', (['train_path'], {'exist_ok': '(True)'}), '(train_path, exist_ok=True)\n', (327, 354), False, 'import os\n'), ((359, 396), 'os.makedirs', 'os.makedirs', (['test_path'], {'exist_ok': '(True)'}), '(test_path, exist_ok=True)\n', (370, 396), False, 'import os\n'), ((422, 443), 'c... |
"""DisasterModel time series"""
from pymc.examples import DisasterModel
import pylab as P
import numpy as np
y = DisasterModel.disasters_array
years = 1852 + np.arange(len(y))
P.rcdefaults()
P.figure(figsize=(6,3))
P.subplots_adjust(bottom=.2)
P.subplot(111)
P.plot(years, y, 'bo', ms=3)
P.plot(years, y, 'k-', lw=1... | [
"pylab.subplots_adjust",
"pylab.subplot",
"pylab.plot",
"pylab.savefig",
"pylab.xlabel",
"pylab.close",
"pylab.figure",
"pylab.rcdefaults",
"pylab.ylabel"
] | [((180, 194), 'pylab.rcdefaults', 'P.rcdefaults', ([], {}), '()\n', (192, 194), True, 'import pylab as P\n'), ((196, 220), 'pylab.figure', 'P.figure', ([], {'figsize': '(6, 3)'}), '(figsize=(6, 3))\n', (204, 220), True, 'import pylab as P\n'), ((220, 249), 'pylab.subplots_adjust', 'P.subplots_adjust', ([], {'bottom': '... |
# -*- coding:utf-8 -*-
__author__ = 'Edwin.Wu'
__date__ = '2017/3/11 15:44'
import xadmin
from .models import Course, Lesson, Video, CourseResource
class CourseAdmin(object):
list_display = ['name', 'desc', 'detail', 'degree', 'learn_times', 'students', 'fav_nums', 'image', 'click_nums',
'add... | [
"xadmin.site.register"
] | [((1216, 1257), 'xadmin.site.register', 'xadmin.site.register', (['Course', 'CourseAdmin'], {}), '(Course, CourseAdmin)\n', (1236, 1257), False, 'import xadmin\n'), ((1258, 1299), 'xadmin.site.register', 'xadmin.site.register', (['Lesson', 'LessonAdmin'], {}), '(Lesson, LessonAdmin)\n', (1278, 1299), False, 'import xad... |
#!/usr/bin/env python3
import logging
import argparse
import json
from dhcppython import client, options, utils
CLIENT_NAME = "DORA"
CLIENT_VER = "0.1.3"
if __name__ == "__main__":
logging.basicConfig(
level=logging.DEBUG,
format="%(asctime)s - %(threadName)s - %(levelname)s: %(message)s",
... | [
"dhcppython.client.DHCPClient",
"json.loads",
"logging.StreamHandler",
"dhcppython.utils.cur_datetime",
"logging.debug",
"argparse.ArgumentParser",
"dhcppython.options.options.value_to_object",
"dhcppython.options.OptionList",
"dhcppython.utils.get_ip_by_server",
"dhcppython.utils.random_mac",
"... | [((1211, 1318), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': "help_texts['main']", 'formatter_class': 'argparse.RawTextHelpFormatter'}), "(description=help_texts['main'], formatter_class=\n argparse.RawTextHelpFormatter)\n", (1234, 1318), False, 'import argparse\n'), ((3933, 3957), 'dhc... |
import subprocess
import sys
base_cmd = "sbatch"
ss= "launch_scripts/cpu_mila_cluster.sl"
module = "scripts.run_probe"
args = [base_cmd, ss, module]
args.extend(sys.argv[1:])
#envs = ["pong", "freeway","ms_pacman"]
#envs = [ 'video_pinball',
#'yars_revenge', 'space_invaders', 'private_eye', 'montezuma_revenge',
#'m... | [
"subprocess.run"
] | [((1299, 1320), 'subprocess.run', 'subprocess.run', (['sargs'], {}), '(sargs)\n', (1313, 1320), False, 'import subprocess\n')] |
# -*- coding: utf-8 -*-
#
# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE file for details.
from datetime import datetime
from logging import getLogger as get_logger
from threading import Event, Thread
from limits import parse as parse_rate_limit
from limits.stor... | [
"logging.getLogger",
"six.moves.queue.Queue",
"logstash_async.database.DatabaseCache",
"logstash_async.memory_cache.MemoryCache",
"limits.storage.MemoryStorage",
"threading.Event",
"datetime.datetime.now",
"limits.parse",
"limits.strategies.FixedWindowRateLimiter",
"logstash_async.utils.safe_log_v... | [((1610, 1617), 'threading.Event', 'Event', ([], {}), '()\n', (1615, 1617), False, 'from threading import Event, Thread\n'), ((1646, 1653), 'threading.Event', 'Event', ([], {}), '()\n', (1651, 1653), False, 'from threading import Event, Thread\n'), ((1676, 1683), 'six.moves.queue.Queue', 'Queue', ([], {}), '()\n', (168... |
"""Sample script of word embedding model.
This code implements skip-gram model and continuous-bow model.
Use ../ptb/download.py to download 'ptb.train.txt'.
"""
import argparse
import collections
import numpy as np
import six
import chainer
from chainer import cuda
import chainer.functions as F
import chainer.initial... | [
"chainer.training.extensions.PrintReport",
"chainer.datasets.get_ptb_words",
"chainer.training.StandardUpdater",
"numpy.array",
"numpy.arange",
"argparse.ArgumentParser",
"chainer.training.Trainer",
"chainer.training.extensions.Evaluator",
"chainer.cuda.to_cpu",
"chainer.links.Linear",
"chainer.... | [((497, 522), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (520, 522), False, 'import argparse\n'), ((5708, 5740), 'chainer.datasets.get_ptb_words', 'chainer.datasets.get_ptb_words', ([], {}), '()\n', (5738, 5740), False, 'import chainer\n'), ((5750, 5776), 'collections.Counter', 'collections... |
# Copyright 2018 Neural Networks and Deep Learning lab, MIPT
#
# 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 applicab... | [
"logging.getLogger",
"tensorflow.unstack",
"tensorflow.einsum",
"tensorflow.get_variable_scope",
"tensorflow.nn.softmax",
"tensorflow.set_random_seed",
"tensorflow.nn.embedding_lookup",
"tensorflow.Session",
"tensorflow.placeholder",
"deeppavlov.models.ranking.matching_models.dam_utils.layers.loss... | [((1012, 1031), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (1021, 1031), False, 'from logging import getLogger\n'), ((1035, 1053), 'deeppavlov.core.common.registry.register', 'register', (['"""dam_nn"""'], {}), "('dam_nn')\n", (1043, 1053), False, 'from deeppavlov.core.common.registry import ... |
from _repobee import plugin
from repobee_encode import encode
def test_register():
"""Just test that there is no crash"""
plugin.register_plugins([encode])
| [
"_repobee.plugin.register_plugins"
] | [((133, 166), '_repobee.plugin.register_plugins', 'plugin.register_plugins', (['[encode]'], {}), '([encode])\n', (156, 166), False, 'from _repobee import plugin\n')] |
import os, argparse
import datetime
import time
from poloniex import Poloniex
def read_ticker():
#TODO: should add a check to see if user input is in the list of valid options
ticker = input("Enter the ticker pair, e.g. BTC_ETH \n")
return ticker
def continueOption():
'''Allows user to be able to vie... | [
"datetime.datetime.now",
"poloniex.Poloniex",
"time.sleep"
] | [((1179, 1204), 'poloniex.Poloniex', 'Poloniex', (['api_key', 'secret'], {}), '(api_key, secret)\n', (1187, 1204), False, 'from poloniex import Poloniex\n'), ((3396, 3419), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (3417, 3419), False, 'import datetime\n'), ((3690, 3710), 'time.sleep', 'time.s... |
# -*- coding: utf-8 -*-
from datetime import datetime
from scim import schema
class TestUser:
def test_serialize(self):
u = schema.User()
u.id = '43568296982626'
u.external_id = '42'
u.meta.created = datetime.now()
u.meta.attributes.append('blue')
u.meta.attributes... | [
"datetime.datetime.now",
"scim.schema.User",
"scim.schema.User.deserialize"
] | [((139, 152), 'scim.schema.User', 'schema.User', ([], {}), '()\n', (150, 152), False, 'from scim import schema\n'), ((239, 253), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (251, 253), False, 'from datetime import datetime\n'), ((1646, 1672), 'scim.schema.User.deserialize', 'schema.User.deserialize', (['... |
import gc
import weakref
import sympy
from sympy import cache
__all__ = ['Cached', '_SymbolCache', 'CacheManager']
_SymbolCache = {}
"""The symbol cache."""
class AugmentedWeakRef(weakref.ref):
def __new__(cls, obj, meta):
obj = super().__new__(cls, obj)
obj.nbytes = meta.get('nbytes', 0)
... | [
"sympy.polys.rootoftools.ComplexRootOf.clear_cache",
"sympy.polys.domains.modularinteger._modular_integer_cache.clear",
"sympy.cache.clear_cache",
"gc.collect",
"sympy.polys.fields._field_cache.clear",
"sympy.polys.rings._ring_cache.clear"
] | [((3669, 3688), 'sympy.cache.clear_cache', 'cache.clear_cache', ([], {}), '()\n', (3686, 3688), False, 'from sympy import cache\n'), ((3756, 3807), 'sympy.polys.rootoftools.ComplexRootOf.clear_cache', 'sympy.polys.rootoftools.ComplexRootOf.clear_cache', ([], {}), '()\n', (3805, 3807), False, 'import sympy\n'), ((3816, ... |
import requests
import time
import math
from random import randint
url = 'http://127.0.0.1:8000/api/datum/'
headers = {'Authorization': 'Token <PASSWORD>'}
def funcData(value):
return {'probe_hash': '38ca7d9fc6d488ac37f3b7dc3fb906ad', 'value': str(value), 'note':''}
def funcData2(value):
return {'probe_hash'... | [
"requests.post",
"random.randint",
"time.sleep"
] | [((474, 520), 'requests.post', 'requests.post', (['url'], {'data': 'data', 'headers': 'headers'}), '(url, data=data, headers=headers)\n', (487, 520), False, 'import requests\n'), ((525, 538), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (535, 538), False, 'import time\n'), ((606, 653), 'requests.post', 'requests... |
""" Script to proceed segmentation with user interaction
A Graphical User Interface allows to restore and remove edges
Store graph in _save_segmentation
"""
from stentseg.stentdirect.stentgraph import create_mesh
## Rerun step 3 without removing nodes
# p.graph_minimumClusterSize = 1
# sd._params = p
sd.Step3(cleanNo... | [
"stentseg.stentdirect.stentgraph.StentGraph",
"stentseg.stentdirect.stentgraph.prune_clusters",
"stentseg.stentdirect.stentgraph._edge_length",
"stentseg.stentdirect.stentgraph._pop_node",
"stentseg.stentdirect.stentgraph.prune_tails",
"visvis.Pointset",
"stentseg.stentdirect.stentgraph.pop_nodes",
"s... | [((2601, 2654), 'stentseg.stentdirect.stentgraph._edge_length', 'stentgraph._edge_length', (['sd._nodes3', 'select1', 'select2'], {}), '(sd._nodes3, select1, select2)\n', (2624, 2654), False, 'from stentseg.stentdirect import stentgraph\n'), ((3090, 3101), 'visvis.Pointset', 'Pointset', (['p'], {}), '(p)\n', (3098, 310... |
import jittor as jt
import numpy as np
from advance import *
import matplotlib.pyplot as plt
import argparse
import matplotlib.pyplot as plt
from tqdm import trange
from utils import get_model, modelSet, dataset_choices
import argparse
plt.switch_backend('agg')
# CUDA_VISIBLE_DEVICES=0 log_silent=1 python3.7 run_ssl... | [
"utils.get_model",
"matplotlib.pyplot.savefig",
"argparse.ArgumentParser",
"matplotlib.pyplot.plot",
"numpy.savetxt",
"matplotlib.pyplot.switch_backend"
] | [((238, 263), 'matplotlib.pyplot.switch_backend', 'plt.switch_backend', (['"""agg"""'], {}), "('agg')\n", (256, 263), True, 'import matplotlib.pyplot as plt\n'), ((509, 534), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (532, 534), False, 'import argparse\n'), ((1618, 1633), 'utils.get_model'... |
#!/usr/bin/env python
# -*- coding: utf-8
# Copyright 2017-2019 The FIAAS 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
#
# Unle... | [
"logging.getLogger",
"os.path.exists",
"configargparse.ArgParser"
] | [((1088, 1115), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1105, 1115), False, 'import logging\n'), ((1233, 1679), 'configargparse.ArgParser', 'configargparse.ArgParser', ([], {'auto_env_var_prefix': '""""""', 'add_config_file_help': '(False)', 'add_env_var_help': '(False)', 'config_... |
import os
class TemplatingEngine:
def __init__(self, context):
self.context = context
self.theme_paths = (
context.settings.THEME_PATHS +
self.context.plugins.THEME_PATHS +
context.settings.CORE_THEME_PATHS
)
def find_static_dirs(self):
sta... | [
"os.path.exists",
"os.path.join"
] | [((405, 439), 'os.path.join', 'os.path.join', (['theme_path', '"""static"""'], {}), "(theme_path, 'static')\n", (417, 439), False, 'import os\n'), ((456, 483), 'os.path.exists', 'os.path.exists', (['static_path'], {}), '(static_path)\n', (470, 483), False, 'import os\n')] |
from collections import deque
from functools import reduce
from operator import mul
from typing import Iterable, Tuple
class BitProvider:
def __init__(self, characters: str) -> None:
self.characters: deque[str] = deque(characters)
self.currentBits: deque[int] = deque()
def _BitsFromNextChar(s... | [
"collections.deque"
] | [((227, 244), 'collections.deque', 'deque', (['characters'], {}), '(characters)\n', (232, 244), False, 'from collections import deque\n'), ((284, 291), 'collections.deque', 'deque', ([], {}), '()\n', (289, 291), False, 'from collections import deque\n'), ((564, 571), 'collections.deque', 'deque', ([], {}), '()\n', (569... |
# -*- coding: utf-8 -*-
#
# jQuery File Upload Plugin GAE Python Example 1.1.5
# https://github.com/blueimp/jQuery-File-Upload
#
# Copyright 2011, <NAME>
# https://blueimp.net
#
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT
#
from __future__ import with_statement
from google.appengine.api ... | [
"re.compile",
"google.appengine.ext.blobstore.delete",
"google.appengine.ext.deferred.defer",
"google.appengine.api.files.open",
"google.appengine.ext.blobstore.get",
"urllib.quote",
"google.appengine.api.files.blobstore.create",
"webapp2.WSGIApplication",
"google.appengine.api.files.blobstore.get_b... | [((617, 658), 're.compile', 're.compile', (['"""image/(gif|p?jpeg|(x-)?png)"""'], {}), "('image/(gif|p?jpeg|(x-)?png)')\n", (627, 658), False, 'import json, re, urllib, webapp2\n'), ((5000, 5102), 'webapp2.WSGIApplication', 'webapp2.WSGIApplication', (["[('/', UploadHandler), ('/([^/]+)/([^/]+)', DownloadHandler)]"], {... |
#!/bin/env python
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | [
"nmigen.Signal"
] | [((1065, 1075), 'nmigen.Signal', 'Signal', (['(32)'], {}), '(32)\n', (1071, 1075), False, 'from nmigen import Signal\n'), ((1098, 1106), 'nmigen.Signal', 'Signal', ([], {}), '()\n', (1104, 1106), False, 'from nmigen import Signal\n'), ((1128, 1136), 'nmigen.Signal', 'Signal', ([], {}), '()\n', (1134, 1136), False, 'fro... |
from __future__ import unicode_literals
import warnings
from django.db import models
from cms.models import CMSPlugin
from django.utils.translation import ugettext_lazy as _
from filer.fields.folder import FilerFolderField
from filer.utils.compatibility import python_2_unicode_compatible
from .conf import settings
fro... | [
"django.db.models.OneToOneField",
"django.utils.translation.ugettext_lazy",
"cmsplugin_filer_utils.FilerPluginManager",
"filer.fields.folder.FilerFolderField",
"warnings.warn"
] | [((778, 832), 'filer.fields.folder.FilerFolderField', 'FilerFolderField', ([], {'null': '(True)', 'on_delete': 'models.SET_NULL'}), '(null=True, on_delete=models.SET_NULL)\n', (794, 832), False, 'from filer.fields.folder import FilerFolderField\n'), ((964, 1060), 'django.db.models.OneToOneField', 'models.OneToOneField'... |
import logging
import os
import re
import time
from threading import Event, Lock, Thread
import cook.util as cu
class ProgressSequenceCounter:
"""Utility class that supports atomically incrementing the sequence value."""
def __init__(self, initial=0):
self.lock = Lock()
self.value = initial
... | [
"os.linesep.encode",
"os.path.exists",
"logging.debug",
"cook.util.is_out_of_memory_error",
"threading.Lock",
"time.sleep",
"logging.exception",
"threading.Event",
"os.path.isfile",
"time.time",
"threading.Thread",
"logging.info"
] | [((282, 288), 'threading.Lock', 'Lock', ([], {}), '()\n', (286, 288), False, 'from threading import Event, Lock, Thread\n'), ((1489, 1495), 'threading.Lock', 'Lock', ([], {}), '()\n', (1493, 1495), False, 'from threading import Event, Lock, Thread\n'), ((11187, 11281), 'logging.debug', 'logging.debug', (['"""Updating p... |
"""
sentry.plugins.bases.notify
~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import logging
from django import forms
from sentry.app import (
digests... | [
"sentry.utils.samples.create_sample_event",
"sentry.app.digests.enabled",
"sentry.tasks.digests.deliver_digest.delay",
"sentry.plugins.Notification",
"sentry.digests.notifications.event_to_record",
"sentry.models.UserOption.objects.filter",
"sentry.digests.notifications.unsplit_key"
] | [((5291, 5338), 'sentry.utils.samples.create_sample_event', 'create_sample_event', (['project'], {'platform': '"""python"""'}), "(project, platform='python')\n", (5310, 5338), False, 'from sentry.utils.samples import create_sample_event\n'), ((5362, 5387), 'sentry.plugins.Notification', 'Notification', ([], {'event': '... |
# coding: utf-8
"""
Modules lister.
"""
from sugar.lib.loader import SugarModuleLoader
class ModuleLister:
"""
Module lister.
"""
def __init__(self, *paths):
self.loader = SugarModuleLoader(*paths) # Get paths from the master config
def get_all_module_uris(self) -> dict:
"""
... | [
"sugar.lib.loader.SugarModuleLoader"
] | [((198, 223), 'sugar.lib.loader.SugarModuleLoader', 'SugarModuleLoader', (['*paths'], {}), '(*paths)\n', (215, 223), False, 'from sugar.lib.loader import SugarModuleLoader\n')] |
import torchvision
from torchvision.models.detection.faster_rcnn import FastRCNNPredictor
from torchvision.models.detection.mask_rcnn import MaskRCNNPredictor
def get_instance_segmentation_model(num_classes):
# load an instance segmentation model pre-trained on COCO
model = torchvision.models.detection.maskrc... | [
"utils.warmup_lr_scheduler",
"math.isfinite",
"utils.reduce_dict",
"utils.SmoothedValue",
"torchvision.models.detection.faster_rcnn.FastRCNNPredictor",
"torchvision.models.detection.mask_rcnn.MaskRCNNPredictor",
"utils.MetricLogger",
"torchvision.models.detection.maskrcnn_resnet50_fpn"
] | [((285, 353), 'torchvision.models.detection.maskrcnn_resnet50_fpn', 'torchvision.models.detection.maskrcnn_resnet50_fpn', ([], {'pretrained': '(False)'}), '(pretrained=False)\n', (335, 353), False, 'import torchvision\n'), ((569, 612), 'torchvision.models.detection.faster_rcnn.FastRCNNPredictor', 'FastRCNNPredictor', (... |
import numpy as np
import sys
# # temp solution for directory.
sys.path.append("./src/")
import math
from undefined.UDFunction import UDFunction
from undefined.GraphGenerator import UDGraph
from undefined.Utils import UDPrimitive, check_division_by_zero, check_log, check_pow, check_arc
def cos(udobject):
"""calc... | [
"numpy.arccos",
"numpy.sqrt",
"math.acos",
"undefined.Utils.check_pow",
"math.sqrt",
"numpy.log",
"math.log",
"math.cos",
"numpy.sin",
"math.exp",
"sys.path.append",
"math.atan",
"undefined.UDFunction.UDFunction",
"math.tan",
"numpy.exp",
"numpy.arctan",
"undefined.Utils.check_arc",
... | [((63, 88), 'sys.path.append', 'sys.path.append', (['"""./src/"""'], {}), "('./src/')\n", (78, 88), False, 'import sys\n'), ((1320, 1348), 'undefined.UDFunction.UDFunction', 'UDFunction', (['new_val', 'new_der'], {}), '(new_val, new_der)\n', (1330, 1348), False, 'from undefined.UDFunction import UDFunction\n'), ((3091,... |
#! /bin/env python
import os
import sys
import numpy as np
from ...grids import RasterField
class BovError(Exception):
pass
class MissingRequiredKeyError(BovError):
def __init__(self, opt):
self.opt = opt
def __str__(self):
return "%s: Missing required key" % self.opt
class BadKeyVa... | [
"numpy.prod",
"numpy.fromfile",
"os.path.isabs",
"os.path.splitext",
"os.path.isfile",
"numpy.array",
"os.path.dirname"
] | [((4109, 4135), 'os.path.splitext', 'os.path.splitext', (['filename'], {}), '(filename)\n', (4125, 4135), False, 'import os\n'), ((4226, 4261), 'numpy.array', 'np.array', (['spacing'], {'dtype': 'np.float64'}), '(spacing, dtype=np.float64)\n', (4234, 4261), True, 'import numpy as np\n'), ((4275, 4309), 'numpy.array', '... |
#!/usr/bin/env python
"""
# *****************************************************************
# (C) Copyright IBM Corp. 2021. 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 Licens... | [
"setuptools.find_packages"
] | [((1221, 1236), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (1234, 1236), False, 'from setuptools import find_packages, setup\n')] |
#!/usr/bin/python
# baby 1st python script
# needs pip install pystray
# needs pip install schedule
import os
import sys
import json
import schedule
import time
from threading import Thread
import pystray
from pystray import Icon as icon, Menu as menu, MenuItem as item
from PIL import Image
PROGDIR=os.path.dirname(os... | [
"PIL.Image.open",
"schedule.run_pending",
"time.sleep",
"os.path.realpath",
"pystray.Icon.run",
"pystray.MenuItem",
"schedule.every",
"os._exit",
"json.load",
"os.system",
"threading.Thread",
"pystray.Icon"
] | [((318, 344), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (334, 344), False, 'import os\n'), ((781, 869), 'os.system', 'os.system', (["('bash ' + sunsetLocation + ' ' + lightThemeSetting + ' ' + lightThemeName)"], {}), "('bash ' + sunsetLocation + ' ' + lightThemeSetting + ' ' +\n lig... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Matgenix SRL, All rights reserved.
# Distributed open source for academic and non-profit users.
# Contact Matgenix for commercial usage.
# See LICENSE file for details.
"""Module containing custodian validators for SISSO."""
import os
from custodian.custodian import Vali... | [
"os.path.isfile",
"os.stat"
] | [((1781, 1813), 'os.path.isfile', 'os.path.isfile', (['self.stderr_file'], {}), '(self.stderr_file)\n', (1795, 1813), False, 'import os\n'), ((1561, 1593), 'os.path.isfile', 'os.path.isfile', (['self.output_file'], {}), '(self.output_file)\n', (1575, 1593), False, 'import os\n'), ((1635, 1667), 'os.path.isfile', 'os.pa... |
from csv import DictReader
from functools import lru_cache
from itertools import groupby
from pathlib import Path
from typing import TextIO
import click
import h5py
from skelshop.corpus import index_corpus_desc
from skelshop.face.consts import DEFAULT_METRIC
from skelshop.iden.idsegs import ref_arg
from skelshop.util... | [
"skelshop.utils.click.PathPath",
"csv.DictReader",
"itertools.groupby",
"skelshop.face.io.SparseFaceReader",
"click.File",
"h5py.File",
"skelshop.corpus.index_corpus_desc",
"numpy.vstack",
"functools.lru_cache",
"click.command"
] | [((369, 391), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': '(128)'}), '(maxsize=128)\n', (378, 391), False, 'from functools import lru_cache\n'), ((587, 602), 'click.command', 'click.command', ([], {}), '()\n', (600, 602), False, 'import click\n'), ((496, 516), 'h5py.File', 'h5py.File', (['face_path'], {}), '(f... |
from django.contrib.auth import authenticate, login, get_user_model
from django.shortcuts import render, redirect
from properties.models import Property
def home_page(request):
object_list = Property.objects.all().featured()
context = {
"object_list": object_list,
}
return render(request, 'i... | [
"django.shortcuts.render",
"properties.models.Property.objects.all"
] | [((302, 340), 'django.shortcuts.render', 'render', (['request', '"""index.html"""', 'context'], {}), "(request, 'index.html', context)\n", (308, 340), False, 'from django.shortcuts import render, redirect\n'), ((379, 408), 'django.shortcuts.render', 'render', (['request', '"""about.html"""'], {}), "(request, 'about.htm... |
'''
Copyright (C) 2021 CG Cookie
http://cgcookie.com
<EMAIL>
Created by <NAME>, <NAME>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your op... | [
"bgl.glBegin",
"bgl.glColor4f",
"bgl.glDisable",
"bgl.glVertex3f",
"bgl.glEnd",
"bgl.glEnable",
"bgl.glDepthFunc"
] | [((3203, 3229), 'bgl.glEnable', 'bgl.glEnable', (['bgl.GL_BLEND'], {}), '(bgl.GL_BLEND)\n', (3215, 3229), False, 'import bgl\n'), ((6793, 6819), 'bgl.glEnable', 'bgl.glEnable', (['bgl.GL_BLEND'], {}), '(bgl.GL_BLEND)\n', (6805, 6819), False, 'import bgl\n'), ((7605, 7630), 'bgl.glBegin', 'bgl.glBegin', (['bgl.GL_QUADS'... |
from urllib.request import urlopen
from bs4 import BeautifulSoup
html = urlopen("http://en.wikipedia.org/wiki/kevin_bacon")
| [
"urllib.request.urlopen"
] | [((73, 124), 'urllib.request.urlopen', 'urlopen', (['"""http://en.wikipedia.org/wiki/kevin_bacon"""'], {}), "('http://en.wikipedia.org/wiki/kevin_bacon')\n", (80, 124), False, 'from urllib.request import urlopen\n')] |
from helper.shapenet.shapenetMapper import desc_to_id
from deformations.FFD import get_template_ffd
from deformations.meshDeformation import get_thresholded_template_mesh
from mayavi import mlab
import numpy as np
from graphicUtils.visualizer.mayaviVisualizer import visualize_mesh, visualize_point_cloud
ds = get_tem... | [
"numpy.array",
"numpy.matmul",
"helper.shapenet.shapenetMapper.desc_to_id",
"mayavi.mlab.show"
] | [((991, 1002), 'mayavi.mlab.show', 'mlab.show', ([], {}), '()\n', (1000, 1002), False, 'from mayavi import mlab\n'), ((1043, 1054), 'mayavi.mlab.show', 'mlab.show', ([], {}), '()\n', (1052, 1054), False, 'from mayavi import mlab\n'), ((404, 424), 'helper.shapenet.shapenetMapper.desc_to_id', 'desc_to_id', (['"""pistol""... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=missing-docstring
import json
from datetime import date, datetime
from .common import common
class jsonl(object):
""" jsonl exporter plugin.
As opposed to json exporter jsonl serializes messages as one JSON object per line, not as
one giant ... | [
"json.dumps"
] | [((1417, 1489), 'json.dumps', 'json.dumps', (['msgDictionary'], {'default': 'self._json_serial', 'ensure_ascii': '(False)'}), '(msgDictionary, default=self._json_serial, ensure_ascii=False)\n', (1427, 1489), False, 'import json\n')] |
import json
import pytest
from tests.functional.services.api.conftest import USER_API_CONFS
from tests.functional import get_logger
from tests.functional.services.utils.http_utils import (
http_post,
RequestFailedError,
http_del,
)
_logger = get_logger(__name__)
@pytest.fixture(scope="class", params=US... | [
"tests.functional.services.utils.http_utils.http_post",
"json.load",
"pytest.fixture",
"tests.functional.services.utils.http_utils.http_del",
"tests.functional.services.utils.http_utils.RequestFailedError",
"tests.functional.get_logger"
] | [((257, 277), 'tests.functional.get_logger', 'get_logger', (['__name__'], {}), '(__name__)\n', (267, 277), False, 'from tests.functional import get_logger\n'), ((281, 333), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""class"""', 'params': 'USER_API_CONFS'}), "(scope='class', params=USER_API_CONFS)\n", (295, 3... |
"""PWInput
By <NAME> <EMAIL>
A cross-platform Python module that displays **** for password input. Works on Windows, unlike getpass. Formerly called stdiomask."""
__version__ = '1.0.2' # type: str
import sys
"""Notes about making this code backwards-compatible with Python 2:
sys.stdout.write() can only write unic... | [
"sys.stdin.fileno",
"getpass.getpass",
"sys.stdin.read",
"termios.tcsetattr",
"msvcrt.getch",
"termios.tcgetattr",
"sys.stdout.flush",
"sys.stdout.write"
] | [((2699, 2723), 'sys.stdout.write', 'sys.stdout.write', (['prompt'], {}), '(prompt)\n', (2715, 2723), False, 'import sys\n'), ((2728, 2746), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n', (2744, 2746), False, 'import sys\n'), ((1247, 1265), 'sys.stdin.fileno', 'sys.stdin.fileno', ([], {}), '()\n', (1263, 126... |
from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^stacks/', include(('stacks.urls', 'stacks'), namespace='stacks')),
]
| [
"django.conf.urls.include",
"django.conf.urls.url"
] | [((96, 127), 'django.conf.urls.url', 'url', (['"""^admin/"""', 'admin.site.urls'], {}), "('^admin/', admin.site.urls)\n", (99, 127), False, 'from django.conf.urls import url, include\n'), ((151, 205), 'django.conf.urls.include', 'include', (["('stacks.urls', 'stacks')"], {'namespace': '"""stacks"""'}), "(('stacks.urls'... |
from calendar import timegm
from datetime import datetime
from flask import request
from flask_socketio import join_room, leave_room
from flask_login import login_required, current_user, logout_user
from .. import db, socketio
from ..api.log import log_event
@socketio.on('connect')
@login_required
def connect():
... | [
"flask_login.current_user.current_rooms.remove",
"flask_login.logout_user",
"flask_login.current_user.rooms.append",
"flask_socketio.join_room",
"datetime.datetime.now",
"flask_socketio.leave_room",
"flask_login.current_user.rooms.count"
] | [((3183, 3196), 'flask_login.logout_user', 'logout_user', ([], {}), '()\n', (3194, 3196), False, 'from flask_login import login_required, current_user, logout_user\n'), ((430, 456), 'flask_login.current_user.rooms.count', 'current_user.rooms.count', ([], {}), '()\n', (454, 456), False, 'from flask_login import login_re... |
from python_helper.api.src.service import SettingHelper, ReflectionHelper, ObjectHelper
def EnvironmentVariable(*outerArgs, environmentVariables=None, **outerKwargs) :
def innerMethodWrapper(resourceInstanceMethod,*innerMethodArgs,**innerMethodKwargs) :
def innerResourceInstanceMethod(*innerArgs,**innerKwa... | [
"python_helper.api.src.service.SettingHelper.extractEnvironmentVariables",
"python_helper.api.src.service.ReflectionHelper.overrideSignatures",
"python_helper.api.src.service.ObjectHelper.isNotNone",
"python_helper.api.src.service.SettingHelper.recoverEnvironmentVariables"
] | [((982, 1074), 'python_helper.api.src.service.ReflectionHelper.overrideSignatures', 'ReflectionHelper.overrideSignatures', (['innerResourceInstanceMethod', 'resourceInstanceMethod'], {}), '(innerResourceInstanceMethod,\n resourceInstanceMethod)\n', (1017, 1074), False, 'from python_helper.api.src.service import Sett... |
#sample_grammar.py
import argparse
import random
import numpy.random
import pcfgfactory
import pcfg
import utility
parser = argparse.ArgumentParser(description='Replace low probability tokens with an UNK token for a given PCFG')
parser.add_argument("inputfilename", help="File where the original PCFG is.")
parser.ad... | [
"pcfg.load_pcfg_from_file",
"argparse.ArgumentParser"
] | [((127, 236), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Replace low probability tokens with an UNK token for a given PCFG"""'}), "(description=\n 'Replace low probability tokens with an UNK token for a given PCFG')\n", (150, 236), False, 'import argparse\n'), ((634, 678), 'pcfg.l... |
from collections import namedtuple
import attr
from fuzzysearch.common import FuzzySearchBase, Match, \
consolidate_overlapping_matches
from fuzzysearch.compat import text_type, xrange
from fuzzysearch.search_exact import search_exact
__all__ = [
'find_near_matches_generic',
'find_near_matches_generic_l... | [
"collections.namedtuple",
"fuzzysearch._generic_search.c_find_near_matches_generic_linear_programming",
"fuzzysearch.common.consolidate_overlapping_matches",
"fuzzysearch.search_exact.search_exact",
"fuzzysearch.compat.xrange",
"fuzzysearch.common.Match"
] | [((446, 552), 'collections.namedtuple', 'namedtuple', (['"""GenericSearchCandidate"""', "['start', 'subseq_index', 'l_dist', 'n_subs', 'n_ins', 'n_dels']"], {}), "('GenericSearchCandidate', ['start', 'subseq_index', 'l_dist',\n 'n_subs', 'n_ins', 'n_dels'])\n", (456, 552), False, 'from collections import namedtuple\... |
# Generated by Django 1.11.21 on 2019-06-12 15:50
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('blobs', '0008_deletedblobmeta'),
]
operations = [
migrations.DeleteModel(
name='BlobExpiration',
),
]
| [
"django.db.migrations.DeleteModel"
] | [((224, 269), 'django.db.migrations.DeleteModel', 'migrations.DeleteModel', ([], {'name': '"""BlobExpiration"""'}), "(name='BlobExpiration')\n", (246, 269), False, 'from django.db import migrations\n')] |
# $Id: SD.py,v 1.10 2008-08-05 00:20:44 gosselin_a Exp $
# $Log: not supported by cvs2svn $
# Revision 1.9 2008/06/30 02:59:57 gosselin_a
# Fixed definition of equivNumericTypes list.
#
# Revision 1.8 2008/06/30 02:41:44 gosselin_a
# Preleminary check-in of changes leading to the 0.8 revision.
# - switch to numpy... | [
"os.path.exists",
"os.remove"
] | [((54097, 54117), 'os.path.exists', 'os.path.exists', (['path'], {}), '(path)\n', (54111, 54117), False, 'import os, sys, types\n'), ((54307, 54322), 'os.remove', 'os.remove', (['path'], {}), '(path)\n', (54316, 54322), False, 'import os, sys, types\n')] |
# coding: utf-8
"""
LUSID API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.11.3725
Contact: <EMAIL>
Generated by: https://openapi-generator.tech
"""
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getfullargspec
... | [
"re.search",
"inspect.getargspec",
"six.iteritems",
"lusid.configuration.Configuration.get_default_copy"
] | [((13969, 14002), 'six.iteritems', 'six.iteritems', (['self.openapi_types'], {}), '(self.openapi_types)\n', (13982, 14002), False, 'import six\n'), ((3892, 3924), 'lusid.configuration.Configuration.get_default_copy', 'Configuration.get_default_copy', ([], {}), '()\n', (3922, 3924), False, 'from lusid.configuration impo... |
from flask import render_template, redirect,url_for,request,flash
from . import main
from flask_login import login_required,current_user
from ..models import Blog,Comment
from .forms import NewblogForm,CommentForm
from .. import db
from app.request import getQuotes
# Views
@main.route('/')
def index():
quote = get... | [
"flask.render_template",
"flask.flash",
"app.request.getQuotes",
"flask_login.current_user._get_current_object",
"flask.url_for"
] | [((317, 328), 'app.request.getQuotes', 'getQuotes', ([], {}), '()\n', (326, 328), False, 'from app.request import getQuotes\n'), ((441, 509), 'flask.render_template', 'render_template', (['"""index.html"""'], {'title': 'title', 'quote': 'quote', 'blogs': 'blogs'}), "('index.html', title=title, quote=quote, blogs=blogs)... |
import cv2
import selectivesearch
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import numpy as np
#step1
image2="images/test2.png"
#用cv2读取图片
img = cv2.imread(image2,cv2.IMREAD_UNCHANGED)
#白底黑字图 改为黑底白字图
img=255-img
img_lbl, regions =selectivesearch.selective_search(img, scale=500, sigma=0.9, ... | [
"matplotlib.pyplot.savefig",
"cv2.copyMakeBorder",
"numpy.zeros",
"cv2.cvtColor",
"selectivesearch.selective_search",
"cv2.resize",
"cv2.imread",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((175, 215), 'cv2.imread', 'cv2.imread', (['image2', 'cv2.IMREAD_UNCHANGED'], {}), '(image2, cv2.IMREAD_UNCHANGED)\n', (185, 215), False, 'import cv2\n'), ((260, 332), 'selectivesearch.selective_search', 'selectivesearch.selective_search', (['img'], {'scale': '(500)', 'sigma': '(0.9)', 'min_size': '(20)'}), '(img, sca... |
import argparse
import logging
from os import path
import signal
import subprocess
import sys
import time
import cv2
import numpy as np
from picamera.array import PiRGBArray
from picamera import PiCamera
from socketIO_client import SocketIO, BaseNamespace
# enable safe shutdown with ctl+c
global running
running = Tru... | [
"logging.getLogger",
"cv2.meanStdDev",
"cv2.rectangle",
"time.sleep",
"cv2.imshow",
"socketIO_client.SocketIO",
"argparse.ArgumentParser",
"cv2.threshold",
"picamera.array.PiRGBArray",
"cv2.waitKey",
"picamera.PiCamera",
"os.path.dirname",
"cv2.cvtColor",
"cv2.GaussianBlur",
"time.time",... | [((398, 442), 'signal.signal', 'signal.signal', (['signal.SIGINT', 'signal_handler'], {}), '(signal.SIGINT, signal_handler)\n', (411, 442), False, 'import signal\n'), ((453, 513), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Do fancy OpenCV stuff"""'}), "(description='Do fancy OpenCV s... |
import sys
import inspect
import threading
#import logging
class logging:
@staticmethod
def debug( msg ):
print( msg, file=sys.stderr)
def format_frame( frame ):
return '{}:{} {}'.format( *[str(getattr(frame, a)) for a in ('filename', 'lineno', 'function')] )
# Class to wrap Lock and simplify logging of lock us... | [
"threading.Lock",
"threading.RLock",
"inspect.stack"
] | [((516, 532), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (530, 532), False, 'import threading\n'), ((1208, 1223), 'inspect.stack', 'inspect.stack', ([], {}), '()\n', (1221, 1223), False, 'import inspect\n'), ((1823, 1840), 'threading.RLock', 'threading.RLock', ([], {}), '()\n', (1838, 1840), False, 'import t... |
import tensorflow as tf
import os
import time
import numpy as np
import glob
import matplotlib.pyplot as plt
import PIL
import imageio
import argparse
import dataset as dt
INPUT_SHAPE = (32, 32, 1)
tf.random.set_seed(777)
NORM_LIST = ["interframe_minmax", "est_minmax", "zscore"]
class ConvVAE(tf.keras.Model):
... | [
"matplotlib.pyplot.ylabel",
"tensorflow.math.log",
"tensorflow.reduce_sum",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.GradientTape",
"numpy.array",
"dataset.Processor",
"tensorflow.keras.layers.Dense",
"tensorflow.reduce_mean",
"imageio.get_writer",
"os.remove",
"matplotlib.pyp... | [((201, 224), 'tensorflow.random.set_seed', 'tf.random.set_seed', (['(777)'], {}), '(777)\n', (219, 224), True, 'import tensorflow as tf\n'), ((2581, 2605), 'tensorflow.math.log', 'tf.math.log', (['(2.0 * np.pi)'], {}), '(2.0 * np.pi)\n', (2592, 2605), True, 'import tensorflow as tf\n'), ((2903, 2968), 'tensorflow.nn.s... |
from __future__ import unicode_literals
import collections
import restea.errors as errors
import restea.formats as formats
import restea.fields as fields
# TODO: Add fileds with validation
class Resource(object):
'''
Resource class implements all the logic of mapping HTTP methods to
methods and error ha... | [
"restea.errors.ServerError",
"restea.errors.BadRequestError",
"restea.fields.FieldSet"
] | [((876, 893), 'restea.fields.FieldSet', 'fields.FieldSet', ([], {}), '()\n', (891, 893), True, 'import restea.fields as fields\n'), ((3572, 3624), 'restea.errors.BadRequestError', 'errors.BadRequestError', (['"""Given method requires iden"""'], {}), "('Given method requires iden')\n", (3594, 3624), True, 'import restea... |
import numpy
import six
from chainer.backends import cuda
from chainer.backends import intel64
from chainer import function_node
from chainer.utils import type_check
def _cu_conv_sum(y, x, n):
# Convolutional sum
# TODO(beam2d): Use scan computation
rdim = x.size // (x.shape[0] * x.shape[1])
cuda.ele... | [
"chainer.backends.intel64.ideep.localResponseNormalizationParam",
"six.moves.range",
"chainer.backends.cuda.cupy.square",
"chainer.backends.intel64.ideep.array",
"chainer.backends.cuda.cupy.empty_like",
"numpy.square",
"chainer.backends.cuda.elementwise",
"chainer.backends.intel64.inputs_all_ready",
... | [((312, 887), 'chainer.backends.cuda.elementwise', 'cuda.elementwise', (['"""raw T x, int32 rdim, int32 N, int32 n_"""', '"""raw T y"""', '"""\n int half_n = n_ / 2;\n int offset = i / rdim * N * rdim + i % rdim;\n\n float sum_part = 0;\n for (int j = 0; j < N + half_n; ++j) {\n ... |
from __future__ import absolute_import
import uuid
from collections import defaultdict
from datetime import datetime
from sqlalchemy import Column, DateTime, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.schema import Index
from changes.config import db
from changes.db.types.guid import GUID
fro... | [
"sqlalchemy.orm.relationship",
"datetime.datetime.utcnow",
"sqlalchemy.ForeignKey",
"changes.models.ItemOption.item_id.in_",
"sqlalchemy.schema.Index",
"changes.db.utils.model_repr",
"uuid.uuid4",
"changes.config.db.session.query",
"collections.defaultdict",
"changes.utils.imports.import_string",
... | [((1916, 1966), 'sqlalchemy.Column', 'Column', (['GUID'], {'primary_key': '(True)', 'default': 'uuid.uuid4'}), '(GUID, primary_key=True, default=uuid.uuid4)\n', (1922, 1966), False, 'from sqlalchemy import Column, DateTime, ForeignKey\n'), ((2349, 2390), 'sqlalchemy.Column', 'Column', (['DateTime'], {'default': 'dateti... |
import pytest
from triple_agent.organization.replay_file_iterator import iterate_over_replays
from triple_agent.classes.missions import Missions
from triple_agent.classes.venues import Venue
from triple_agent.classes.outcomes import WinType
from triple_agent.parsing.replay.parse_single_replay import parse_single_repla... | [
"triple_agent.organization.replay_file_iterator.iterate_over_replays",
"triple_agent.parsing.replay.parse_single_replay.parse_single_replay",
"triple_agent.classes.timeline.Timeline",
"pytest.raises"
] | [((5536, 5583), 'triple_agent.parsing.replay.parse_single_replay.parse_single_replay', 'parse_single_replay', (['this_test_replay', 'tmp_path'], {}), '(this_test_replay, tmp_path)\n', (5555, 5583), False, 'from triple_agent.parsing.replay.parse_single_replay import parse_single_replay\n'), ((5748, 5795), 'triple_agent.... |
# coding: utf-8
import numpy as np
import torch
import pysptk
import pyworld
import librosa
from sklearn.preprocessing import MinMaxScaler
from nnmnkwii.io import hts
from nnmnkwii.frontend import merlin as fe
from nnmnkwii.postfilters import merlin_post_filter
from nnmnkwii.preprocessing.f0 import interp1d
from nnsv... | [
"numpy.clip",
"librosa.midi_to_hz",
"pysptk.util.mcepalpha",
"numpy.log",
"pysptk.mc2sp",
"nnmnkwii.io.hts.HTSLabelFile",
"torch.from_numpy",
"numpy.array",
"numpy.asarray",
"nnmnkwii.preprocessing.f0.interp1d",
"numpy.maximum",
"nnmnkwii.frontend.merlin.linguistic_features",
"numpy.round",
... | [((950, 985), 'librosa.midi_to_hz', 'librosa.midi_to_hz', (['x[indices, idx]'], {}), '(x[indices, idx])\n', (968, 985), False, 'import librosa\n'), ((1622, 1646), 'nnsvs.io.hts.get_note_indices', 'get_note_indices', (['labels'], {}), '(labels)\n', (1638, 1646), False, 'from nnsvs.io.hts import get_note_indices\n'), ((3... |
# -*- encoding: utf-8 -*-
#
# Copyright © 2013 IBM Corp
#
# Author: <NAME> <<EMAIL>>
#
# 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
#
# Un... | [
"datetime.datetime",
"ceilometer.collector.dispatcher.database.DatabaseDispatcher",
"ceilometer.publisher.rpc.compute_signature"
] | [((1067, 1104), 'ceilometer.collector.dispatcher.database.DatabaseDispatcher', 'database.DatabaseDispatcher', (['cfg.CONF'], {}), '(cfg.CONF)\n', (1094, 1104), False, 'from ceilometer.collector.dispatcher import database\n'), ((1332, 1398), 'ceilometer.publisher.rpc.compute_signature', 'rpc.compute_signature', (['msg',... |
"""Python wrappers around TensorFlow ops.
This file is MACHINE GENERATED! Do not edit.
Original C++ source file: gen_encode_proto_op_py.cc
"""
import collections as _collections
import six as _six
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
from tensorflow.python.eager import context as _co... | [
"tensorflow.python.framework.op_def_library.OpDefLibrary",
"tensorflow.python.framework.op_def_registry.register_op_list",
"tensorflow.python.eager.execute.execute",
"tensorflow.core.framework.op_def_pb2.OpList",
"tensorflow.python.pywrap_tensorflow.TFE_Py_FastPathExecute",
"tensorflow.python.eager.execut... | [((1071, 1096), 'tensorflow.python.util.tf_export.tf_export', 'tf_export', (['"""encode_proto"""'], {}), "('encode_proto')\n", (1080, 1096), False, 'from tensorflow.python.util.tf_export import tf_export\n'), ((4104, 4151), 'tensorflow.python.eager.execute.make_str', '_execute.make_str', (['message_type', '"""message_t... |
# Copyright 2020 Adap GmbH. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | [
"flwr.common.logger.log",
"flwr.common.Reconnect",
"flwr.common.Parameters",
"flwr.common.weights_to_parameters",
"timeit.default_timer",
"flwr.server.strategy.FedAvg",
"flwr.server.history.History"
] | [((11371, 11394), 'flwr.common.Reconnect', 'Reconnect', ([], {'seconds': 'None'}), '(seconds=None)\n', (11380, 11394), False, 'from flwr.common import Disconnect, EvaluateIns, EvaluateRes, FitIns, FitRes, Parameters, Reconnect, Scalar, Weights, weights_to_parameters\n'), ((2917, 2968), 'flwr.common.Parameters', 'Parame... |
import ezdxf
dwg = ezdxf.readfile('perfil_77_curve.dxf')
msp = dwg.modelspace()
lwpolylines = msp.query('LWPOLYLINE')
print('Found {} LWPOLYLINE entities.'.format(len(lwpolylines)))
splines = msp.query('SPLINE')
print('Found {} SPLINE entities.'.format(len(splines)))
for spline in splines:
print(str(spline))
... | [
"ezdxf.readfile",
"ezdxf.new"
] | [((20, 57), 'ezdxf.readfile', 'ezdxf.readfile', (['"""perfil_77_curve.dxf"""'], {}), "('perfil_77_curve.dxf')\n", (34, 57), False, 'import ezdxf\n'), ((1062, 1080), 'ezdxf.new', 'ezdxf.new', (['"""R2010"""'], {}), "('R2010')\n", (1071, 1080), False, 'import ezdxf\n')] |
# ----------------------------------------------------------------------
# inv.ResourceGroup tests
# ----------------------------------------------------------------------
# Copyright (C) 2007-2018 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
# NOC ... | [
"noc.inv.models.resourcegroup.ResourceGroup._get_collection"
] | [((425, 456), 'noc.inv.models.resourcegroup.ResourceGroup._get_collection', 'ResourceGroup._get_collection', ([], {}), '()\n', (454, 456), False, 'from noc.inv.models.resourcegroup import ResourceGroup\n')] |
# Copyright (c) 2021 by Cisco Systems, Inc.
# All rights reserved.
"""
Script to check cpu utilization at regular intervals
Arguments:
threshold: int, threshold of cpu utilization
To trigger script
Step 1: Add and configure script as shown in README.MD
Step 2: Register the application with Appmgr
Configuraton:
appm... | [
"cisco.script_mgmt.xrlog.getScriptLogger",
"iosxr.netconf.netconf_lib.NetconfClient",
"argparse.ArgumentParser",
"cisco.script_mgmt.xrlog.getSysLogger",
"time.sleep",
"re.search"
] | [((1366, 1397), 'cisco.script_mgmt.xrlog.getScriptLogger', 'xrlog.getScriptLogger', (['"""Sample"""'], {}), "('Sample')\n", (1387, 1397), False, 'from cisco.script_mgmt import xrlog\n'), ((1407, 1435), 'cisco.script_mgmt.xrlog.getSysLogger', 'xrlog.getSysLogger', (['"""Sample"""'], {}), "('Sample')\n", (1425, 1435), Fa... |
"""
EasyConfig
Simple configuration management. Originally created for the Chronolapse project.
Author: <NAME>
"""
import json
class EasyConfig(object):
"""
Object to manage configuration changes, including automatically
saving persisting changes and updating UI.
All config should be in a section,... | [
"json.loads",
"json.dumps",
"json.dump"
] | [((3265, 3289), 'json.dumps', 'json.dumps', (['self._config'], {}), '(self._config)\n', (3275, 3289), False, 'import json\n'), ((4899, 4918), 'json.loads', 'json.loads', (['content'], {}), '(content)\n', (4909, 4918), False, 'import json\n'), ((2961, 2987), 'json.dump', 'json.dump', (['self._config', 'f'], {}), '(self.... |
import os
import time
import argparse
import math
from numpy import finfo
import numpy as np
import torch
from distributed import apply_gradient_allreduce
import torch.distributed as dist
from torch.utils.data.distributed import DistributedSampler
from torch.utils.data import DataLoader
from model import Tacotron2
fr... | [
"matplotlib.pylab.subplots",
"apex.amp.initialize",
"argparse.ArgumentParser",
"model.Tacotron2",
"torch.autograd.Variable",
"matplotlib.pylab.close",
"matplotlib.use",
"matplotlib.pylab.xlabel",
"distributed.apply_gradient_allreduce",
"os.path.isfile",
"data_utils.TextMelCollate",
"numpy.finf... | [((500, 521), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (514, 521), False, 'import matplotlib\n'), ((753, 782), 'matplotlib.pylab.subplots', 'plt.subplots', ([], {'figsize': '(12, 3)'}), '(figsize=(12, 3))\n', (765, 782), True, 'import matplotlib.pylab as plt\n'), ((891, 914), 'matplotlib.py... |
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | [
"numpy.sqrt",
"box_utils.box_crop",
"PIL.ImageEnhance.Contrast",
"box_utils.box_iou_xywh",
"numpy.arange",
"numpy.asarray",
"PIL.ImageEnhance.Color",
"numpy.concatenate",
"random.randint",
"random.uniform",
"numpy.random.beta",
"random.randrange",
"PIL.ImageEnhance.Brightness",
"cv2.resize... | [((1398, 1420), 'numpy.random.shuffle', 'np.random.shuffle', (['ops'], {}), '(ops)\n', (1415, 1420), True, 'import numpy as np\n'), ((1432, 1452), 'PIL.Image.fromarray', 'Image.fromarray', (['img'], {}), '(img)\n', (1447, 1452), False, 'from PIL import Image, ImageEnhance\n'), ((1529, 1544), 'numpy.asarray', 'np.asarra... |
# coding: utf-8
from django import forms
from django.utils.translation import ugettext_lazy as _
from value.measures.models import Measure
class BaseMeasureForm(forms.ModelForm):
class Meta:
model = Measure
fields = ('name',)
class CreateMeasureForm(BaseMeasureForm):
pass
class ChangeMea... | [
"django.utils.translation.ugettext_lazy",
"django.forms.CheckboxInput"
] | [((398, 419), 'django.forms.CheckboxInput', 'forms.CheckboxInput', ([], {}), '()\n', (417, 419), False, 'from django import forms\n'), ((435, 446), 'django.utils.translation.ugettext_lazy', '_', (['"""Active"""'], {}), "('Active')\n", (436, 446), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((466... |
# Generated by Django 3.1.3 on 2020-12-09 11:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wagtail_ab_testing', '0007_grant_moderators_add_abtest_permission'),
]
operations = [
migrations.AlterField(
model_name='abtest'... | [
"django.db.models.CharField"
] | [((367, 582), 'django.db.models.CharField', 'models.CharField', ([], {'choices': "[('draft', 'Draft'), ('running', 'Running'), ('paused', 'Paused'), (\n 'cancelled', 'Cancelled'), ('finished', 'Finished'), ('completed',\n 'Completed')]", 'default': '"""draft"""', 'max_length': '(20)'}), "(choices=[('draft', 'Draf... |
from django.db.models import Q
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from leasing.enums import LeaseState, RentType
from leasing.models import Lease
from leasing.report.report_base import ReportBase
def get_lease_id(obj):
return obj.get_identifier_string()
cl... | [
"django.utils.timezone.now",
"django.db.models.Q",
"django.utils.translation.ugettext_lazy"
] | [((377, 416), 'django.utils.translation.ugettext_lazy', '_', (['"""Leases where invoicing is disabled"""'], {}), "('Leases where invoicing is disabled')\n", (378, 416), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((435, 490), 'django.utils.translation.ugettext_lazy', '_', (['"""Shows active leas... |
from random import choice
from discord.ext import commands
from discord.ext.commands import BucketType, Context
from bot import Yasen
from core.fun_core import generate_dice_rolls, parse_repeat, parse_salt
class Fun:
"""
Class to hold `Fun` commands.
"""
__slots__ = ('bot',)
def __init__(self, ... | [
"core.fun_core.parse_salt",
"random.choice",
"core.fun_core.parse_repeat",
"discord.ext.commands.cooldown",
"discord.ext.commands.command"
] | [((471, 489), 'discord.ext.commands.command', 'commands.command', ([], {}), '()\n', (487, 489), False, 'from discord.ext import commands\n'), ((495, 549), 'discord.ext.commands.cooldown', 'commands.cooldown', ([], {'rate': '(1)', 'per': '(5)', 'type': 'BucketType.user'}), '(rate=1, per=5, type=BucketType.user)\n', (512... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
# Export this package's modules as members:
from ._enums import *
from .api import *
from .api_diagnostic import *
from .api_diagnostic_logger import *... | [
"pulumi.ResourceOptions",
"pulumi.runtime.register_resource_module"
] | [((8874, 8978), 'pulumi.runtime.register_resource_module', 'pulumi.runtime.register_resource_module', (['"""azure-native"""', '"""apimanagement/v20170301"""', '_module_instance'], {}), "('azure-native',\n 'apimanagement/v20170301', _module_instance)\n", (8913, 8978), False, 'import pulumi\n'), ((2915, 2946), 'pulumi... |
import logging as lg
import bpy
from bpy import (
context as C,
data as D,
ops as Op
)
import math as m
import mathutils as M
from utils import Get, Set, hex_to_color
from . Taxonomy import Taxonomy
from . Camera import Camera
from . Light import Light
from . Plane import Plane
from . Payload import Payload
f... | [
"bpy.ops.object.delete",
"bpy.data.scenes.remove",
"bpy.data.collections.remove",
"utils.Set.runtime",
"logging.info",
"utils.Get.config",
"bpy.data.worlds.remove",
"utils.Get.collection",
"bpy.data.scenes.new",
"utils.Get.scene",
"utils.read_ndjson",
"utils.Get.world"
] | [((651, 677), 'utils.Set.runtime', 'Set.runtime', (['"""scene"""', 'data'], {}), "('scene', data)\n", (662, 677), False, 'from utils import Get, Set, hex_to_color\n'), ((2050, 2061), 'utils.Get.world', 'Get.world', ([], {}), '()\n', (2059, 2061), False, 'from utils import Get, Set, hex_to_color\n'), ((2164, 2191), 'uti... |
import pytest
from bepasty.storage.filesystem import Storage
def test_contains(tmpdir):
storage = Storage(str(tmpdir))
name = "foo"
# check if it is not there yet
assert name not in storage
with storage.create(name, 0):
# we just want it created, no need to write sth into it
pass
... | [
"pytest.raises"
] | [((898, 925), 'pytest.raises', 'pytest.raises', (['RuntimeError'], {}), '(RuntimeError)\n', (911, 925), False, 'import pytest\n')] |
'''Operating System Scheduler
'''
from queue import Queue
from task import Task
from systemCall import *
import time
import select
class Scheduler(object):
def __init__(self):
self.ready = Queue()
self.taskMap = {}
self.waitMap = {}
self.waitrl = {}
self... | [
"select.select",
"queue.Queue",
"task.Task"
] | [((218, 225), 'queue.Queue', 'Queue', ([], {}), '()\n', (223, 225), False, 'from queue import Queue\n'), ((380, 392), 'task.Task', 'Task', (['target'], {}), '(target)\n', (384, 392), False, 'from task import Task\n'), ((1106, 1158), 'select.select', 'select.select', (['self.waitrl', 'self.waitwl', '[]', 'timeout'], {})... |
import jax.numpy as np
import logging
def deinsum(subscript, aa, bb):
real = np.einsum(subscript, aa[0], bb[0]) - np.einsum(subscript, aa[1], bb[1])
imag = np.einsum(subscript, aa[0], bb[1]) + np.einsum(subscript, aa[1], bb[0])
return np.stack([real, imag], axis=0)
def deinsum_ord(subscript, aa, bb):
... | [
"jax.numpy.imag",
"jax.numpy.stack",
"jax.numpy.einsum",
"jax.numpy.real"
] | [((248, 278), 'jax.numpy.stack', 'np.stack', (['[real, imag]'], {'axis': '(0)'}), '([real, imag], axis=0)\n', (256, 278), True, 'import jax.numpy as np\n'), ((327, 358), 'jax.numpy.einsum', 'np.einsum', (['subscript', 'aa', 'bb[0]'], {}), '(subscript, aa, bb[0])\n', (336, 358), True, 'import jax.numpy as np\n'), ((370,... |
from banyan.api.base import ServiceBase
from banyan.model.policy import PolicyInfoOrName, PolicyAttachInfo
from banyan.model.service import ServiceInfo, Service, ServiceInfoOrName
class ServiceAPI(ServiceBase):
class Meta:
data_class = Service
info_class = ServiceInfo
arg_type = ServiceInf... | [
"banyan.api.policy.PolicyAPI"
] | [((1418, 1441), 'banyan.api.policy.PolicyAPI', 'PolicyAPI', (['self._client'], {}), '(self._client)\n', (1427, 1441), False, 'from banyan.api.policy import PolicyAPI\n'), ((1624, 1647), 'banyan.api.policy.PolicyAPI', 'PolicyAPI', (['self._client'], {}), '(self._client)\n', (1633, 1647), False, 'from banyan.api.policy i... |