code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from django.core.urlresolvers import reverse, NoReverseMatch
from django.test import TestCase
from model_mommy import mommy
from musician import models
from musician.models import Song
class MusicianBaseViewTestCase(TestCase):
@classmethod
def setUpClass(cls):
cls.user = mommy.make('auth.user', user... | [
"musician.models.Song.objects.all",
"model_mommy.mommy.make",
"musician.models.Song.objects.get",
"musician.models.Song",
"django.core.urlresolvers.reverse"
] | [((292, 348), 'model_mommy.mommy.make', 'mommy.make', (['"""auth.user"""'], {'username': '"""test"""', 'is_active': '(True)'}), "('auth.user', username='test', is_active=True)\n", (302, 348), False, 'from model_mommy import mommy\n'), ((436, 545), 'model_mommy.mommy.make', 'mommy.make', (['"""songs.song"""'], {'name': ... |
'''
Python client for the TomTom Routing service.
'''
import json
import requests
from uritemplate import URITemplate
from cartodb_services.metrics import Traceable
from cartodb_services.tools import PolyLine
from cartodb_services.tools.coordinates import (validate_coordinates,
... | [
"json.loads",
"cartodb_services.tools.coordinates.validate_coordinates",
"uritemplate.URITemplate",
"cartodb_services.tools.exceptions.ServiceException",
"cartodb_services.tools.qps.qps_retry",
"requests.get"
] | [((3780, 3815), 'cartodb_services.tools.qps.qps_retry', 'qps_retry', ([], {'qps': '(5)', 'provider': '"""tomtom"""'}), "(qps=5, provider='tomtom')\n", (3789, 3815), False, 'from cartodb_services.tools.qps import qps_retry\n'), ((3023, 3043), 'json.loads', 'json.loads', (['response'], {}), '(response)\n', (3033, 3043), ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import shlex
from multiprocessing import Process
from goodjob.jobs.models import Job, Operation
class TestCase(object):
def create_job(self, name='test', command='echo test'):
args = shlex.split(command)
provider = Operation(type='shell', command=arg... | [
"shlex.split",
"goodjob.jobs.models.Operation",
"goodjob.jobs.models.Job",
"multiprocessing.Process"
] | [((245, 265), 'shlex.split', 'shlex.split', (['command'], {}), '(command)\n', (256, 265), False, 'import shlex\n'), ((285, 340), 'goodjob.jobs.models.Operation', 'Operation', ([], {'type': '"""shell"""', 'command': 'args[0]', 'args': 'args[1:]'}), "(type='shell', command=args[0], args=args[1:])\n", (294, 340), False, '... |
from django.contrib import admin
import wemo.models as wemo
from homeauto.admin import make_discoverable, remove_discoverable
class WemoAdmin(admin.ModelAdmin):
list_display = ('name', 'id', 'type', 'status', 'enabled')
list_filter = ('type','status','enabled')
search_fields = ('name',)
actions = [mak... | [
"django.contrib.admin.site.register"
] | [((358, 401), 'django.contrib.admin.site.register', 'admin.site.register', (['wemo.Device', 'WemoAdmin'], {}), '(wemo.Device, WemoAdmin)\n', (377, 401), False, 'from django.contrib import admin\n'), ((475, 526), 'django.contrib.admin.site.register', 'admin.site.register', (['wemo.Account', 'WemoAccountAdmin'], {}), '(w... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This module implements the Estrangement Confinement Algorithm (ECA) and various functions necessary
to read the input snapshots, process information and return the results and/or print them to file.
"""
__all__ = ['make_Zgraph','read_general','maxQ','repeated_runs','ECA... | [
"networkx.NetworkXError",
"logging.info",
"pprint.pprint",
"utils.match_labels",
"logging.error",
"os.path.exists",
"os.listdir",
"os.mkdir",
"utils.Estrangement",
"os.path.getsize",
"networkx.connected_components",
"networkx.number_connected_components",
"networkx.read_edgelist",
"multipr... | [((1974, 1993), 'os.listdir', 'os.listdir', (['datadir'], {}), '(datadir)\n', (1984, 1993), False, 'import os\n'), ((2125, 2172), 'os.path.join', 'os.path.join', (['datadir', '"""initial_label_dict.txt"""'], {}), "(datadir, 'initial_label_dict.txt')\n", (2137, 2172), False, 'import os\n'), ((4488, 4498), 'networkx.Grap... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Annotator to add NER and time variables
Created: 2021 12 22
Author: lukasp
"""
from datetime import datetime
from pymongo import MongoClient
import pandas as pd
from tqdm import tqdm
import spacy
import pickle
import utils
import constants
# Load auxiliary file wi... | [
"spacy.load",
"tqdm.tqdm",
"pickle.load",
"utils.resolve_cabinet",
"utils.cabinet_entities",
"pandas.DataFrame",
"pymongo.MongoClient",
"utils.prime_and_prez"
] | [((432, 472), 'pymongo.MongoClient', 'MongoClient', (['constants.mongo_conn_string'], {}), '(constants.mongo_conn_string)\n', (443, 472), False, 'from pymongo import MongoClient\n'), ((639, 668), 'spacy.load', 'spacy.load', (['"""lt_core_news_lg"""'], {}), "('lt_core_news_lg')\n", (649, 668), False, 'import spacy\n'), ... |
import torch
import torch.nn as nn
import torchvision
import torchvision.transforms as transforms
import argparse, time, sys, os, cv2
import numpy as np
from dataloader import AlzhDataset
import tensorboard_logger as tb_logger
from PIL import Image
from utils import AverageMeter, accuracy, adjust_learning_rate
from net... | [
"torch.nn.CrossEntropyLoss",
"sklearn.metrics.auc",
"utils.adjust_learning_rate",
"sklearn.metrics.precision_score",
"sklearn.metrics.recall_score",
"torch.cuda.is_available",
"sklearn.metrics.roc_curve",
"os.listdir",
"argparse.ArgumentParser",
"os.path.isdir",
"network.custom.Linear_cls",
"t... | [((649, 697), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""argument for training"""'], {}), "('argument for training')\n", (672, 697), False, 'import argparse, time, sys, os, cv2\n'), ((3015, 3123), 'torch.utils.data.DataLoader', 'torch.utils.data.DataLoader', (['train_dataset', 'opt.batch_size'], {'num_... |
import os
import sys
lib_path = os.path.join(os.path.dirname(__file__))
if lib_path not in sys.path:
sys.path.insert(0, lib_path)
| [
"os.path.dirname",
"sys.path.insert"
] | [((46, 71), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (61, 71), False, 'import os\n'), ((106, 134), 'sys.path.insert', 'sys.path.insert', (['(0)', 'lib_path'], {}), '(0, lib_path)\n', (121, 134), False, 'import sys\n')] |
"""
Debris Module - adapted from JDH Consulting and Martin's work
- An instance of Debris class represents a debris item
- generate sources of debris.
- generate debris items from those sources.
- track items and sample target collisions.
- handle collisions (impact)
"""
import logging
import nump... | [
"logging.getLogger",
"vaws.model.stats.sample_lognormal",
"math.sqrt",
"shapely.geometry.Point",
"math.radians",
"shapely.geometry.LineString"
] | [((3153, 3201), 'shapely.geometry.LineString', 'geometry.LineString', (['[self.source, self.landing]'], {}), '([self.source, self.landing])\n', (3172, 3201), False, 'from shapely import geometry\n'), ((7880, 7942), 'math.sqrt', 'math.sqrt', (['(RHO_AIR * self.cdav * self.frontal_area / self.mass)'], {}), '(RHO_AIR * se... |
"""
Sets ligth-related constants
"""
import yaml
import numpy as np
LUT_VOX_DIV = np.zeros(0)
N_OP_CHANNEL = 0
LIGHT_SIMULATED = True
OP_CHANNEL_EFFICIENCY = np.zeros(0)
#: Prescale factor analogous to ScintPreScale in LArSoft FIXME
SCINT_PRESCALE = 1
#: Ion + excitation work function in `MeV`
W_PH = 19.5e-6 # MeV
de... | [
"numpy.array",
"numpy.zeros",
"yaml.load"
] | [((83, 94), 'numpy.zeros', 'np.zeros', (['(0)'], {}), '(0)\n', (91, 94), True, 'import numpy as np\n'), ((159, 170), 'numpy.zeros', 'np.zeros', (['(0)'], {}), '(0)\n', (167, 170), True, 'import numpy as np\n'), ((729, 766), 'yaml.load', 'yaml.load', (['df'], {'Loader': 'yaml.FullLoader'}), '(df, Loader=yaml.FullLoader)... |
# -*- coding: utf-8 -*-
#%% Imports
import os
from qcodes import Instrument
from instrumentserver.client import Client
from instrumentserver.serialize import saveParamsToFile
from instrumentserver.client import ProxyInstrument
#%% Create all my instruments
Instrument.close_all()
ins_cli = Client()
dummy_vna = ins_c... | [
"os.path.abspath",
"instrumentserver.client.Client",
"qcodes.Instrument.close_all"
] | [((261, 283), 'qcodes.Instrument.close_all', 'Instrument.close_all', ([], {}), '()\n', (281, 283), False, 'from qcodes import Instrument\n'), ((294, 302), 'instrumentserver.client.Client', 'Client', ([], {}), '()\n', (300, 302), False, 'from instrumentserver.client import Client\n'), ((726, 762), 'os.path.abspath', 'os... |
import numpy as np
import random
import cv2
import os
def Draw(image, result):
# output 저장을 위한 경로 설정
output_path = os.path.dirname(image) + "/ocred_" + os.path.basename(image)
# Draw TextBox with opencv
img = cv2.imread(image)
np.random.seed(42)
COLORS = np.random.randint(0, 255, size=(255,... | [
"cv2.rectangle",
"cv2.imwrite",
"os.path.dirname",
"numpy.random.randint",
"os.path.basename",
"numpy.random.seed",
"cv2.imread",
"random.randint"
] | [((230, 247), 'cv2.imread', 'cv2.imread', (['image'], {}), '(image)\n', (240, 247), False, 'import cv2\n'), ((252, 270), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (266, 270), True, 'import numpy as np\n'), ((284, 339), 'numpy.random.randint', 'np.random.randint', (['(0)', '(255)'], {'size': '(255... |
import matplotlib.pyplot as plt
import numpy as np
import json
if __name__ == '__main__':
x = np.arange(100)
y = x*x
z = x*x + 10*x
with open("example.json") as json_file:
s = json.load(json_file)
plt.rcParams.update(s)
plt.plot(x,y,label='Y=x*x');
plt.plot(x,z,label='Y=x*x+10*x');
plt.title('Nice JSON... | [
"matplotlib.pyplot.savefig",
"numpy.arange",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.rcParams.update",
"json.load",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend"
] | [((98, 112), 'numpy.arange', 'np.arange', (['(100)'], {}), '(100)\n', (107, 112), True, 'import numpy as np\n'), ((210, 232), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (['s'], {}), '(s)\n', (229, 232), True, 'import matplotlib.pyplot as plt\n'), ((235, 264), 'matplotlib.pyplot.plot', 'plt.plot', (['x'... |
import datetime
import scrapy
from enum import Enum
import re
PageType = Enum('PageType', 'links article datatable')
class CNNSpider(scrapy.Spider):
name = "cnn_spider"
allowed_domains = ['cnn.com']
start_urls = [
'https://www.cnn.com/business'
# 'https://www... | [
"datetime.datetime.now",
"re.findall",
"enum.Enum"
] | [((81, 124), 'enum.Enum', 'Enum', (['"""PageType"""', '"""links article datatable"""'], {}), "('PageType', 'links article datatable')\n", (85, 124), False, 'from enum import Enum\n'), ((3491, 3514), 're.findall', 're.findall', (['"""\\\\w"""', 'item'], {}), "('\\\\w', item)\n", (3501, 3514), False, 'import re\n'), ((16... |
''' Cado Response API Integration for the Cortex XSOAR Platform '''
import time
import traceback
from typing import Any, Dict, Optional
from CommonServerPython import *
from CommonServerUserPython import *
import demistomock as demisto
import requests
''' Module Level Declarations '''
requests.packages.urllib3.... | [
"demistomock.params",
"demistomock.command",
"traceback.format_exc",
"requests.packages.urllib3.disable_warnings",
"demistomock.args",
"time.time"
] | [((294, 338), 'requests.packages.urllib3.disable_warnings', 'requests.packages.urllib3.disable_warnings', ([], {}), '()\n', (336, 338), False, 'import requests\n'), ((15699, 15716), 'demistomock.command', 'demisto.command', ([], {}), '()\n', (15714, 15716), True, 'import demistomock as demisto\n'), ((15744, 15758), 'de... |
'''
Created on 6 jan. 2013
@author: Juice
'''
from PySide import QtGui, QtCore
from math import *
def centerTextItem(text):
form = QtGui.QTextBlockFormat()
form.setAlignment(QtCore.Qt.AlignCenter)
cursor = text.textCursor()
cursor.select(QtGui.QTextCursor.Document)
cursor.mergeBlockFormat(form)
... | [
"PySide.QtGui.QTextBlockFormat",
"PySide.QtCore.QPoint",
"PySide.QtGui.QFont",
"PySide.QtGui.QPolygon",
"PySide.QtGui.QPen",
"PySide.QtGui.QGraphicsRectItem.mousePressEvent",
"PySide.QtCore.QRect"
] | [((138, 162), 'PySide.QtGui.QTextBlockFormat', 'QtGui.QTextBlockFormat', ([], {}), '()\n', (160, 162), False, 'from PySide import QtGui, QtCore\n'), ((1550, 1602), 'PySide.QtGui.QGraphicsRectItem.mousePressEvent', 'QtGui.QGraphicsRectItem.mousePressEvent', (['self', 'event'], {}), '(self, event)\n', (1589, 1602), False... |
from docx import Document
document = Document()
paragraph = document.add_paragraph('Lorem ipsum dolor sit amet.')
document.save('test.docx')
| [
"docx.Document"
] | [((38, 48), 'docx.Document', 'Document', ([], {}), '()\n', (46, 48), False, 'from docx import Document\n')] |
import argparse
import json
from ..config import LSSTConfig
from eliot import start_action
def parse_args(cfg=LSSTConfig(),
desc="Get list of Lab Images for display or prepulling",
component="scanner"):
'''Parse command-line arguments.
'''
with start_action(action_type="parse... | [
"json.loads",
"eliot.start_action",
"argparse.ArgumentParser"
] | [((289, 327), 'eliot.start_action', 'start_action', ([], {'action_type': '"""parse_args"""'}), "(action_type='parse_args')\n", (301, 327), False, 'from eliot import start_action\n'), ((346, 387), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'desc'}), '(description=desc)\n', (369, 387), Fal... |
# -*- coding: utf-8 -*-
from collections import OrderedDict
# from worst to most certain benign
ACMG_MAP = OrderedDict([
(4, 'pathogenic'),
(3, 'likely_pathogenic'),
(0, 'uncertain_significance'),
(2, 'likely_benign'),
(1, 'benign'),
])
REV_ACMG_MAP = OrderedDict([(value, key) for key, value in AC... | [
"collections.OrderedDict"
] | [((108, 238), 'collections.OrderedDict', 'OrderedDict', (["[(4, 'pathogenic'), (3, 'likely_pathogenic'), (0, 'uncertain_significance'),\n (2, 'likely_benign'), (1, 'benign')]"], {}), "([(4, 'pathogenic'), (3, 'likely_pathogenic'), (0,\n 'uncertain_significance'), (2, 'likely_benign'), (1, 'benign')])\n", (119, 23... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-10-31 15:58
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('catalogue', '0010_product_conf'),
]
operations = [
migrations.AddField(
... | [
"django.db.models.BooleanField"
] | [((397, 431), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)'}), '(default=False)\n', (416, 431), False, 'from django.db import migrations, models\n')] |
#!/usr/bin/python3
"""
This file will replace the real elf with PyActor to extract features
"""
import os
import shutil
import shlex
import subprocess as sp
import LitDriver as drv
import ServiceLib as sv
import multiprocessing
import fileinput
class Singleton(type):
_instances = {}
def __call__(cls, *args, **... | [
"os.path.exists",
"LitDriver.LitRunner",
"ServiceLib.PassSetService",
"os.getenv",
"shutil.move",
"shutil.copy2",
"os.path.join",
"multiprocessing.cpu_count",
"os.getcwd",
"os.chdir",
"os.path.dirname",
"shutil.rmtree",
"os.path.abspath",
"fileinput.input",
"os.walk",
"ServiceLib.LogSe... | [((679, 722), 'os.getenv', 'os.getenv', (['"""LLVM_THESIS_TestSuite"""', '"""Error"""'], {}), "('LLVM_THESIS_TestSuite', 'Error')\n", (688, 722), False, 'import os\n'), ((2418, 2433), 'ServiceLib.LogService', 'sv.LogService', ([], {}), '()\n', (2431, 2433), True, 'import ServiceLib as sv\n'), ((2452, 2467), 'LitDriver.... |
from get_dane import get_dane
from pprint import pprint
import math
class Wojewodztwo():
def __init__(self, nazwa, k2013, m2013, k2014, m2014):
self.nazwa = nazwa # np.: `w01D`
self.numer = nazwa[1:3]
self.region = nazwa[3:4]
self.k2013 = int(k2013)
self.m2013 = int(m2013)
... | [
"get_dane.get_dane",
"pprint.pprint",
"argparse.ArgumentParser",
"math.floor"
] | [((2537, 2548), 'pprint.pprint', 'pprint', (['odp'], {}), '(odp)\n', (2543, 2548), False, 'from pprint import pprint\n'), ((3850, 3951), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Zadanie 5 z informatyki arkusz 2015. Podpunkty od 1 do 3."""'}), "(description=\n 'Zadanie 5 z inform... |
from bokeh.io import show
from bokeh.models import CheckboxButtonGroup, CustomJS
LABELS = ["Option 1", "Option 2", "Option 3"]
checkbox_button_group = CheckboxButtonGroup(labels=LABELS, active=[0, 1])
checkbox_button_group.js_on_event("button_click", CustomJS(args=dict(btn=checkbox_button_group), code="""
console... | [
"bokeh.io.show",
"bokeh.models.CheckboxButtonGroup"
] | [((153, 202), 'bokeh.models.CheckboxButtonGroup', 'CheckboxButtonGroup', ([], {'labels': 'LABELS', 'active': '[0, 1]'}), '(labels=LABELS, active=[0, 1])\n', (172, 202), False, 'from bokeh.models import CheckboxButtonGroup, CustomJS\n'), ((396, 423), 'bokeh.io.show', 'show', (['checkbox_button_group'], {}), '(checkbox_b... |
import ROOT as root
import numpy as np
import uncertainties.unumpy as unp
from uncertainties import ufloat
from uncertainties.unumpy import nominal_values as noms
from uncertainties.unumpy import std_devs as stds
from array import array
import sys
############### Readout command line argument
try:
name_of_folder ... | [
"numpy.mean",
"sys.path.insert",
"ROOT.gStyle.SetStatFontSize",
"array.array",
"ROOT.TCanvas",
"ROOT.gStyle.SetLabelSize",
"ROOT.TLegend",
"ROOT.gStyle.SetOptTitle",
"ROOT.gStyle.SetTitleOffset",
"numpy.array",
"uncertainties.unumpy.nominal_values",
"uncertainties.unumpy.std_devs",
"ROOT.gSt... | [((511, 558), 'sys.path.insert', 'sys.path.insert', (['(0)', "('./' + name_of_folder + '/')"], {}), "(0, './' + name_of_folder + '/')\n", (526, 558), False, 'import sys\n'), ((771, 797), 'ROOT.gStyle.SetOptTitle', 'root.gStyle.SetOptTitle', (['(0)'], {}), '(0)\n', (794, 797), True, 'import ROOT as root\n'), ((798, 822)... |
from codecs import open
import os
from setuptools import setup
from ricoh_ldap_sync import __VERSION__
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.md'), 'r') as infile:
long_description = infile.read()
setup(
name='ricoh-ldap-sync',
version=__VERSION__,
pack... | [
"os.path.join",
"os.path.dirname",
"setuptools.setup"
] | [((252, 1195), 'setuptools.setup', 'setup', ([], {'name': '"""ricoh-ldap-sync"""', 'version': '__VERSION__', 'packages': "['ricoh_ldap_sync']", 'url': '"""https://github.com/phistrom/ricoh-ldap-sync"""', 'license': '"""MIT"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'description': '"""For creating a... |
# -*- coding:utf-8 -*-
import cv2
import os
import sys
import re
import xml.etree.ElementTree as ET
from PIL import Image
imgreadpath = 'E:\\Users\\yolov5-develop\\VOCData_EL\\JPEGImages\\' # 原始jpg存放的文件夹
imgwritepath = 'E:\\Users\\yolov5-develop\\VOCData_EL\\JPEGImages_flip\\' # 水平翻转后的jpg保存文件夹
xmlre... | [
"cv2.imwrite",
"os.listdir",
"cv2.flip",
"re.sub",
"xml.etree.ElementTree.fromstring",
"cv2.imread"
] | [((544, 563), 'cv2.imread', 'cv2.imread', (['imgname'], {}), '(imgname)\n', (554, 563), False, 'import cv2\n'), ((678, 696), 'cv2.flip', 'cv2.flip', (['image', '(1)'], {}), '(image, 1)\n', (686, 696), False, 'import cv2\n'), ((712, 767), 'cv2.imwrite', 'cv2.imwrite', (["(imgwritepath + 'f_' + id + '.jpg')", 'image_f'],... |
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under ... | [
"mock.Mock",
"apache.thermos.monitoring.resource.ResourceMonitorBase.ResourceResult",
"apache.thermos.config.schema.Resources",
"apache.thermos.monitoring.process.ProcessSample.empty"
] | [((910, 931), 'apache.thermos.monitoring.process.ProcessSample.empty', 'ProcessSample.empty', ([], {}), '()\n', (929, 931), False, 'from apache.thermos.monitoring.process import ProcessSample\n'), ((974, 1009), 'mock.Mock', 'mock.Mock', ([], {'spec': 'ResourceMonitorBase'}), '(spec=ResourceMonitorBase)\n', (983, 1009),... |
# -*- coding: utf-8 -*-
# pylint: disable=missing-docstring, invalid-name
##############################################################################
#
# Copyright (c) 2011, <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (... | [
"threading.Lock",
"time.sleep",
"ant.core.exceptions.MessageError",
"ant.core.message.Message.decode",
"threading.Thread",
"time.time"
] | [((3354, 3360), 'threading.Lock', 'Lock', ([], {}), '()\n', (3358, 3360), False, 'from threading import Lock, Thread\n'), ((3756, 3762), 'time.time', 'time', ([], {}), '()\n', (3760, 3762), False, 'from time import sleep, time\n'), ((4763, 4769), 'threading.Lock', 'Lock', ([], {}), '()\n', (4767, 4769), False, 'from th... |
from django.db.models import Max
from django.db.models.expressions import OuterRef, Subquery
from haystack import indexes
from djangocms_internalsearch.helpers import (
get_version_object,
get_versioning_extension,
)
class BaseSearchConfig(indexes.SearchIndex, indexes.Indexable):
"""
Base config cla... | [
"haystack.indexes.NgramField",
"djangocms_internalsearch.helpers.get_version_object",
"haystack.indexes.BooleanField",
"djangocms_internalsearch.helpers.get_versioning_extension",
"django.db.models.expressions.OuterRef",
"django.db.models.expressions.Subquery",
"haystack.indexes.CharField",
"django.db... | [((401, 453), 'haystack.indexes.CharField', 'indexes.CharField', ([], {'document': '(True)', 'use_template': '(False)'}), '(document=True, use_template=False)\n', (418, 453), False, 'from haystack import indexes\n'), ((471, 525), 'haystack.indexes.NgramField', 'indexes.NgramField', ([], {'document': '(False)', 'use_tem... |
"""
Note
----
'import pycaw.magic' must be generally at the topmost.
To be more specific:
It needs to be imported before any other pycaw or comtypes import.
Reserved Atrributes
-------------------
Note that certain methods and attributes are reserved for the magic module.
Please look into the source code of Magic... | [
"pycaw.magic.MagicApp",
"contextlib.suppress",
"time.sleep"
] | [((1339, 1478), 'pycaw.magic.MagicApp', 'MagicApp', (["{'msedge.exe'}"], {'volume_callback': 'handle_all', 'mute_callback': 'handle_all', 'state_callback': 'handle_all', 'session_callback': 'handle_all'}), "({'msedge.exe'}, volume_callback=handle_all, mute_callback=\n handle_all, state_callback=handle_all, session_c... |
import sys
sys.path.append('.')
from typing import TextIO
from ygo_core.enums.location import LocationEnum
locations = {
str(loc).replace('__', 'none').replace('.', '_').lower().replace('enum', ''):
str(loc).replace('LocationEnum.', '')
for loc in LocationEnum
}
def setup(file: TextIO) -> None:
file... | [
"sys.path.append"
] | [((11, 31), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (26, 31), False, 'import sys\n')] |
from taro.jobs import persistence
from taro.jobs.persistence import SortCriteria
from taroapp import ps, jfilter
from taroapp.jfilter import AllFilter
from taroapp.view import instance as view_inst
def run(args):
jobs = persistence.read_jobs(sort=SortCriteria[args.sort.upper()], asc=args.asc, limit=args.lines or ... | [
"taroapp.ps.print_table",
"taroapp.jfilter.create_id_filter",
"taroapp.jfilter.create_since_filter",
"taroapp.jfilter.create_until_filter",
"taroapp.jfilter.AllFilter"
] | [((598, 694), 'taroapp.ps.print_table', 'ps.print_table', (['filtered_jobs', 'columns', '_colours'], {'show_header': '(True)', 'pager': '(not args.no_pager)'}), '(filtered_jobs, columns, _colours, show_header=True, pager=\n not args.no_pager)\n', (612, 694), False, 'from taroapp import ps, jfilter\n'), ((738, 749), ... |
import torch as th
import math
import numpy as np
from video_loader import VideoLoader
from torch.utils.data import DataLoader
import argparse
from preprocessing import Preprocessing
from random_sequence_shuffler import RandomSequenceSampler
import torch.nn.functional as F
from tqdm import tqdm
import os
import clip
... | [
"os.path.exists",
"random_sequence_shuffler.RandomSequenceSampler",
"numpy.savez",
"torch.cuda.FloatTensor",
"argparse.ArgumentParser",
"preprocessing.Preprocessing",
"os.makedirs",
"tqdm.tqdm",
"video_loader.VideoLoader",
"os.path.isfile",
"os.path.dirname",
"torch.utils.data.DataLoader",
"... | [((329, 396), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Easy video feature extractor"""'}), "(description='Easy video feature extractor')\n", (352, 396), False, 'import argparse\n'), ((1414, 1606), 'video_loader.VideoLoader', 'VideoLoader', (['args.csv'], {'framerate': '(1 / args.cl... |
import os
import sys
import time
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = '1'
import pygame
from paint_station_config import Config
from paint_station_painting_layer import PaintingLayer
from paint_station_gui_layer import GuiLayer
from paint_station_brush import Brush
from paint_station_brush_dialog import BrushDial... | [
"pygame.init",
"pygame.quit",
"time.sleep",
"sys.exit",
"pygame.font.Font",
"pygame.event.peek",
"paint_station_confirm_dialog.ConfirmDialog",
"pygame.display.set_mode",
"pygame.display.flip",
"paint_station_config.Config",
"paint_station_print.Print",
"paint_station_painting_layer.PaintingLay... | [((520, 533), 'pygame.init', 'pygame.init', ([], {}), '()\n', (531, 533), False, 'import pygame\n'), ((557, 565), 'paint_station_config.Config', 'Config', ([], {}), '()\n', (563, 565), False, 'from paint_station_config import Config\n'), ((777, 871), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(self._confi... |
import pandas as pd
from utils import (
get_timestr,
get_fhi_datafile,
load_sources,
write_sources,
load_datafile,
write_datafile,
graphs
)
def update():
now = get_timestr()
# load current data
df = load_datafile("dead")
# get fhi datafile
datafile = get_fhi_datafile(... | [
"pandas.read_csv",
"utils.get_fhi_datafile",
"utils.load_sources",
"utils.write_datafile",
"utils.load_datafile",
"utils.write_sources",
"utils.get_timestr",
"utils.graphs.dead"
] | [((194, 207), 'utils.get_timestr', 'get_timestr', ([], {}), '()\n', (205, 207), False, 'from utils import get_timestr, get_fhi_datafile, load_sources, write_sources, load_datafile, write_datafile, graphs\n'), ((242, 263), 'utils.load_datafile', 'load_datafile', (['"""dead"""'], {}), "('dead')\n", (255, 263), False, 'fr... |
import numpy as np
import pandas as pd
from datetime import datetime
import json
from datetime import timedelta
# 获取日期在一年中的第几周
def get_week(date):
if pd.to_datetime(str(date.year)+"-01-01").weekday() == 0:
return int(datetime.strftime(date, "%W"))
else:
return int(datetime.strftime(date, "%W"))... | [
"datetime.datetime.strptime",
"datetime.datetime.strftime"
] | [((440, 497), 'datetime.datetime.strptime', 'datetime.strptime', (["(year + '-' + month + '-01')", '"""%Y-%m-%d"""'], {}), "(year + '-' + month + '-01', '%Y-%m-%d')\n", (457, 497), False, 'from datetime import datetime\n'), ((654, 711), 'datetime.datetime.strptime', 'datetime.strptime', (["(year + '-' + month + '-01')"... |
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c) 2020 <NAME>
# All rights reserved.
"""Widgets to interact with TPM FAPI objects."""
import gi # isort:skip
gi.require_version("Gtk", "3.0") # pylint: disable=wrong-import-position
# isort:imports-thirdparty
from gi.repository import Gtk
from .widgets impor... | [
"gi.repository.Gtk.TreeStore",
"gi.require_version",
"gi.repository.Gtk.Label",
"gi.repository.Gtk.CellRendererText",
"gi.repository.Gtk.TreePath.new_from_indices",
"gi.repository.Gtk.TreeViewColumn"
] | [((168, 200), 'gi.require_version', 'gi.require_version', (['"""Gtk"""', '"""3.0"""'], {}), "('Gtk', '3.0')\n", (186, 200), False, 'import gi\n'), ((770, 789), 'gi.repository.Gtk.Label', 'Gtk.Label', ([], {'xalign': '(0)'}), '(xalign=0)\n', (779, 789), False, 'from gi.repository import Gtk\n'), ((5720, 5743), 'gi.repos... |
from fastapi import APIRouter
router = APIRouter(prefix='/v1/statistics')
from . import views # noqa
| [
"fastapi.APIRouter"
] | [((40, 74), 'fastapi.APIRouter', 'APIRouter', ([], {'prefix': '"""/v1/statistics"""'}), "(prefix='/v1/statistics')\n", (49, 74), False, 'from fastapi import APIRouter\n')] |
from unittest import TestCase, mock
from unittest.mock import MagicMock, Mock, patch
from uuid import uuid4
from google.api_core.exceptions import DeadlineExceeded, ServiceUnavailable
from google.cloud.tasks_v2 import CreateTaskRequest
from google.cloud.tasks_v2.types.task import Task
from app.cloud_tasks import Clou... | [
"unittest.mock.Mock",
"unittest.mock.MagicMock",
"app.cloud_tasks.CloudTaskPublisher",
"uuid.uuid4",
"google.api_core.exceptions.DeadlineExceeded",
"google.cloud.tasks_v2.types.task.Task",
"google.api_core.exceptions.ServiceUnavailable"
] | [((620, 627), 'uuid.uuid4', 'uuid4', ([], {}), '()\n', (625, 627), False, 'from uuid import uuid4\n'), ((2221, 2232), 'unittest.mock.MagicMock', 'MagicMock', ([], {}), '()\n', (2230, 2232), False, 'from unittest.mock import MagicMock, Mock, patch\n'), ((2272, 2296), 'google.api_core.exceptions.DeadlineExceeded', 'Deadl... |
from unittest import TestCase
from pyfibre.tests.probe_classes.parsers import ProbeFileSet
class TestBaseFileSet(TestCase):
def setUp(self):
self.file_set = ProbeFileSet()
def test_file_set(self):
self.assertEqual(
"ProbeFileSet(prefix='/path/to/some/file')",
repr(se... | [
"pyfibre.tests.probe_classes.parsers.ProbeFileSet"
] | [((173, 187), 'pyfibre.tests.probe_classes.parsers.ProbeFileSet', 'ProbeFileSet', ([], {}), '()\n', (185, 187), False, 'from pyfibre.tests.probe_classes.parsers import ProbeFileSet\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Модуль для работы с датчиком расстояния Promobot по шине Modbus RTU."""
__author__ = "Promobot"
__license__ = "Apache License, Version 2.0"
__status__ = "Production"
__url__ = "https://git.promo-bot.ru"
__version__ = "0.1.0"
import serial
import modbus_tk
import mod... | [
"serial.Serial"
] | [((856, 992), 'serial.Serial', 'serial.Serial', ([], {'port': 'port', 'baudrate': 'baudrate', 'bytesize': '(8)', 'parity': '"""N"""', 'stopbits': '(1)', 'xonxoff': '(0)', 'rtscts': 'port_forward', 'dsrdtr': 'port_forward'}), "(port=port, baudrate=baudrate, bytesize=8, parity='N',\n stopbits=1, xonxoff=0, rtscts=port... |
#!/usr/bin/env python
# requires Python V2.7 or higher
from __future__ import print_function # PY3
import os,sys
try:
from setuptools import setup
except:
print('no setuptools found, trying distutils.core')
from distutils.core import setup # noqa
pver=sys.version[0]
prel=sys.version[2]
print('... | [
"os.path.dirname",
"distutils.core.setup"
] | [((543, 1848), 'distutils.core.setup', 'setup', ([], {'name': '"""adapya-entirex"""', 'version': '"""1.0.1"""', 'author': '"""mmueller"""', 'author_email': '"""<EMAIL>"""', 'description': '"""adapya-entirex - Persistent messaging with webMethods EntireX Broker"""', 'license': '"""Apache License 2.0"""', 'url': '"""http... |
"""
# Relative Path Markdown Extension
During the MkDocs build we rewrite URLs that link to local
Markdown or media files. Using the following pages configuration
we can look at how the output is changed.
pages:
- ['index.md']
- ['tutorial/install.md']
- ['tutorial/intro.md']
## Markdown URLs
When l... | [
"logging.getLogger",
"mkdocs.utils.urlunparse",
"mkdocs.utils.is_markdown_file",
"mkdocs.exceptions.MarkdownNotFound",
"mkdocs.utils.urlparse",
"mkdocs.utils.get_url_path",
"mkdocs.utils.create_relative_media_url"
] | [((1533, 1560), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1550, 1560), False, 'import logging\n'), ((1816, 1835), 'mkdocs.utils.urlparse', 'utils.urlparse', (['url'], {}), '(url)\n', (1830, 1835), False, 'from mkdocs import utils\n'), ((3496, 3523), 'mkdocs.utils.urlunparse', 'utils... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
from datetime import datetime
import time
import sqlite3 as sqlite
import psycopg2
SQLITE_ARCHIVE = "/var/lib/weewx/weewx.sdb"
PG_HOST = "some.host.tld"
PG_DB = "db_name"
PG_PORT = 5432
PG_USER = "username"
PG_PASS = "password"
## TESTING AREA
def main():
... | [
"psycopg2.connect",
"datetime.datetime.fromtimestamp",
"sqlite3.connect",
"sys.exit"
] | [((493, 504), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (501, 504), False, 'import sys\n'), ((586, 611), 'datetime.datetime.fromtimestamp', 'datetime.fromtimestamp', (['(0)'], {}), '(0)\n', (608, 611), False, 'from datetime import datetime\n'), ((1002, 1032), 'sqlite3.connect', 'sqlite.connect', (['SQLITE_ARCHIVE... |
import os
import sys
#import json
#import datetime
#import numpy as np
#import skimage.draw
# Root directory of the project
ROOT_DIR = os.path.abspath("../../")
# Import Mask RCNN
sys.path.append(ROOT_DIR) # To find local version of the library
from mrcnn.config import Config
from mrcnn import model as modellib, ut... | [
"tensorflow.graph_util.convert_variables_to_constants",
"mrcnn.model.MaskRCNN",
"argparse.ArgumentParser",
"tensorflow.keras.backend.get_session",
"tensorflow.python.framework.graph_io.write_graph",
"os.path.join",
"os.path.abspath",
"sys.path.append"
] | [((137, 162), 'os.path.abspath', 'os.path.abspath', (['"""../../"""'], {}), "('../../')\n", (152, 162), False, 'import os\n'), ((183, 208), 'sys.path.append', 'sys.path.append', (['ROOT_DIR'], {}), '(ROOT_DIR)\n', (198, 208), False, 'import sys\n'), ((643, 673), 'os.path.join', 'os.path.join', (['ROOT_DIR', '"""logs"""... |
from django.contrib import admin
from .models import *
#admin.site.unregister(User)
admin.site.register(User)
admin.site.register(University)
admin.site.register(Student)
admin.site.register(SubjectArea)
admin.site.register(Competency)
admin.site.register(UniversityProgram)
admin.site.register(Company)
admin.site.reg... | [
"django.contrib.admin.site.register"
] | [((86, 111), 'django.contrib.admin.site.register', 'admin.site.register', (['User'], {}), '(User)\n', (105, 111), False, 'from django.contrib import admin\n'), ((112, 143), 'django.contrib.admin.site.register', 'admin.site.register', (['University'], {}), '(University)\n', (131, 143), False, 'from django.contrib import... |
#!/usr/bin/env python
# -*- coding: latin-1 -*-
#
# Copyright 2016-2019 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | [
"rapidtide.tests.utils.get_test_temp_path",
"rapidtide.tests.utils.get_test_target_path",
"rapidtide.workflows.rapidtide2x.rapidtide_main",
"rapidtide.tests.utils.get_examples_path"
] | [((1772, 1816), 'rapidtide.workflows.rapidtide2x.rapidtide_main', 'rapidtide2x_workflow.rapidtide_main', (['theargs'], {}), '(theargs)\n', (1807, 1816), True, 'import rapidtide.workflows.rapidtide2x as rapidtide2x_workflow\n'), ((1193, 1213), 'rapidtide.tests.utils.get_test_temp_path', 'get_test_temp_path', ([], {}), '... |
"""
Name:
NameReplacer.py
Author:
Relic
Date:
12/17/2017
-----------------------------------------------------------------------------
Purpose:
Change Rocket League player names using rattletrap.
Default Behavior:
After loading the .REPLAY passe... | [
"ntpath.basename",
"os.path.join",
"os.path.split",
"os.getcwd",
"json.load",
"ntpath.split",
"json.dump"
] | [((814, 825), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (823, 825), False, 'import os, sys, json, subprocess, ntpath, operator, functools, copy, time\n'), ((1584, 1617), 'os.path.join', 'os.path.join', (['old_path', 'file_name'], {}), '(old_path, file_name)\n', (1596, 1617), False, 'import os, sys, json, subprocess, ... |
from model.contact import Contact
import re
from random import randrange
def test_contact_data_for_random_contact(app):
if app.contact.count() == 0:
app.contact.create(Contact(firstname="John", lastname="Connor", address=("%s, %s %s" % ("Los Angeles", str(randrange(1000)), "Nickel Road")), workphone="w4465... | [
"re.sub",
"random.randrange"
] | [((1185, 1208), 're.sub', 're.sub', (['"""[() -]"""', '""""""', 's'], {}), "('[() -]', '', s)\n", (1191, 1208), False, 'import re\n'), ((269, 284), 'random.randrange', 'randrange', (['(1000)'], {}), '(1000)\n', (278, 284), False, 'from random import randrange\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Reference: https://github.com/go2starr/py-flask-video-stream
'''
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
import os
import re
import json
import mimetypes
from flask import Response, render_t... | [
"flask.render_template",
"os.path.getsize",
"flask.Flask",
"re.match",
"tornado.ioloop.IOLoop.instance",
"mimetypes.guess_type",
"tornado.wsgi.WSGIContainer",
"flask.request.headers.get"
] | [((385, 400), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (390, 400), False, 'from flask import Flask\n'), ((547, 568), 'os.path.getsize', 'os.path.getsize', (['path'], {}), '(path)\n', (562, 568), False, 'import os\n'), ((1267, 1295), 'flask.request.headers.get', 'request.headers.get', (['"""Range"""']... |
from pathlib import Path
import os
from subprocess import run
#
colour_correction_types={'alt':'altitude_corrected', 'grey':'greyworld'} #
distortion_correction_types={'nd':'no_distortion', 'd':'distortion_correction'}
rescaling_types={'not_rescaled':'not_rescaled', 'rescaled':'rescaled', 'res_nn':'rescaled_nn', 'drop... | [
"os.path.exists",
"os.system",
"os.makedirs",
"pathlib.Path"
] | [((494, 547), 'pathlib.Path', 'Path', (['"""/home/jenny/Documents/FK2018/tunasand/05_dive"""'], {}), "('/home/jenny/Documents/FK2018/tunasand/05_dive')\n", (498, 547), False, 'from pathlib import Path\n'), ((1010, 1049), 'os.path.exists', 'os.path.exists', (['f"""./logs/{output_file}"""'], {}), "(f'./logs/{output_file}... |
#!/usr/bin/env python
import unittest
from hummingbot.client.config.security import Security
from hummingbot.client import settings
from hummingbot.client.config.global_config_map import global_config_map
from hummingbot.client.config.config_crypt import encrypt_n_save_config_value
import os
import shutil
import async... | [
"os.path.exists",
"hummingbot.client.config.security.Security.any_encryped_files",
"hummingbot.client.config.security.Security.wait_til_decryption_done",
"hummingbot.client.config.security.Security.all_decrypted_values",
"os.makedirs",
"hummingbot.client.config.security.Security.update_secure_config",
"... | [((559, 611), 'os.makedirs', 'os.makedirs', (['settings.CONF_FILE_PATH'], {'exist_ok': '(False)'}), '(settings.CONF_FILE_PATH, exist_ok=False)\n', (570, 611), False, 'import os\n'), ((645, 671), 'shutil.rmtree', 'shutil.rmtree', (['temp_folder'], {}), '(temp_folder)\n', (658, 671), False, 'import shutil\n'), ((938, 957... |
# Copyright 2017 ProjectQ-Framework (www.projectq.ch)
#
# 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 app... | [
"numpy.allclose",
"projectq.cengines.DecompositionRule",
"projectq.ops.Ph",
"projectq.ops.Ry",
"itertools.product",
"math.cos",
"cmath.exp",
"cmath.phase",
"projectq.meta.Control",
"math.sin",
"projectq.ops.Rz",
"projectq.meta.get_control_count"
] | [((2586, 2648), 'numpy.allclose', 'numpy.allclose', (['U', 'matrix'], {'rtol': '(10 * TOLERANCE)', 'atol': 'TOLERANCE'}), '(U, matrix, rtol=10 * TOLERANCE, atol=TOLERANCE)\n', (2600, 2648), False, 'import numpy\n'), ((8659, 8731), 'projectq.cengines.DecompositionRule', 'DecompositionRule', (['BasicGate', '_decompose_ar... |
# coding: utf-8
# author: xuxc
import os
import platform
import random
import sys
from PyQt5.QtCore import (
Qt,
QSettings,
QByteArray,
PYQT_VERSION_STR
)
from PyQt5.QtGui import (
QIcon,
QKeySequence,
QCloseEvent
)
from PyQt5.QtWidgets import (
QApplication,
QMainWindow,
QVBoxL... | [
"vtkmodules.vtkInteractionWidgets.vtkOrientationMarkerWidget",
"vtkmodules.vtkInteractionStyle.vtkInteractorStyleTrackballCamera",
"PyQt5.QtGui.QIcon",
"ui.CentralWidget.ColorPickerWidget",
"vtkmodules.vtkCommonCore.vtkPoints",
"PyQt5.QtWidgets.QApplication",
"PyQt5.QtWidgets.QVBoxLayout",
"vtkmodules... | [((16894, 16916), 'PyQt5.QtWidgets.QApplication', 'QApplication', (['sys.argv'], {}), '(sys.argv)\n', (16906, 16916), False, 'from PyQt5.QtWidgets import QApplication, QMainWindow, QVBoxLayout, QWidget, QFileDialog, QMessageBox, QAction, QTreeWidgetItem\n'), ((2508, 2527), 'ui.CentralWidget.CentralWidget', 'CentralWidg... |
import minifemlib
from minifemlib import Elements
import triangulation
from triangulation import Triangulation
import dmsh
import numpy as np
import matplotlib.pyplot as plt
from scipy.spatial import Delaunay
from scipy.sparse import csc_matrix, linalg as sla
import scipy.linalg
from matplotlib import rcParams
from mat... | [
"triangulation.Triangulation",
"scipy.sparse.linalg.splu",
"dmsh.Circle",
"numpy.ix_",
"matplotlib.animation.ArtistAnimation",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.dot",
"dmsh.generate",
"minifemlib.Elements",
"scipy.sparse.csc_matrix",
"matplotlib.pyplot.tripcolor",
"numpy.aran... | [((3475, 3497), 'dmsh.Circle', 'dmsh.Circle', (['[0, 0]', '(1)'], {}), '([0, 0], 1)\n', (3486, 3497), False, 'import dmsh\n'), ((3514, 3536), 'dmsh.generate', 'dmsh.generate', (['c', '(0.05)'], {}), '(c, 0.05)\n', (3527, 3536), False, 'import dmsh\n'), ((3539, 3567), 'triangulation.Triangulation', 'Triangulation', (['p... |
import abc
import json
import uuid
from threading import Thread
from pyre import Pyre, zhelper
import zmq
from config import *
from messaging.zmq_connection import setup_subscriber
TOPIC_GAZE_EXCHANGE = "gaze_exchange"
GROUP_GAZE_EXCHANGE = "GAZE_EXCHANGE"
STOP_MESSAGE = "$$STOP"
class AbstractRemoteGazePositionStr... | [
"pyre.zhelper.zthread_fork",
"messaging.zmq_connection.setup_subscriber",
"zmq.Poller",
"pyre.Pyre",
"threading.Thread",
"zmq.Context"
] | [((2117, 2169), 'messaging.zmq_connection.setup_subscriber', 'setup_subscriber', (['[TOPIC_GAZE_EXCHANGE]', 'NETWORK_IPS'], {}), '([TOPIC_GAZE_EXCHANGE], NETWORK_IPS)\n', (2133, 2169), False, 'from messaging.zmq_connection import setup_subscriber\n'), ((2214, 2265), 'threading.Thread', 'Thread', ([], {'target': 'self.u... |
import numpy as np
from patterns.pattern import Pattern
class ThreeBlackCrows(Pattern):
def __init__(self, data, lower_shadow_threshold: float = 0.5):
"""Constructor of ThreeBlackCrows class
Parameters
----------
data : pandas dataframe
A pandas dataframe, expected to... | [
"numpy.abs",
"numpy.logical_and"
] | [((1973, 2018), 'numpy.logical_and', 'np.logical_and', (['three_negative', 'lower_shadows'], {}), '(three_negative, lower_shadows)\n', (1987, 2018), True, 'import numpy as np\n'), ((1591, 1613), 'numpy.abs', 'np.abs', (['self.real_body'], {}), '(self.real_body)\n', (1597, 1613), True, 'import numpy as np\n')] |
"""
Shall help to run rclone setup
and put config file for pibackup in place
config file carries info to run backup system
if not present standard parameters shall be used
"""
from pkg_resources import resource_filename
import os
import subprocess
import pathlib
HOME_DIR = str(pathlib.Path.home()) + '/'
def config... | [
"os.path.exists",
"pathlib.Path.home",
"crontab.CronTab",
"pkg_resources.resource_filename",
"subprocess.call",
"os.path.abspath",
"os.system"
] | [((522, 568), 'pkg_resources.resource_filename', 'resource_filename', (['"""pibackup"""', '"""../lib/rclone"""'], {}), "('pibackup', '../lib/rclone')\n", (539, 568), False, 'from pkg_resources import resource_filename\n'), ((635, 672), 'os.system', 'os.system', (["(rclone_abspath + ' config')"], {}), "(rclone_abspath +... |
import numpy as np
def ornstein_uhlenbeck(input, theta=0.1, sigma=0.2):
"""Ornstein-Uhlembeck perturbation. Using Gaussian Wiener process."""
noise_perturb = -theta*input + sigma*np.random.normal()
return input + noise_perturb
noise = 0
for _ in range(20):
noise = ornstein_uhlenbeck(noise)
... | [
"numpy.random.normal"
] | [((192, 210), 'numpy.random.normal', 'np.random.normal', ([], {}), '()\n', (208, 210), True, 'import numpy as np\n')] |
import os
# face_data (directory) represents the path component to be joined.
FACE_DATA_PATH = os.path.join(os.getcwd(),'face_cluster')
ENCODINGS_PATH = os.path.join(os.getcwd(),'encodings.pickle')
CLUSTERING_RESULT_PATH = os.getcwd() | [
"os.getcwd"
] | [((231, 242), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (240, 242), False, 'import os\n'), ((114, 125), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (123, 125), False, 'import os\n'), ((173, 184), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (182, 184), False, 'import os\n')] |
#? import Adafruit_DHT
#? import RPi.GPIO as GPIO
from urllib import request
from time import sleep, strftime
from arkivist import Arkivist
def irrigation():
# get your api key first
# https://home.openweathermap.org/api_keys
key = "enter_your_api_key_here"
# find your coordinates
# https://www.la... | [
"time.sleep",
"urllib.request.urlopen",
"arkivist.Arkivist"
] | [((382, 406), 'arkivist.Arkivist', 'Arkivist', (['"""weather.json"""'], {}), "('weather.json')\n", (390, 406), False, 'from arkivist import Arkivist\n'), ((3171, 3193), 'time.sleep', 'sleep', (['irrigation_rest'], {}), '(irrigation_rest)\n', (3176, 3193), False, 'from time import sleep, strftime\n'), ((3358, 3378), 'ur... |
# -*- test-case-name: twisted.web.test.test_xmlrpc -*-
#
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
#
"""Test XML-RPC support."""
import xmlrpclib
from twisted.web2 import xmlrpc
from twisted.web2.xmlrpc import XMLRPC, addIntrospection
from twisted.internet import defer
from... | [
"twisted.web2.xmlrpc.addIntrospection",
"xmlrpclib.dumps",
"twisted.web2.xmlrpc.XMLRPC.getFunction",
"twisted.web2.xmlrpc.Fault",
"twisted.internet.defer.DeferredList",
"twisted.internet.defer.succeed"
] | [((1422, 1438), 'twisted.internet.defer.succeed', 'defer.succeed', (['x'], {}), '(x)\n', (1435, 1438), False, 'from twisted.internet import defer\n'), ((1698, 1723), 'twisted.web2.xmlrpc.Fault', 'xmlrpc.Fault', (['(12)', '"""hello"""'], {}), "(12, 'hello')\n", (1710, 1723), False, 'from twisted.web2 import xmlrpc\n'), ... |
# Copyright (C) 2020 NumS Development Team.
#
# 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 ... | [
"numpy.median",
"numpy.ones",
"nums.core.application_manager.instance",
"itertools.product",
"numpy.partition",
"numpy.array",
"numpy.quantile",
"numpy.percentile",
"numpy.cov",
"numpy.arange"
] | [((925, 939), 'numpy.ones', 'np.ones', (['(10,)'], {}), '((10,))\n', (932, 939), True, 'import numpy as np\n'), ((1032, 1078), 'itertools.product', 'itertools.product', (['qs', 'methods', 'interpolations'], {}), '(qs, methods, interpolations)\n', (1049, 1078), False, 'import itertools\n'), ((1384, 1420), 'numpy.array',... |
import sys,os,webbrowser
def find(name, path):
for root, dirs, files in os.walk(path):
if name in files:
return os.path.abspath(root+"/"+name)
path=find(sys.argv[1],"/home")
# 1 for display (text files) in terminal, 0 for open
if sys.argv[2] == '1':
os.system("cat "+path)
else:
webbrowser.o... | [
"os.path.abspath",
"os.system",
"webbrowser.open",
"os.walk"
] | [((76, 89), 'os.walk', 'os.walk', (['path'], {}), '(path)\n', (83, 89), False, 'import sys, os, webbrowser\n'), ((277, 301), 'os.system', 'os.system', (["('cat ' + path)"], {}), "('cat ' + path)\n", (286, 301), False, 'import sys, os, webbrowser\n'), ((308, 329), 'webbrowser.open', 'webbrowser.open', (['path'], {}), '(... |
import random
hard_consonants = ['б', 'в', 'г', 'д', 'ж', 'з', 'к', 'л', 'м', 'н', 'п', 'р', 'с', 'т', 'ф', 'х', 'ц', 'ш']
plural_exceptions = []
big_letter = ['А', 'Б', 'В', 'Г', 'Д', 'Е', 'Ё', 'Ж', 'З', 'И', 'Й', 'К', 'Л', 'М', 'Н', 'О', 'П', 'Р', 'С', 'Т', 'У', 'Ф', 'Х', 'Ц', 'Ч', 'Ш', 'Щ', 'Ъ', 'Ы', 'Ь', 'Э', 'Ю'... | [
"random.randint"
] | [((2343, 2369), 'random.randint', 'random.randint', (['(0)', 'max_idx'], {}), '(0, max_idx)\n', (2357, 2369), False, 'import random\n')] |
# -*- coding: utf-8 -*-
from django.db import models
from apps.subject.models import Course, Lecture, Professor
from apps.session.models import UserProfile
class Comment(models.Model):
course = models.ForeignKey(Course, db_index=True)
lecture = models.ForeignKey(Lecture, db_index=True)
comment = models.C... | [
"django.db.models.OneToOneField",
"django.db.models.FloatField",
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"apps.subject.models.Lecture.objects.filter",
"django.db.models.BooleanField",
"django.db.models.SmallIntegerField",
"django.db.models.DateTimeField",
"django.db.models.Ch... | [((200, 240), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Course'], {'db_index': '(True)'}), '(Course, db_index=True)\n', (217, 240), False, 'from django.db import models\n'), ((255, 296), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Lecture'], {'db_index': '(True)'}), '(Lecture, db_index=True)\n',... |
import hashlib
import json
from bottle import route, run, template, static_file, request
from jinja2 import Environment, FileSystemLoader, select_autoescape
from peewee import Model, TextField, CharField, DateTimeField, ForeignKeyField, SqliteDatabase
db = SqliteDatabase('pyhp.db')
db.connect()
class SessionStore(Mo... | [
"bottle.static_file",
"peewee.CharField",
"bottle.template.render",
"peewee.SqliteDatabase",
"bottle.route",
"jinja2.select_autoescape",
"jinja2.FileSystemLoader",
"bottle.run"
] | [((259, 284), 'peewee.SqliteDatabase', 'SqliteDatabase', (['"""pyhp.db"""'], {}), "('pyhp.db')\n", (273, 284), False, 'from peewee import Model, TextField, CharField, DateTimeField, ForeignKeyField, SqliteDatabase\n'), ((800, 828), 'bottle.route', 'route', (['"""/static/<path:path>"""'], {}), "('/static/<path:path>')\n... |
#!/usr/bin/python
import os
import pathlib
from cryptography.fernet import Fernet
# Global variables/Variáveis globais.
path_atual_dc = str(pathlib.Path(__file__).parent.absolute())
path_dc_final = path_atual_dc.replace('/etc','')
def decript_file(arquivo, chave=None):
"""
Decrypt a file/Desencriptografa ... | [
"os.rename",
"cryptography.fernet.Fernet",
"pathlib.Path"
] | [((715, 726), 'cryptography.fernet.Fernet', 'Fernet', (['key'], {}), '(key)\n', (721, 726), False, 'from cryptography.fernet import Fernet\n'), ((941, 970), 'os.rename', 'os.rename', (['arquivo', 'arquivo_f'], {}), '(arquivo, arquivo_f)\n', (950, 970), False, 'import os\n'), ((1191, 1202), 'cryptography.fernet.Fernet',... |
import nltk
nltk.download('stopwords')
from nltk.corpus import stopwords
from nltk.cluster.util import cosine_distance
import numpy as np
import networkx as nx
def read_article(filename):
f = open(filename, "r")
filedata = f.readlines()
article = filedata[0].split(". ")
sentences = []
for sentenc... | [
"nltk.corpus.stopwords.words",
"nltk.download",
"networkx.from_numpy_array",
"networkx.pagerank",
"nltk.cluster.util.cosine_distance"
] | [((12, 38), 'nltk.download', 'nltk.download', (['"""stopwords"""'], {}), "('stopwords')\n", (25, 38), False, 'import nltk\n'), ((1755, 1781), 'nltk.corpus.stopwords.words', 'stopwords.words', (['"""english"""'], {}), "('english')\n", (1770, 1781), False, 'from nltk.corpus import stopwords\n'), ((2005, 2052), 'networkx.... |
# -- coding: utf-8 --
# -- coding: utf-8 --
import tensorflow as tf
import numpy as np
import argparse
from model.hyparameter import parameter
import pandas as pd
class DataIterator():
def __init__(self,
site_id=0,
pollutant_id=4,
is_training=True,
... | [
"argparse.ArgumentParser",
"pandas.read_csv",
"tensorflow.Session",
"tensorflow.data.Dataset.from_generator",
"numpy.array",
"numpy.concatenate"
] | [((1590, 1647), 'numpy.concatenate', 'np.concatenate', (['[self.train_data, self.test_data]'], {'axis': '(0)'}), '([self.train_data, self.test_data], axis=0)\n', (1604, 1647), True, 'import numpy as np\n'), ((3958, 4048), 'tensorflow.data.Dataset.from_generator', 'tf.data.Dataset.from_generator', (['self.generator'], {... |
##########################
# Imports
##########################
import os
import shutil
from few_shots_clf.utils import get_labels_from_catalog
from tests import empty_dir
from tests import build_catalog
from tests import delete_catalog
from tests.test_utils import TEST_DIRECTORY_PATH
##########################
# ... | [
"tests.build_catalog",
"os.makedirs",
"tests.delete_catalog",
"os.path.join",
"few_shots_clf.utils.get_labels_from_catalog",
"tests.empty_dir",
"shutil.rmtree",
"os.remove"
] | [((428, 458), 'tests.empty_dir', 'empty_dir', (['TEST_DIRECTORY_PATH'], {}), '(TEST_DIRECTORY_PATH)\n', (437, 458), False, 'from tests import empty_dir\n'), ((502, 546), 'os.path.join', 'os.path.join', (['TEST_DIRECTORY_PATH', '"""catalog"""'], {}), "(TEST_DIRECTORY_PATH, 'catalog')\n", (514, 546), False, 'import os\n'... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | [
"pulumi.get",
"pulumi.getter",
"pulumi.set",
"warnings.warn",
"pulumi.log.warn",
"pulumi.ResourceOptions"
] | [((7388, 7416), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""ssoUrl"""'}), "(name='ssoUrl')\n", (7401, 7416), False, 'import pulumi\n'), ((7637, 7676), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""accountLinkAction"""'}), "(name='accountLinkAction')\n", (7650, 7676), False, 'import pulumi\n'), ((7977, 802... |
from django.db.models import Sum
from kolibri.content.models import ContentNode
from kolibri.content.models import LocalFile
from kolibri.content.utils.content_types_tools import renderable_contentnodes_q_filter
def get_files_to_transfer(channel_id, node_ids, exclude_node_ids, available, renderable_only=True):
f... | [
"kolibri.content.models.LocalFile.objects.filter",
"kolibri.content.models.ContentNode.objects.filter",
"django.db.models.Sum"
] | [((339, 431), 'kolibri.content.models.LocalFile.objects.filter', 'LocalFile.objects.filter', ([], {'files__contentnode__channel_id': 'channel_id', 'available': 'available'}), '(files__contentnode__channel_id=channel_id,\n available=available)\n', (363, 431), False, 'from kolibri.content.models import LocalFile\n'), ... |
from PyQt5.QtWidgets import *
from PyQt5 import QtCore, QtWidgets, QtGui
import BLL.ClientSocket
import BLL.FileSystem
# 登录界面
class LoginWin(QWidget):
def __init__(self):
super(LoginWin, self).__init__()
# 设置窗口背景颜色为白色
pe = QtGui.QPalette()
pe.setColor(pe.Background, QtGui.QColor(25... | [
"PyQt5.QtWidgets.QWidget",
"PyQt5.QtGui.QPalette",
"PyQt5.QtGui.QFont",
"PyQt5.QtGui.QColor",
"PyQt5.QtGui.QImage",
"PyQt5.QtGui.QCursor",
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtWidgets.QInputDialog.getText",
"PyQt5.QtCore.QSize"
] | [((253, 269), 'PyQt5.QtGui.QPalette', 'QtGui.QPalette', ([], {}), '()\n', (267, 269), False, 'from PyQt5 import QtCore, QtWidgets, QtGui\n'), ((912, 931), 'PyQt5.QtWidgets.QWidget', 'QtWidgets.QWidget', ([], {}), '()\n', (929, 931), False, 'from PyQt5 import QtCore, QtWidgets, QtGui\n'), ((1010, 1028), 'PyQt5.QtWidgets... |
"""Author: <NAME>, Copyright 2019"""
import tensorflow as tf
from mineral.algorithms.actors.actor_critic import ActorCritic
class ImportanceSampling(ActorCritic):
def __init__(
self,
policy,
old_policy,
critic,
old_update_every=1,
old_update_after=... | [
"tensorflow.reduce_mean",
"mineral.algorithms.actors.actor_critic.ActorCritic.__init__",
"tensorflow.reduce_min",
"tensorflow.reduce_max"
] | [((358, 410), 'mineral.algorithms.actors.actor_critic.ActorCritic.__init__', 'ActorCritic.__init__', (['self', 'policy', 'critic'], {}), '(self, policy, critic, **kwargs)\n', (378, 410), False, 'from mineral.algorithms.actors.actor_critic import ActorCritic\n'), ((1510, 1544), 'tensorflow.reduce_mean', 'tf.reduce_mean'... |
def celciusToFahrenheit(celcius: float, ndigits: int = 2)->float:
"""
Convert a given value from Celsius to Fahrenheit and round it to 2 decimal places.
Wikipedia reference: https://en.wikipedia.org/wiki/Celsius
Wikipedia reference: https://en.wikipedia.org/wiki/Fahrenheit
"""
return round((floa... | [
"doctest.testmod"
] | [((4676, 4693), 'doctest.testmod', 'doctest.testmod', ([], {}), '()\n', (4691, 4693), False, 'import doctest\n')] |
'''
JoinableQueue([maxsize]),这就像一个Queue对象,但队列允许项目的使用者通知生成者
项目已经被成功处理.通知进程是使用共享信号和条件变量来实现的.
'''
from multiprocessing import Process, JoinableQueue
import time
def producer(q, name):
for i in range(3):
res = 'baozi %s' % i
time.sleep(1)
print('%s producer %s' % (name, res))
q.put(re... | [
"multiprocessing.Process",
"multiprocessing.JoinableQueue",
"time.sleep"
] | [((611, 626), 'multiprocessing.JoinableQueue', 'JoinableQueue', ([], {}), '()\n', (624, 626), False, 'from multiprocessing import Process, JoinableQueue\n'), ((637, 677), 'multiprocessing.Process', 'Process', ([], {'target': 'producer', 'args': "(q, 'p1')"}), "(target=producer, args=(q, 'p1'))\n", (644, 677), False, 'f... |
from __future__ import absolute_import
import json
import os
import pytest
import requests
import time
from rancher_gen.compat import b64encode
@pytest.fixture(scope='session')
def stack_service(request):
host = os.getenv('RANCHER_HOST')
port = int(os.getenv('RANCHER_PORT', 80))
access_key = os.getenv('... | [
"requests.post",
"os.getenv",
"requests.get",
"time.sleep",
"os.path.dirname",
"pytest.fixture"
] | [((149, 180), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (163, 180), False, 'import pytest\n'), ((1822, 1854), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (1836, 1854), False, 'import pytest\n'), ((220, 245), 'os.getenv... |
from urllib.parse import urlencode
from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME
from security.forms.object_list import PRISON_SELECTOR_USER_PRISONS_CHOICE_VALUE
from security.utils import can_choose_prisons
def prison_choice_available(request):
return {
'prison_ch... | [
"urllib.parse.urlencode",
"security.utils.can_choose_prisons"
] | [((504, 577), 'urllib.parse.urlencode', 'urlencode', (["{'prison_selector': PRISON_SELECTOR_USER_PRISONS_CHOICE_VALUE}"], {}), "({'prison_selector': PRISON_SELECTOR_USER_PRISONS_CHOICE_VALUE})\n", (513, 577), False, 'from urllib.parse import urlencode\n'), ((385, 417), 'security.utils.can_choose_prisons', 'can_choose_p... |
import os
from pkg_resources import parse_version
from sys import version_info as py_version
from setuptools import setup, find_packages
from setuptools import __version__ as setuptools_version
HERE = os.path.abspath(os.path.dirname(__file__))
# retrieve package information
about = {}
with open(os.path.join(HERE, 'a... | [
"os.path.dirname",
"pkg_resources.parse_version",
"setuptools.find_packages",
"os.path.join"
] | [((219, 244), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (234, 244), False, 'import os\n'), ((299, 346), 'os.path.join', 'os.path.join', (['HERE', '"""autossl"""', '"""__version__.py"""'], {}), "(HERE, 'autossl', '__version__.py')\n", (311, 346), False, 'import os\n'), ((413, 445), 'os.pa... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2019-01-24 14:17
from __future__ import unicode_literals
import builtins
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('analytics', '0011_auto_20190123_1530'),
]
operations = [
mi... | [
"django.db.models.DateTimeField",
"django.db.migrations.RenameField",
"django.db.models.TextField",
"django.db.models.CharField"
] | [((318, 421), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name': '"""analyticsimporttask"""', 'old_name': '"""timestamp"""', 'new_name': '"""created"""'}), "(model_name='analyticsimporttask', old_name=\n 'timestamp', new_name='created')\n", (340, 421), False, 'from django.db import mig... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#
# Library to extract Exif information from digital camera image files.
# https://github.com/ianare/exif-py
#
#
# Copyright (c) 2002-2007 <NAME>
# Copyright (c) 2007-2014 <NAME> and contributors
# Copyright (c) 2020- Cyb3r Jak3
#
# See LICENSE.txt file for licensing ... | [
"exifreader.exif_log.setup_logger",
"argparse.ArgumentParser",
"timeit.default_timer",
"exifreader.process_file",
"sys.exit",
"exifreader.exif_log.get_logger"
] | [((612, 633), 'exifreader.exif_log.get_logger', 'exif_log.get_logger', ([], {}), '()\n', (631, 633), False, 'from exifreader import process_file, exif_log, __version__\n'), ((767, 778), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (775, 778), False, 'import sys\n'), ((857, 969), 'argparse.ArgumentParser', 'argparse.... |
import random
from NiaPy.benchmarks.utility import Utility
__all__ = ['HybridBatAlgorithm']
class HybridBatAlgorithm(object):
r"""Implementation of Hybrid bat algorithm.
**Algorithm:** Hybrid bat algorithm
**Date:** 2018
**Author:** <NAME>
**License:** MIT
**Reference paper:**
Fi... | [
"NiaPy.benchmarks.utility.Utility",
"random.random",
"random.uniform"
] | [((1147, 1156), 'NiaPy.benchmarks.utility.Utility', 'Utility', ([], {}), '()\n', (1154, 1156), False, 'from NiaPy.benchmarks.utility import Utility\n'), ((3018, 3038), 'random.uniform', 'random.uniform', (['(0)', '(1)'], {}), '(0, 1)\n', (3032, 3038), False, 'import random\n'), ((3774, 3794), 'random.uniform', 'random.... |
import base64
import time
import requests
import yaml
from sawtooth_sdk.protobuf import batch_pb2
from sawtooth_signing import ParseError, CryptoFactory, create_context
from sawtooth_signing.secp256k1 import Secp256k1PrivateKey
from cli.common.protobuf import payload_pb2
from cli.common import transaction, helper
fro... | [
"cli.common.helper.make_patient_list_address",
"requests.post",
"cli.common.transaction.add_lab_test",
"cli.common.protobuf.payload_pb2.CreatePatient",
"cli.common.transaction.create_patient",
"sawtooth_signing.create_context",
"cli.common.transaction.add_pulse",
"cli.common.transaction.create_doctor"... | [((1237, 1330), 'cli.common.transaction.create_clinic', 'transaction.create_clinic', ([], {'txn_signer': 'self._signer', 'batch_signer': 'self._signer', 'name': 'name'}), '(txn_signer=self._signer, batch_signer=self.\n _signer, name=name)\n', (1262, 1330), False, 'from cli.common import transaction, helper\n'), ((13... |
#
# Copyright 2010 <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
#
# Unless required by applicable law or agreed to in wr... | [
"gae2django.models.RegressionTestModel",
"gae2django.models.RefTestModel",
"gae2django.models.RegressionTestModel.all"
] | [((834, 860), 'gae2django.models.RegressionTestModel', 'TestModel', ([], {'key_name': '"""foo1"""'}), "(key_name='foo1')\n", (843, 860), True, 'from gae2django.models import RegressionTestModel as TestModel\n'), ((1040, 1052), 'gae2django.models.RefTestModel', 'TestModel2', ([], {}), '()\n', (1050, 1052), True, 'from g... |
import discord
from discord.ext import commands
from discord.utils import get
class c20(commands.Cog, name="c20"):
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.command(name='Varatora_Temporal_Justiciar', aliases=['c20','Temporal_11'])
async def example_embed(self, ctx):
... | [
"discord.Embed",
"discord.ext.commands.command"
] | [((188, 276), 'discord.ext.commands.command', 'commands.command', ([], {'name': '"""Varatora_Temporal_Justiciar"""', 'aliases': "['c20', 'Temporal_11']"}), "(name='Varatora_Temporal_Justiciar', aliases=['c20',\n 'Temporal_11'])\n", (204, 276), False, 'from discord.ext import commands\n'), ((328, 395), 'discord.Embed... |
# Copyright (C) 2015-2018 <NAME>
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
import os
import subprocess
from dammit.utils import which, doit_task
from dammit.tasks.utils import InstallationError
def check_parallel... | [
"dammit.tasks.utils.InstallationError",
"subprocess.check_output",
"dammit.utils.which"
] | [((350, 367), 'dammit.utils.which', 'which', (['"""parallel"""'], {}), "('parallel')\n", (355, 367), False, 'from dammit.utils import which, doit_task\n'), ((407, 447), 'dammit.tasks.utils.InstallationError', 'InstallationError', (['"""parallel not found."""'], {}), "('parallel not found.')\n", (424, 447), False, 'from... |
'''BernoulliNB gave slightly better results than MultinomialNB on just TF-IDF feature vector.'''
import numpy as np
#Load the binary files of sarcastic and non-sarcastic tweets
sarcasm=np.load("posproc.npy")
neutral=np.load("negproc.npy")
#Print sample data
print ("10 sample sarcastic lines:")
print (sarcasm[:10])
p... | [
"sklearn.metrics.f1_score",
"sklearn.model_selection.train_test_split",
"sklearn.svm.LinearSVC",
"sklearn.metrics.precision_score",
"sklearn.metrics.recall_score",
"numpy.array",
"sklearn.feature_extraction.text.TfidfVectorizer",
"numpy.concatenate",
"sklearn.preprocessing.FunctionTransformer",
"n... | [((187, 209), 'numpy.load', 'np.load', (['"""posproc.npy"""'], {}), "('posproc.npy')\n", (194, 209), True, 'import numpy as np\n'), ((218, 240), 'numpy.load', 'np.load', (['"""negproc.npy"""'], {}), "('negproc.npy')\n", (225, 240), True, 'import numpy as np\n'), ((2439, 2473), 'numpy.concatenate', 'np.concatenate', (['... |
import gzip
import struct
import os
import logging
import logging.handlers
import sys
import json
def getBootstraps(quantDir):
logging.basicConfig(level=logging.INFO)
bootstrapFile = os.path.sep.join([quantDir, "aux_info", "bootstrap", "bootstraps.gz"])
nameFile = os.path.sep.join([quantDir, "aux_info", "... | [
"logging.basicConfig",
"gzip.open",
"os.path.isfile",
"os.path.sep.join",
"sys.exit",
"json.load",
"struct.Struct",
"logging.info"
] | [((132, 171), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (151, 171), False, 'import logging\n'), ((193, 263), 'os.path.sep.join', 'os.path.sep.join', (["[quantDir, 'aux_info', 'bootstrap', 'bootstraps.gz']"], {}), "([quantDir, 'aux_info', 'bootstrap', 'boots... |
#!/usr/local/bin/python3
# -*- coding: utf-8 -*-
# filename: setup.py
import sys
from cx_Freeze import setup,Executable
build_options = {
'packages':['os','sys','numpy','ctypes','PyQt5'],
'includes':['ui2048'],
'include_files':['./build/lib/lib2048.so']
}
base = 'Win32GUI' if sys.pl... | [
"cx_Freeze.Executable"
] | [((517, 549), 'cx_Freeze.Executable', 'Executable', (['"""main.py"""'], {'base': 'base'}), "('main.py', base=base)\n", (527, 549), False, 'from cx_Freeze import setup, Executable\n')] |
from rec_to_nwb.processing.nwb.components.associated_files.fl_associated_file import FlAssociatedFile
class FlAssociatedFilesBuilder:
@staticmethod
def build(name, description, content, task_epochs):
return FlAssociatedFile(name, description, content, task_epochs)
| [
"rec_to_nwb.processing.nwb.components.associated_files.fl_associated_file.FlAssociatedFile"
] | [((226, 283), 'rec_to_nwb.processing.nwb.components.associated_files.fl_associated_file.FlAssociatedFile', 'FlAssociatedFile', (['name', 'description', 'content', 'task_epochs'], {}), '(name, description, content, task_epochs)\n', (242, 283), False, 'from rec_to_nwb.processing.nwb.components.associated_files.fl_associa... |
from matplotlib import pyplot as plt
import figlatex
import afterpulse_tile21
vov = 5.5
################
fig, axs = plt.subplots(1, 2, num='figctfitaplaser', clear=True, figsize=[9, 3.5], gridspec_kw=dict(width_ratios=[2, 1]))
ap21 = afterpulse_tile21.AfterPulseTile21(vov)
kw = dict(selection=False, overflow=True... | [
"afterpulse_tile21.AfterPulseTile21",
"matplotlib.pyplot.close",
"figlatex.save"
] | [((239, 278), 'afterpulse_tile21.AfterPulseTile21', 'afterpulse_tile21.AfterPulseTile21', (['vov'], {}), '(vov)\n', (273, 278), False, 'import afterpulse_tile21\n'), ((455, 470), 'matplotlib.pyplot.close', 'plt.close', (['fig1'], {}), '(fig1)\n', (464, 470), True, 'from matplotlib import pyplot as plt\n'), ((625, 640),... |
import sys
from bs4 import BeautifulSoup
import os
def list_html_files(path_html):
abs_path= os.path.abspath(path_html)
html_files= os.listdir(path_html)
html_files= [os.path.join(abs_path, x) for x in html_files if x.endswith('.html')]
return html_files
def get_name(html_file):
name_view= html_f... | [
"os.listdir",
"os.path.join",
"os.path.split",
"bs4.BeautifulSoup",
"os.path.abspath"
] | [((99, 125), 'os.path.abspath', 'os.path.abspath', (['path_html'], {}), '(path_html)\n', (114, 125), False, 'import os\n'), ((142, 163), 'os.listdir', 'os.listdir', (['path_html'], {}), '(path_html)\n', (152, 163), False, 'import os\n'), ((181, 206), 'os.path.join', 'os.path.join', (['abs_path', 'x'], {}), '(abs_path, ... |
from enn import *
import numpy as np
from grid_LSTM import netLSTM, netLSTM_full
from grid_data_v2 import TextDataset
import grid_data_v2 as grid_data
from grid_configuration import config
from util import Record, save_var, get_file_list, Regeneralize, list_to_csv
from torch.autograd import Variable
from torch.utils.da... | [
"grid_LSTM.netLSTM",
"util.Record",
"torch.nn.MSELoss",
"numpy.array",
"grid_LSTM.netLSTM_full",
"torch.random.manual_seed",
"os.path.exists",
"matplotlib.pyplot.plot",
"pandas.DataFrame.from_dict",
"numpy.random.seed",
"os.mkdir",
"util.get_file_list",
"matplotlib.pyplot.ion",
"numpy.shap... | [((442, 451), 'matplotlib.pyplot.ion', 'plt.ion', ([], {}), '()\n', (449, 451), True, 'import matplotlib.pyplot as plt\n'), ((472, 502), 'torch.random.manual_seed', 'torch.random.manual_seed', (['seed'], {}), '(seed)\n', (496, 502), False, 'import torch\n'), ((503, 523), 'numpy.random.seed', 'np.random.seed', (['seed']... |
# Generated by Django 2.1.4 on 2018-12-17 23:11
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
dependencies = [
('subscribers', '0004_subscriptionrequest_token'),
]
operations = [
migrations.AlterField(
model_name='subscriptionreq... | [
"django.db.models.CharField"
] | [((371, 448), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'default': 'uuid.uuid4', 'max_length': '(100)', 'unique': '(True)'}), '(blank=True, default=uuid.uuid4, max_length=100, unique=True)\n', (387, 448), False, 'from django.db import migrations, models\n')] |
# Author: <NAME>
# Created: 2021-07-17
# Copyright (C) 2021, <NAME>
# License: MIT
# Handle image bands
from PIL import Image
# Find the bands of the boats image
image = Image.open("boat-small.jpg")
bands = image.getbands()
print(bands) # ('R', 'G', 'B')
# Get the R, G and B channels as separate greyscale images
#... | [
"PIL.Image.new",
"PIL.Image.open",
"PIL.Image.merge"
] | [((174, 202), 'PIL.Image.open', 'Image.open', (['"""boat-small.jpg"""'], {}), "('boat-small.jpg')\n", (184, 202), False, 'from PIL import Image\n'), ((860, 916), 'PIL.Image.merge', 'Image.merge', (['"""RGB"""', '[red_image, green_image, blue_image]'], {}), "('RGB', [red_image, green_image, blue_image])\n", (871, 916), ... |
# Generated by Django 3.1.1 on 2020-11-26 07:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main_store', '0007_auto_20201126_1230'),
]
operations = [
migrations.AlterField(
model_name='order',
name='status',
... | [
"django.db.models.IntegerField"
] | [((338, 368), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'null': '(True)'}), '(null=True)\n', (357, 368), False, 'from django.db import migrations, models\n')] |
#!/usr/bin/env python
from urllib2 import urlopen
from sys import argv
if __name__ == '__main__':
n_iter = 1
if len(argv) > 1:
n_iter = int(argv[1])
for i in range(0,n_iter):
for j in range(1,11):
f = urlopen('http://localhost:1234/stuff/stuff%d.html' % j)
f.read()
| [
"urllib2.urlopen"
] | [((213, 268), 'urllib2.urlopen', 'urlopen', (["('http://localhost:1234/stuff/stuff%d.html' % j)"], {}), "('http://localhost:1234/stuff/stuff%d.html' % j)\n", (220, 268), False, 'from urllib2 import urlopen\n')] |
# BST -- AVL Tree
import sys, os
sys.path.append(os.path.dirname(sys.path[0]))
from computGeometry import planeSweepMeshes
class new_node:
def __init__(self,key):
self.key=key
self.parent=None
self.left=None
self.right=None
self.height=0
self.skew=0
def __st... | [
"os.path.dirname",
"computGeometry.planeSweepMeshes.myOrder"
] | [((49, 77), 'os.path.dirname', 'os.path.dirname', (['sys.path[0]'], {}), '(sys.path[0])\n', (64, 77), False, 'import sys, os\n'), ((3220, 3264), 'computGeometry.planeSweepMeshes.myOrder', 'planeSweepMeshes.myOrder', (['node.key', 'k', 'point'], {}), '(node.key, k, point)\n', (3244, 3264), False, 'from computGeometry im... |
# Copyright 2014 Intel Corporation, 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 require... | [
"vsmclient.base.getid",
"urllib.urlencode"
] | [((2526, 2541), 'vsmclient.base.getid', 'base.getid', (['mds'], {}), '(mds)\n', (2536, 2541), False, 'from vsmclient import base\n'), ((1629, 1654), 'urllib.urlencode', 'urllib.urlencode', (['qparams'], {}), '(qparams)\n', (1645, 1654), False, 'import urllib\n'), ((2059, 2074), 'vsmclient.base.getid', 'base.getid', (['... |