code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Written by <NAME>.
MIT Licensed.
Contact at www.sinclair.bio
Development script to test some of the functionality in `pbs3`.
Typically you would run this file from a command line like this:
ipython3 -i -- ~/deploy/pbs3/tests/test_dev.py
"""
# Internal modules... | [
"sh.barrnap",
"pbs3.ls",
"sh.ls"
] | [((559, 582), 'sh.barrnap', 'sh.barrnap', (['"""--version"""'], {}), "('--version')\n", (569, 582), False, 'import sh\n'), ((454, 470), 'pbs3.ls', 'pbs3.ls', (['"""-halt"""'], {}), "('-halt')\n", (461, 470), False, 'import pbs3\n'), ((499, 513), 'sh.ls', 'sh.ls', (['"""-halt"""'], {}), "('-halt')\n", (504, 513), False,... |
"""Test the Z-Wave JS siren platform."""
from zwave_js_server.event import Event
from homeassistant.components.siren import ATTR_TONE, ATTR_VOLUME_LEVEL
from homeassistant.const import STATE_OFF, STATE_ON
SIREN_ENTITY = "siren.indoor_siren_6_2"
TONE_ID_VALUE_ID = {
"endpoint": 2,
"commandClass": 121,
"co... | [
"zwave_js_server.event.Event"
] | [((3786, 4063), 'zwave_js_server.event.Event', 'Event', ([], {'type': '"""value updated"""', 'data': "{'source': 'node', 'event': 'value updated', 'nodeId': node.node_id, 'args':\n {'commandClassName': 'Sound Switch', 'commandClass': 121, 'endpoint': 2,\n 'property': 'toneId', 'newValue': 255, 'prevValue': 0, 'pr... |
#importing all dependencies
from time import time
import time
from data import *
from funcs import *
from stats import *
from selenium import webdriver
TIME = 2
PATH = r"C:\Program Files (x86)\chromedriver_win32\chromedriver.exe" ... | [
"selenium.webdriver.Chrome",
"time.sleep"
] | [((364, 386), 'selenium.webdriver.Chrome', 'webdriver.Chrome', (['PATH'], {}), '(PATH)\n', (380, 386), False, 'from selenium import webdriver\n'), ((2308, 2324), 'time.sleep', 'time.sleep', (['TIME'], {}), '(TIME)\n', (2318, 2324), False, 'import time\n')] |
from . import api
from flask import render_template
@api.route('/', methods=['GET'])
def index():
# example of a route with HTML templating
message = "Hello, World"
entries = []
entries.append({"title":"entry 1", "text":"text 1 ?</>"})
entries.append({"title":"entry 2", "text":"text 2 ?</>"})
r... | [
"flask.render_template"
] | [((326, 389), 'flask.render_template', 'render_template', (['"""index.html"""'], {'message': 'message', 'entries': 'entries'}), "('index.html', message=message, entries=entries)\n", (341, 389), False, 'from flask import render_template\n')] |
"""Evaluation measures at the level of document orderings."""
from repro_eval.config import TRIM_THRESH, PHI
from scipy.stats.stats import kendalltau
from tqdm import tqdm
from repro_eval.measure.external.rbo import rbo
from repro_eval.util import break_ties
def _rbo(run, ideal, p, depth):
# Implementation taken... | [
"repro_eval.util.break_ties",
"scipy.stats.stats.kendalltau"
] | [((2647, 2667), 'repro_eval.util.break_ties', 'break_ties', (['orig_run'], {}), '(orig_run)\n', (2657, 2667), False, 'from repro_eval.util import break_ties\n'), ((2682, 2701), 'repro_eval.util.break_ties', 'break_ties', (['rep_run'], {}), '(rep_run)\n', (2692, 2701), False, 'from repro_eval.util import break_ties\n'),... |
import pytest
from dagster import check
from dagster.core.code_pointer import ModuleCodePointer
from dagster.core.definitions.reconstructable import ReconstructableRepository
from dagster.core.host_representation.origin import (
ExternalPipelineOrigin,
ExternalRepositoryOrigin,
InProcessRepositoryLocationOr... | [
"dagster.core.storage.pipeline_run.PipelineRun",
"dagster.core.code_pointer.ModuleCodePointer",
"pytest.raises"
] | [((810, 906), 'dagster.core.storage.pipeline_run.PipelineRun', 'PipelineRun', ([], {'status': 'PipelineRunStatus.QUEUED', 'external_pipeline_origin': 'fake_pipeline_origin'}), '(status=PipelineRunStatus.QUEUED, external_pipeline_origin=\n fake_pipeline_origin)\n', (821, 906), False, 'from dagster.core.storage.pipeli... |
""" Utilities not directly related to formulas or CNFs """
import logging
import math
import os
import re
import shutil
import subprocess
import tempfile
from typing import TYPE_CHECKING, Dict, Set, Tuple, Iterable
from dsharpy.preprocess import preprocess_c_code
from pathlib import Path
from tempfile import NamedTem... | [
"logging.basicConfig",
"tempfile.TemporaryDirectory",
"dsharpy.preprocess.preprocess_c_code",
"re.compile",
"pathlib.Path",
"os.environ.copy",
"math.log",
"os.getcwd",
"shutil.copy",
"tempfile.NamedTemporaryFile",
"prettyprinter.install_extras",
"prettyprinter.pprint",
"logging.info",
"log... | [((368, 410), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.WARNING'}), '(level=logging.WARNING)\n', (387, 410), False, 'import logging\n'), ((462, 534), 'prettyprinter.install_extras', 'prettyprinter.install_extras', ([], {'exclude': "['ipython', 'ipython_repr_pretty']"}), "(exclude=['ipython',... |
'''
04 - Price of conventional vs. organic avocados:
Creating multiple plots for different subsets of data allows you to compare
groups. In this exercise, you'll create multiple histograms to compare the prices
of conventional and organic avocados.
matplotlib.pyplot has been imported as plt and pandas has been import... | [
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show"
] | [((1541, 1580), 'matplotlib.pyplot.legend', 'plt.legend', (["['conventional', 'organic']"], {}), "(['conventional', 'organic'])\n", (1551, 1580), True, 'import matplotlib.pyplot as plt\n'), ((1598, 1608), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (1606, 1608), True, 'import matplotlib.pyplot as plt\n')] |
# -*- coding: utf-8 -*-
import argparse, sys, json, time, random, pprint, base64, requests, hmac, hashlib, re
# named params
if not sys.argv[1].startswith('-') and not sys.argv[2].startswith('-'):
username = sys.argv[1]
password = sys.argv[2]
else:
parser=argparse.ArgumentParser()
parser.add_argument('-u', '--u... | [
"requests.post",
"argparse.ArgumentParser",
"base64.b64encode",
"json.dumps",
"requests.get",
"sys.exit",
"re.sub",
"time.time",
"random.randint"
] | [((263, 288), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (286, 288), False, 'import argparse, sys, json, time, random, pprint, base64, requests, hmac, hashlib, re\n'), ((1825, 1939), 'requests.post', 'requests.post', (["('https://%s-api.coolkit.cc:8080/api/user/login' % api_region)"], {'hea... |
import logging
import logging.config
from pycbc import client, token
from pycbc.config import load
log = logging.getLogger(__name__)
_AVAILABLE = b'iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQCAYAAAAiYZ4HAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAOhJREFUKJHNkMFNw0AURN//u6QJo0Qy9BFbpA0HEeoKSJgyjPYAbRAUQ5og6/0ckCM7yiUXx... | [
"logging.getLogger",
"logging.config.dictConfig",
"pycbc.config.load",
"pycbc.token.decrypt",
"pycbc.client.WebBookingClient"
] | [((107, 134), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (124, 134), False, 'import logging\n'), ((657, 668), 'pycbc.config.load', 'load', (['event'], {}), '(event)\n', (661, 668), False, 'from pycbc.config import load\n'), ((673, 714), 'logging.config.dictConfig', 'logging.config.dic... |
from datetime import datetime
from utils import build_accuracy
import tempfile
import tensorflow as tf
import tensorflow.contrib.slim as slim
flags = tf.app.flags
FLAGS = flags.FLAGS
class OneStreamTrainer(object):
def __init__(self, model, logger=None, display_freq=1,
learning_rate=0.0001, nu... | [
"tensorflow.tile",
"utils.build_accuracy",
"tensorflow.gfile.MakeDirs",
"tensorflow.Summary.Value",
"tensorflow.GPUOptions",
"tensorflow.variables_initializer",
"tensorflow.train.create_global_step",
"tensorflow.gfile.Exists",
"tensorflow.losses.get_total_loss",
"tensorflow.placeholder",
"tensor... | [((715, 772), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32', '[None, num_classes]', '"""labels"""'], {}), "(tf.float32, [None, num_classes], 'labels')\n", (729, 772), True, 'import tensorflow as tf\n'), ((1205, 1308), 'tensorflow.losses.softmax_cross_entropy', 'tf.losses.softmax_cross_entropy', ([], {'oneh... |
from django.contrib import admin
from .models import *
admin.site.register(Location)
admin.site.register(Conference)
admin.site.register(Section)
admin.site.register(Speaker)
admin.site.register(Lecture)
admin.site.register(Speech)
admin.site.register(Comment)
# Register your models here.
| [
"django.contrib.admin.site.register"
] | [((56, 85), 'django.contrib.admin.site.register', 'admin.site.register', (['Location'], {}), '(Location)\n', (75, 85), False, 'from django.contrib import admin\n'), ((86, 117), 'django.contrib.admin.site.register', 'admin.site.register', (['Conference'], {}), '(Conference)\n', (105, 117), False, 'from django.contrib im... |
import torch
from torch import nn
from torch.distributions import Uniform
__all__ = ['randconv']
def randconv(image: torch.Tensor, K: int, mix: bool, p: float) -> torch.Tensor:
"""
Outputs the image or the random convolution applied on the image.
Args:
image (torch.Tensor): input image
K ... | [
"torch.randint",
"torch.nn.init.uniform_",
"torch.rand",
"torch.nn.Conv2d"
] | [((596, 667), 'torch.nn.init.uniform_', 'torch.nn.init.uniform_', (['random_convolution.weight', '(0)', '(1.0 / (3 * k * k))'], {}), '(random_convolution.weight, 0, 1.0 / (3 * k * k))\n', (618, 667), False, 'import torch\n'), ((391, 404), 'torch.rand', 'torch.rand', (['(1)'], {}), '(1)\n', (401, 404), False, 'import to... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models, fields, tools
class StockTrackConfirmation(models.TransientModel):
_name = 'stock.track.confirmation'
_description = 'Stock Track Confirmation'
tracking_line_ids = fields.One2... | [
"odoo.fields.Many2one",
"odoo.fields.Selection",
"odoo.fields.One2many"
] | [((309, 357), 'odoo.fields.One2many', 'fields.One2many', (['"""stock.track.line"""', '"""wizard_id"""'], {}), "('stock.track.line', 'wizard_id')\n", (324, 357), False, 'from odoo import api, models, fields, tools\n'), ((377, 424), 'odoo.fields.Many2one', 'fields.Many2one', (['"""stock.inventory"""', '"""Inventory"""'],... |
#!/usr/bin/env python3
from activate import install
"""
Script to install LUFA boards for Arduino.
More info can be found in the activate.py script.
"""
if __name__ == '__main__':
install()
| [
"activate.install"
] | [((185, 194), 'activate.install', 'install', ([], {}), '()\n', (192, 194), False, 'from activate import install\n')] |
#!/usr/bin/env python3.5
# -*- coding: utf-8 -*-
import os
import re
import sys
import sqlite3
from collections import defaultdict
def value2list(text):
text = re.sub(r'(^\[|\]$)', '', text)
value_list = text.split(',') if text != "" else []
value_list = [value.strip() for value in value_list]
retur... | [
"os.path.exists",
"os.listdir",
"sqlite3.connect",
"os.mkdir",
"re.sub",
"re.findall"
] | [((167, 198), 're.sub', 're.sub', (['"""(^\\\\[|\\\\]$)"""', '""""""', 'text'], {}), "('(^\\\\[|\\\\]$)', '', text)\n", (173, 198), False, 'import re\n'), ((1758, 1782), 'os.path.exists', 'os.path.exists', (['img_path'], {}), '(img_path)\n', (1772, 1782), False, 'import os\n'), ((3183, 3211), 'sqlite3.connect', 'sqlite... |
'''
Module of Linux API for plyer.battery.
'''
from math import floor
from os import environ
from os.path import exists, join
from subprocess import Popen, PIPE
from plyer.facades import Battery
from plyer.utils import whereis_exe
class LinuxBattery(Battery):
'''
Implementation of Linux battery API via acces... | [
"plyer.facades.Battery",
"math.floor",
"subprocess.Popen",
"os.path.join",
"os.environ.get",
"sys.stderr.write",
"plyer.utils.whereis_exe"
] | [((2739, 2760), 'plyer.utils.whereis_exe', 'whereis_exe', (['"""upower"""'], {}), "('upower')\n", (2750, 2760), False, 'from plyer.utils import whereis_exe\n'), ((2797, 2834), 'sys.stderr.write', 'sys.stderr.write', (['"""upower not found."""'], {}), "('upower not found.')\n", (2813, 2834), False, 'import sys\n'), ((29... |
"""
checks sections for common strings
"""
import re
# regex patterns to look for
patterns = {
# local and remote filepaths
re.compile(r'(?:[a-zA-Z]\:|[\w ]+)?\\+(?:[\w\- .\\$~]+)*[\w\- .]*'),
# IP addresses
re.compile(r'(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)... | [
"re.compile"
] | [((130, 206), 're.compile', 're.compile', (['"""(?:[a-zA-Z]\\\\:|[\\\\w ]+)?\\\\\\\\+(?:[\\\\w\\\\- .\\\\\\\\$~]+)*[\\\\w\\\\- .]*"""'], {}), "('(?:[a-zA-Z]\\\\:|[\\\\w ]+)?\\\\\\\\+(?:[\\\\w\\\\- .\\\\\\\\$~]+)*[\\\\w\\\\- .]*')\n", (140, 206), False, 'import re\n'), ((218, 332), 're.compile', 're.compile', (['"""(?:(... |
# -*- coding: utf-8 -*-
import gc
import numpy as np
import pandas as pd
import lightgbm as lgb
from data import *
from feat import *
from resource import *
from utils import (load_dataframe, convert_dtype, CrossValidation, merge_all)
def rank_feat_inside_session(df, cols):
for col in cols:
col_n = '... | [
"utils.CrossValidation",
"numpy.mean",
"lightgbm.LGBMClassifier",
"gc.collect"
] | [((2226, 2243), 'utils.CrossValidation', 'CrossValidation', ([], {}), '()\n', (2241, 2243), False, 'from utils import load_dataframe, convert_dtype, CrossValidation, merge_all\n'), ((2257, 2541), 'lightgbm.LGBMClassifier', 'lgb.LGBMClassifier', ([], {'n_estimators': '(50000)', 'objective': '"""binary"""', 'metric': '""... |
from django.db.models import Count
from django.core.paginator import EmptyPage, PageNotAnInteger
from django.core.urlresolvers import reverse
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.http import Http404
from django.shortcu... | [
"re.compile",
"django.db.models.Count",
"django.contrib.messages.warning",
"django.template.RequestContext",
"django.core.urlresolvers.reverse",
"django.utils.http.urlquote",
"django.contrib.messages.success",
"re.sub",
"django.http.Http404"
] | [((684, 774), 're.compile', 're.compile', (['"""[a-zA-Z0-9\\\\-"\\\\\'`\\\\|~!@#\\\\$%\\\\^&\\\\\'\\\\*\\\\(\\\\)_\\\\[\\\\]{};:,\\\\.<>=\\\\+]+\\""""'], {}), '(\n \'[a-zA-Z0-9\\\\-"\\\\\\\'`\\\\|~!@#\\\\$%\\\\^&\\\\\\\'\\\\*\\\\(\\\\)_\\\\[\\\\]{};:,\\\\.<>=\\\\+]+"\')\n', (694, 774), False, 'import re\n'), ((1015,... |
################################################
__author__='acgreyjo'
#
# Class aims to test some of the basic simpler
# features/properties of this application that
# are deemed testable.
################################################
import os
import pandas as pd
import unittest
from analytika.publ... | [
"os.path.exists",
"pandas.read_csv",
"os.path.join",
"analytika.public.application.analyzer.Analyzer",
"unittest.main"
] | [((1960, 1975), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1973, 1975), False, 'import unittest\n'), ((654, 704), 'analytika.public.application.analyzer.Analyzer', 'Analyzer', ([], {'setup_config': '"""../setup_configuration.py"""'}), "(setup_config='../setup_configuration.py')\n", (662, 704), False, 'from an... |
import face_recognition
import cv2
from keyboard import is_pressed
name = input("Enter your name: ")
camera = cv2.VideoCapture(0)
while not is_pressed("esc"):
_, img = camera.read()
if not _:
continue
locations = face_recognition.face_locations(img)
if len(locations) != 1:
... | [
"cv2.rectangle",
"face_recognition.face_locations",
"keyboard.is_pressed",
"cv2.putText",
"cv2.imshow",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"cv2.waitKey"
] | [((116, 135), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (132, 135), False, 'import cv2\n'), ((656, 679), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (677, 679), False, 'import cv2\n'), ((149, 166), 'keyboard.is_pressed', 'is_pressed', (['"""esc"""'], {}), "('esc')\n", (159,... |
#!/usr/bin/python3
import re
import subprocess
# set the path of the linux ssh auth log
# TODO allow to pass this path as argument to the script
authLog = "/var/log/auth.log"
whiteList = "config/WHITELIST"
# set the maximum number of password errors before being
maxAllowedErrors = 10
# allows to test if ip is in Sunr... | [
"re.findall",
"subprocess.run",
"re.match"
] | [((970, 1032), 're.match', 're.match', (['"""Anywhere\\\\s+DENY\\\\s+([0-9]+(?:\\\\.[0-9]+){3})"""', 'line'], {}), "('Anywhere\\\\s+DENY\\\\s+([0-9]+(?:\\\\.[0-9]+){3})', line)\n", (978, 1032), False, 'import re\n'), ((1466, 1501), 're.match', 're.match', (['""".*Failed password"""', 'line'], {}), "('.*Failed password'... |
from numpy import argsort, diff, max, where
from numpy import abs as np_abs
from numpy import mean as np_mean
from numpy import median as np_median
from numpy import var as np_var
from numpy import min as np_min
from numpy import max as np_max
import numpy as np
from numpy.lib.histograms import _unsigned_subtract
from ... | [
"numpy.abs",
"scipy.signal.convolve",
"numpy.where",
"numpy.diff",
"numpy.argsort",
"scipy.signal.find_peaks"
] | [((4597, 4637), 'scipy.signal.convolve', 'convolve', (['data', 'self.filter'], {'mode': '"""same"""'}), "(data, self.filter, mode='same')\n", (4605, 4637), False, 'from scipy.signal import convolve, find_peaks\n'), ((3208, 3241), 'numpy.where', 'where', (['(arr_ind_peaks > trough_ind)'], {}), '(arr_ind_peaks > trough_i... |
import os
import gettext
from . import db
LOCALEDIR = os.path.join(os.path.dirname(__file__), 'locales')
langcodes = [
f for f in os.listdir(LOCALEDIR)
if os.path.isdir(os.path.join(LOCALEDIR, f))
]
translates = {
lang: gettext.translation('main', LOCALEDIR, [lang])
for lang in langcodes
}
languages = ... | [
"os.path.dirname",
"os.listdir",
"os.path.join",
"gettext.translation"
] | [((68, 93), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (83, 93), False, 'import os\n'), ((233, 279), 'gettext.translation', 'gettext.translation', (['"""main"""', 'LOCALEDIR', '[lang]'], {}), "('main', LOCALEDIR, [lang])\n", (252, 279), False, 'import gettext\n'), ((135, 156), 'os.listdir... |
#!/usr/bin/env python3
# License: CC0
import sys
import re
def main():
print("""<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
</head>
<body>"... | [
"re.sub",
"re.match"
] | [((472, 497), 're.match', 're.match', (['"""^[ ]+"""', 'result'], {}), "('^[ ]+', result)\n", (480, 497), False, 'import re\n'), ((608, 693), 're.sub', 're.sub', (['"""(https?://[^\\\\t "\'<>|]+[A-Za-z0-9/])"""', '"""<a href="\\\\1">\\\\1</a>"""', 'result'], {}), '(\'(https?://[^\\\\t "\\\'<>|]+[A-Za-z0-9/])\', \'<a hr... |
from django.urls import path, include
from .views import custom_webhook
urlpatterns = [
path("", include("djstripe.urls", namespace="djstripe")),
path("custom_webhook", custom_webhook)
] | [
"django.urls.path",
"django.urls.include"
] | [((154, 192), 'django.urls.path', 'path', (['"""custom_webhook"""', 'custom_webhook'], {}), "('custom_webhook', custom_webhook)\n", (158, 192), False, 'from django.urls import path, include\n'), ((102, 148), 'django.urls.include', 'include', (['"""djstripe.urls"""'], {'namespace': '"""djstripe"""'}), "('djstripe.urls',... |
import cv2,time,pandas
from datetime import datetime
video=cv2.VideoCapture(0)
first_frame=None
status_list=[None,None]
times=[]
df=pandas.DataFrame(columns=["Start","End"])
while True:
check,frame=video.read()
status=0
gray=cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY)
gray=cv2.GaussianBlur(g... | [
"cv2.rectangle",
"cv2.threshold",
"cv2.imshow",
"cv2.contourArea",
"datetime.datetime.now",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"cv2.cvtColor",
"pandas.DataFrame",
"cv2.dilate",
"cv2.GaussianBlur",
"cv2.waitKey",
"cv2.absdiff",
"cv2.boundingRect"
] | [((63, 82), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (79, 82), False, 'import cv2, time, pandas\n'), ((142, 184), 'pandas.DataFrame', 'pandas.DataFrame', ([], {'columns': "['Start', 'End']"}), "(columns=['Start', 'End'])\n", (158, 184), False, 'import cv2, time, pandas\n'), ((1591, 1614), 'cv2.de... |
# -*- coding: utf-8 -*-
"""Call back view for OAuth2 authentication."""
from django import http
from django.contrib import messages
from django.contrib.auth.decorators import user_passes_test
from django.core.handlers.wsgi import WSGIRequest
from django.shortcuts import redirect, reverse
from django.utils.translation ... | [
"django.utils.translation.ugettext_lazy",
"django.contrib.messages.error",
"ontask.core.SessionPayload",
"django.contrib.auth.decorators.user_passes_test",
"django.shortcuts.redirect",
"ontask.oauth.services.process_callback",
"django.shortcuts.reverse",
"django.utils.translation.ugettext"
] | [((483, 514), 'django.contrib.auth.decorators.user_passes_test', 'user_passes_test', (['is_instructor'], {}), '(is_instructor)\n', (499, 514), False, 'from django.contrib.auth.decorators import user_passes_test\n'), ((872, 903), 'ontask.core.SessionPayload', 'SessionPayload', (['request.session'], {}), '(request.sessio... |
import enum
from typing import Sequence, TypeVar, Type
T = TypeVar("T", bound=enum.Enum)
class StrEnumMeta(enum.EnumMeta):
auto = enum.auto
def from_str(self: Type[T], member: str) -> T: # type: ignore[misc]
try:
return self[member]
except KeyError:
# TODO: use `add_... | [
"typing.TypeVar"
] | [((60, 89), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {'bound': 'enum.Enum'}), "('T', bound=enum.Enum)\n", (67, 89), False, 'from typing import Sequence, TypeVar, Type\n')] |
from graphviz import Digraph
dot = Digraph(
comment='First flowchart',
name='<NAME>',
filename='hello_world.dot',
)
dot.node('1', 'Inicio')
dot.node('2', '"<NAME>"', shape='invhouse')
#dot.node('2', '"<NAME>"', shapefile='assets/print.svg')
dot.node('3', 'Fin')
dot.node('4', 'Fin 2')
dot.edge('1', '2')
#... | [
"graphviz.Digraph"
] | [((36, 113), 'graphviz.Digraph', 'Digraph', ([], {'comment': '"""First flowchart"""', 'name': '"""<NAME>"""', 'filename': '"""hello_world.dot"""'}), "(comment='First flowchart', name='<NAME>', filename='hello_world.dot')\n", (43, 113), False, 'from graphviz import Digraph\n')] |
import os, sys
from os import listdir
from os.path import isfile, join
from urllib.parse import urlparse
from flask import Flask
from flask_pymongo import PyMongo
import requests
import logging
from datetime import datetime, timedelta, timezone
import datetime
import time
from zipfile import ZipFile
import shutil
impor... | [
"logging.StreamHandler",
"logging.debug",
"zipfile.ZipFile",
"flask.Flask",
"time.sleep",
"logging.info",
"logging.error",
"os.remove",
"os.listdir",
"os.path.isdir",
"logging.FileHandler",
"os.mkdir",
"traceback.print_exc",
"json.loads",
"os.path.splitext",
"requests.get",
"os.path.... | [((426, 441), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (431, 441), False, 'from flask import Flask\n'), ((468, 534), 'os.environ.get', 'os.environ.get', (['"""MONGODB_URI"""', '"""mongodb://127.0.0.1:27017/cvedata"""'], {}), "('MONGODB_URI', 'mongodb://127.0.0.1:27017/cvedata')\n", (482, 534), False,... |
"""
FASTQ SE and PE splitter loader tester
TODO:
-----
. not in test suite
"""
import unittest, numpy
# get glbase
import sys, os
import glbase3
class Test_Fastq(unittest.TestCase):
def test_splitPE(self):
"""
@HWI-ST507:76:A81MKNABXX:7:1:5257:1711:1
CTCCTAGAGGGAAATATGGAGCAATTACATATTGTT... | [
"unittest.TextTestRunner",
"unittest.TestLoader",
"glbase3.fastq"
] | [((581, 640), 'glbase3.fastq', 'glbase3.fastq', (['"""test_data/fastq_typical_data.fq"""', '"""phred33"""'], {}), "('test_data/fastq_typical_data.fq', 'phred33')\n", (594, 640), False, 'import glbase3\n'), ((1010, 1070), 'glbase3.fastq', 'glbase3.fastq', (['"""test_data/fastq_typical_data2.fq"""', '"""phred64"""'], {})... |
#### encoding: cp1255 ####
from collections import namedtuple
import urllib2
import re
import logging
import csv
import datetime
from django.core.management.base import BaseCommand
from django.contrib.contenttypes.models import ContentType
from dateutil import zoneinfo
from mks.models import Member
from committees.mo... | [
"logging.getLogger",
"dateutil.zoneinfo.gettz",
"datetime.datetime",
"collections.namedtuple",
"django.contrib.contenttypes.models.ContentType.objects.get_for_model",
"urllib2.urlopen",
"committees.models.Committee.objects.get",
"re.compile",
"events.models.Event.objects.count"
] | [((468, 492), 'dateutil.zoneinfo.gettz', 'zoneinfo.gettz', (['"""Israel"""'], {}), "('Israel')\n", (482, 492), False, 'from dateutil import zoneinfo\n'), ((502, 523), 'dateutil.zoneinfo.gettz', 'zoneinfo.gettz', (['"""UTC"""'], {}), "('UTC')\n", (516, 523), False, 'from dateutil import zoneinfo\n'), ((534, 599), 'loggi... |
"""
Contains Marktlokation class
and corresponding marshmallow schema for de-/serialization
"""
import attr
from marshmallow import fields
from marshmallow_enum import EnumField # type:ignore[import]
from bo4e.bo.geschaeftsobjekt import Geschaeftsobjekt, GeschaeftsobjektSchema
from bo4e.bo.geschaeftspartner import G... | [
"attr.s",
"marshmallow_enum.EnumField",
"marshmallow.fields.Nested",
"marshmallow.fields.Str",
"marshmallow.fields.Bool",
"attr.ib"
] | [((1159, 1198), 'attr.s', 'attr.s', ([], {'auto_attribs': '(True)', 'kw_only': '(True)'}), '(auto_attribs=True, kw_only=True)\n', (1165, 1198), False, 'import attr\n'), ((1554, 1590), 'attr.ib', 'attr.ib', ([], {'default': 'BoTyp.MARKTLOKATION'}), '(default=BoTyp.MARKTLOKATION)\n', (1561, 1590), False, 'import attr\n')... |
from django.test import TestCase
class TestObscureEmail(TestCase):
def test_obscure_email_none(self):
from django_flex_user.util import obscure_email
self.assertRaises(ValueError, obscure_email, None)
def test_obscure_email_empty_string(self):
from django_flex_user.util import obscur... | [
"django_flex_user.util.obscure_phone",
"phonenumbers.parse",
"django_flex_user.util.obscure_email"
] | [((3411, 3448), 'phonenumbers.parse', 'phonenumbers.parse', (['"""+1 202-555-1234"""'], {}), "('+1 202-555-1234')\n", (3429, 3448), False, 'import phonenumbers\n'), ((4486, 4524), 'phonenumbers.parse', 'phonenumbers.parse', (['"""+251 91 123 4567"""'], {}), "('+251 91 123 4567')\n", (4504, 4524), False, 'import phonenu... |
from collections import defaultdict
from collections import Counter # Pakiet ten nie jest ładowany domyślnie.
users = [
{"id": 0, "name": "Hero"},
{"id": 1, "name": "Dunn"},
{"id": 2, "name": "Sue"},
{"id": 3, "name": "Chi"},
{"id": 4, "name": "Thor"},
{"id": 5, "name": "Clive"},
{"id": 6,... | [
"collections.Counter",
"collections.defaultdict"
] | [((3854, 3871), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (3865, 3871), False, 'from collections import defaultdict\n'), ((4126, 4143), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (4137, 4143), False, 'from collections import defaultdict\n'), ((4844, 4861), 'collect... |
import json
from edge.blast import blast_genome
from edge.models import Operation
from Bio.Seq import Seq
class CrisprTarget(object):
def __init__(self, fragment_id, fragment_name, strand, subject_start, subject_end, pam):
self.fragment_id = fragment_id
self.fragment_name = fragment_name
... | [
"edge.blast.blast_genome",
"Bio.Seq.Seq",
"json.dumps"
] | [((1800, 1837), 'edge.blast.blast_genome', 'blast_genome', (['genome', '"""blastn"""', 'guide'], {}), "(genome, 'blastn', guide)\n", (1812, 1837), False, 'from edge.blast import blast_genome\n'), ((3735, 3753), 'json.dumps', 'json.dumps', (['params'], {}), '(params)\n', (3745, 3753), False, 'import json\n'), ((1180, 11... |
from setuptools import setup, find_packages
setup(name='aiocmd',
packages=find_packages("."),
version='0.1.4',
author='<NAME>',
author_email='<EMAIL>',
description='Coroutine-based CLI generator using prompt_toolkit',
url='http://github.com/KimiNewt/aiocmd',
keywords=['asyncio... | [
"setuptools.find_packages"
] | [((81, 99), 'setuptools.find_packages', 'find_packages', (['"""."""'], {}), "('.')\n", (94, 99), False, 'from setuptools import setup, find_packages\n')] |
import os
import pickle
import glob
import numpy as np
from tqdm import tqdm
import random
class Create:
"""
Reads, transforms and saves the data in the format your network will use.
Keyword arguments:
raw_data_folder_path -- the Folder Path where all the raw data is saved.
save_data_folder_path ... | [
"numpy.mean",
"os.path.exists",
"os.makedirs",
"tqdm.tqdm",
"pickle.load",
"os.remove",
"numpy.array",
"numpy.save",
"numpy.std",
"numpy.load",
"glob.glob",
"numpy.random.shuffle"
] | [((2345, 2392), 'glob.glob', 'glob.glob', (["(self.raw_data_folder_path + '/*.pkl')"], {}), "(self.raw_data_folder_path + '/*.pkl')\n", (2354, 2392), False, 'import glob\n'), ((2603, 2616), 'tqdm.tqdm', 'tqdm', (['listing'], {}), '(listing)\n', (2607, 2616), False, 'from tqdm import tqdm\n'), ((6970, 7026), 'numpy.arra... |
# Copyright 2018 ICON Foundation
#
# 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 writi... | [
"os.path.exists",
"enum.auto",
"os.getenv",
"os.path.join",
"os.path.dirname",
"os.cpu_count",
"sys.path.append"
] | [((1142, 1176), 'os.path.exists', 'os.path.exists', (['PATH_PROTO_BUFFERS'], {}), '(PATH_PROTO_BUFFERS)\n', (1156, 1176), False, 'import os\n'), ((1406, 1447), 'os.getenv', 'os.getenv', (['"""LOOPCHAIN_LOG_LEVEL"""', '"""DEBUG"""'], {}), "('LOOPCHAIN_LOG_LEVEL', 'DEBUG')\n", (1415, 1447), False, 'import os\n'), ((1777,... |
from django.contrib import admin
from django.urls import path
from places import views
from django.conf.urls.static import static
from django.conf import settings
urlpatterns = [
path('admin/', admin.site.urls),
path('', views.show_main),
path('places/<int:place_id>', views.show_place),
] + static(settings... | [
"django.conf.urls.static.static",
"django.urls.path"
] | [((387, 448), 'django.conf.urls.static.static', 'static', (['settings.MEDIA_URL'], {'document_root': 'settings.MEDIA_ROOT'}), '(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)\n', (393, 448), False, 'from django.conf.urls.static import static\n'), ((305, 368), 'django.conf.urls.static.static', 'static', (['setti... |
#Algos for stemming are Porter , Lancaster , Snowball
from nltk import SnowballStemmer
#Language attribute must be there
stemmer = SnowballStemmer("english")
for word in ['blogging','blogged','blogs']:
print(stemmer.stem(word))
| [
"nltk.SnowballStemmer"
] | [((140, 166), 'nltk.SnowballStemmer', 'SnowballStemmer', (['"""english"""'], {}), "('english')\n", (155, 166), False, 'from nltk import SnowballStemmer\n')] |
#!/usr/bin/python
"""Bitfinex Rest API V2 implementation"""
# pylint: disable=R0904
from __future__ import absolute_import
import json
from json.decoder import JSONDecodeError
import hmac
import hashlib
import requests
from bitfinex import utils
from enum import Enum
PROTOCOL = "https"
PUBLIC_PREFIX = "api-pub"
PRIVA... | [
"requests.post",
"bitfinex.utils.get_nonce",
"json.dumps",
"requests.get",
"bitfinex.utils.get_bitfinex_logger"
] | [((434, 469), 'bitfinex.utils.get_bitfinex_logger', 'utils.get_bitfinex_logger', (['__name__'], {}), '(__name__)\n', (459, 469), False, 'from bitfinex import utils\n'), ((2686, 2774), 'requests.post', 'requests.post', (['(self.private_url + path)'], {'headers': 'headers', 'data': 'payload', 'verify': 'verify'}), '(self... |
from ase.visualize import view
from ase import Atoms
def drawing(file_path):
f = open(file_path, 'r') # 開啟並讀取檔案
lines = f.readlines() # 讀取檔案內容的每一行文字為陣列 是一堆strings的list
atom_num = len(lines) # 原子數
print("Atom_numbers: ",atom_num)
for i in range(atom_num): #去掉結尾換行
lines[i] =... | [
"ase.Atoms",
"ase.visualize.view"
] | [((814, 866), 'ase.Atoms', 'Atoms', (['name_list'], {'positions': 'position_list', 'cell': 'Cell'}), '(name_list, positions=position_list, cell=Cell)\n', (819, 866), False, 'from ase import Atoms\n'), ((875, 890), 'ase.visualize.view', 'view', (['All_atoms'], {}), '(All_atoms)\n', (879, 890), False, 'from ase.visualize... |
from task_script_utils.is_number import isnumber
def test_is_number():
assert isnumber(10)
assert isnumber("10")
assert isnumber("NaN")
assert not isnumber(True)
assert not isnumber("cheese")
| [
"task_script_utils.is_number.isnumber"
] | [((84, 96), 'task_script_utils.is_number.isnumber', 'isnumber', (['(10)'], {}), '(10)\n', (92, 96), False, 'from task_script_utils.is_number import isnumber\n'), ((108, 122), 'task_script_utils.is_number.isnumber', 'isnumber', (['"""10"""'], {}), "('10')\n", (116, 122), False, 'from task_script_utils.is_number import i... |
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import datetime as dt
from pandas_datareader import data
import statsmodels.api as sm
from statsmodels.tsa.seasonal import STL
import pandas_datareader.data as DataReader
def get_stock(stock,start,end):
df = data.DataReader(stock, 'stooq',star... | [
"pandas.Series",
"pandas_datareader.data.DataReader",
"matplotlib.pyplot.close",
"numba.jit",
"numpy.empty_like",
"datetime.date",
"statsmodels.api.tsa.filters.hpfilter",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.subplots"
] | [((404, 422), 'numba.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (407, 422), False, 'from numba import jit\n'), ((467, 483), 'numpy.empty_like', 'np.empty_like', (['x'], {}), '(x)\n', (480, 483), True, 'import numpy as np\n'), ((1107, 1126), 'datetime.date', 'dt.date', (['(2020)', '(1)', '(1)'], {})... |
import raylibpy as rl
class Camera(object):
def __init__(self, position = rl.Vector3(4, 2, 4), target = rl.Vector3(0, 1.8, 0), up = rl.Vector3(0, 1, 0), fovy = 60, projection = rl.CAMERA_PERSPECTIVE):
self.FIRST_PERSON = rl.CAMERA_FIRST_PERSON
self.PERSPECTIVE = rl.CAMERA_PERSPECTIVE
self.... | [
"raylibpy.Vector3",
"raylibpy.Camera"
] | [((79, 98), 'raylibpy.Vector3', 'rl.Vector3', (['(4)', '(2)', '(4)'], {}), '(4, 2, 4)\n', (89, 98), True, 'import raylibpy as rl\n'), ((109, 130), 'raylibpy.Vector3', 'rl.Vector3', (['(0)', '(1.8)', '(0)'], {}), '(0, 1.8, 0)\n', (119, 130), True, 'import raylibpy as rl\n'), ((137, 156), 'raylibpy.Vector3', 'rl.Vector3'... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
torch.manual_seed(1)
# 훈련 데이터
x_data = [[1, 2], [2, 3], [3, 1], [4, 3], [5, 3], [6, 2]]
y_data = [[0], [0], [0], [1], [1], [1]]
x_train = torch.FloatTensor(x_data)
y_train = torch.FloatTensor(y_data)
'''
nn.Sequential()은 ... | [
"torch.manual_seed",
"torch.nn.Sigmoid",
"torch.nn.functional.binary_cross_entropy",
"torch.nn.Linear",
"torch.FloatTensor"
] | [((96, 116), 'torch.manual_seed', 'torch.manual_seed', (['(1)'], {}), '(1)\n', (113, 116), False, 'import torch\n'), ((235, 260), 'torch.FloatTensor', 'torch.FloatTensor', (['x_data'], {}), '(x_data)\n', (252, 260), False, 'import torch\n'), ((271, 296), 'torch.FloatTensor', 'torch.FloatTensor', (['y_data'], {}), '(y_d... |
#!/usr/bin/env python
from nougat import __version__
from setuptools import setup
version = __version__
try:
with open("requirements.txt", "r") as f:
install_requires = [x.strip() for x in f.readlines()]
except IOError:
install_requires = []
setup(name='nougat',
version=version,
description=... | [
"setuptools.setup"
] | [((262, 716), 'setuptools.setup', 'setup', ([], {'name': '"""nougat"""', 'version': 'version', 'description': '"""An automated analysis pipeline for de novo assembly"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '"""https://github.com/SciLifeLab/NouGAT"""', 'license': '"""MIT"""', 'scripts': "[... |
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 17 11:02:24 2022
@author: rossgra
"""
import numpy as np
from numpy.core.fromnumeric import std
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import scipy
from scipy.stats import mannwhitneyu
import statistics as stat
metric = input('SAE or N... | [
"seaborn.displot",
"numpy.mean",
"numpy.median",
"pandas.read_csv",
"numpy.average",
"statistics.median",
"scipy.stats.wilcoxon",
"scipy.stats.ttest_ind",
"numpy.std",
"pandas.DataFrame",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show"
] | [((1581, 1609), 'pandas.read_csv', 'pd.read_csv', (['No_hood_MJ_path'], {}), '(No_hood_MJ_path)\n', (1592, 1609), True, 'import pandas as pd\n'), ((1620, 1645), 'pandas.read_csv', 'pd.read_csv', (['Hood_MJ_Path'], {}), '(Hood_MJ_Path)\n', (1631, 1645), True, 'import pandas as pd\n'), ((18233, 18331), 'scipy.stats.ttest... |
from sklearn.feature_extraction.text import CountVectorizer
from nltk.corpus import names
from nltk.stem import WordNetLemmatizer
import glob
import os
import numpy as np
file_path = 'enron1/ham/0007.1999-12-14.farmer.ham.txt'
with open(file_path, 'r') as infile:
ham_sample = infile.read()
print(ham_sample)
fil... | [
"matplotlib.pyplot.ylabel",
"sklearn.metrics.classification_report",
"numpy.log",
"sklearn.metrics.precision_score",
"sklearn.metrics.recall_score",
"sklearn.metrics.roc_auc_score",
"sklearn.model_selection.StratifiedKFold",
"numpy.array",
"numpy.arange",
"sklearn.feature_extraction.text.CountVect... | [((465, 520), 'sklearn.feature_extraction.text.CountVectorizer', 'CountVectorizer', ([], {'stop_words': '"""english"""', 'max_features': '(500)'}), "(stop_words='english', max_features=500)\n", (480, 520), False, 'from sklearn.feature_extraction.text import CountVectorizer\n'), ((1076, 1095), 'nltk.stem.WordNetLemmatiz... |
"""Tests for sorno.datetimeutil
Copyright 2015 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to... | [
"datetime.datetime",
"pytz.timezone",
"sorno.datetimeutil.GO_REFERENCE_TIME.astimezone",
"sorno.datetimeutil.number_to_local_datetime",
"sorno.datetimeutil.strftime",
"sorno.datetimeutil.TIMESTAMP_REGEX.search",
"sorno.datetimeutil.guess_local_datetime",
"sorno.datetimeutil.timestamp_to_local_datetime... | [((927, 997), 'sorno.datetimeutil.GO_REFERENCE_TIME.astimezone', 'datetimeutil.GO_REFERENCE_TIME.astimezone', (['datetimeutil.LOCAL_TIMEZONE'], {}), '(datetimeutil.LOCAL_TIMEZONE)\n', (968, 997), False, 'from sorno import datetimeutil\n'), ((1169, 1205), 'pytz.timezone', 'pytz.timezone', (['"""America/Los_Angeles"""'],... |
# import sys
# sys.path.pop(0)
# sys.path.append("..")
from setuptools import setup
import sdist_upip
from os import path
# read the contents of your README file
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_... | [
"os.path.join",
"os.path.dirname",
"setuptools.setup"
] | [((344, 723), 'setuptools.setup', 'setup', ([], {'name': '"""mPython-ledstrip"""', 'version': '"""0.0.4"""', 'description': '""""""', 'long_description': 'long_description', 'long_description_content_type': '"""text/markdown"""', 'url': '"""https://github.com/labplus-cn/mPython_ledstrip"""', 'author': '"""tangliufeng""... |
import numpy as np
import tensorflow as tf
def get_angles(pos, i, d_model):
angle_rates = 1 / np.power(10000, (2 * (i//2)) / np.float32(d_model))
return pos * angle_rates
def positional_encoding(position, d_model):
angle_rads = get_angles(np.arange(position)[:, np.newaxis],
np.ar... | [
"tensorflow.shape",
"numpy.float32",
"tensorflow.image.resize",
"numpy.arange",
"tensorflow.io.read_file",
"numpy.zeros",
"tensorflow.constant",
"numpy.cos",
"tensorflow.maximum",
"numpy.sin",
"tensorflow.cast",
"numpy.zeros_like",
"tensorflow.minimum",
"tensorflow.stack",
"tensorflow.im... | [((461, 488), 'numpy.sin', 'np.sin', (['angle_rads[:, 0::2]'], {}), '(angle_rads[:, 0::2])\n', (467, 488), True, 'import numpy as np\n'), ((566, 593), 'numpy.cos', 'np.cos', (['angle_rads[:, 1::2]'], {}), '(angle_rads[:, 1::2])\n', (572, 593), True, 'import numpy as np\n'), ((654, 693), 'tensorflow.cast', 'tf.cast', ([... |
# DO NOT EDIT THIS FILE!
#
# This file is generated from the CDP specification. If you need to make
# changes, edit the generator and regenerate all of the modules.
#
# CDP domain: Security
from __future__ import annotations
from cdp.util import event_class, T_JSON_DICT
from dataclasses import dataclass
import enum
im... | [
"deprecated.sphinx.deprecated",
"cdp.util.event_class"
] | [((6565, 6590), 'deprecated.sphinx.deprecated', 'deprecated', ([], {'version': '"""1.3"""'}), "(version='1.3')\n", (6575, 6590), False, 'from deprecated.sphinx import deprecated\n'), ((7207, 7232), 'deprecated.sphinx.deprecated', 'deprecated', ([], {'version': '"""1.3"""'}), "(version='1.3')\n", (7217, 7232), False, 'f... |
# -*- coding: utf-8 -*-
"""Custom pipe-queue adapter to read from a pipe and write *text* content to
thread-safe queues"""
from __future__ import unicode_literals
import logging
from .contentwrapper import ContentWrapper
from .prpipe import _PrPipe
# Private class only intended to be used by ProcessRunner
# Works a... | [
"logging.getLogger",
"logging.NullHandler"
] | [((2209, 2239), 'logging.getLogger', 'logging.getLogger', (['logger_name'], {}), '(logger_name)\n', (2226, 2239), False, 'import logging\n'), ((2263, 2284), 'logging.NullHandler', 'logging.NullHandler', ([], {}), '()\n', (2282, 2284), False, 'import logging\n')] |
from collections import OrderedDict
from django.contrib import messages
from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import login_required
from django.db.models import Count, Q
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404, redirect, r... | [
"django.shortcuts.render",
"django.contrib.auth.get_user_model",
"collections.OrderedDict",
"django.http.HttpResponseRedirect",
"taggit.models.Tag.objects.all",
"taggit.models.Tag.objects.filter",
"django.db.models.Count",
"django.shortcuts.get_object_or_404",
"django.contrib.messages.add_message",
... | [((748, 764), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (762, 764), False, 'from django.contrib.auth import get_user_model\n'), ((3993, 4006), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (4004, 4006), False, 'from collections import OrderedDict\n'), ((8815, 8879), 'django... |
from gym import Wrapper
import inspect
import logging
from functools import partial
logger = logging.getLogger(__name__)
class RewardWrapper(Wrapper):
"""
Adds support for reward decomposition of the environment.
To support reward decompisition the environment has to return reward as a list of dictiona... | [
"logging.getLogger",
"functools.partial",
"inspect.getargspec"
] | [((95, 122), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (112, 122), False, 'import logging\n'), ((867, 907), 'inspect.getargspec', 'inspect.getargspec', (['self.unwrapped._step'], {}), '(self.unwrapped._step)\n', (885, 907), False, 'import inspect\n'), ((984, 1048), 'functools.partial... |
import torch
from dlc_practical_prologue import generate_pair_sets
import torch.nn as nn
from utils import *
from utils_pipeline2 import *
import time
import models
import torch.nn.functional as F
def main():
# Set the device to cuda if it is available otherwise use the CPU
if torch.cuda.is_available():
... | [
"torch.cuda.is_available",
"torch.nn.CrossEntropyLoss"
] | [((289, 314), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (312, 314), False, 'import torch\n'), ((986, 1007), 'torch.nn.CrossEntropyLoss', 'nn.CrossEntropyLoss', ([], {}), '()\n', (1005, 1007), True, 'import torch.nn as nn\n')] |
import setuptools
setuptools.setup(
name='dlw',
version='0.0.16',
author='<NAME>',
author_email='<EMAIL>',
packages=setuptools.find_packages(),
include_package_data=True,
url='https://github.com/jchmyz/DoublyLabeledWater',
license='LICENSE.txt',
d... | [
"setuptools.find_packages"
] | [((157, 183), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (181, 183), False, 'import setuptools\n')] |
import pygame
class Buttons(object):
def __init__(self, all_sprites, all_buttons):
self.all_sprites = all_sprites
self.all_buttons = all_buttons
red_pos = (50, 100)
blue_pos = (1050, 100)
green_pos = (50, 600)
yellow_pos = (1050, 600)
width = 100
he... | [
"pygame.image.load",
"pygame.Rect",
"pygame.transform.scale"
] | [((1179, 1212), 'pygame.Rect', 'pygame.Rect', (['pos', '(width, height)'], {}), '(pos, (width, height))\n', (1190, 1212), False, 'import pygame\n'), ((1380, 1431), 'pygame.transform.scale', 'pygame.transform.scale', (['self.image', '(width, height)'], {}), '(self.image, (width, height))\n', (1402, 1431), False, 'import... |
'''
Description: Exercise 14 (turtle graphics)
Version: 1.0.0.20210118
Author: <NAME>
Date: 2021-01-18 05:15:35
Last Editors: <NAME>
LastEditTime: 2021-01-18 10:57:45
'''
import turtle, random
turtle.shape(random.choice(['arrow', 'turtle', 'circle', 'square', 'triangle', 'classic']))
# Draw an octagon.
for count in... | [
"turtle.mainloop",
"turtle.right",
"random.choice",
"turtle.forward"
] | [((464, 481), 'turtle.mainloop', 'turtle.mainloop', ([], {}), '()\n', (479, 481), False, 'import turtle, random\n'), ((209, 286), 'random.choice', 'random.choice', (["['arrow', 'turtle', 'circle', 'square', 'triangle', 'classic']"], {}), "(['arrow', 'turtle', 'circle', 'square', 'triangle', 'classic'])\n", (222, 286), ... |
from __future__ import absolute_import
from checkout_sdk.authorization_type import AuthorizationType
from checkout_sdk.exception import CheckoutAuthorizationException
from checkout_sdk.platform_type import PlatformType
from checkout_sdk.sdk_authorization import SdkAuthorization
from checkout_sdk.sdk_credentials import... | [
"checkout_sdk.sdk_authorization.SdkAuthorization",
"checkout_sdk.exception.CheckoutAuthorizationException.invalid_key",
"checkout_sdk.exception.CheckoutAuthorizationException.invalid_authorization"
] | [((794, 890), 'checkout_sdk.exception.CheckoutAuthorizationException.invalid_authorization', 'CheckoutAuthorizationException.invalid_authorization', ([], {'authorization_type': 'authorization_type'}), '(authorization_type=\n authorization_type)\n', (846, 890), False, 'from checkout_sdk.exception import CheckoutAutho... |
# encoding: utf-8
import glob
import re
import os
import os.path as osp
from .base import BaseImageDataset
class LPW(BaseImageDataset):
"""
"""
dataset_dir = 'LPW/'
def __init__(self, root='', verbose=True, **kwargs):
super(LPW, self).__init__()
self.dataset_dir = osp.join(root, self... | [
"os.path.exists",
"os.listdir",
"os.path.join",
"os.path.isdir"
] | [((301, 333), 'os.path.join', 'osp.join', (['root', 'self.dataset_dir'], {}), '(root, self.dataset_dir)\n', (309, 333), True, 'import os.path as osp\n'), ((1437, 1457), 'os.listdir', 'os.listdir', (['dir_path'], {}), '(dir_path)\n', (1447, 1457), False, 'import os\n'), ((1124, 1152), 'os.path.exists', 'osp.exists', (['... |
####################################### MALETESS ##################################
################################################################################
#
# Copyright (C) 2019 <NAME>
# <EMAIL>
#
# This program is free software: you can redistribute it and/or modify
# it under the te... | [
"scipy.fftpack.fftfreq",
"scipy.fftpack.fft",
"astropy.io.fits.open",
"numpy.arange",
"numpy.mean",
"argparse.ArgumentParser",
"json.dumps",
"scipy.signal.find_peaks",
"numpy.abs",
"pickle.load",
"numpy.argmax",
"scipy.ndimage.filters.gaussian_filter1d",
"numpy.interp",
"numpy.std",
"num... | [((1412, 1589), 'argparse.ArgumentParser', 'argp.ArgumentParser', ([], {'prog': '"""maletess.py"""', 'description': '"""This is a Python3 algorithm to make predictions for planets candidates using Machine Learning """', 'usage': '"""%(prog)s"""'}), "(prog='maletess.py', description=\n 'This is a Python3 algorithm to... |
"""Tasks related to running jobs for Tamr Categorization projects"""
import logging
from typing import List
from tamr_unify_client.categorization.project import CategorizationProject
from tamr_unify_client.operation import Operation
from tamr_toolbox.models.project_type import ProjectType
from tamr_toolbox.utils impo... | [
"logging.getLogger",
"tamr_toolbox.utils.operation.enforce_success"
] | [((343, 370), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (360, 370), False, 'import logging\n'), ((1904, 1933), 'tamr_toolbox.utils.operation.enforce_success', 'operation.enforce_success', (['op'], {}), '(op)\n', (1929, 1933), False, 'from tamr_toolbox.utils import operation\n'), ((22... |
import contextlib
import os
import re
import shlex
import subprocess
from behave import *
ANSI_ESCAPE = re.compile(r"\x1B\[[0-?]*[ -/]*[@-~]")
def strip_ansi_codes(inp):
return ANSI_ESCAPE.sub("", inp)
@contextlib.contextmanager
def pushd(new_dir):
old_dir = os.getcwd()
os.chdir(new_dir)
yield
... | [
"os.chdir",
"os.getcwd",
"shlex.split",
"re.compile"
] | [((106, 145), 're.compile', 're.compile', (['"""\\\\x1B\\\\[[0-?]*[ -/]*[@-~]"""'], {}), "('\\\\x1B\\\\[[0-?]*[ -/]*[@-~]')\n", (116, 145), False, 'import re\n'), ((273, 284), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (282, 284), False, 'import os\n'), ((289, 306), 'os.chdir', 'os.chdir', (['new_dir'], {}), '(new_dir... |
# make sure bpe from the root of the repository is in PYTHONPATH environment variable
# or in the same directory to be able to import it
from bpe import load_subword_nmt_table, BpeOnlineTokenizer
merge_table_path = './subword_nmt.voc'
merge_table = load_subword_nmt_table(merge_table_path)
subword_nmt_tokenizer = BpeO... | [
"bpe.BpeOnlineTokenizer",
"bpe.load_subword_nmt_table"
] | [((250, 290), 'bpe.load_subword_nmt_table', 'load_subword_nmt_table', (['merge_table_path'], {}), '(merge_table_path)\n', (272, 290), False, 'from bpe import load_subword_nmt_table, BpeOnlineTokenizer\n'), ((316, 381), 'bpe.BpeOnlineTokenizer', 'BpeOnlineTokenizer', ([], {'bpe_dropout_rate': '(0.1)', 'merge_table': 'me... |
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 22 09:22:42 2021
@author: luyao.li
"""
import numpy as np
import os
from functools import partial
from collections import defaultdict
import matplotlib.pyplot as plt
def hash_fun(a,b,n_buckets,x, p=123457):
y=x%p
hash_val = (a*y+b ) %p
return hash_val % n_b... | [
"matplotlib.pyplot.grid",
"matplotlib.pyplot.loglog",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"numpy.log",
"numpy.exp",
"matplotlib.pyplot.figure",
"collections.defaultdict",
"os.path.abspath",
"matplotlib.pyplot.title",
"numpy.loadtxt",
"matplotlib.pyplot.show"
] | [((526, 571), 'numpy.loadtxt', 'np.loadtxt', (['"""hash_params.txt"""'], {'delimiter': '"""\t"""'}), "('hash_params.txt', delimiter='\\t')\n", (536, 571), True, 'import numpy as np\n'), ((583, 593), 'numpy.exp', 'np.exp', (['(-5)'], {}), '(-5)\n', (589, 593), True, 'import numpy as np\n'), ((1662, 1690), 'matplotlib.py... |
import valorant
from valorant.utils.gameplay import enemy_score_info, own_score_info
import time
custom_config = valorant.config(tesseract=r'D:\Program Files\Tesseract-OCR\tesseract.exe')
time.sleep(1)
print(enemy_score_info(config=custom_config))
print(own_score_info(config=custom_config)) | [
"valorant.utils.gameplay.enemy_score_info",
"valorant.config",
"time.sleep",
"valorant.utils.gameplay.own_score_info"
] | [((114, 190), 'valorant.config', 'valorant.config', ([], {'tesseract': '"""D:\\\\Program Files\\\\Tesseract-OCR\\\\tesseract.exe"""'}), "(tesseract='D:\\\\Program Files\\\\Tesseract-OCR\\\\tesseract.exe')\n", (129, 190), False, 'import valorant\n'), ((189, 202), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (199,... |
from __future__ import absolute_import, print_function
from django.db import models
from sentry.db.models import BoundedPositiveIntegerField, Model, sane_repr
class CommitAuthor(Model):
__core__ = False
organization_id = BoundedPositiveIntegerField(db_index=True)
name = models.CharField(max_length=128,... | [
"django.db.models.EmailField",
"sentry.db.models.sane_repr",
"sentry.db.models.BoundedPositiveIntegerField",
"django.db.models.CharField"
] | [((234, 276), 'sentry.db.models.BoundedPositiveIntegerField', 'BoundedPositiveIntegerField', ([], {'db_index': '(True)'}), '(db_index=True)\n', (261, 276), False, 'from sentry.db.models import BoundedPositiveIntegerField, Model, sane_repr\n'), ((288, 331), 'django.db.models.CharField', 'models.CharField', ([], {'max_le... |
import os
import pickle
import sys
import icdiff
from util import data_io
sys.path.append(".")
import difflib
from typing import Optional, List, Tuple
import numpy as np
from nemo.collections.asr.parts.preprocessing import AudioSegment
from speech_to_text.transcribe_audio import (
SpeechToText,
AlignedTrans... | [
"util.data_io.read_lines",
"pickle.dump",
"icdiff.ConsoleDiff",
"speech_to_text.transcribe_audio.LetterIdx",
"speech_to_text.transcribe_audio.SpeechToText",
"difflib.SequenceMatcher",
"nemo.collections.asr.parts.preprocessing.AudioSegment.from_file",
"pickle.load",
"os.path.isfile",
"speech_to_tex... | [((76, 96), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (91, 96), False, 'import sys\n'), ((704, 729), 'difflib.SequenceMatcher', 'difflib.SequenceMatcher', ([], {}), '()\n', (727, 729), False, 'import difflib\n'), ((1827, 1915), 'speech_to_text.transcribe_audio.AlignedTranscript', 'AlignedTrans... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^new_budget/', views.create_budget, name='create'),
url(r'^manage_budget/', views.manage_budget, name='manage'),
url(r'^new_expense/', views.new_expense, name='new_expense'),
url(r'^expense/(?P<expense_id>[0-9]+)/', views.expen... | [
"django.conf.urls.url"
] | [((81, 136), 'django.conf.urls.url', 'url', (['"""^new_budget/"""', 'views.create_budget'], {'name': '"""create"""'}), "('^new_budget/', views.create_budget, name='create')\n", (84, 136), False, 'from django.conf.urls import url\n'), ((141, 199), 'django.conf.urls.url', 'url', (['"""^manage_budget/"""', 'views.manage_b... |
import os
import os.path
from setuptools import setup, find_packages
from codecs import open
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='perspective-python',
version='0.0.14',
descriptio... | [
"os.path.dirname",
"setuptools.find_packages",
"os.path.join"
] | [((117, 142), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (132, 142), False, 'import os\n'), ((155, 186), 'os.path.join', 'os.path.join', (['here', '"""README.md"""'], {}), "(here, 'README.md')\n", (167, 186), False, 'import os\n'), ((1073, 1088), 'setuptools.find_packages', 'find_packages... |
import json
from configparser import ConfigParser
from azure.mgmt.resource import PolicyClient
from tenacity import retry, wait_random, stop_after_attempt
from mop2.comprehension.azure.identity.azure_identity_credential_adapter import (
AzureIdentityCredentialAdapter, )
from mop2.utils.files import change_dir
fr... | [
"mop2.comprehension.azure.identity.azure_identity_credential_adapter.AzureIdentityCredentialAdapter",
"configparser.ConfigParser",
"mop2.utils.files.change_dir",
"azure.mgmt.resource.PolicyClient",
"json.load"
] | [((1398, 1468), 'azure.mgmt.resource.PolicyClient', 'PolicyClient', ([], {'credentials': 'credentials', 'subscription_id': 'subscription_id'}), '(credentials=credentials, subscription_id=subscription_id)\n', (1410, 1468), False, 'from azure.mgmt.resource import PolicyClient\n'), ((2261, 2331), 'azure.mgmt.resource.Poli... |
"""Example, how write generator agent for tesla car"""
from random import sample
from string import ascii_lowercase, digits
from magic_agent.core.base import BaseAgent, RuleItem, RuleDevice, RuleItemGenerator
# import constants Rules
from magic_agent.core.rules import MozillaDefault, AppleWebKit, LikeGecko, Safari, ch... | [
"random.sample",
"magic_agent.core.base.BaseAgent",
"magic_agent.core.base.RuleItemGenerator",
"magic_agent.core.base.RuleDevice"
] | [((477, 515), 'magic_agent.core.base.RuleDevice', 'RuleDevice', ([], {'items': "('X11', 'GNU/Linux')"}), "(items=('X11', 'GNU/Linux'))\n", (487, 515), False, 'from magic_agent.core.base import BaseAgent, RuleItem, RuleDevice, RuleItemGenerator\n'), ((879, 958), 'magic_agent.core.base.RuleItemGenerator', 'RuleItemGenera... |
__author__ = "<NAME>"
__copyright__ = "Copyright 2015, <NAME>"
from abc import ABCMeta, abstractstaticmethod
from collections import defaultdict, Counter
class ReorderingTransform(metaclass=ABCMeta):
@abstractstaticmethod
def iter_byte_indexes(len_bytes):
"""
:param len_bytes:
:type... | [
"collections.Counter",
"collections.defaultdict"
] | [((749, 771), 'collections.defaultdict', 'defaultdict', (['bytearray'], {}), '(bytearray)\n', (760, 771), False, 'from collections import defaultdict, Counter\n'), ((1977, 1999), 'collections.defaultdict', 'defaultdict', (['bytearray'], {}), '(bytearray)\n', (1988, 1999), False, 'from collections import defaultdict, Co... |
import collections
import copy
import datetime
import json
def flatten(d, parent_key='', sep='_'):
items = []
for k, v in d.items():
new_key = parent_key + sep + k if parent_key else k
if isinstance(v, collections.MutableMapping):
items.extend(flatten(v, new_key, sep=sep).items())
... | [
"datetime.datetime.strptime",
"json.dumps",
"copy.deepcopy"
] | [((1543, 1563), 'copy.deepcopy', 'copy.deepcopy', (['new_d'], {}), '(new_d)\n', (1556, 1563), False, 'import copy\n'), ((1903, 1919), 'json.dumps', 'json.dumps', (['r[k]'], {}), '(r[k])\n', (1913, 1919), False, 'import json\n'), ((675, 707), 'json.dumps', 'json.dumps', (['flatten_data[column]'], {}), '(flatten_data[col... |
"""
QP-BASIL - Quantiphyse processes for ASL data
These processes use the ``oxasl`` and `fslpyt` python libraries which involves
the following key mappings between Quantiphyse concepts and
oxasl concepts.
- ``quantiphyse.data.QpData`` <-> ``fsl.data.image.Image``
Quantiphyse data objects can be transformed to and ... | [
"oxasl.oxford_asl.oxasl",
"quantiphyse.utils.cmdline.LogProcess.__init__",
"sys.exc_info",
"six.StringIO",
"oxasl.Workspace",
"quantiphyse.utils.QpException",
"traceback.print_exc",
"quantiphyse.utils.cmdline.OutputStreamMonitor",
"quantiphyse.data.DataGrid"
] | [((5024, 5050), 'quantiphyse.utils.cmdline.OutputStreamMonitor', 'OutputStreamMonitor', (['queue'], {}), '(queue)\n', (5043, 5050), False, 'from quantiphyse.utils.cmdline import OutputStreamMonitor, LogProcess\n'), ((5065, 5094), 'oxasl.Workspace', 'Workspace', ([], {'log': 'output_monitor'}), '(log=output_monitor)\n',... |
from django.core.urlresolvers import resolve
from django.test import TestCase
from django.http import HttpRequest, QueryDict
from minimal_django import index, urlpatterns
class HomePageTest(TestCase):
def test_root_url_resolves_to_home_page_view(self):
found = resolve('/', urlconf = urlpatterns)
se... | [
"django.core.urlresolvers.resolve",
"minimal_django.index",
"django.http.HttpRequest"
] | [((274, 307), 'django.core.urlresolvers.resolve', 'resolve', (['"""/"""'], {'urlconf': 'urlpatterns'}), "('/', urlconf=urlpatterns)\n", (281, 307), False, 'from django.core.urlresolvers import resolve\n'), ((424, 437), 'django.http.HttpRequest', 'HttpRequest', ([], {}), '()\n', (435, 437), False, 'from django.http impo... |
import traceback
import os
from todayLoginService import TodayLoginService
from actions.autoSign import AutoSign
from actions.collection import Collection
from actions.sleepCheck import sleepCheck
from actions.workLog import workLog
from actions.sendMessage import SendMessage
from actions.teacherSign import teacherSign... | [
"traceback.format_exc",
"actions.workLog.workLog",
"actions.sleepCheck.sleepCheck",
"actions.autoSign.AutoSign",
"actions.teacherSign.teacherSign",
"os.path.abspath",
"todayLoginService.TodayLoginService",
"actions.collection.Collection"
] | [((1924, 1947), 'todayLoginService.TodayLoginService', 'TodayLoginService', (['user'], {}), '(user)\n', (1941, 1947), False, 'from todayLoginService import TodayLoginService\n'), ((2136, 2159), 'actions.collection.Collection', 'Collection', (['today', 'user'], {}), '(today, user)\n', (2146, 2159), False, 'from actions.... |
import numpy as np
from .qnumber import is_qsparse
__all__ = ['retained_bond_indices', 'split_matrix_svd', 'qr']
def retained_bond_indices(s, tol):
"""
Indices of retained singular values based on given tolerance.
"""
w = np.linalg.norm(s)
if w == 0:
return np.array([], dtype=int)
# ... | [
"numpy.intersect1d",
"numpy.linalg.qr",
"numpy.where",
"numpy.argsort",
"numpy.array",
"numpy.zeros",
"numpy.linalg.norm",
"numpy.linalg.svd",
"numpy.cumsum"
] | [((241, 258), 'numpy.linalg.norm', 'np.linalg.norm', (['s'], {}), '(s)\n', (255, 258), True, 'import numpy as np\n'), ((423, 436), 'numpy.argsort', 'np.argsort', (['s'], {}), '(s)\n', (433, 436), True, 'import numpy as np\n'), ((455, 477), 'numpy.cumsum', 'np.cumsum', (['s[sort_idx]'], {}), '(s[sort_idx])\n', (464, 477... |
import copy
import inspect
import itertools
import types
import warnings
from typing import Any, Dict
import numpy as np
from axelrod import _module_random
from axelrod.action import Action
from axelrod.game import DefaultGame
from axelrod.history import History
from axelrod.random_ import RandomGenerator
C, D = Acti... | [
"axelrod.random_.RandomGenerator",
"itertools.cycle",
"axelrod._module_random.random_seed_int",
"itertools.tee",
"inspect.signature",
"numpy.array_equal",
"axelrod.history.History",
"copy.deepcopy",
"warnings.warn",
"copy.copy"
] | [((2878, 2909), 'inspect.signature', 'inspect.signature', (['cls.__init__'], {}), '(cls.__init__)\n', (2895, 2909), False, 'import inspect\n'), ((3407, 3416), 'axelrod.history.History', 'History', ([], {}), '()\n', (3414, 3416), False, 'from axelrod.history import History\n'), ((3443, 3473), 'copy.deepcopy', 'copy.deep... |
from django.test import TestCase
from newsletter.models import Subscriber
class NewsletterModelTest(TestCase):
""" Test suite for customer model """
def setUp(self):
""" Set up test database """
Subscriber.objects.create(email='<EMAIL>', confirmed=True)
Subscriber.objects.cr... | [
"newsletter.models.Subscriber.objects.all",
"newsletter.models.Subscriber.objects.filter",
"newsletter.models.Subscriber.objects.get",
"newsletter.models.Subscriber.objects.create"
] | [((231, 289), 'newsletter.models.Subscriber.objects.create', 'Subscriber.objects.create', ([], {'email': '"""<EMAIL>"""', 'confirmed': '(True)'}), "(email='<EMAIL>', confirmed=True)\n", (256, 289), False, 'from newsletter.models import Subscriber\n'), ((299, 358), 'newsletter.models.Subscriber.objects.create', 'Subscri... |
'''
@author: <NAME>
@date: 2015-08-25
@organization: MLSB API
@summary: The basic espys API
'''
from flask_restful import Resource, reqparse
from flask import Response
from json import dumps
from api import DB
from api.model import Espys
from api.authentication import requires_admin
from api.errors import EspysDoesNotE... | [
"flask.request.args.get",
"api.model.Espys.query.get",
"flask_restful.reqparse.RequestParser",
"api.errors.EspysDoesNotExist",
"api.DB.session.commit",
"json.dumps",
"api.DB.session.add",
"api.DB.session.delete",
"api.model.Espys",
"api.model.Espys.query.paginate",
"api.helper.pagination_respons... | [((548, 572), 'flask_restful.reqparse.RequestParser', 'reqparse.RequestParser', ([], {}), '()\n', (570, 572), False, 'from flask_restful import Resource, reqparse\n'), ((874, 916), 'flask_restful.reqparse.RequestParser', 'reqparse.RequestParser', ([], {'bundle_errors': '(True)'}), '(bundle_errors=True)\n', (896, 916), ... |
from typing import List
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from chemcharts.core.container.chemdata import ChemData
from chemcharts.core.plots.base_plot import BasePlot, _check_value_input
from chemcharts.core.utils.value_functions import generate_value
from c... | [
"numpy.atleast_2d",
"matplotlib.pyplot.gcf",
"seaborn.set_context",
"matplotlib.pyplot.close",
"chemcharts.core.utils.value_functions.generate_value",
"chemcharts.core.plots.base_plot._check_value_input",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.subplots"
] | [((854, 900), 'chemcharts.core.plots.base_plot._check_value_input', '_check_value_input', (['chemdata_list', '"""Histogram"""'], {}), "(chemdata_list, 'Histogram')\n", (872, 900), False, 'from chemcharts.core.plots.base_plot import BasePlot, _check_value_input\n'), ((1693, 1707), 'matplotlib.pyplot.subplots', 'plt.subp... |
from flask import Flask, render_template, flash, request, session, redirect, url_for
from dbconnect import connection
from flask_bootstrap import Bootstrap
from wtforms import Form, TextField, validators, PasswordField, BooleanField, SelectField, DateField, IntegerField, StringField
from wtforms.validators import I... | [
"flask.render_template",
"dbconnect.connection",
"flask.flash",
"flask.Flask"
] | [((518, 533), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (523, 533), False, 'from flask import Flask, render_template, flash, request, session, redirect, url_for\n'), ((617, 629), 'dbconnect.connection', 'connection', ([], {}), '()\n', (627, 629), False, 'from dbconnect import connection\n'), ((697, 73... |
from usure.config import config
import usure.common.logging as usurelogging
from usure.wordvectors.core import EmbeddingsMachine
from usure.wordvectors.infrastructure import FileCorpusRep, FileKeyedVectorsRep, FileWord2VecRep
if __name__ == "__main__":
usurelogging.config(config.logs, "wordvectors.log")
cor... | [
"usure.wordvectors.infrastructure.FileKeyedVectorsRep",
"usure.wordvectors.core.EmbeddingsMachine",
"usure.wordvectors.infrastructure.FileWord2VecRep",
"usure.common.logging.config",
"usure.wordvectors.infrastructure.FileCorpusRep"
] | [((260, 311), 'usure.common.logging.config', 'usurelogging.config', (['config.logs', '"""wordvectors.log"""'], {}), "(config.logs, 'wordvectors.log')\n", (279, 311), True, 'import usure.common.logging as usurelogging\n'), ((329, 363), 'usure.wordvectors.infrastructure.FileCorpusRep', 'FileCorpusRep', (['config.preproce... |
### Shelly Dimmer 2 Plotter
### Temperature / Brightness over Time
### SpawnTerror 2021
import datetime as dt
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from urllib.request import urlopen
from datetime import datetime
import json
import time
# Create figure for plotting / variables
fi... | [
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.ylabel",
"matplotlib.animation.FuncAnimation",
"datetime.datetime.now",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.pause",
"urllib.request.urlopen",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.show"
] | [((324, 336), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (334, 336), True, 'import matplotlib.pyplot as plt\n'), ((1987, 2066), 'matplotlib.animation.FuncAnimation', 'animation.FuncAnimation', (['fig', 'animate'], {'fargs': '(xs, ys)', 'interval': 'update_interval'}), '(fig, animate, fargs=(xs, ys), in... |
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions describe... | [
"wx.BoxSizer",
"traits.api.TraitEnum",
"traits.api.Trait"
] | [((5056, 5080), 'wx.BoxSizer', 'wx.BoxSizer', (['wx.VERTICAL'], {}), '(wx.VERTICAL)\n', (5067, 5080), False, 'import wx\n'), ((1352, 1373), 'traits.api.Trait', 'Trait', (['ToolBarManager'], {}), '(ToolBarManager)\n', (1357, 1373), False, 'from traits.api import Trait, TraitDict, TraitEnum, TraitList\n'), ((1496, 1517),... |
from model.contact import Contact
from random import randrange
def test_delete_some_contact(app):
if app.contact.count() == 0:
app.contact.add_new_contact(Contact("Test", "Testovich", "Test", "Test_Testovich", "<EMAIL>", "10", "November",
"1997"))
old_contacts = app.contac... | [
"model.contact.Contact"
] | [((169, 264), 'model.contact.Contact', 'Contact', (['"""Test"""', '"""Testovich"""', '"""Test"""', '"""Test_Testovich"""', '"""<EMAIL>"""', '"""10"""', '"""November"""', '"""1997"""'], {}), "('Test', 'Testovich', 'Test', 'Test_Testovich', '<EMAIL>', '10',\n 'November', '1997')\n", (176, 264), False, 'from model.cont... |
import io
import os
import crepe
from google.cloud import translate_v2, speech_v1, texttospeech
from moviepy.editor import *
from scipy.io import wavfile
class VideoTranslator:
def __init__(self):
#BEGIN TRANSLATION SETUP
self.translate_client = translate_v2.Client()
#END TRANSLATION SET... | [
"google.cloud.speech_v1.SpeechClient",
"google.cloud.texttospeech.types.VoiceSelectionParams",
"google.cloud.translate_v2.Client",
"google.cloud.texttospeech.types.AudioConfig",
"crepe.predict",
"io.open",
"scipy.io.wavfile.read",
"google.cloud.texttospeech.types.SynthesisInput",
"google.cloud.textt... | [((4726, 4750), 'scipy.io.wavfile.read', 'wavfile.read', (['"""nani.mov"""'], {}), "('nani.mov')\n", (4738, 4750), False, 'from scipy.io import wavfile\n'), ((4793, 4831), 'crepe.predict', 'crepe.predict', (['audio', 'sr'], {'viterbi': '(True)'}), '(audio, sr, viterbi=True)\n', (4806, 4831), False, 'import crepe\n'), (... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 <NAME> <<EMAIL>>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
from setuptools import find_packages, setup
setup(
name='TracChangelogFilter... | [
"setuptools.find_packages"
] | [((357, 372), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (370, 372), False, 'from setuptools import find_packages, setup\n')] |
# Highly divisible triangular number
# Problem 12
# The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28.
# The first ten terms would be:
# 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...
# Let us list the factors of the first seven t... | [
"datetime.datetime.now",
"math.sqrt"
] | [((923, 946), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (944, 946), False, 'import datetime\n'), ((1119, 1142), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (1140, 1142), False, 'import datetime\n'), ((698, 710), 'math.sqrt', 'math.sqrt', (['n'], {}), '(n)\n', (707, 710)... |
#!/usr/bin/env python
'''
@author <NAME> <<EMAIL>>
@date Thu Oct 25 15:41:44 EDT 2012
@file pyon/util/poller.py
@brief Utility for polling
'''
import gevent
import functools
def poll(poller, *args, **kwargs):
'''
Polls a callback (poller) until success is met
poller must be a valid callback and returns Tr... | [
"functools.wraps",
"gevent.sleep",
"gevent.timeout.Timeout"
] | [((482, 513), 'gevent.timeout.Timeout', 'gevent.timeout.Timeout', (['timeout'], {}), '(timeout)\n', (504, 513), False, 'import gevent\n'), ((699, 720), 'functools.wraps', 'functools.wraps', (['func'], {}), '(func)\n', (714, 720), False, 'import functools\n'), ((600, 617), 'gevent.sleep', 'gevent.sleep', (['(0.2)'], {})... |
from typing import TypeVar, Generic, Optional, Dict, List, Any
from dataclasses import dataclass
from dataclasses_json import dataclass_json, LetterCase, Undefined
from datetime import datetime, timedelta
T = TypeVar('T')
Table = TypeVar('Table')
From = TypeVar('From')
Into = TypeVar('Into')
TKey = TypeVar('TKey')
TVa... | [
"dataclasses_json.dataclass_json",
"typing.TypeVar"
] | [((210, 222), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (217, 222), False, 'from typing import TypeVar, Generic, Optional, Dict, List, Any\n'), ((231, 247), 'typing.TypeVar', 'TypeVar', (['"""Table"""'], {}), "('Table')\n", (238, 247), False, 'from typing import TypeVar, Generic, Optional, Dict, List, ... |
from scipy.stats import multivariate_normal as normal
import numpy as np
from time import time
from experiments.lnpdfs.create_target_lnpfs import build_target_likelihood_planar_n_link
from sampler.SliceSampling.slice_sampler import slice_sample
num_dimensions = 10
conf_likelihood_var = 4e-2 * np.ones(num_dimensions)
c... | [
"numpy.savez",
"numpy.eye",
"numpy.ones",
"experiments.lnpdfs.create_target_lnpfs.build_target_likelihood_planar_n_link",
"numpy.array",
"numpy.zeros",
"time.time"
] | [((368, 394), 'numpy.array', 'np.array', (['[0.0001, 0.0001]'], {}), '([0.0001, 0.0001])\n', (376, 394), True, 'import numpy as np\n'), ((295, 318), 'numpy.ones', 'np.ones', (['num_dimensions'], {}), '(num_dimensions)\n', (302, 318), True, 'import numpy as np\n'), ((400, 499), 'experiments.lnpdfs.create_target_lnpfs.bu... |
from django.urls import path
from . import views
app_name = 'predictor'
# TODO: add static just for one app
urlpatterns = [
path('', views.index, name='index'),
path('auth', views.auth, name='auth'),
path('register', views.register_page, name='register'),
path('restore', views.restore, name='restore... | [
"django.urls.path"
] | [((132, 167), 'django.urls.path', 'path', (['""""""', 'views.index'], {'name': '"""index"""'}), "('', views.index, name='index')\n", (136, 167), False, 'from django.urls import path\n'), ((173, 210), 'django.urls.path', 'path', (['"""auth"""', 'views.auth'], {'name': '"""auth"""'}), "('auth', views.auth, name='auth')\n... |
# print values of interesting diagnoses.
import csv
file = open('atc_icd_implausible_excluded_validated_deleted.csv')
reader = csv.reader(file, delimiter=';')
headers = next(reader, None)
interesting_columns = ['icd10_01']
info = {}
for col in interesting_columns:
info[col] = {}
data = []
for row in reader:
... | [
"csv.reader"
] | [((128, 159), 'csv.reader', 'csv.reader', (['file'], {'delimiter': '""";"""'}), "(file, delimiter=';')\n", (138, 159), False, 'import csv\n')] |