code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# coding: utf-8
from django.db import models
from django.contrib.auth.models import User
from RoomManage.models import Room, Customs
# Create your models here.
class Task(models.Model):
context = models.TextField()
date = models.DateTimeField()
task_status = models.CharField(max_length=20, default='und... | [
"django.db.models.DateTimeField",
"django.db.models.ForeignKey",
"django.db.models.TextField",
"django.db.models.CharField"
] | [((205, 223), 'django.db.models.TextField', 'models.TextField', ([], {}), '()\n', (221, 223), False, 'from django.db import models\n'), ((235, 257), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {}), '()\n', (255, 257), False, 'from django.db import models\n'), ((276, 323), 'django.db.models.CharField'... |
import pathlib
import pytest
from pypendency.parser.yaml import Parser
from pypendency.lexer import LarkRelationLexer
def test_read_yaml_node_length():
file = pathlib.Path(__file__).parent / "example.yml"
lexer = LarkRelationLexer()
p = Parser(lexer=lexer, folder=pathlib.Path(__file__).parent)
g = p... | [
"pypendency.lexer.LarkRelationLexer",
"pytest.assume",
"pathlib.Path"
] | [((225, 244), 'pypendency.lexer.LarkRelationLexer', 'LarkRelationLexer', ([], {}), '()\n', (242, 244), False, 'from pypendency.lexer import LarkRelationLexer\n'), ((372, 398), 'pytest.assume', 'pytest.assume', (['(length == 4)'], {}), '(length == 4)\n', (385, 398), False, 'import pytest\n'), ((167, 189), 'pathlib.Path'... |
# Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"json.dumps",
"os.path.basename"
] | [((989, 1024), 'os.path.basename', 'os.path.basename', (['actuator_root_dir'], {}), '(actuator_root_dir)\n', (1005, 1024), False, 'import os\n'), ((1194, 1211), 'json.dumps', 'json.dumps', (['image'], {}), '(image)\n', (1204, 1211), False, 'import json\n')] |
# linuxjournalarchiver - Some hacky code I wrote to archive the Linux Journal.
# Licensed under the BSD-3-Clause license.
from bs4 import BeautifulSoup
import requests
import re
import pathlib
# Download the download page.
print("Downloading magazine list...")
session = requests.session()
# Update the User Agent to c... | [
"bs4.BeautifulSoup",
"re.findall",
"requests.session",
"pathlib.Path"
] | [((272, 290), 'requests.session', 'requests.session', ([], {}), '()\n', (288, 290), False, 'import requests\n'), ((522, 551), 'bs4.BeautifulSoup', 'BeautifulSoup', (['r.text', '"""lxml"""'], {}), "(r.text, 'lxml')\n", (535, 551), False, 'from bs4 import BeautifulSoup\n'), ((1114, 1178), 're.findall', 're.findall', (['"... |
#! /usr/bin/env python3
"""
Pulls artifacts from external repo using branches defined in branchConfig.yaml
file.
Run the script with -h flag to learn about script's running options.
"""
__author__ = "<NAME>"
__copyright__ = "Copyright (C) 2018 ACK CYFRONET AGH"
__license__ = "This software is released under the MIT li... | [
"boto3.session.Session",
"pull_artifact.download_artifact_safe",
"argparse.ArgumentParser",
"paramiko.AutoAddPolicy",
"pull_artifact.s3_download_artifact_safe",
"os.getenv",
"yaml.load",
"paramiko.SSHClient"
] | [((872, 1061), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter', 'description': '"""Pull sources and images lists for branches specified in branchConfig.yaml file."""'}), "(formatter_class=argparse.\n ArgumentDefaultsHelpFormatter, description=\n... |
import os
import shutil
from distutils.dir_util import copy_tree
from setuptools import find_packages, setup
# global variables
nb_dir = os.environ['PYNQ_JUPYTER_NOTEBOOKS']
package_name = 'pystrath_rfsoc'
pip_name = 'pystrath-rfsoc'
data_files = []
# copy common notebooks to jupyter home
def copy_common_notebooks()... | [
"os.path.exists",
"distutils.dir_util.copy_tree",
"setuptools.find_packages",
"os.path.join",
"shutil.rmtree"
] | [((336, 359), 'os.path.join', 'os.path.join', (['f"""common"""'], {}), "(f'common')\n", (348, 359), False, 'import os\n'), ((374, 413), 'os.path.join', 'os.path.join', (['nb_dir', '"""rfsoc-notebooks"""'], {}), "(nb_dir, 'rfsoc-notebooks')\n", (386, 413), False, 'import os\n'), ((421, 444), 'os.path.exists', 'os.path.e... |
"""Tests of querying tools."""
import contextlib
import importlib
import io
import logging
import os
import pathlib
import sys
import tempfile
import unittest
from version_query.version import VersionComponent, Version
from version_query.git_query import query_git_repo, predict_git_repo
from version_query.py_query im... | [
"logging.getLogger",
"sys.path.insert",
"version_query.query.predict_version_str",
"unittest.skipIf",
"contextlib.redirect_stderr",
"pathlib.Path",
"version_query.py_query.query_pkg_info",
"sys.path.remove",
"tempfile.NamedTemporaryFile",
"warnings.warn",
"io.StringIO",
"contextlib.redirect_st... | [((689, 716), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (706, 716), False, 'import logging\n'), ((3611, 3697), 'unittest.skipIf', 'unittest.skipIf', (['(not METADATA_JSON_EXAMPLE_PATHS)', '"""no "metadata.json" files found"""'], {}), '(not METADATA_JSON_EXAMPLE_PATHS,\n \'no "meta... |
import argparse
import getpass
import glob
import hashlib
import itertools
import json
import logging
import os
import sys
import threading
import time
import traceback
import subprocess
import urllib
import urllib.request
import urllib.parse
import urwid
import pybtex
import pybtex.database
class BibEntry:
cla... | [
"logging.debug",
"time.sleep",
"urwid.SimpleListWalker",
"sys.exit",
"getpass.getuser",
"logging.info",
"logging.error",
"urwid.Columns",
"threading.Lock",
"subprocess.run",
"urwid.SolidFill",
"pybtex.database.BibliographyData",
"urwid.Pile",
"urwid.connect_signal",
"urllib.request.urlop... | [((41926, 42091), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': 'args.log', 'format': '"""[%(asctime)s %(levelname)7s] %(threadName)s: %(message)s"""', 'datefmt': '"""%m-%d-%Y %H:%M:%S"""', 'level': 'logging.DEBUG'}), "(filename=args.log, format=\n '[%(asctime)s %(levelname)7s] %(threadName)s: %(me... |
# ----------------------- #
# -------- SETUP -------- #
# ----------------------- #
# Import PySpark, Parameters, File Paths, Functions & Packages
import pyspark
from CCSLink import Parameters
from CCSLink.Parameters import FILE_PATH
from CCSLink import Person_Functions as PF
from CCSLink import Household_Functions as... | [
"CCSLink.Parameters.FILE_PATH"
] | [((11087, 11121), 'CCSLink.Parameters.FILE_PATH', 'FILE_PATH', (['"""Stage_1_clean_HHs_ccs"""'], {}), "('Stage_1_clean_HHs_ccs')\n", (11096, 11121), False, 'from CCSLink.Parameters import FILE_PATH\n'), ((6967, 6997), 'CCSLink.Parameters.FILE_PATH', 'FILE_PATH', (['"""Stage_1_clean_ccs"""'], {}), "('Stage_1_clean_ccs')... |
# Get arxiv data
import json
import logging
import os
import pickle
from collections import Counter
from datetime import datetime
from io import BytesIO
from zipfile import ZipFile
import numpy as np
import pandas as pd
import requests
from kaggle.api.kaggle_api_extended import KaggleApi
from eurito_indicators impor... | [
"datetime.datetime",
"os.path.exists",
"pandas.isnull",
"os.makedirs",
"pandas.read_csv",
"pickle.load",
"io.BytesIO",
"requests.get",
"collections.Counter",
"pandas.concat",
"eurito_indicators.pipeline.processing_utils.covid_getter",
"json.load",
"kaggle.api.kaggle_api_extended.KaggleApi",
... | [((805, 916), 'pandas.read_csv', 'pd.read_csv', (['f"""{PROJECT_DIR}/inputs/data/arxiv_articles_v2.csv"""'], {'dtype': "{'id': str}", 'parse_dates': "['created']"}), "(f'{PROJECT_DIR}/inputs/data/arxiv_articles_v2.csv', dtype={'id':\n str}, parse_dates=['created'])\n", (816, 916), True, 'import pandas as pd\n'), ((1... |
####
#Made reduntant in Alpha 0.4
#
# As this provided no extra functionality from the Channel, and is, in essance,
# simply a speciall channel, various additions were made to Channel.py
# To perform the same function. This has meant less duplication of code.
####
import sys, sip
from PyQt5 import QtCore, QtGui
#fro... | [
"pybirchMessage.Ui_BirchMessageWindow",
"time.strftime",
"PyQt5.QtGui.QMdiSubWindow.__init__",
"PyQt5.QtCore.SIGNAL",
"userInputSorter.UserInputSorter"
] | [((1130, 1172), 'PyQt5.QtGui.QMdiSubWindow.__init__', 'QtGui.QMdiSubWindow.__init__', (['self', 'parent'], {}), '(self, parent)\n', (1158, 1172), False, 'from PyQt5 import QtCore, QtGui\n'), ((1214, 1237), 'pybirchMessage.Ui_BirchMessageWindow', 'Ui_BirchMessageWindow', ([], {}), '()\n', (1235, 1237), False, 'from pybi... |
import csv
import random
from functools import partial
from typing import Callable, Optional
from pdb import set_trace as st
import os
import random
import pandas as pd
from typing import Any, Callable, Dict, Iterable, List, Tuple, Union
import numpy as np
import tensorflow as tf
from foolbox.attacks import (
FGSM... | [
"numpy.prod",
"matplotlib.pyplot.ylabel",
"sklearn.metrics.auc",
"model.config.LENET.network_class.graph",
"nninst_utils.numpy.arg_approx",
"sklearn.metrics.roc_curve",
"numpy.isfinite",
"nninst_utils.fs.abspath",
"nninst_utils.ray.ray_init",
"matplotlib.pyplot.switch_backend",
"tensorflow.set_r... | [((724, 749), 'matplotlib.pyplot.switch_backend', 'plt.switch_backend', (['"""Agg"""'], {}), "('Agg')\n", (742, 749), True, 'import matplotlib.pyplot as plt\n'), ((3011, 3079), 'trace.common.class_trace', 'class_trace', (['trace_name'], {'model_config': 'LENET', 'data_config': 'data_config'}), '(trace_name, model_confi... |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | [
"os.path.realpath",
"os.path.join"
] | [((951, 973), 'os.path.realpath', 'os.path.realpath', (['path'], {}), '(path)\n', (967, 973), False, 'import os\n'), ((690, 731), 'os.path.join', 'os.path.join', (['"""tests"""', '"""test_app_minimal"""'], {}), "('tests', 'test_app_minimal')\n", (702, 731), False, 'import os\n'), ((755, 792), 'os.path.join', 'os.path.j... |
import twitter
import util
from config import *
BOSTON_WOEID = 2367105
api = twitter.Api(consumer_key=key,consumer_secret=secret,access_token_key=access_key,access_token_secret=access_secret)
def search(searchTerm):
"""
Print recent tweets containing `searchTerm`.
To test this function, at the command li... | [
"util.safe_print",
"twitter.Api"
] | [((78, 200), 'twitter.Api', 'twitter.Api', ([], {'consumer_key': 'key', 'consumer_secret': 'secret', 'access_token_key': 'access_key', 'access_token_secret': 'access_secret'}), '(consumer_key=key, consumer_secret=secret, access_token_key=\n access_key, access_token_secret=access_secret)\n', (89, 200), False, 'import... |
# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import NoAlertPresentException... | [
"selenium.webdriver.Chrome",
"selenium.webdriver.support.ui.Select",
"time.sleep",
"unittest.main",
"os.path.abspath"
] | [((9920, 9935), 'unittest.main', 'unittest.main', ([], {}), '()\n', (9933, 9935), False, 'import unittest, time, re, os\n'), ((432, 481), 'os.path.abspath', 'os.path.abspath', (['"""C:\\\\Python27\\\\chromedriver.exe"""'], {}), "('C:\\\\Python27\\\\chromedriver.exe')\n", (447, 481), False, 'import unittest, time, re, o... |
from dataclasses import dataclass, field
from itertools import chain
from typing import Optional
from talon import Context, Module, actions, app, cron, ui
# XXX(nriley) actions are being returned out of order; that's a problem if we want to pop up a menu
mod = Module()
mod.list("notification_actions", desc="Notific... | [
"talon.Context",
"talon.ui.register",
"dataclasses.dataclass",
"talon.ui.apps",
"talon.actions.user.create_spoken_forms_from_list",
"talon.Module",
"rich.console.Console",
"talon.app.notify",
"talon.ui.unregister",
"talon.cron.after",
"talon.app.register",
"dataclasses.field"
] | [((264, 272), 'talon.Module', 'Module', ([], {}), '()\n', (270, 272), False, 'from talon import Context, Module, actions, app, cron, ui\n'), ((1701, 1723), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (1710, 1723), False, 'from dataclasses import dataclass, field\n'), ((4167, 417... |
import numpy as np
from multiagent.core import World, Agent, Landmark
from multiagent.scenario import BaseScenario
class Scenario(BaseScenario):
def make_world(self):
world = World()
# set any world properties first
world.dim_c = 2
num_agents = 2
num_adversaries = 1
... | [
"multiagent.core.Landmark",
"numpy.array",
"numpy.zeros",
"multiagent.core.World",
"numpy.concatenate",
"numpy.random.uniform",
"multiagent.core.Agent"
] | [((188, 195), 'multiagent.core.World', 'World', ([], {}), '()\n', (193, 195), False, 'from multiagent.core import World, Agent, Landmark\n'), ((3273, 3311), 'numpy.random.uniform', 'np.random.uniform', (['(-1)', '(+1)', 'world.dim_p'], {}), '(-1, +1, world.dim_p)\n', (3290, 3311), True, 'import numpy as np\n'), ((3353,... |
# Imports
import numpy as np
# Single to double frame
# Combines images by 2, returning an array with two frames (one for each image).
#
# Input: 5 images with step 1.
# Output: 4 double-framed images.
# FrameA: 1 2 3 4
# FrameB: 2 3 4 5
#
# Input: 8 images with step 3.
# Output: 5 doubled... | [
"numpy.array"
] | [((1479, 1509), 'numpy.array', 'np.array', (['images_double_framed'], {}), '(images_double_framed)\n', (1487, 1509), True, 'import numpy as np\n'), ((1273, 1324), 'numpy.array', 'np.array', (['double_frame[0][min_y:max_y, min_x:max_x]'], {}), '(double_frame[0][min_y:max_y, min_x:max_x])\n', (1281, 1324), True, 'import ... |
import os
import time
from dataclasses import dataclass, field
from enum import Enum
from typing import List, Optional, Union
import torch
from filelock import FileLock
from transformers import PreTrainedTokenizer, RobertaTokenizer, RobertaTokenizerFast, XLMRobertaTokenizer
from transformers.data.datasets import GlueDa... | [
"os.path.exists",
"loguru.logger.info",
"torch.load",
"filelock.FileLock",
"torch.save",
"transformers.data.processors.glue.glue_convert_examples_to_features",
"time.time"
] | [((2821, 2840), 'filelock.FileLock', 'FileLock', (['lock_path'], {}), '(lock_path)\n', (2829, 2840), False, 'from filelock import FileLock\n'), ((2858, 2894), 'os.path.exists', 'os.path.exists', (['cached_features_file'], {}), '(cached_features_file)\n', (2872, 2894), False, 'import os\n'), ((2949, 2960), 'time.time', ... |
#! /usr/bin/env python
"""
This script parses and cleans up a provided Flow Cytometry Standard (fcs) file
and saves it as a Comma Separated Value (csv).
"""
import os
import re
import numpy as np
import pandas as pd
import optparse
import fcsparser
# ####################################################################... | [
"os.listdir",
"optparse.OptionParser",
"numpy.array",
"os.path.isdir",
"fcsparser.parse",
"os.mkdir",
"re.sub"
] | [((386, 409), 'optparse.OptionParser', 'optparse.OptionParser', ([], {}), '()\n', (407, 409), False, 'import optparse\n'), ((1906, 1955), 'numpy.array', 'np.array', (['[(ops.pattern in f) for f in usr_files]'], {}), '([(ops.pattern in f) for f in usr_files])\n', (1914, 1955), True, 'import numpy as np\n'), ((1804, 1828... |
import requests
import configparser
from email_validator import validate_email, EmailNotValidError
from mailchimp import OnCampusJobList
import email_notifier
import groupme_bot
config = configparser.ConfigParser()
config.read('config.ini')
google_config = config['GOOGLE']
def is_valid_recaptcha(recaptcha_response) ... | [
"requests.post",
"configparser.ConfigParser",
"groupme_bot.send_message",
"mailchimp.OnCampusJobList",
"email_notifier.send_welcome_message",
"email_validator.validate_email"
] | [((188, 215), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (213, 215), False, 'import configparser\n'), ((541, 591), 'requests.post', 'requests.post', (['request_url'], {'data': 'verification_data'}), '(request_url, data=verification_data)\n', (554, 591), False, 'import requests\n'), ((92... |
import logging
import os
from datetime import datetime
from enum import Enum
from typing import Optional
from pydantic import BaseModel, Field, HttpUrl, SecretStr, ValidationError
from ..DataGoKr import DataGoKr
# logging
logger = logging.getLogger(__file__)
# debug only
KMA_API_KEY = os.getenv("KMA_API_KEY")
####... | [
"logging.getLogger",
"datetime.datetime.now",
"os.getenv"
] | [((234, 261), 'logging.getLogger', 'logging.getLogger', (['__file__'], {}), '(__file__)\n', (251, 261), False, 'import logging\n'), ((290, 314), 'os.getenv', 'os.getenv', (['"""KMA_API_KEY"""'], {}), "('KMA_API_KEY')\n", (299, 314), False, 'import os\n'), ((1920, 1934), 'datetime.datetime.now', 'datetime.now', ([], {})... |
from traits.api import HasTraits, Bool, Enum, List, Str
from numpy import array, cos, sin
class ElementalRotationDefinition(HasTraits):
'''
A definition of an elemental rotation and its angle's name
'''
angle_name = Str("undefined angle")
axis = Enum('around_x', 'around_y', 'around_z')
isClock... | [
"traits.api.Enum",
"traits.api.Str",
"numpy.cos",
"numpy.sin",
"traits.api.Bool",
"traits.api.List"
] | [((234, 256), 'traits.api.Str', 'Str', (['"""undefined angle"""'], {}), "('undefined angle')\n", (237, 256), False, 'from traits.api import HasTraits, Bool, Enum, List, Str\n'), ((268, 308), 'traits.api.Enum', 'Enum', (['"""around_x"""', '"""around_y"""', '"""around_z"""'], {}), "('around_x', 'around_y', 'around_z')\n"... |
#!/usr/bin/env python3
import unittest
from textwrap import dedent
from datetime import timedelta
from parse import parse_block, TranslationShift
class TestTranslationShift(unittest.TestCase):
def test_eq(self):
self.assertEqual(TranslationShift('name', 'lang'), TranslationShift('name', 'lang'))
... | [
"unittest.main",
"textwrap.dedent",
"datetime.timedelta",
"parse.TranslationShift"
] | [((3436, 3451), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3449, 3451), False, 'import unittest\n'), ((244, 276), 'parse.TranslationShift', 'TranslationShift', (['"""name"""', '"""lang"""'], {}), "('name', 'lang')\n", (260, 276), False, 'from parse import parse_block, TranslationShift\n'), ((278, 310), 'parse... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from .models import Shortener
@admin.register(Shortener)
class ShortenerAdmin(admin.ModelAdmin):
list_display = ('id', 'short_url', 'link_url', 'status', 'created')
fields = ('short_url', 'link_url', 'status', '... | [
"django.contrib.admin.register"
] | [((132, 157), 'django.contrib.admin.register', 'admin.register', (['Shortener'], {}), '(Shortener)\n', (146, 157), False, 'from django.contrib import admin\n')] |
import os
import ipaddress
import numpy as np
import pandas as pd
import datetime
import boto3
import gzip
import json
from signal_processing import signalProcess
BUCKET_NAME = os.environ.get("BUCKET_NAME", None)
VPC_FLOW_LOGS_PATH = os.environ.get("VPC_FLOW_LOGS_PATH", None)
FINDINGS_PATH = os.environ.get("FINDINGS_... | [
"os.path.exists",
"os.listdir",
"json.dumps",
"os.environ.get",
"os.path.join",
"signal_processing.signalProcess",
"boto3.resource",
"datetime.datetime.now",
"os.mkdir",
"pandas.DataFrame",
"ipaddress.ip_address",
"pandas.to_datetime"
] | [((179, 214), 'os.environ.get', 'os.environ.get', (['"""BUCKET_NAME"""', 'None'], {}), "('BUCKET_NAME', None)\n", (193, 214), False, 'import os\n'), ((236, 278), 'os.environ.get', 'os.environ.get', (['"""VPC_FLOW_LOGS_PATH"""', 'None'], {}), "('VPC_FLOW_LOGS_PATH', None)\n", (250, 278), False, 'import os\n'), ((295, 33... |
import argparse
import json
parser = argparse.ArgumentParser()
parser.add_argument("--text", type=str, help="path to original text file")
parser.add_argument("--train", type=str, help="path to original training data file")
parser.add_argument("--valid", type=str, help="path to original validation data file")
parser.ad... | [
"argparse.ArgumentParser"
] | [((38, 63), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (61, 63), False, 'import argparse\n')] |
#!/usr/bin/env python3
#
# Copyright (c) 2019 <NAME> and contributors.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""The test_webframe module covers the webframe module."""
from typing import List
from typing import TYPE_CHECKING
from typing import Tuple
from... | [
"unittest.main",
"traceback.format_exc",
"typing.cast"
] | [((1517, 1532), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1530, 1532), False, 'import unittest\n'), ((1150, 1187), 'typing.cast', 'cast', (['"""StartResponse"""', 'start_response'], {}), "('StartResponse', start_response)\n", (1154, 1187), False, 'from typing import cast\n'), ((1259, 1281), 'traceback.format... |
from functools import reduce
def bfs(root, points):
queue = [root]
visited_states = {root}
basin_size = 1
while len(queue) > 0:
i, j = queue[0]
queue = queue[1:]
ps = [(i - 1, j), (i + 1, j), (i, j - 1), (i, j + 1)]
for n in ps:
if n not in visited_states... | [
"functools.reduce"
] | [((1197, 1244), 'functools.reduce', 'reduce', (['(lambda x, y: x * y)', 'basin_sizes[-3:]', '(1)'], {}), '(lambda x, y: x * y, basin_sizes[-3:], 1)\n', (1203, 1244), False, 'from functools import reduce\n')] |
from django.urls import path
from . import views
urlpatterns = [
path('new', views.new_list, name='new_list'),
path('<list_id>/', views.view_list, name='view_list'),
path('users/<email>/', views.my_lists, name='my_lists'),
] | [
"django.urls.path"
] | [((70, 114), 'django.urls.path', 'path', (['"""new"""', 'views.new_list'], {'name': '"""new_list"""'}), "('new', views.new_list, name='new_list')\n", (74, 114), False, 'from django.urls import path\n'), ((120, 173), 'django.urls.path', 'path', (['"""<list_id>/"""', 'views.view_list'], {'name': '"""view_list"""'}), "('<... |
import discord
import random
from asd import *
from mtgsdk import Card
from mtgsdk import Set
from mtgsdk import Type
from mtgsdk import Supertype
from mtgsdk import Subtype
from mtgsdk import Changelog
client=discord.Client()
@client.event
async def on_ready():
print('logged in as')
print... | [
"discord.Client",
"discord.Embed",
"mtgsdk.Card.where",
"discord.Game"
] | [((226, 242), 'discord.Client', 'discord.Client', ([], {}), '()\n', (240, 242), False, 'import discord\n'), ((2357, 2422), 'discord.Embed', 'discord.Embed', ([], {'title': "x['name']", 'description': 'prices', 'color': '(7629417)'}), "(title=x['name'], description=prices, color=7629417)\n", (2370, 2422), False, 'import... |
#!/usr/bin/env python3
import datetime
import json
import loadPath # Adds the project path.
import linkograph.labels as llabels
import linkograph.linkoCreate as llinkoCreate
import ontologyExtraction as oe
import os
import sys
def print_usage():
print("usage:", sys.argv[0], "<JSON commands filename> ...")
def ... | [
"ontologyExtraction.simple_lg_to_ontology",
"datetime.datetime.now",
"ontologyExtraction.threshold_lg_to_ontology",
"json.load",
"linkograph.labels.writeLabelsToJsonFile",
"os.remove"
] | [((1715, 1738), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (1736, 1738), False, 'import datetime\n'), ((1789, 1812), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (1810, 1812), False, 'import datetime\n'), ((1866, 1889), 'datetime.datetime.now', 'datetime.datetime.now', ([... |
import torch
from torch.utils.data import Dataset, DataLoader
from torch.distributions.multivariate_normal import MultivariateNormal
import numpy as np
from tqdm import tqdm
import random
def get_rotation(theta):
rad = np.radians(theta)
c, s = np.cos(rad), np.sin(rad)
R = np.array([[c, -s],
... | [
"numpy.radians",
"torch.sin",
"numpy.array",
"torch.cos",
"torch.sum",
"numpy.sin",
"torch.eye",
"numpy.random.seed",
"torch.randn",
"torch.distributions.Normal",
"torch.Tensor",
"numpy.cos",
"torch.Size",
"torch.cat",
"torch.manual_seed",
"torch.full",
"random.seed",
"torch.tensor... | [((224, 241), 'numpy.radians', 'np.radians', (['theta'], {}), '(theta)\n', (234, 241), True, 'import numpy as np\n'), ((286, 313), 'numpy.array', 'np.array', (['[[c, -s], [s, c]]'], {}), '([[c, -s], [s, c]])\n', (294, 313), True, 'import numpy as np\n'), ((2140, 2187), 'torch.distributions.multivariate_normal.Multivari... |
import datetime
import typing
from src import core
from src.todo import domain, adapter
__all__ = ("SqlAlchemyTodoService",)
class SqlAlchemyTodoService(domain.TodoService):
def __init__(self, /, uow: core.SqlAlchemyUnitOfWork):
self._uow = uow
def all(self, /, user_id: int) -> typing.List[domain.T... | [
"datetime.date.today",
"src.core.exception.AuthException",
"src.todo.adapter.SqlAlchemyTodoRepository"
] | [((1385, 1406), 'datetime.date.today', 'datetime.date.today', ([], {}), '()\n', (1404, 1406), False, 'import datetime\n'), ((1684, 1705), 'datetime.date.today', 'datetime.date.today', ([], {}), '()\n', (1703, 1705), False, 'import datetime\n'), ((2336, 2387), 'src.todo.adapter.SqlAlchemyTodoRepository', 'adapter.SqlAlc... |
# -*- coding: utf-8 -*-
"""
Created on Sat May 23 11:28:30 2020
@author: rener
"""
import numpy as np
import pandas as pd
import os
from datetime import date
import time
import sys
dir_path = os.path.dirname(os.path.realpath(__file__))
os.chdir(dir_path)
#%% For the various companies we have data going back differen... | [
"numpy.mean",
"os.listdir",
"pandas.read_csv",
"os.chdir",
"os.path.realpath",
"pandas.DataFrame",
"pandas.concat"
] | [((238, 256), 'os.chdir', 'os.chdir', (['dir_path'], {}), '(dir_path)\n', (246, 256), False, 'import os\n'), ((362, 382), 'os.listdir', 'os.listdir', (['"""Stocks"""'], {}), "('Stocks')\n", (372, 382), False, 'import os\n'), ((856, 873), 'pandas.concat', 'pd.concat', (['frames'], {}), '(frames)\n', (865, 873), True, 'i... |
import bs4
import urllib
from base_online_scraper import base_online_scraper as scraper
BASE_URL = 'http://catalog.northeastern.edu'
INITIAL_PATH = '/course-descriptions/'
fp = urllib.urlopen(BASE_URL + INITIAL_PATH)
soup = bs4.BeautifulSoup(fp, 'lxml')
nav_menu = soup.find("div", {"id": "atozindex"}).find_all('a', h... | [
"bs4.BeautifulSoup",
"base_online_scraper.base_online_scraper.scrape",
"urllib.urlopen",
"base_online_scraper.base_online_scraper"
] | [((179, 218), 'urllib.urlopen', 'urllib.urlopen', (['(BASE_URL + INITIAL_PATH)'], {}), '(BASE_URL + INITIAL_PATH)\n', (193, 218), False, 'import urllib\n'), ((226, 255), 'bs4.BeautifulSoup', 'bs4.BeautifulSoup', (['fp', '"""lxml"""'], {}), "(fp, 'lxml')\n", (243, 255), False, 'import bs4\n'), ((341, 352), 'base_online_... |
import pandas as pd
import numpy as np
import re
import spacy
import string
import sklearn
from html.parser import HTMLParser
from joblib import load
import tensorflow as tf
nlp = spacy.load('en_core_web_sm')
tfidf = load('tfidf.joblib')
wordlist = load('wordlist.joblib')
tf.keras.backend.clear_session()
model = tf... | [
"pandas.Series",
"spacy.load",
"tensorflow.keras.models.load_model",
"joblib.load",
"re.sub",
"tensorflow.keras.backend.clear_session",
"tensorflow.get_default_graph"
] | [((183, 211), 'spacy.load', 'spacy.load', (['"""en_core_web_sm"""'], {}), "('en_core_web_sm')\n", (193, 211), False, 'import spacy\n'), ((220, 240), 'joblib.load', 'load', (['"""tfidf.joblib"""'], {}), "('tfidf.joblib')\n", (224, 240), False, 'from joblib import load\n'), ((252, 275), 'joblib.load', 'load', (['"""wordl... |
from lit.fields.base import Field
from lit.fields.base import TextType
class TextField(Field):
sql_type = TextType()
py_type = str
| [
"lit.fields.base.TextType"
] | [((111, 121), 'lit.fields.base.TextType', 'TextType', ([], {}), '()\n', (119, 121), False, 'from lit.fields.base import TextType\n')] |
from datetime import datetime
from typing import Any
from typing import Dict
from typing import Iterable
from typing import Optional
from typing import Type
from evidently.analyzers.base_analyzer import Analyzer
from evidently.analyzers.cat_target_drift_analyzer import CatTargetDriftAnalyzer
from evidently.model_profi... | [
"datetime.datetime.now",
"evidently.analyzers.cat_target_drift_analyzer.CatTargetDriftAnalyzer.get_results"
] | [((843, 896), 'evidently.analyzers.cat_target_drift_analyzer.CatTargetDriftAnalyzer.get_results', 'CatTargetDriftAnalyzer.get_results', (['analyzers_results'], {}), '(analyzers_results)\n', (877, 896), False, 'from evidently.analyzers.cat_target_drift_analyzer import CatTargetDriftAnalyzer\n'), ((1630, 1644), 'datetime... |
import re, logging
from django import forms
from django.forms import ModelForm
from django.utils.translation import ugettext as _
from django.contrib.localflavor.us.forms import USStateSelect,\
USPhoneNumberField
from models import Preference, ShippingWeight, ShippingPrice, ShippingItem, TaxState, DnsShop, EmailNo... | [
"models.TaxState.objects.get",
"models.DnsShop.objects.get",
"django.forms.CharField",
"django.contrib.localflavor.us.forms.USPhoneNumberField",
"re.match",
"django.forms.ValidationError",
"django.utils.translation.ugettext",
"django.forms.EmailField"
] | [((491, 523), 'django.forms.EmailField', 'forms.EmailField', ([], {'required': '(False)'}), '(required=False)\n', (507, 523), False, 'from django import forms\n'), ((536, 570), 'django.contrib.localflavor.us.forms.USPhoneNumberField', 'USPhoneNumberField', ([], {'required': '(False)'}), '(required=False)\n', (554, 570)... |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://www.mozilla.org/en-US/MPL/2.0/.
import warnings
from unittest import TestCase
import pytest
def pytest_addoption(parser):
parser.addop... | [
"warnings.warn",
"pytest.hookimpl"
] | [((1646, 1675), 'pytest.hookimpl', 'pytest.hookimpl', ([], {'trylast': '(True)'}), '(trylast=True)\n', (1661, 1675), False, 'import pytest\n'), ((1363, 1424), 'warnings.warn', 'warnings.warn', (['"""Repeating unittest class tests not supported"""'], {}), "('Repeating unittest class tests not supported')\n", (1376, 1424... |
__copyright__ = "Copyright (C) 2019 <NAME>"
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modif... | [
"pyopencl.array.empty_like",
"loopy.Options",
"loopy.ValueArg",
"numpy.sqrt",
"pymbolic.var",
"pystella.elementwise.append_new_args",
"numpy.empty_like",
"loopy.add_inames_for_unused_hw_axes",
"pystella.field.index_fields",
"pystella.get_field_args"
] | [((25354, 25421), 'numpy.sqrt', 'np.sqrt', (['(36 * c2 ** 4 + 36 * c2 ** 3 - 135 * c2 ** 2 + 84 * c2 - 12)'], {}), '(36 * c2 ** 4 + 36 * c2 ** 3 - 135 * c2 ** 2 + 84 * c2 - 12)\n', (25361, 25421), True, 'import numpy as np\n'), ((5142, 5198), 'pystella.get_field_args', 'get_field_args', (['self.rhs_dict'], {'prepend_wi... |
# python
#
# Copyright 2020 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 applicable law ... | [
"os.path.abspath"
] | [((940, 965), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (955, 965), False, 'import os\n')] |
# --==[ Screens ]==--
from libqtile import bar
from libqtile.config import Screen
from ..utils.settings import wallpaper
from ..extras.widgets import widgets
screens = [
Screen(
wallpaper = wallpaper,
wallpaper_mode = 'fill',
top = bar.Bar(
# Source in widgets.py
w... | [
"libqtile.bar.Bar",
"libqtile.config.Screen"
] | [((573, 623), 'libqtile.config.Screen', 'Screen', ([], {'wallpaper': 'wallpaper', 'wallpaper_mode': '"""fill"""'}), "(wallpaper=wallpaper, wallpaper_mode='fill')\n", (579, 623), False, 'from libqtile.config import Screen\n'), ((263, 341), 'libqtile.bar.Bar', 'bar.Bar', (['widgets', '(20)'], {'background': '"""#00000000... |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | [
"tensorflow_transform.beam.tft_beam_io.beam_metadata_io.WriteMetadata",
"tensorflow_transform.tf_metadata.metadata_io.read_metadata",
"tensorflow_transform.beam.tft_beam_io.beam_metadata_io.BeamDatasetMetadata",
"apache_beam.Create",
"unittest.main",
"apache_beam.Pipeline"
] | [((2304, 2319), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2317, 2319), False, 'import unittest\n'), ((1457, 1488), 'tensorflow_transform.tf_metadata.metadata_io.read_metadata', 'metadata_io.read_metadata', (['path'], {}), '(path)\n', (1482, 1488), False, 'from tensorflow_transform.tf_metadata import metadata... |
from django.test import TestCase
from opentech.apply.funds.tests.factories import ApplicationSubmissionFactory
from .factories import ReviewFactory, ReviewOpinionFactory
from ..options import MAYBE, NO, YES
class TestReviewQueryset(TestCase):
def test_reviews_yes(self):
submission = ApplicationSubmission... | [
"opentech.apply.funds.tests.factories.ApplicationSubmissionFactory"
] | [((299, 329), 'opentech.apply.funds.tests.factories.ApplicationSubmissionFactory', 'ApplicationSubmissionFactory', ([], {}), '()\n', (327, 329), False, 'from opentech.apply.funds.tests.factories import ApplicationSubmissionFactory\n'), ((630, 660), 'opentech.apply.funds.tests.factories.ApplicationSubmissionFactory', 'A... |
import asyncio
import json
import os
from datetime import datetime, timedelta
import aiohttp
import tweepy
from dateutil.parser import parse
from fpl import FPL, utils
from pymongo import MongoClient
from constants import lineup_markers, twitter_usernames
dirname = os.path.dirname(os.path.realpath(__file__))
client =... | [
"aiohttp.ClientSession",
"fpl.utils.get_current_gameweek",
"fpl.FPL",
"os.path.realpath",
"datetime.datetime.now",
"tweepy.API",
"pymongo.MongoClient",
"datetime.timedelta",
"asyncio.get_event_loop",
"tweepy.OAuthHandler"
] | [((321, 334), 'pymongo.MongoClient', 'MongoClient', ([], {}), '()\n', (332, 334), False, 'from pymongo import MongoClient\n'), ((284, 310), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (300, 310), False, 'import os\n'), ((1178, 1198), 'datetime.timedelta', 'timedelta', ([], {'minutes': '(... |
# -*- coding: utf-8 -*-
#
# <NAME> 2021 gpSTS
###########################################
###Configuration File######################
###for gpSTS steering of experiments######
###########################################
import os
import numpy as np
from gpsts.NanonisInterface.nanonis_interface import Nanonis
from gps... | [
"gpsts.NanonisInterface.data_class.PointList",
"os.path.exists",
"gpsts.NanonisInterface.data_class.SpecCounter",
"numpy.sqrt",
"os.makedirs",
"json.dump",
"gpsts.NanonisInterface.nanonis_interface.Nanonis.readheader",
"gpsts.NanonisInterface.nanonis_interface.Nanonis.readimage",
"gpsts.NanonisInter... | [((1551, 1561), 'gpsts.NanonisInterface.data_class.ScanData', 'ScanData', ([], {}), '()\n', (1559, 1561), False, 'from gpsts.NanonisInterface.data_class import ScanData, SpecCounter, PointList, ImageInfo\n'), ((2616, 2629), 'gpsts.NanonisInterface.data_class.SpecCounter', 'SpecCounter', ([], {}), '()\n', (2627, 2629), ... |
"""squeezenet in pytorch
[1] <NAME>, <NAME>, <NAME>, <NAME>
squeezenet: Learning both Weights and Connections for Efficient Neural Networks
https://arxiv.org/abs/1506.02626
"""
import torch
import torch.nn as nn
from .channel_selection import channel_selection
class Fire(nn.Module):
def __init__(self... | [
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.AdaptiveAvgPool2d"
] | [((2292, 2320), 'torch.nn.Conv2d', 'nn.Conv2d', (['(512)', 'class_num', '(1)'], {}), '(512, class_num, 1)\n', (2301, 2320), True, 'import torch.nn as nn\n'), ((2340, 2363), 'torch.nn.AdaptiveAvgPool2d', 'nn.AdaptiveAvgPool2d', (['(1)'], {}), '(1)\n', (2360, 2363), True, 'import torch.nn as nn\n'), ((2387, 2405), 'torch... |
#-*- coding : utf-8-*-
import os
import json
import yaml
import glob
import jieba
import pickle
import datetime
import argparse
from collections import Counter
from concurrent.futures import ProcessPoolExecutor, Executor, as_completed
def task_one_gram(news):
gram1 = {}
with open('./training/pinyin_table/一二... | [
"jieba.lcut",
"json.loads",
"jieba.enable_parallel",
"pickle.dump",
"argparse.ArgumentParser",
"pickle.load",
"collections.Counter",
"datetime.datetime.now",
"concurrent.futures.ProcessPoolExecutor",
"glob.glob"
] | [((859, 902), 'glob.glob', 'glob.glob', (['"""./training/sina_news_gbk/*.txt"""'], {}), "('./training/sina_news_gbk/*.txt')\n", (868, 902), False, 'import glob\n'), ((2687, 2730), 'glob.glob', 'glob.glob', (['"""./training/sina_news_gbk/*.txt"""'], {}), "('./training/sina_news_gbk/*.txt')\n", (2696, 2730), False, 'impo... |
# AMZ-Driverless
# Copyright (c) 2019 Authors:
# - <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use,... | [
"yaml.safe_dump",
"logging.info"
] | [((1588, 1639), 'logging.info', 'logging.info', (['"""TestSimulationEnvironment.prepare()"""'], {}), "('TestSimulationEnvironment.prepare()')\n", (1600, 1639), False, 'import logging\n'), ((1693, 1745), 'logging.info', 'logging.info', (['"""TestSimulationEnvironment.simulate()"""'], {}), "('TestSimulationEnvironment.si... |
import os
from django.conf import settings
def get_location(directory, path, current="", parser=None):
"""Returns a tuple (directory, path)
params:
- directory: [Directory] Directory containing the currently parsed file
- path: [str] Path to the file needed
... | [
"os.listdir",
"os.path.join",
"os.path.isfile",
"os.path.normpath",
"os.path.isdir"
] | [((2379, 2422), 'os.path.join', 'os.path.join', (['directory.root', 'current', 'path'], {}), '(directory.root, current, path)\n', (2391, 2422), False, 'import os\n'), ((3200, 3216), 'os.path.join', 'os.path.join', (['*p'], {}), '(*p)\n', (3212, 3216), False, 'import os\n'), ((1047, 1091), 'os.path.join', 'os.path.join'... |
"""
:Description: PasteScript Template to generate a GitHub hosted python package.
Let you set the package name, a one line description, the Licence (support
GPL, LGPL, AGPL and BSD - GPLv3 by default) and the author name, email and
organisation variables::
paster create -t gh_package <project name>
.. note::
... | [
"paste.script.templates.var",
"os.getcwd",
"os.getlogin",
"paste.script.templates.Template.check_vars",
"datetime.date.today"
] | [((1886, 1898), 'datetime.date.today', 'date.today', ([], {}), '()\n', (1896, 1898), False, 'from datetime import date\n'), ((4273, 4286), 'os.getlogin', 'os.getlogin', ([], {}), '()\n', (4284, 4286), False, 'import os\n'), ((4643, 4701), 'paste.script.templates.var', 'var', (['"""package"""', '"""The package contained... |
from ncclient import manager
from xml.dom import minidom
import xmltodict
huaweiautomation = {'address':'ios-xe-mgmt-latest.cisco.com',
'netconf_port': 10000, 'username': 'developer', 'password': '<PASSWORD>'}
huawei_manager = manager.connect(host = huaweiautomation["address"], port = huaweiautomation["netconf_port"... | [
"xml.dom.minidom.parseString",
"ncclient.manager.connect",
"xmltodict.parse"
] | [((230, 465), 'ncclient.manager.connect', 'manager.connect', ([], {'host': "huaweiautomation['address']", 'port': "huaweiautomation['netconf_port']", 'username': "huaweiautomation['username']", 'password': "huaweiautomation['password']", 'device_params': "{'name': 'iosxe'}", 'hostkey_verify': '(False)'}), "(host=huawei... |
import numpy as np
from numpy import array
from numpy.linalg import det
from numpy.linalg import matrix_rank
from numpy.linalg import solve
"""
*** remember the following useful tools***
from numpy import transpose
from numpy import dot
from numpy import argmax
from numpy import abs
from numpy.linalg import eig
fr... | [
"numpy.linalg.matrix_rank",
"numpy.linalg.solve",
"sympy.Matrix",
"numpy.linalg.det",
"numpy.array"
] | [((811, 830), 'numpy.linalg.matrix_rank', 'matrix_rank', (['matrix'], {}), '(matrix)\n', (822, 830), False, 'from numpy.linalg import matrix_rank\n'), ((844, 858), 'numpy.linalg.matrix_rank', 'matrix_rank', (['B'], {}), '(B)\n', (855, 858), False, 'from numpy.linalg import matrix_rank\n'), ((1689, 1708), 'numpy.linalg.... |
#Chapter 4 - Creating and Manipulating your own Databases
#*******************************************************************************************#
#Creating Tables with SQLAlchemy
# Import Table, Column, String, Integer, Float, Boolean from sqlalchemy
fr... | [
"sqlalchemy.Float",
"sqlalchemy.Boolean",
"sqlalchemy.insert",
"sqlalchemy.Integer",
"sqlalchemy.delete",
"sqlalchemy.String",
"sqlalchemy.select"
] | [((2838, 2850), 'sqlalchemy.insert', 'insert', (['data'], {}), '(data)\n', (2844, 2850), False, 'from sqlalchemy import insert, select\n'), ((3226, 3240), 'sqlalchemy.insert', 'insert', (['census'], {}), '(census)\n', (3232, 3240), False, 'from sqlalchemy import insert, select\n'), ((5517, 5550), 'sqlalchemy.select', '... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division, print_function, unicode_literals
from time import strftime, gmtime
from email.header import make_header
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from .utils import strip_tags, for... | [
"email.mime.multipart.MIMEMultipart",
"time.gmtime",
"email.mime.text.MIMEText"
] | [((3988, 4039), 'email.mime.multipart.MIMEMultipart', 'MIMEMultipart', (['"""alternative"""'], {'charset': 'self._charset'}), "('alternative', charset=self._charset)\n", (4001, 4039), False, 'from email.mime.multipart import MIMEMultipart\n'), ((4191, 4231), 'email.mime.text.MIMEText', 'MIMEText', (['content', '"""html... |
"""
Module to execute the simulation for a given instance.
"""
""" import packages """
import logging
from importlib import import_module
import numpy.random as rdm
import copy
import numpy as np
""" import project configurations """
import configurations.settings_simulation as config
""" import project librar... | [
"logging.getLogger",
"modules.simulation.entities.Tram",
"modules.simulation.entities.Passengers.reset",
"modules.simulation.entities.Passengers.boarding",
"modules.simulation.entities.Passengers.alighting",
"modules.simulation.entities.Stop",
"modules.data.datamgm.initialise_logger",
"modules.simulat... | [((506, 537), 'modules.data.datamgm.initialise_logger', 'dtm.initialise_logger', (['__name__'], {}), '(__name__)\n', (527, 537), True, 'import modules.data.datamgm as dtm\n'), ((1746, 1777), 'logging.getLogger', 'logging.getLogger', (['"""simulation"""'], {}), "('simulation')\n", (1763, 1777), False, 'import logging\n'... |
# -*- mode: python; encoding: utf-8 -*-
#
# Copyright 2012 <NAME>, Opera Software ASA
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | [
"customization.branches.isRebasedBranchCandidate",
"gitutils.Repository.lsremote",
"page.utils.DisplayMessage",
"page.parameters.Optional",
"customization.branches.getRebasedBranchPattern",
"gitutils.Commit.fromSHA1",
"page.utils.PaleYellowTable",
"htmlutils.jsify",
"request.DisplayMessage"
] | [((2689, 2752), 'page.utils.PaleYellowTable', 'page.utils.PaleYellowTable', (['self.body', '"""Rebase tracking review"""'], {}), "(self.body, 'Rebase tracking review')\n", (2715, 2752), False, 'import page\n'), ((1019, 1032), 'page.parameters.Optional', 'Optional', (['str'], {}), '(str)\n', (1027, 1032), False, 'from p... |
#!/usr/bin/env python3
import sys
import ujson as json
import json as json_orig
import traceback
import re
import argparse
import os.path
import operator
import requests
from threading import Thread
from queue import Queue
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib... | [
"requests.packages.urllib3.disable_warnings",
"requests.Session",
"argparse.ArgumentParser",
"re.compile",
"operator.itemgetter",
"ujson.loads",
"threading.Thread",
"queue.Queue",
"traceback.print_exc"
] | [((296, 362), 'requests.packages.urllib3.disable_warnings', 'requests.packages.urllib3.disable_warnings', (['InsecureRequestWarning'], {}), '(InsecureRequestWarning)\n', (338, 362), False, 'import requests\n'), ((373, 398), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (396, 398), False, 'impo... |
# MIT licensed
# Copyright (c) 2020 lilydjwg <<EMAIL>>, et al.
# Copyright (c) 2017 <NAME> <<EMAIL>>, et al.
from flaky import flaky
import pytest
pytestmark = [pytest.mark.asyncio, pytest.mark.needs_net]
@flaky(max_runs=10)
async def test_debianpkg(get_version):
assert await get_version("sigrok-firmware-fx2lafw"... | [
"flaky.flaky"
] | [((208, 226), 'flaky.flaky', 'flaky', ([], {'max_runs': '(10)'}), '(max_runs=10)\n', (213, 226), False, 'from flaky import flaky\n'), ((377, 395), 'flaky.flaky', 'flaky', ([], {'max_runs': '(10)'}), '(max_runs=10)\n', (382, 395), False, 'from flaky import flaky\n'), ((586, 604), 'flaky.flaky', 'flaky', ([], {'max_runs'... |
import numpy as np
import matplotlib.pyplot as plt
from scipy import linalg as la
def PCA(dat, center=False, percentage=0.8):
M, N = dat.shape
if center:
mu = np.mean(dat,0)
dat -= mu
U, L, Vh = la.svd(dat, full_matrices=False)
V = Vh.T.conjugate()
SIGMA = np.diag(L)
X = U... | [
"numpy.mean",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.diag",
"matplotlib.pyplot.figure",
"scipy.linalg.svd"
] | [((225, 257), 'scipy.linalg.svd', 'la.svd', (['dat'], {'full_matrices': '(False)'}), '(dat, full_matrices=False)\n', (231, 257), True, 'from scipy import linalg as la\n'), ((300, 310), 'numpy.diag', 'np.diag', (['L'], {}), '(L)\n', (307, 310), True, 'import numpy as np\n'), ((738, 750), 'matplotlib.pyplot.figure', 'plt... |
# --------------------------------------------------------
# Licensed under The MIT License [see LICENSE for details]
# --------------------------------------------------------
import os
import torch
import torch.nn.functional as F
import numpy as np
from core import networks
from core.utils import *
from core.loss i... | [
"os.path.exists",
"torch.ones_like",
"torch.unique",
"torch.cuda.FloatTensor",
"torch.optim.lr_scheduler.MultiStepLR",
"os.makedirs",
"torch.load",
"torch.Tensor",
"numpy.array",
"torch.no_grad",
"torch.device"
] | [((2639, 2654), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (2652, 2654), False, 'import torch\n'), ((4199, 4214), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (4212, 4214), False, 'import torch\n'), ((3116, 3151), 'torch.cuda.FloatTensor', 'torch.cuda.FloatTensor', (['state[0][1]'], {}), '(state[0][1])\... |
import gym
import datetime
import os
import numpy as np
from agent import DeepQAgent
def main():
env = gym.make("LunarLander-v2")
timestamp = '{:%Y-%m-%d-%H:%M}'.format(datetime.datetime.now())
o_dir = "LunarLander-v2/{}/models".format(timestamp)
if not os.path.exists(o_dir):
os.makedirs(o_d... | [
"os.path.exists",
"numpy.reshape",
"os.makedirs",
"agent.DeepQAgent",
"datetime.datetime.now",
"gym.make"
] | [((110, 136), 'gym.make', 'gym.make', (['"""LunarLander-v2"""'], {}), "('LunarLander-v2')\n", (118, 136), False, 'import gym\n'), ((487, 531), 'agent.DeepQAgent', 'DeepQAgent', (['state_size', 'action_size'], {'model': '(2)'}), '(state_size, action_size, model=2)\n', (497, 531), False, 'from agent import DeepQAgent\n')... |
from io import StringIO
from typing import List
import os
import csv
import re
import pytest
from django.core.management import call_command
from django.core.management.base import CommandError
from django.core.files.temp import NamedTemporaryFile
import accounts.models
from supply_chains.management.commands.ingest_c... | [
"os.path.exists",
"csv.DictReader",
"supply_chains.test.factories.StrategicActionFactory",
"supply_chains.test.factories.SupplyChainFactory",
"django.core.files.temp.NamedTemporaryFile",
"django.core.management.call_command",
"supply_chains.test.factories.StrategicActionUpdateFactory",
"re.match",
"... | [((734, 781), 'django.core.files.temp.NamedTemporaryFile', 'NamedTemporaryFile', ([], {'suffix': '""".csv"""', 'delete': '(False)'}), "(suffix='.csv', delete=False)\n", (752, 781), False, 'from django.core.files.temp import NamedTemporaryFile\n'), ((822, 852), 'os.remove', 'os.remove', (['self.data_file.name'], {}), '(... |
from bootstrap.lib.options import Options
from bootstrap.lib.logger import Logger
from .extract_engine import ExtractEngine
from .predict_engine import PredictEngine
def factory():
if Options()['engine']['name'] == 'extract':
engine = ExtractEngine()
elif Options()['engine']['name'] == 'predict... | [
"bootstrap.lib.options.Options"
] | [((195, 204), 'bootstrap.lib.options.Options', 'Options', ([], {}), '()\n', (202, 204), False, 'from bootstrap.lib.options import Options\n'), ((338, 347), 'bootstrap.lib.options.Options', 'Options', ([], {}), '()\n', (345, 347), False, 'from bootstrap.lib.options import Options\n'), ((281, 290), 'bootstrap.lib.options... |
#!/usr/bin/python3
## Tommy
from botbase import *
_aachen_c = re.compile(r"eit Ende Februar 2020 (?:wurden beim Robert.Koch.Institut \(RKI\) )?insgesamt ([0-9.]+)")
_aachen_d = re.compile(r"Die Zahl der gemeldeten Todesfälle liegt bei ([0-9.]+)")
_aachen_a = re.compile(r"Aktuell sind ([0-9.]+) Menschen nachgewiesen")
... | [
"locale.setlocale"
] | [((363, 410), 'locale.setlocale', 'locale.setlocale', (['locale.LC_TIME', '"""de_DE.UTF-8"""'], {}), "(locale.LC_TIME, 'de_DE.UTF-8')\n", (379, 410), False, 'import locale\n')] |
from mach_utils import *
import logging
from argparse import ArgumentParser
from fc_network import FCNetwork
import tqdm
from dataset import XCDataset,XCDataset_massive
import json
from typing import Dict, List
from trim_labels import get_discard_set
from xclib.evaluation import xc_metrics
from xclib.data import data_u... | [
"xclib.evaluation.xc_metrics._eval_flags",
"logging.StreamHandler",
"argparse.ArgumentParser",
"xclib.data.data_utils.read_data",
"tqdm.tqdm",
"xclib.evaluation.xc_metrics._ndcg",
"time.perf_counter",
"torchnet.meter.mAPMeter",
"xclib.evaluation.xc_metrics._setup_metric",
"fc_network.FCNetwork",
... | [((390, 406), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (404, 406), False, 'from argparse import ArgumentParser\n'), ((5506, 5564), 'dataset.XCDataset_massive', 'XCDataset_massive', (['test_file', '(0)', 'data_cfg', 'model_cfg', '"""te"""'], {}), "(test_file, 0, data_cfg, model_cfg, 'te')\n", (5523... |
import glob
import os
import sys
from sgfmill.sgfmill import sgf
import global_vars_go as gvg
import loader
import utils
import board3d as go_board
import numpy as np
kifuPath = "./kifu"
num_games = gvg.num_games
from_game = gvg.from_test_games
lb_size = 250.
correct = 0
total = 0
num_lb = int((num_g... | [
"board3d.make_move",
"os.path.join",
"board3d.get_encoded_board",
"board3d.setup_board",
"numpy.zeros",
"board3d.switch_player_perspec",
"loader.load_model_from_file"
] | [((380, 420), 'loader.load_model_from_file', 'loader.load_model_from_file', (['gvg.nn_type'], {}), '(gvg.nn_type)\n', (407, 420), False, 'import loader\n'), ((544, 575), 'os.path.join', 'os.path.join', (['kifuPath', '"""*.sgf"""'], {}), "(kifuPath, '*.sgf')\n", (556, 575), False, 'import os\n'), ((1036, 1075), 'board3d... |
from typing import cast
import pandas as pd
import os
import numpy as np
import glob
from sklearn.model_selection import train_test_split
def prepare_data(random_state,path):
new_df = []
path1 = path
#path1 = ['C:\CassFlipkratScrappingProject\S1_Dataset','C:\CassFlipkratScrappingProject\S2_Dataset']
... | [
"os.listdir",
"sklearn.model_selection.train_test_split",
"os.path.join",
"pandas.DataFrame",
"pandas.concat"
] | [((364, 378), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (376, 378), True, 'import pandas as pd\n'), ((910, 945), 'pandas.concat', 'pd.concat', (['tst1'], {'ignore_index': '(False)'}), '(tst1, ignore_index=False)\n', (919, 945), True, 'import pandas as pd\n'), ((954, 969), 'pandas.DataFrame', 'pd.DataFrame',... |
import os
import numpy as np
from allennlp.predictors import Predictor
from isanlp.annotation_rst import DiscourseUnit
from symbol_map import SYMBOL_MAP
class AllenNLPSegmenter:
def __init__(self, model_dir_path, cuda_device=-1):
self._model_path = os.path.join(model_dir_path, 'segmenter_neural', 'model... | [
"allennlp.predictors.Predictor.from_path",
"numpy.array",
"os.path.join",
"isanlp.annotation_rst.DiscourseUnit"
] | [((265, 329), 'os.path.join', 'os.path.join', (['model_dir_path', '"""segmenter_neural"""', '"""model.tar.gz"""'], {}), "(model_dir_path, 'segmenter_neural', 'model.tar.gz')\n", (277, 329), False, 'import os\n'), ((395, 463), 'allennlp.predictors.Predictor.from_path', 'Predictor.from_path', (['self._model_path'], {'cud... |
# -*- coding: utf-8 -*-
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | [
"nailgun.test.base.EnvironmentManager",
"functools.partial"
] | [((957, 1004), 'nailgun.test.base.EnvironmentManager', 'EnvironmentManager', ([], {'app': 'cls.app', 'session': 'cls.db'}), '(app=cls.app, session=cls.db)\n', (975, 1004), False, 'from nailgun.test.base import EnvironmentManager\n'), ((1482, 1547), 'functools.partial', 'functools.partial', (['self.get_handler', '"""Nod... |
import magic
import os
import random
import string
from ahye.settings import LOCAL_UPLOADS_DIR
def generate_filename(image_data, detect_extension=True):
alphanum = string.ascii_letters + string.digits
retval = ''
while not retval or os.path.exists(os.path.join(LOCAL_UPLOADS_DIR, retval)):
retval... | [
"magic.from_buffer",
"random.sample",
"os.path.join"
] | [((547, 576), 'magic.from_buffer', 'magic.from_buffer', (['image_data'], {}), '(image_data)\n', (564, 576), False, 'import magic\n'), ((263, 302), 'os.path.join', 'os.path.join', (['LOCAL_UPLOADS_DIR', 'retval'], {}), '(LOCAL_UPLOADS_DIR, retval)\n', (275, 302), False, 'import os\n'), ((331, 357), 'random.sample', 'ran... |
import json
import boto3
from elasticsearch import Elasticsearch, RequestsHttpConnection
from requests_aws4auth import AWS4Auth
from boto3.dynamodb.conditions import Key
user_table = 'user-profile'
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table(user_table)
cognito = boto3.client('cognito-idp')
region = '... | [
"json.loads",
"boto3.client",
"requests_aws4auth.AWS4Auth",
"elasticsearch.Elasticsearch",
"boto3.Session",
"json.dumps",
"boto3.resource"
] | [((210, 236), 'boto3.resource', 'boto3.resource', (['"""dynamodb"""'], {}), "('dynamodb')\n", (224, 236), False, 'import boto3\n'), ((282, 309), 'boto3.client', 'boto3.client', (['"""cognito-idp"""'], {}), "('cognito-idp')\n", (294, 309), False, 'import boto3\n'), ((489, 599), 'requests_aws4auth.AWS4Auth', 'AWS4Auth', ... |
import crypt
import io
import json
import logging
import re
import requests
import uuid
import yaml
from flask import current_app as app
from base64 import b64encode
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.backends imp... | [
"logging.getLogger",
"operations_api.app.cache.get",
"requests.Session",
"jinja2.Environment",
"re.compile",
"os.urandom",
"jinja2.meta.find_undeclared_variables",
"pygerrit2.HTTPBasicAuth",
"uuid.uuid4",
"pygerrit2.GerritRestAPI",
"operations_api.exceptions.ImproperlyConfigured",
"io.open",
... | [((639, 674), 'logging.getLogger', 'logging.getLogger', (['"""operations_api"""'], {}), "('operations_api')\n", (656, 674), False, 'import logging\n'), ((4752, 4764), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (4762, 4764), False, 'import uuid\n'), ((3087, 3114), 'crypt.crypt', 'crypt.crypt', (['password', 'salt'], ... |
#!/usr/bin/env python3
# 2次元累積和 S の [x1, x2) × [y1, y2) 総和
def ac2(s, x1, x2, y1, y2):
return s[x2][y2] - s[x1][y2] - s[x2][y1] + s[x1][y1]
import numpy as np
_, *d = open(0)
n, k = map(int, _.split())
B = np.zeros((2*k, 2*k))
for e in d:
*z, c = e.split()
x, y = map(int, z)
B[x % (2*k)][(y + k * (z ==... | [
"numpy.tile",
"numpy.zeros"
] | [((211, 235), 'numpy.zeros', 'np.zeros', (['(2 * k, 2 * k)'], {}), '((2 * k, 2 * k))\n', (219, 235), True, 'import numpy as np\n'), ((383, 401), 'numpy.tile', 'np.tile', (['B', '(2, 2)'], {}), '(B, (2, 2))\n', (390, 401), True, 'import numpy as np\n')] |
from __future__ import print_function, absolute_import, division # makes these scripts backward compatible with python 2.6 and 2.7
# pyKratos imports
from .Element import Element
# Other imports
import numpy as np
class TriangleElement(Element):
def __init__(self, elem_id, nodes):
super(TriangleElement... | [
"numpy.array",
"numpy.zeros"
] | [((1609, 1638), 'numpy.zeros', 'np.zeros', (['(3, 2)'], {'dtype': 'float'}), '((3, 2), dtype=float)\n', (1617, 1638), True, 'import numpy as np\n'), ((1958, 2001), 'numpy.array', 'np.array', (['[one_third, one_third, one_third]'], {}), '([one_third, one_third, one_third])\n', (1966, 2001), True, 'import numpy as np\n')... |
from collections import defaultdict
from ...account.models import Address, CustomerEvent, User
from ..core.dataloaders import DataLoader
class AddressByIdLoader(DataLoader):
context_key = "address_by_id"
def batch_load(self, keys):
address_map = Address.objects.in_bulk(keys)
return [address_... | [
"collections.defaultdict"
] | [((791, 808), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (802, 808), False, 'from collections import defaultdict\n')] |
##############################################################################
#
# Copyright (c) 2009 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | [
"zope.authentication.interfaces.IUnauthenticatedPrincipal.providedBy"
] | [((1011, 1058), 'zope.authentication.interfaces.IUnauthenticatedPrincipal.providedBy', 'IUnauthenticatedPrincipal.providedBy', (['principal'], {}), '(principal)\n', (1047, 1058), False, 'from zope.authentication.interfaces import IUnauthenticatedPrincipal\n')] |
import vtk
import numpy as np
class LinearSubdivisionFilter:
InputData = None
Output = None
NumberOfSubdivisions = 1
def SetInputData(self, polydata):
self.InputData = polydata
def GetOutput(self):
return self.Output
def SetNumberOfSubdivisions (self, subdivisions):
self.NumberOfSubdivisions = subdivis... | [
"vtk.vtkIdList",
"vtk.vtkTriangle",
"vtk.vtkAppendPolyData",
"vtk.vtkPolyData",
"vtk.vtkCellArray",
"vtk.vtkPoints",
"vtk.vtkCleanPolyData"
] | [((567, 590), 'vtk.vtkAppendPolyData', 'vtk.vtkAppendPolyData', ([], {}), '()\n', (588, 590), False, 'import vtk\n'), ((3151, 3173), 'vtk.vtkCleanPolyData', 'vtk.vtkCleanPolyData', ([], {}), '()\n', (3171, 3173), False, 'import vtk\n'), ((789, 804), 'vtk.vtkIdList', 'vtk.vtkIdList', ([], {}), '()\n', (802, 804), False,... |
#!/usr/bin/env python
# hsslms.py
#
# This provides a command line interface for the pyhsslms.py
# implementation of HSS/LMS Hash-based Signatures as defined
# in RFC 8554.
#
#
# Copyright (c) 2020-2021, Vigil Security, LLC
# All rights reserved.
#
# Redistribution and use, with or without modification, are permitted
... | [
"pyhsslms.HssLmsPrivateKey",
"argparse.ArgumentParser",
"pyhsslms.HssLmsSignature",
"pyhsslms.HssLmsPublicKey",
"pyhsslms.HssLmsPrivateKey.genkey",
"sys.exit"
] | [((3467, 3478), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (3475, 3478), False, 'import sys\n'), ((3864, 3875), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (3872, 3875), False, 'import sys\n'), ((3986, 3997), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (3994, 3997), False, 'import sys\n'), ((4148, 4159), '... |
"""Methods for parsing the unicode spec, and retrieving a list of Emoji and Modifiers.
Note that the model of 'Emoji' here isn't sufficiently general to represent everything in the spec -
a visual / user-facing emoji could be, for example, a super complicated Zero-Width-Join sequence. I
wanted to go in favor of ease-o... | [
"os.path.join",
"emoji.core.Emoji",
"collections.defaultdict"
] | [((1547, 1569), 'collections.defaultdict', 'defaultdict', (['_make_cpi'], {}), '(_make_cpi)\n', (1558, 1569), False, 'from collections import defaultdict\n'), ((2493, 2539), 'os.path.join', 'os.path.join', (['data_directory', '"""emoji-data.txt"""'], {}), "(data_directory, 'emoji-data.txt')\n", (2505, 2539), False, 'im... |
# -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='superpose3d',
packages=['superpose3d'],
description='Diamond\'s 1988 rotational superposition algorithm (+scale tranforms)',
long_description='''Register 3-D point clouds using rotation, translation, and scale transformations.
## Usage
... | [
"setuptools.setup"
] | [((55, 4049), 'setuptools.setup', 'setup', ([], {'name': '"""superpose3d"""', 'packages': "['superpose3d']", 'description': '"""Diamond\'s 1988 rotational superposition algorithm (+scale tranforms)"""', 'long_description': '"""Register 3-D point clouds using rotation, translation, and scale transformations.\n\n## Usag... |
import os
import tempfile
from glob import glob
import json
from collections import OrderedDict
import numpy as np
from .adding_features import adding_no_features
def iterate_json_data(filepath,
columns_to_keep=None,
feature_adder=adding_no_features,
... | [
"tempfile.TemporaryDirectory",
"json.loads",
"collections.OrderedDict",
"json.dumps",
"os.path.join",
"numpy.random.seed"
] | [((2255, 2284), 'tempfile.TemporaryDirectory', 'tempfile.TemporaryDirectory', ([], {}), '()\n', (2282, 2284), False, 'import tempfile\n'), ((480, 496), 'json.loads', 'json.loads', (['line'], {}), '(line)\n', (490, 496), False, 'import json\n'), ((1497, 1524), 'os.path.join', 'os.path.join', (['dir', '"""*.json"""'], {}... |
# -*- coding: utf-8 -*-
###########
# IMPORTS #
###########
# Standard
from os.path import (
abspath as _os_abspath,
dirname as _os_dirname,
isfile as _os_isfile,
join as _os_join
)
from json import (
load as _json_load
)
#############
# CONSTANTS #
#############
_replacements = [
('NaN'... | [
"os.path.isfile",
"os.path.dirname",
"os.path.join",
"json.load"
] | [((4664, 4727), 'os.path.join', '_os_join', (['base_directory', 'f"""fixtures/fixtures_{test_name}.json"""'], {}), "(base_directory, f'fixtures/fixtures_{test_name}.json')\n", (4672, 4727), True, 'from os.path import abspath as _os_abspath, dirname as _os_dirname, isfile as _os_isfile, join as _os_join\n'), ((4617, 463... |
import hashlib
import hmac
import requests
import time
from functools import reduce
class CryptoMKT(object):
BASE_URL = 'https://api.cryptomkt.com'
API_VERSION = 'v1'
ENDPOINT_BALANCE = 'balance'
ENDPOINT_BOOK = 'book'
ENDPOINT_MARKETS = 'market'
ENDPOINT_TICKER = 'ticker'
ENDPOINT_TRAD... | [
"functools.reduce",
"time.time"
] | [((762, 773), 'time.time', 'time.time', ([], {}), '()\n', (771, 773), False, 'import time\n'), ((1928, 1953), 'functools.reduce', 'reduce', (['str.__add__', 'body'], {}), '(str.__add__, body)\n', (1934, 1953), False, 'from functools import reduce\n')] |
# -*- coding: utf-8 -*-
"""
Combination of
http://scipy-central.org/item/52/1/zplane-function
and
http://www.dsprelated.com/showcode/244.php
with my own modifications
"""
# Copyright (c) 2011 <NAME>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General... | [
"matplotlib.pyplot.grid",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.margins",
"numpy.arange",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.axhline",
"numpy.rint",
"scipy.signal.tf2zpk",
"matplotlib.pyplot.axis",
"matplotlib.patches.Circle",
"matplotlib.pyplot.s... | [((1321, 1341), 'matplotlib.pyplot.subplot', 'plt.subplot', (['(2)', '(2)', '(1)'], {}), '(2, 2, 1)\n', (1332, 1341), True, 'import matplotlib.pyplot as plt\n'), ((1466, 1552), 'matplotlib.patches.Circle', 'patches.Circle', (['(0, 0)'], {'radius': '(1)', 'fill': '(False)', 'color': '"""black"""', 'ls': '"""solid"""', '... |
import string
import math
from codestat_token import Token
from codestat_tokenizer import Tokenizer
from token_builders import (
InvalidTokenBuilder,
NullTokenBuilder,
WhitespaceTokenBuilder,
NewlineTokenBuilder,
EscapedStringTokenBuilder,
PrefixedStringTokenBuilder,
IntegerTokenBuilder,
IntegerExponen... | [
"token_builders.IntegerTokenBuilder.__escape_z__",
"token_builders.WhitespaceTokenBuilder",
"token_builders.PrefixedStringTokenBuilder.__escape_z__",
"token_builders.CaseSensitiveListTokenBuilder",
"token_builders.InvalidTokenBuilder",
"codestat_tokenizer.Tokenizer.combine_number_and_adjacent_identifier",... | [((833, 867), 'token_builders.InvalidTokenBuilder.__escape_z__', 'InvalidTokenBuilder.__escape_z__', ([], {}), '()\n', (865, 867), False, 'from token_builders import InvalidTokenBuilder, NullTokenBuilder, WhitespaceTokenBuilder, NewlineTokenBuilder, EscapedStringTokenBuilder, PrefixedStringTokenBuilder, IntegerTokenBui... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from .models import (
BaseModel
)
classes = [BaseModel]
for c in classes:
admin.site.register(c)
| [
"django.contrib.admin.site.register"
] | [((184, 206), 'django.contrib.admin.site.register', 'admin.site.register', (['c'], {}), '(c)\n', (203, 206), False, 'from django.contrib import admin\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
from PyQt5.QtWidgets import QWidget, QFormLayout, QComboBox, QSpinBox, QCheckBox
from PyQt5.QtCore import QSettings, pyqtSignal
from common import IMAGE_HASH_ALGO, DEFAULT_IMAGE_HASH_ALGO, DEFAULT_IMAGE_HASH_MAX_SCORE
class SearchForSimilarSet... | [
"PyQt5.QtCore.pyqtSignal",
"PyQt5.QtWidgets.QSpinBox",
"PyQt5.QtWidgets.QComboBox",
"PyQt5.QtWidgets.QFormLayout",
"PyQt5.QtWidgets.QCheckBox"
] | [((368, 384), 'PyQt5.QtCore.pyqtSignal', 'pyqtSignal', (['bool'], {}), '(bool)\n', (378, 384), False, 'from PyQt5.QtCore import QSettings, pyqtSignal\n'), ((512, 523), 'PyQt5.QtWidgets.QComboBox', 'QComboBox', ([], {}), '()\n', (521, 523), False, 'from PyQt5.QtWidgets import QWidget, QFormLayout, QComboBox, QSpinBox, Q... |
from flask import Blueprint
auth_blueprint = Blueprint(
'auth_blueprint',
__name__,
template_folder='templates'
)
| [
"flask.Blueprint"
] | [((47, 113), 'flask.Blueprint', 'Blueprint', (['"""auth_blueprint"""', '__name__'], {'template_folder': '"""templates"""'}), "('auth_blueprint', __name__, template_folder='templates')\n", (56, 113), False, 'from flask import Blueprint\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017~2999 - cologler <<EMAIL>>
# ----------
#
# ----------
from pytest import raises
from singletonify import singleton
def test_base():
@singleton()
class A:
pass
assert not A._is_init()
assert A() is A()
assert A._is_init(... | [
"pytest.raises",
"singletonify.singleton"
] | [((210, 221), 'singletonify.singleton', 'singleton', ([], {}), '()\n', (219, 221), False, 'from singletonify import singleton\n'), ((350, 366), 'singletonify.singleton', 'singleton', ([], {'x': '"""s"""'}), "(x='s')\n", (359, 366), False, 'from singletonify import singleton\n'), ((513, 524), 'singletonify.singleton', '... |
from flask import Flask, request, jsonify
from ..common import app, db, getJson
from .model import User
from .method import *
@app.route("/api/user/register", methods=["POST"])
def register():
json = getJson()
username = json['username']
password = json['password']
userId = addUser(username, password)
... | [
"flask.jsonify"
] | [((355, 421), 'flask.jsonify', 'jsonify', (["{'status': 'ok', 'username': username, 'user id': userId}"], {}), "({'status': 'ok', 'username': username, 'user id': userId})\n", (362, 421), False, 'from flask import Flask, request, jsonify\n'), ((447, 536), 'flask.jsonify', 'jsonify', (["{'status': 'error', 'username': u... |
import subprocess
import pytest
import os
import json
def test_call_generate_promoter_terminator():
print('')
process_result = subprocess.run(['python', 'generate_promoter_terminator.py', './test/1.gff.json', '500', '200'], \
capture_output=True)
assert process_result.returncode == 0
... | [
"json.load",
"json.loads",
"subprocess.run",
"os.path.join"
] | [((136, 257), 'subprocess.run', 'subprocess.run', (["['python', 'generate_promoter_terminator.py', './test/1.gff.json', '500', '200'\n ]"], {'capture_output': '(True)'}), "(['python', 'generate_promoter_terminator.py',\n './test/1.gff.json', '500', '200'], capture_output=True)\n", (150, 257), False, 'import subpr... |
"""
VF: Validation Functions (for Python dicts.)
Copyright (c) 2020 Polydojo, Inc.
SOFTWARE LICENSING
------------------
The software is released "AS IS" under the MIT License,
WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. Kindly
see LICENSE.txt for more details.
NO TRADEMARK RIGHTS
-------------------
The above... | [
"re.match"
] | [((1528, 1548), 're.match', 're.match', (['pattern', 's'], {}), '(pattern, s)\n', (1536, 1548), False, 'import re\n')] |
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, validators
from wtforms.fields.html5 import EmailField
class RegisterForm(FlaskForm):
firstname = StringField(u"Firstname", [validators.Length(min=2, max=256)])
lastname = StringField(u"Lastname", [validators.length(min=2, max=256)... | [
"wtforms.validators.Email",
"wtforms.PasswordField",
"wtforms.validators.EqualTo",
"wtforms.validators.length",
"wtforms.validators.Length",
"wtforms.validators.InputRequired"
] | [((527, 561), 'wtforms.PasswordField', 'PasswordField', (['u"""Confirm password"""'], {}), "(u'Confirm password')\n", (540, 561), False, 'from wtforms import StringField, PasswordField, validators\n'), ((210, 243), 'wtforms.validators.Length', 'validators.Length', ([], {'min': '(2)', 'max': '(256)'}), '(min=2, max=256)... |
from setuptools import setup, find_packages
version = '0.0.1'
setup(name='mvvm',
version=version,
description='Model-View-ViewModel framework for Python, based on Wx',
long_description=open('README.rst').read(),
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended... | [
"setuptools.find_packages"
] | [((765, 780), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (778, 780), False, 'from setuptools import setup, find_packages\n')] |
"""
Corporation management paths
"""
from datetime import datetime
from typing import Dict, Iterator, List, Optional
from fastapi import APIRouter, Depends
import pydantic as pdt
from sni.esi.scope import EsiScope, esi_scope_set_to_hex
from sni.esi.token import tracking_status, TrackingStatus
from sni.uac.clearance ... | [
"sni.uac.clearance.assert_has_clearance",
"sni.user.models.Corporation.objects",
"sni.user.user.ensure_corporation",
"fastapi.APIRouter",
"sni.user.models.User.objects",
"fastapi.Depends",
"sni.esi.token.tracking_status"
] | [((596, 607), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (605, 607), False, 'from fastapi import APIRouter, Depends\n'), ((4525, 4566), 'fastapi.Depends', 'Depends', (['from_authotization_header_nondyn'], {}), '(from_authotization_header_nondyn)\n', (4532, 4566), False, 'from fastapi import APIRouter, Depends\... |
import requests
import json
from .Graph import Graph
from .FactSheets import FactSheets
from .Users import Users
from .Metrics import Metrics
from .Polls import Polls
class LeanIX:
def __init__(self,api_token="",workspaceid="",baseurl="https://us.leanix.net/"):
""" Authenticates to LeanIX with the given A... | [
"json.dumps",
"requests.post",
"requests.get"
] | [((1231, 1339), 'requests.post', 'requests.post', (['auth_url'], {'auth': "('apitoken', self.__api_token)", 'data': "{'grant_type': 'client_credentials'}"}), "(auth_url, auth=('apitoken', self.__api_token), data={\n 'grant_type': 'client_credentials'})\n", (1244, 1339), False, 'import requests\n'), ((1821, 1882), 'r... |
import os
import numpy as np
from constants import DATABASE_FILE_NAME, PLAYER_ONE, PLAYER_TWO, POSITION_TO_DATABASE
from Agents.random import Random
from othello import Othello
import multiprocessing as mp
class Database:
def __init__(self):
"""
load database data and store them in self._db_data
... | [
"othello.Othello",
"Agents.random.Random.get_move",
"multiprocessing.cpu_count",
"os.path.isfile",
"numpy.zeros",
"multiprocessing.Pool",
"numpy.savetxt",
"numpy.loadtxt"
] | [((765, 825), 'numpy.loadtxt', 'np.loadtxt', (['DATABASE_FILE_NAME'], {'delimiter': '""";"""', 'dtype': '"""int64"""'}), "(DATABASE_FILE_NAME, delimiter=';', dtype='int64')\n", (775, 825), True, 'import numpy as np\n'), ((1042, 1083), 'numpy.zeros', 'np.zeros', ([], {'shape': '(60, 9, 3)', 'dtype': '"""int64"""'}), "(s... |