code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# ##### BEGIN MIT LICENSE BLOCK #####
#
# MIT License
#
# Copyright (c) 2022 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rig... | [
"enum.auto",
"mathutils.Vector"
] | [((1292, 1298), 'enum.auto', 'auto', ([], {}), '()\n', (1296, 1298), False, 'from enum import Flag, auto\n'), ((1315, 1321), 'enum.auto', 'auto', ([], {}), '()\n', (1319, 1321), False, 'from enum import Flag, auto\n'), ((1338, 1344), 'enum.auto', 'auto', ([], {}), '()\n', (1342, 1344), False, 'from enum import Flag, au... |
from typing import TYPE_CHECKING
from sqlalchemy import Float, Integer, Text
from sqlalchemy.orm import relationship
from sqlalchemy.sql.schema import Column, ForeignKey
from app.db.base_class import Base
if TYPE_CHECKING:
from .survey import Survey
class Survey_Results(Base):
id = Column(Integer, primary_ke... | [
"sqlalchemy.sql.schema.ForeignKey",
"sqlalchemy.sql.schema.Column"
] | [((294, 352), 'sqlalchemy.sql.schema.Column', 'Column', (['Integer'], {'primary_key': '(True)', 'index': '(True)', 'unique': '(True)'}), '(Integer, primary_key=True, index=True, unique=True)\n', (300, 352), False, 'from sqlalchemy.sql.schema import Column, ForeignKey\n'), ((478, 506), 'sqlalchemy.sql.schema.Column', 'C... |
from flask import Flask, render_template
app = Flask(__name__)
namelist = ['chengli', 'qizhi', 'zhangsan', 'wangqizhi']
name2 = 'wangqizhi'
user = {
'username': 'Grey Li',
'bio': 'A boy who loves movies and music.',
}
movies = [
{'name': 'My Neighbor Totoro', 'year': '1988'},
{'name': 'Three Colours... | [
"flask.render_template",
"flask.Flask"
] | [((48, 63), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (53, 63), False, 'from flask import Flask, render_template\n'), ((802, 891), 'flask.render_template', 'render_template', (['"""index.html"""'], {'movies': 'movies', 'name2': 'name2', 'mylist': 'mylist', 'mydic': 'mydic'}), "('index.html', movies=mo... |
from __future__ import print_function
import argparse
import atexit
import boto3
import psycopg2
import re
import sys
import logging
from botocore.client import Config
if sys.argv[0].endswith("__main__.py"):
sys.argv[0] = "python -m redshiftsql"
nl_tabs_regex = re.compile(r"[\n\t]")
spaces_regex = re.compile(r"... | [
"logging.getLogger",
"psycopg2.connect",
"argparse.ArgumentParser",
"re.compile",
"botocore.client.Config"
] | [((270, 292), 're.compile', 're.compile', (['"""[\\\\n\\\\t]"""'], {}), "('[\\\\n\\\\t]')\n", (280, 292), False, 'import re\n'), ((307, 327), 're.compile', 're.compile', (['"""/s{2,}"""'], {}), "('/s{2,}')\n", (317, 327), False, 'import re\n'), ((465, 490), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {})... |
'''
Four Digit Display demo
Author: shaoziyang
Date: 2018.3
http://www.micropython.org.cn
'''
from microbit import *
import FourDigitDisplay
fdd = FourDigitDisplay.FourDigitDisplay()
n = 0
while 1:
fdd.shownum(n)
n += 1
sleep(1000)
| [
"FourDigitDisplay.FourDigitDisplay"
] | [((169, 204), 'FourDigitDisplay.FourDigitDisplay', 'FourDigitDisplay.FourDigitDisplay', ([], {}), '()\n', (202, 204), False, 'import FourDigitDisplay\n')] |
#wolframalpha settings
from wolframalpha import Client
app_id = "TGRUL2-794AT5556P"
client = Client(app_id)
#getting user directory
from subprocess import getoutput
homeDir = getoutput('echo $HOME')
| [
"wolframalpha.Client",
"subprocess.getoutput"
] | [((93, 107), 'wolframalpha.Client', 'Client', (['app_id'], {}), '(app_id)\n', (99, 107), False, 'from wolframalpha import Client\n'), ((176, 199), 'subprocess.getoutput', 'getoutput', (['"""echo $HOME"""'], {}), "('echo $HOME')\n", (185, 199), False, 'from subprocess import getoutput\n')] |
# coding: utf-8
import s3fs
import xarray as xr
def apply_nldas_weight_grid(weight_grid_zarr, dataset_zarr, out_store):
ds = xr.open_zarr(weight_grid_zarr)
ds_nldas = xr.open_zarr(dataset_zarr)
ds_nldas_st = ds_nldas.stack(nldas_grid_no=['lat', 'lon'])
ds_nldas_st = ds_nldas_st.assign_coords(nldas_gri... | [
"xarray.open_zarr",
"s3fs.S3Map",
"xarray.Dataset",
"s3fs.S3FileSystem"
] | [((131, 161), 'xarray.open_zarr', 'xr.open_zarr', (['weight_grid_zarr'], {}), '(weight_grid_zarr)\n', (143, 161), True, 'import xarray as xr\n'), ((177, 203), 'xarray.open_zarr', 'xr.open_zarr', (['dataset_zarr'], {}), '(dataset_zarr)\n', (189, 203), True, 'import xarray as xr\n'), ((684, 705), 'xarray.Dataset', 'xr.Da... |
import numpy as np
class GA(object):
def __init__(self, nInd, nCrom, probCruz, probMut, nGer, fCusto, tipoSel='roleta', tipoCruz='ponto', tipoMut='bit-a-bit', elit=True, verbose=True):
'''
Algoritmo genético para problemas de minimização de custo.
nInd - Número de indivíduos
... | [
"numpy.ones",
"numpy.random.random",
"numpy.where",
"numpy.sum",
"numpy.random.randint",
"numpy.zeros",
"numpy.argmin"
] | [((1474, 1522), 'numpy.random.randint', 'np.random.randint', (['(0)', '(2)', '(self.nInd, self.nCrom)'], {}), '(0, 2, (self.nInd, self.nCrom))\n', (1491, 1522), True, 'import numpy as np\n'), ((1548, 1566), 'numpy.ones', 'np.ones', (['self.nInd'], {}), '(self.nInd)\n', (1555, 1566), True, 'import numpy as np\n'), ((247... |
import zengl
class Context:
context = None
main_uniform_buffer = None
main_uniform_buffer_data = bytearray(b'\x00' * 64)
@classmethod
def initialize(cls):
ctx = zengl.context()
cls.context = ctx
cls.main_uniform_buffer = ctx.buffer(size=64)
ctx.includes['main_unifo... | [
"zengl.context",
"zengl.camera"
] | [((192, 207), 'zengl.context', 'zengl.context', ([], {}), '()\n', (205, 207), False, 'import zengl\n'), ((564, 613), 'zengl.camera', 'zengl.camera', (['eye', 'target'], {'aspect': 'aspect', 'fov': 'fov'}), '(eye, target, aspect=aspect, fov=fov)\n', (576, 613), False, 'import zengl\n')] |
#!/usr/bin/env python
# Quick test
import NameMapping
print(NameMapping.legacyPathToRiakBucketName('IMG_','/fdaf16c657d997656bbccc5752eefa9f/images/1620028670_192497.jpg'))
print(NameMapping.legacyPathToRiakBucketName('IMG_','/fdaf16c657d997656bbccc5752eefa9f/images/'))
print(NameMapping.legacyPathToRiakBucketName('... | [
"NameMapping.legacyPathToRiakKeyName",
"NameMapping.legacyPathToRiakBucketName"
] | [((63, 179), 'NameMapping.legacyPathToRiakBucketName', 'NameMapping.legacyPathToRiakBucketName', (['"""IMG_"""', '"""/fdaf16c657d997656bbccc5752eefa9f/images/1620028670_192497.jpg"""'], {}), "('IMG_',\n '/fdaf16c657d997656bbccc5752eefa9f/images/1620028670_192497.jpg')\n", (101, 179), False, 'import NameMapping\n'), ... |
import ast
import collections
import itertools
import logging
import os
import sys
from argparse import ArgumentParser
from enum import Enum
from pprint import pformat
from typing import Dict, Iterator, List, Optional, Set, Tuple
class DuplicateEnumClassError(Exception):
pass
class DuplicateEnumItemError(Except... | [
"itertools.chain",
"logging.getLogger",
"logging.StreamHandler",
"argparse.ArgumentParser",
"os.path.join",
"pprint.pformat",
"collections.Counter",
"ast.parse",
"os.walk"
] | [((3663, 3713), 'itertools.chain', 'itertools.chain', (['*[a.targets for a in assignments]'], {}), '(*[a.targets for a in assignments])\n', (3678, 3713), False, 'import itertools\n'), ((3967, 3993), 'collections.Counter', 'collections.Counter', (['names'], {}), '(names)\n', (3986, 3993), False, 'import collections\n'),... |
import os
import redis
from rq import Queue, Worker, Connection
redis_url = os.getenv('REDIS_URL') or 'redis://localhost:6379'
listen = ['default']
conn = redis.from_url(redis_url)
if __name__ == '__main__':
with Connection(conn):
worker = Worker(list(map(Queue,listen)))
worker.work() | [
"redis.from_url",
"rq.Connection",
"os.getenv"
] | [((158, 183), 'redis.from_url', 'redis.from_url', (['redis_url'], {}), '(redis_url)\n', (172, 183), False, 'import redis\n'), ((78, 100), 'os.getenv', 'os.getenv', (['"""REDIS_URL"""'], {}), "('REDIS_URL')\n", (87, 100), False, 'import os\n'), ((221, 237), 'rq.Connection', 'Connection', (['conn'], {}), '(conn)\n', (231... |
from typing import Dict, List, Any
from tcfbot.account import Account
from tcfbot.event import Event
from tcfbot.payment_day import PaymentDay
import logging
logger = logging.getLogger(__name__)
class Reservation:
def __init__(self, **kwargs):
self.account: Account = kwargs.get('account', Ac... | [
"logging.getLogger",
"tcfbot.account.Account",
"tcfbot.event.Event",
"tcfbot.payment_day.PaymentDay"
] | [((176, 203), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (193, 203), False, 'import logging\n'), ((318, 327), 'tcfbot.account.Account', 'Account', ([], {}), '()\n', (325, 327), False, 'from tcfbot.account import Account\n'), ((378, 385), 'tcfbot.event.Event', 'Event', ([], {}), '()\n'... |
#!python
import os
import psycopg2
class Database():
""" Handles interaction with the Postgres database """
def __init__(self):
self.port = 5432
self.host = 'localhost'
self.database = 'postgis'
self.user = 'postgis'
self.password = 'password'
s... | [
"psycopg2.connect",
"os.getenv"
] | [((744, 774), 'os.getenv', 'os.getenv', (['"""PGPORT"""', 'self.port'], {}), "('PGPORT', self.port)\n", (753, 774), False, 'import os\n'), ((796, 826), 'os.getenv', 'os.getenv', (['"""PGHOST"""', 'self.host'], {}), "('PGHOST', self.host)\n", (805, 826), False, 'import os\n'), ((852, 890), 'os.getenv', 'os.getenv', (['"... |
"""Add a column in tbl_layers
Revision ID: 5dc24c7056e5
Revises: <KEY>
Create Date: 2021-12-30 12:58:00.775568
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5dc24c7056e5'
down_revision = '<KEY>'
branch_labels = None
depends_on = None
def upgrade():
op.... | [
"sqlalchemy.String",
"alembic.op.drop_column"
] | [((410, 454), 'alembic.op.drop_column', 'op.drop_column', (['"""tbl_layers"""', '"""display_name"""'], {}), "('tbl_layers', 'display_name')\n", (424, 454), False, 'from alembic import op\n'), ((370, 384), 'sqlalchemy.String', 'sa.String', (['(255)'], {}), '(255)\n', (379, 384), True, 'import sqlalchemy as sa\n')] |
# coding: UTF-8
from django.core.urlresolvers import reverse
from django.views.generic import DeleteView
from django.contrib import messages
class DeleteViewBase(DeleteView):
url_name = ""
template_name = 'base/templates/cbv/base/DeleteViewCustom.html'
class DeleteViewCustom(DeleteViewBase):
def get... | [
"django.core.urlresolvers.reverse",
"django.contrib.messages.add_message"
] | [((343, 417), 'django.contrib.messages.add_message', 'messages.add_message', (['self.request', 'messages.INFO', '"""Suppression effectuée"""'], {}), "(self.request, messages.INFO, 'Suppression effectuée')\n", (363, 417), False, 'from django.contrib import messages\n'), ((428, 453), 'django.core.urlresolvers.reverse', '... |
###
# Taken from http://bokeh.pydata.org/en/latest/docs/gallery/iris.html
###
from bokeh.sampledata.iris import flowers
import bokeh.plotting as plt
def main():
colormap = {'setosa': 'red', 'versicolor': 'green', 'virginica': 'blue'}
flowers['color'] = flowers['species'].map(lambda x: colormap[x])
plt.... | [
"bokeh.plotting.show",
"bokeh.plotting.figure",
"bokeh.plotting.output_file"
] | [((316, 369), 'bokeh.plotting.output_file', 'plt.output_file', (['"""iris.html"""'], {'title': '"""iris.py example"""'}), "('iris.html', title='iris.py example')\n", (331, 369), True, 'import bokeh.plotting as plt\n'), ((379, 414), 'bokeh.plotting.figure', 'plt.figure', ([], {'title': '"""Iris Morphology"""'}), "(title... |
from flask_restful import Resource, reqparse
from flask_jwt_extended import jwt_required, fresh_jwt_required, get_jwt_claims
from db.db import insert_timestamp
from models.item import ItemModel
from models.store import StoreModel
class Item(Resource):
parser = reqparse.RequestParser()
parser.add_argument('item... | [
"flask_restful.reqparse.RequestParser",
"models.store.StoreModel.find_by_name",
"models.item.ItemModel.query.all",
"flask_jwt_extended.get_jwt_claims",
"models.item.ItemModel.find_by_name",
"models.item.ItemModel.find_stock",
"db.db.insert_timestamp"
] | [((266, 290), 'flask_restful.reqparse.RequestParser', 'reqparse.RequestParser', ([], {}), '()\n', (288, 290), False, 'from flask_restful import Resource, reqparse\n'), ((3095, 3119), 'flask_restful.reqparse.RequestParser', 'reqparse.RequestParser', ([], {}), '()\n', (3117, 3119), False, 'from flask_restful import Resou... |
import pandas as pd
import numpy as np
from astropy.io import ascii
def load_master_table():
df1 = ascii.read("mwgc1.dat").to_pandas()
df1.index = df1.pop("ID")
df2 = ascii.read("mwgc2.dat").to_pandas()
df2.index = df2.pop("ID")
df3 = ascii.read("mwgc3.dat").to_pandas()
df3.index = df3.pop("ID"... | [
"pandas.concat",
"astropy.io.ascii.read"
] | [((331, 365), 'pandas.concat', 'pd.concat', (['[df1, df2, df3]'], {'axis': '(1)'}), '([df1, df2, df3], axis=1)\n', (340, 365), True, 'import pandas as pd\n'), ((104, 127), 'astropy.io.ascii.read', 'ascii.read', (['"""mwgc1.dat"""'], {}), "('mwgc1.dat')\n", (114, 127), False, 'from astropy.io import ascii\n'), ((180, 20... |
#!/usr/bin/env python3
import argparse
import mcb185
# In prokaryotic genomes, genes are often predicted based on length
# Long ORFs are not expected to occur by chance
# Write a program that creates a histogram of ORF lengths in random DNA - how many tmes did you see each length
# Your library should contain new f... | [
"mcb185.randseq",
"mcb185.orf",
"argparse.ArgumentParser"
] | [((754, 811), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""explore ORF length"""'}), "(description='explore ORF length')\n", (777, 811), False, 'import argparse\n'), ((1899, 1931), 'mcb185.randseq', 'mcb185.randseq', (['arg.size', 'arg.gc'], {}), '(arg.size, arg.gc)\n', (1913, 1931), F... |
import re
from collections import defaultdict, Counter
from numbers import Number
from typing import Optional, List, Dict
import numpy as np
import torch
from allennlp.common import FromParams, Registrable
from dataclasses import dataclass, replace
from pycocoevalcap.bleu.bleu import Bleu
from pycocoevalcap.cider.cid... | [
"third_party.detection_metrics.lib.Evaluator.BoundingBoxes",
"pycocoevalcap.bleu.bleu.Bleu",
"dataclasses.dataclass",
"numpy.array",
"third_party.detection_metrics.lib.Evaluator.Evaluator",
"gpv2.data.dataset.CaptioningExample",
"re.search",
"gpv2.utils.image_utils.get_image_size",
"numpy.mean",
"... | [((1083, 1105), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (1092, 1105), False, 'from dataclasses import dataclass, replace\n'), ((6042, 6062), 'collections.Counter', 'Counter', (['ngt_answers'], {}), '(ngt_answers)\n', (6049, 6062), False, 'from collections import defaultdict,... |
# Copyright (c) 2015-2018 by the parties listed in the AUTHORS file.
# All rights reserved. Use of this source code is governed by
# a BSD-style license that can be found in the LICENSE file.
# from memory_profiler import profile
from collections import OrderedDict
import os
from toast_planck.preproc_modules import ... | [
"numpy.radians",
"astropy.io.fits.ColDefs",
"numpy.hstack",
"healpy.rotator.get_coordconv_matrix",
"numpy.argsort",
"numpy.array",
"astropy.io.fits.Column",
"numpy.diff",
"numpy.dot",
"numpy.eye",
"collections.OrderedDict",
"astropy.io.fits.PrimaryHDU",
"toast_planck.preproc_modules.MapSampl... | [((933, 942), 'numpy.eye', 'np.eye', (['(3)'], {}), '(3)\n', (939, 942), True, 'import numpy as np\n'), ((689, 714), 'numpy.radians', 'np.radians', (['(90 - self.lat)'], {}), '(90 - self.lat)\n', (699, 714), True, 'import numpy as np\n'), ((734, 754), 'numpy.radians', 'np.radians', (['self.lon'], {}), '(self.lon)\n', (... |
import torch
import numpy
import environment as env
from environment import get_valid_directions, move, prettyprint
class Policy(nn.Module):
def __init__(self):
super(Policy, self).__init__()
self.input_dim = 4 # onehot of possible paths
self.output_dim = 4 # action probs
self... | [
"numpy.mean",
"torch.distributions.Categorical",
"environment.get_valid_directions",
"torch.mean",
"torch.stack",
"torch.cuda.is_available",
"torch.sum",
"environment.move",
"torch.no_grad",
"torch.zeros",
"torch.cat",
"torch.device"
] | [((1234, 1259), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (1257, 1259), False, 'import torch\n'), ((1210, 1230), 'torch.device', 'torch.device', (['"""cuda"""'], {}), "('cuda')\n", (1222, 1230), False, 'import torch\n'), ((1265, 1284), 'torch.device', 'torch.device', (['"""cpu"""'], {}), "... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# LICENSE
#
# Copyright (C) 2010-2018 GEM Foundation, <NAME>, <NAME>,
# <NAME>.
#
# The Hazard Modeller's Toolkit is free software: you can redistribute
# it and/or modify it under the terms of the GNU Affero General Public
# Li... | [
"openquake.hazardlib.mfd.truncated_gr.TruncatedGRMFD",
"numpy.ones",
"openquake.hazardlib.tom.PoissonTOM",
"openquake.hmtk.seismicity.catalogue.Catalogue",
"numpy.testing.assert_array_equal",
"warnings.resetwarnings",
"openquake.hmtk.sources.point_source.mtkPointSource",
"openquake.hazardlib.geo.point... | [((2647, 2663), 'openquake.hazardlib.tom.PoissonTOM', 'PoissonTOM', (['(50.0)'], {}), '(50.0)\n', (2657, 2663), False, 'from openquake.hazardlib.tom import PoissonTOM\n'), ((3081, 3112), 'warnings.simplefilter', 'warnings.simplefilter', (['"""ignore"""'], {}), "('ignore')\n", (3102, 3112), False, 'import warnings\n'), ... |
import json
import requests
import base64
from past.builtins import basestring
from auth0_provider import Auth0Provider
class AuthzAssociationProvider(Auth0Provider, object):
"""
"""
def __init__(self, supported_resource_type, owner, owned, collection=None):
super(AuthzAssociationProvider, self)... | [
"base64.b64encode",
"json.dumps",
"base64.b64decode"
] | [((2207, 2250), 'base64.b64decode', 'base64.b64decode', (['self.physical_resource_id'], {}), '(self.physical_resource_id)\n', (2223, 2250), False, 'import base64\n'), ((1973, 2035), 'json.dumps', 'json.dumps', (['[self.owner_id, self.owned_id]'], {'ensure_ascii': '(False)'}), '([self.owner_id, self.owned_id], ensure_as... |
import unittest
import numpy as np
from pax import core, plugin
from pax.datastructure import Event, Peak
class TestPosRecMaxPMT(unittest.TestCase):
def setUp(self):
self.pax = core.Processor(config_names='XENON100', just_testing=True, config_dict={'pax': {
'plugin_group_names': ['test'],
... | [
"pax.core.Processor",
"numpy.array",
"numpy.zeros",
"pax.datastructure.Event.empty_event",
"unittest.main",
"pax.datastructure.Peak"
] | [((2092, 2107), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2105, 2107), False, 'import unittest\n'), ((193, 342), 'pax.core.Processor', 'core.Processor', ([], {'config_names': '"""XENON100"""', 'just_testing': '(True)', 'config_dict': "{'pax': {'plugin_group_names': ['test'], 'test': 'MaxPMT.PosRecMaxPMT'}}"}... |
__author__ = 'wcong'
import ants
import time
from antsext import CrawlDao
import random
import re
import datetime
class CarSpider(ants.Spider):
name = 'yang_che_car_spider'
start_urls = [
'http://www.yangche51.com/'
]
source_id = '6'
url = 'http://www.yangche51.com/handlers/choosecar/ch... | [
"ants.Request",
"antsext.CrawlDao.CrawlDao",
"re.compile",
"datetime.datetime.now",
"random.random",
"time.time"
] | [((525, 544), 'antsext.CrawlDao.CrawlDao', 'CrawlDao.CrawlDao', ([], {}), '()\n', (542, 544), False, 'from antsext import CrawlDao\n'), ((568, 586), 're.compile', 're.compile', (['"""\\\\d+"""'], {}), "('\\\\d+')\n", (578, 586), False, 'import re\n'), ((601, 624), 'datetime.datetime.now', 'datetime.datetime.now', ([], ... |
"""
Set of functions related to Deirokay validation.
"""
import functools
import json
import warnings
from copy import deepcopy
from datetime import datetime
from os.path import splitext
from types import ModuleType
from typing import Optional, Union
import pandas
from jinja2 import BaseLoader
from jinja2 import Stri... | [
"datetime.datetime.utcnow",
"jinja2.BaseLoader",
"json.dumps",
"os.path.splitext",
"deirokay.exceptions.ValidationError",
"deirokay.fs.fs_factory",
"deirokay.history_template.get_series",
"deirokay.utils._check_columns_in_df_columns",
"copy.deepcopy",
"warnings.warn",
"functools.lru_cache"
] | [((729, 760), 'functools.lru_cache', 'functools.lru_cache', ([], {'maxsize': '(32)'}), '(maxsize=32)\n', (748, 760), False, 'import functools\n'), ((964, 985), 'deirokay.fs.fs_factory', 'fs_factory', (['file_path'], {}), '(file_path)\n', (974, 985), False, 'from deirokay.fs import FileSystem, LocalFileSystem, fs_factor... |
import os
from setuptools import find_packages, setup
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
long_description = readme.read()
with open(os.path.join(os.path.dirname(__file__), 'requirements.txt')) as f:
requirements = f.read().splitlines()
# allow setup.py to be run from a... | [
"mxio.version.get_version",
"os.path.dirname",
"setuptools.find_packages",
"os.path.abspath"
] | [((484, 497), 'mxio.version.get_version', 'get_version', ([], {}), '()\n', (495, 497), False, 'from mxio.version import get_version\n'), ((568, 583), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (581, 583), False, 'from setuptools import find_packages, setup\n'), ((78, 103), 'os.path.dirname', 'os.pat... |
import pandas as pd
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
import time
import re
data = pd.read_csv('data.csv')
missed_data_3 = data[data.isnull()['Room Scheduling Product']]
chrome_options = Options()
chrome_options.add_ar... | [
"selenium.webdriver.chrome.options.Options",
"time.sleep",
"selenium.webdriver.Chrome",
"pandas.read_csv"
] | [((183, 206), 'pandas.read_csv', 'pd.read_csv', (['"""data.csv"""'], {}), "('data.csv')\n", (194, 206), True, 'import pandas as pd\n'), ((289, 298), 'selenium.webdriver.chrome.options.Options', 'Options', ([], {}), '()\n', (296, 298), False, 'from selenium.webdriver.chrome.options import Options\n'), ((355, 417), 'sele... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-04-14 15:02
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("app_rename_column", "0001_initial")]
operations = [
migrations.RenameField(model_name="a", old_... | [
"django.db.migrations.RenameField"
] | [((277, 353), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name': '"""a"""', 'old_name': '"""field"""', 'new_name': '"""renamed"""'}), "(model_name='a', old_name='field', new_name='renamed')\n", (299, 353), False, 'from django.db import migrations\n')] |
# pylint: disable=unused-argument
"""
Tests for the data dissemination application
"""
import random
from api.endpoints.constants import DISSEMINATION_NO_ASSOCIATION, \
DISSEMINATION_RESULT_FEMALE, DISSEMINATION_RESULT_MALE
from api.script import populate
def test_calculate_result_bias_block_3(client, make_quiz):... | [
"api.script.populate",
"random.choices"
] | [((2586, 2596), 'api.script.populate', 'populate', ([], {}), '()\n', (2594, 2596), False, 'from api.script import populate\n'), ((3454, 3492), 'random.choices', 'random.choices', (['range_3'], {'k': 'sample_size'}), '(range_3, k=sample_size)\n', (3468, 3492), False, 'import random\n'), ((3513, 3551), 'random.choices', ... |
import asyncio
from datetime import timedelta
import pytest
import schedule
from lightbus.exceptions import CannotBlockHere
from lightbus.utilities.async_tools import (
call_every,
cancel,
call_on_schedule,
run_user_provided_callable,
block,
)
pytestmark = pytest.mark.unit
@pytest.fixture()
def... | [
"datetime.timedelta",
"schedule.every",
"pytest.raises",
"asyncio.ensure_future",
"asyncio.sleep",
"pytest.fixture",
"lightbus.utilities.async_tools.cancel",
"lightbus.utilities.async_tools.run_user_provided_callable"
] | [((300, 316), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (314, 316), False, 'import pytest\n'), ((874, 890), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (888, 890), False, 'import pytest\n'), ((660, 690), 'pytest.raises', 'pytest.raises', (['CannotBlockHere'], {}), '(CannotBlockHere)\n', (673, 690)... |
"""
Provides infilling support for stitched IFCB rev 1 images
Based on pyifcb API
"""
import numpy as np
from scipy.interpolate import Rbf
from functools32 import lru_cache
from ifcb.data.utils import BaseDictlike
from ifcb.data.stitching import Stitcher
_LEGACY_EPS = 0.000001
def normz(a):
m = np.max(a) + _LE... | [
"numpy.convolve",
"numpy.sqrt",
"numpy.logical_not",
"numpy.array",
"numpy.cumsum",
"numpy.arange",
"numpy.where",
"numpy.max",
"numpy.take",
"numpy.random.seed",
"numpy.random.normal",
"numpy.ones",
"numpy.argmax",
"ifcb.data.stitching.Stitcher",
"functools32.lru_cache",
"numpy.sum",
... | [((925, 974), 'numpy.array', 'np.array', (['[2, 2, 2, 2, 2, 4, 8, 2, 1, 1, 1, 1, 1]'], {}), '([2, 2, 2, 2, 2, 4, 8, 2, 1, 1, 1, 1, 1])\n', (933, 974), True, 'import numpy as np\n'), ((459, 473), 'numpy.arange', 'np.arange', (['(256)'], {}), '(256)\n', (468, 473), True, 'import numpy as np\n'), ((507, 526), 'numpy.sum',... |
from math import sqrt
from baseClasses.Template import *
import os, numpy as np, random
from helper.functions import outputObj, loadOBJ, scaleValues
from PIL import Image as im
class EurecomTemplate(Template):
folderTemplate = None
faceMarks = []
layersChar = None
overFlow = None
underFlow = None
... | [
"helper.functions.scaleValues",
"os.path.exists",
"PIL.Image.fromarray",
"PIL.Image.open",
"numpy.uint8",
"os.makedirs",
"os.path.join",
"numpy.zeros",
"os.path.sep.join",
"random.randint",
"helper.functions.loadOBJ"
] | [((2344, 2371), 'os.path.exists', 'os.path.exists', (['fullImgPath'], {}), '(fullImgPath)\n', (2358, 2371), False, 'import os, numpy as np, random\n'), ((4618, 4643), 'os.path.exists', 'os.path.exists', (['filesPath'], {}), '(filesPath)\n', (4632, 4643), False, 'import os, numpy as np, random\n'), ((5367, 5412), 'PIL.I... |
#!/usr/bin/env python3
import os
from os import path
import shutil
import csv
import argparse
class FileMover():
SETTINGS = {}
LOOKUP_TABLE = {}
def __init__(self, csv_file, src, dst_folder, classes, opr, ext):
self.SETTINGS = {
'csv_file': csv_file,
'src': src,
... | [
"os.path.exists",
"os.listdir",
"argparse.ArgumentParser",
"os.path.join",
"os.mkdir",
"csv.reader"
] | [((2047, 2072), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2070, 2072), False, 'import argparse\n'), ((1729, 1778), 'csv.reader', 'csv.reader', (['csvfile'], {'delimiter': '""","""', 'quotechar': '"""|"""'}), "(csvfile, delimiter=',', quotechar='|')\n", (1739, 1778), False, 'import csv\n')... |
# -*- coding: utf-8 -*-
""" standard """
import ConfigParser
from random import randint
import sys
""" custom """
from threatconnect import ThreatConnect
from threatconnect.Config.FilterOperator import FilterSetOperator
# configuration file
config_file = "tc.conf"
# retrieve configuration file
config = ConfigParser... | [
"threatconnect.ThreatConnect",
"ConfigParser.RawConfigParser",
"sys.exit"
] | [((308, 338), 'ConfigParser.RawConfigParser', 'ConfigParser.RawConfigParser', ([], {}), '()\n', (336, 338), False, 'import ConfigParser\n'), ((819, 894), 'threatconnect.ThreatConnect', 'ThreatConnect', (['api_access_id', 'api_secret_key', 'api_default_org', 'api_base_url'], {}), '(api_access_id, api_secret_key, api_def... |
import sys
import os
import time
import random
import keyboard
from console.screen import sc
from rich.console import Console
mythical_creature_list = None
male_name_list = None
both_sex_name_list = None
name_of_queen = None
weapon_type_list = None
your_weapon_type = None
name_of_trainer = None
... | [
"random.choice",
"keyboard.is_pressed",
"rich.console.Console",
"random.random",
"console.screen.sc.location",
"os.system",
"sys.stdout.flush",
"sys.stdout.write"
] | [((365, 374), 'rich.console.Console', 'Console', ([], {}), '()\n', (372, 374), False, 'from rich.console import Console\n'), ((1781, 1814), 'os.system', 'os.system', (['"""title Rise of Savior"""'], {}), "('title Rise of Savior')\n", (1790, 1814), False, 'import os\n'), ((1820, 1836), 'os.system', 'os.system', (['"""cl... |
from __future__ import annotations
from abc import abstractmethod
from typing import TypeVar, TYPE_CHECKING, Dict, List, Type
from ravendb.documents.store.lazy import Lazy
if TYPE_CHECKING:
from ravendb.documents.session.document_session import DocumentSession
_T = TypeVar("_T")
class LoaderWithInclude:
@a... | [
"typing.TypeVar"
] | [((273, 286), 'typing.TypeVar', 'TypeVar', (['"""_T"""'], {}), "('_T')\n", (280, 286), False, 'from typing import TypeVar, TYPE_CHECKING, Dict, List, Type\n')] |
import requests
from multiprocessing import Process, Queue, Manager
import json
import random
import sys
import time
import click
import zmq
import multiprocessing
import logging
logging.basicConfig(filename='broker.log', filemode='w', level=logging.INFO)
# from multichannel.worker_tasks import deep_github_worker_t... | [
"logging.basicConfig",
"json.loads",
"requests.post",
"multiprocessing.Process",
"zmq.Context.instance",
"zmq.Poller",
"multiprocessing.Manager",
"logging.info"
] | [((182, 258), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': '"""broker.log"""', 'filemode': '"""w"""', 'level': 'logging.INFO'}), "(filename='broker.log', filemode='w', level=logging.INFO)\n", (201, 258), False, 'import logging\n'), ((1347, 1356), 'multiprocessing.Manager', 'Manager', ([], {}), '()\n'... |
from monty.json import jsanitize, MontyDecoder
from uncertainties import unumpy
from maggma.builder import Builder
from pymatgen.entries.computed_entries import ComputedEntry
from pymatgen.entries.compatibility import MaterialsProjectCompatibility
from propnet import logger
from propnet.core.quantity import Quantity
f... | [
"monty.json.jsanitize",
"propnet.core.graph.Graph",
"propnet.core.quantity.Quantity",
"pymatgen.entries.computed_entries.ComputedEntry",
"pydash.get",
"uncertainties.unumpy.nominal_values",
"propnet.core.materials.Material",
"uncertainties.unumpy.std_devs",
"pymatgen.entries.compatibility.MaterialsP... | [((4903, 5076), 'pymatgen.entries.computed_entries.ComputedEntry', 'ComputedEntry', (["doc['unit_cell_formula']", "doc['final_energy']"], {'parameters': '{k: doc[k] for k in params}', 'data': "{'oxide_type': doc['oxide_type']}", 'entry_id': "doc['task_id']"}), "(doc['unit_cell_formula'], doc['final_energy'], parameters... |
from __future__ import annotations
import pytest
from _pytest.config import Config
from docutils import __version__ as docutils_version
from sphinx import __display_version__ as sphinx_version
from sphinx.testing.path import path
pytest_plugins = "sphinx.testing.fixtures"
collect_ignore = ["roots"]
def pytest_repor... | [
"pytest.fixture",
"sphinx.testing.path.path"
] | [((448, 495), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""', 'name': '"""rootdir"""'}), "(scope='session', name='rootdir')\n", (462, 495), False, 'import pytest\n'), ((531, 545), 'sphinx.testing.path.path', 'path', (['__file__'], {}), '(__file__)\n', (535, 545), False, 'from sphinx.testing.path imp... |
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
wd = webdriver.Firefox()
wd.get("http://www.python.org")
assert "Python" in wd.title
el = wd.find_element_by_name("q")
el.send_keys("pycon")
el.send_keys(Keys.RETURN)
assert "No results found." not in wd.page_source
wd.close()
| [
"selenium.webdriver.Firefox"
] | [((84, 103), 'selenium.webdriver.Firefox', 'webdriver.Firefox', ([], {}), '()\n', (101, 103), False, 'from selenium import webdriver\n')] |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import peewee, datetime
db = peewee.SqliteDatabase('banco.db')
class Ente(peewee.Model):
nome = peewee.CharField()
municipio = peewee.CharField()
link_transparencia = peewee.CharField()
link_licitacoes = peewee.CharField()
link_contratos = peewee.CharField... | [
"peewee.BooleanField",
"peewee.CharField",
"peewee.SqliteDatabase",
"peewee.ForeignKeyField",
"peewee.DateTimeField"
] | [((72, 105), 'peewee.SqliteDatabase', 'peewee.SqliteDatabase', (['"""banco.db"""'], {}), "('banco.db')\n", (93, 105), False, 'import peewee, datetime\n'), ((144, 162), 'peewee.CharField', 'peewee.CharField', ([], {}), '()\n', (160, 162), False, 'import peewee, datetime\n'), ((179, 197), 'peewee.CharField', 'peewee.Char... |
from django.db import models
from django.utils import timezone
from django.contrib.auth.models import User
# Create your models here.
class Tag(models.Model):
tid = models.AutoField(primary_key=True)
name = models.CharField(max_length=100)
class Video(models.Model):
vid = models.AutoField(primary_key=True... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((170, 204), 'django.db.models.AutoField', 'models.AutoField', ([], {'primary_key': '(True)'}), '(primary_key=True)\n', (186, 204), False, 'from django.db import models\n'), ((216, 248), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (232, 248), False, 'from djan... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import time
def parse_args():
parser = argparse.ArgumentParser(desc... | [
"time.sleep",
"argparse.ArgumentParser"
] | [((292, 342), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""test script"""'}), "(description='test script')\n", (315, 342), False, 'import argparse\n'), ((698, 719), 'time.sleep', 'time.sleep', (['args.wait'], {}), '(args.wait)\n', (708, 719), False, 'import time\n')] |
import time
def speed_calc_decorator(function):
def wrapper():
start_time = time.time()
function()
difference = time.time() - start_time
print(f"{function.__name__} run speed: {difference}s")
return wrapper
@speed_calc_decorator
def fast_function():
for i in range(10000000... | [
"time.time"
] | [((90, 101), 'time.time', 'time.time', ([], {}), '()\n', (99, 101), False, 'import time\n'), ((142, 153), 'time.time', 'time.time', ([], {}), '()\n', (151, 153), False, 'import time\n')] |
import numpy as np
import cv2
#def maxpoolGlobal(res):
def MaxPoolingDos(Img):
fr=len(Img)//2
cr=len(Img[0])//2
Resultado=np.zeros((fr,cr),np.uint8)
#Proceso del maxPooling
a=0
for i in range(0,len(Img),2):
b=0
for j in range(0,len(Img),2):
Resultado[a][b]=np.a... | [
"numpy.zeros",
"numpy.amax"
] | [((135, 163), 'numpy.zeros', 'np.zeros', (['(fr, cr)', 'np.uint8'], {}), '((fr, cr), np.uint8)\n', (143, 163), True, 'import numpy as np\n'), ((316, 346), 'numpy.amax', 'np.amax', (['Img[i:i + 2, j:j + 2]'], {}), '(Img[i:i + 2, j:j + 2])\n', (323, 346), True, 'import numpy as np\n')] |
import numpy as np
from data import io
'''
flatten(imageset)
- converts an image to a column vector
'''
def flatten(imageset):
flat = imageset.reshape(imageset.shape[ 0 ], -1).T
return flat
'''
weight(U, dataset, shi)
- calculate weight of each train sample
- using first k pca
'''
def weight(U, d... | [
"numpy.dot",
"data.io.load",
"numpy.linalg.eig"
] | [((345, 371), 'numpy.dot', 'np.dot', (['U.T', '(dataset - shi)'], {}), '(U.T, dataset - shi)\n', (351, 371), True, 'import numpy as np\n'), ((542, 560), 'numpy.dot', 'np.dot', (['phi', 'phi.T'], {}), '(phi, phi.T)\n', (548, 560), True, 'import numpy as np\n'), ((586, 611), 'numpy.linalg.eig', 'np.linalg.eig', (['covari... |
import random
import string
import pandas as pd
class StringGenerator:
def __init__(self, column_name, row_count):
self.column_name = column_name
self.row_count = row_count
def generate(self) -> pd.DataFrame:
data_frame = pd.DataFrame(columns=[self.column_name])
for index i... | [
"pandas.DataFrame",
"random.choice"
] | [((259, 299), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': '[self.column_name]'}), '(columns=[self.column_name])\n', (271, 299), True, 'import pandas as pd\n'), ((633, 655), 'random.choice', 'random.choice', (['letters'], {}), '(letters)\n', (646, 655), False, 'import random\n')] |
"""Benchmark Transforms on a batch of inputs."""
from typing import Dict
from absl import app, flags
from tf_autoaugment.benchmark.benchmarker import TransformBenchmarker
from tf_autoaugment.transforms.autocontrast import AutoContrast
from tf_autoaugment.transforms.brightness import Brightness
from tf_autoaugment.tra... | [
"absl.flags.DEFINE_integer",
"tf_autoaugment.benchmark.benchmarker.TransformBenchmarker",
"absl.app.run"
] | [((1099, 1191), 'absl.flags.DEFINE_integer', 'flags.DEFINE_integer', (['"""batch_size"""'], {'default': '(5)', 'help': '"""Batch size to use."""', 'short_name': '"""b"""'}), "('batch_size', default=5, help='Batch size to use.',\n short_name='b')\n", (1119, 1191), False, 'from absl import app, flags\n'), ((1728, 1777... |
# Generated by Django 3.2.7 on 2021-09-12 06:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('kutub', '0006_manuscript_foliation'),
]
operations = [
migrations.AddField(
model_name='manuscript',
name='condition... | [
"django.db.models.CharField"
] | [((341, 560), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'default': '""""""', 'help_text': '"""A summary of the overall physical state of a manuscript, in particular where such information is not recorded elsewhere in the description."""', 'max_length': '(255)'}), "(blank=True, default='... |
"""Test cases for git use case."""
import pytest
from pytest_mock import MockerFixture
import git_portfolio.use_cases.git as git
@pytest.fixture
def mock_command_checker(mocker: MockerFixture) -> MockerFixture:
"""Fixture for mocking CommandChecker.check."""
return mocker.patch("git_portfolio.use_cases.comma... | [
"git_portfolio.use_cases.git.GitUseCase"
] | [((761, 777), 'git_portfolio.use_cases.git.GitUseCase', 'git.GitUseCase', ([], {}), '()\n', (775, 777), True, 'import git_portfolio.use_cases.git as git\n'), ((1154, 1170), 'git_portfolio.use_cases.git.GitUseCase', 'git.GitUseCase', ([], {}), '()\n', (1168, 1170), True, 'import git_portfolio.use_cases.git as git\n'), (... |
from collections import OrderedDict
from typing import Dict
import torch
import torch.nn as nn
import torch.nn.functional as F
class Loss(nn.Module):
def __init__(self):
super().__init__()
def forward(self, output: Dict[str, torch.Tensor], target: Dict[str, torch.Tensor]) -> Dict[str, torch.Tensor]:... | [
"collections.OrderedDict",
"torch.nn.CrossEntropyLoss",
"torch.nn.functional.log_softmax",
"torch.nn.functional.kl_div",
"torch.nn.functional.softmax"
] | [((502, 569), 'torch.nn.CrossEntropyLoss', 'nn.CrossEntropyLoss', ([], {'ignore_index': 'ignore_index', 'reduction': 'reduction'}), '(ignore_index=ignore_index, reduction=reduction)\n', (521, 569), True, 'import torch.nn as nn\n'), ((760, 773), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (771, 773), Fal... |
from pyramid.testing import Configurator
def test_MpgOlacConfig(mocker):
from clldmpg import MpgOlacConfig
cfg = MpgOlacConfig()
assert cfg.admin(None).role == 'Admin'
assert 'eva' in cfg.description(mocker.MagicMock())['institution'].url
def test_includeme():
from clldmpg import includeme
... | [
"pyramid.testing.Configurator",
"clldmpg.MpgOlacConfig"
] | [((124, 139), 'clldmpg.MpgOlacConfig', 'MpgOlacConfig', ([], {}), '()\n', (137, 139), False, 'from clldmpg import MpgOlacConfig\n'), ((331, 385), 'pyramid.testing.Configurator', 'Configurator', ([], {'settings': "{'sqlalchemy.url': 'sqlite://'}"}), "(settings={'sqlalchemy.url': 'sqlite://'})\n", (343, 385), False, 'fro... |
# Define a Structure and Trajectory filled with random data. All possible attrs
# are used (I hope :)
from pwtools.crys import Structure, Trajectory
import numpy as np
rand = np.random.rand
def get_rand_traj():
natoms = 10
nstep = 100
cell = rand(nstep,3,3)
stress = rand(nstep,3,3)
forces = rand(n... | [
"pwtools.crys.Trajectory"
] | [((431, 555), 'pwtools.crys.Trajectory', 'Trajectory', ([], {'coords_frac': 'coords_frac', 'cell': 'cell', 'symbols': 'symbols', 'forces': 'forces', 'stress': 'stress', 'etot': 'etot', 'timestep': '(1.11)'}), '(coords_frac=coords_frac, cell=cell, symbols=symbols, forces=\n forces, stress=stress, etot=etot, timestep=... |
import datetime, io, json, os, uuid
import azure.functions as func
# TODO: usual trigger
# implement support for blob and others
def main(req: func.HttpRequest, context: func.Context) -> func.HttpResponse:
income_timestamp = datetime.datetime.now().timestamp()
req_json = req.get_json()
if 'connection_st... | [
"os.path.exists",
"json.dumps",
"os.path.join",
"uuid.uuid4",
"datetime.datetime.now",
"datetime.timedelta"
] | [((534, 557), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (555, 557), False, 'import datetime, io, json, os, uuid\n'), ((676, 699), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (697, 699), False, 'import datetime, io, json, os, uuid\n'), ((1511, 1543), 'os.path.join', 'os.... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
# from datetime import datetime, timedelta
class SepsisPredictorConfig(AppConfig):
name = 'SepsisPredictor'
def ready(self):
# from DataInterface import uiinterface
from SepsisPredictor import mod... | [
"SepsisPredictor.models.Measurement"
] | [((337, 357), 'SepsisPredictor.models.Measurement', 'models.Measurement', ([], {}), '()\n', (355, 357), False, 'from SepsisPredictor import models\n')] |
import collections
from unittest import mock
import pytest
from datarobot_drum.drum.args_parser import CMRunnerArgsRegistry
from datarobot_drum.drum.common import RunMode
from datarobot_drum.drum.runtime import DrumRuntime
class TestDrumRuntime:
Options = collections.namedtuple(
"Options",
"with... | [
"datarobot_drum.drum.runtime.DrumRuntime",
"unittest.mock.patch",
"pytest.raises"
] | [((585, 643), 'unittest.mock.patch', 'mock.patch', (['"""datarobot_drum.drum.runtime.run_error_server"""'], {}), "('datarobot_drum.drum.runtime.run_error_server')\n", (595, 643), False, 'from unittest import mock\n'), ((803, 861), 'unittest.mock.patch', 'mock.patch', (['"""datarobot_drum.drum.runtime.run_error_server""... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-10-14 21:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('junit_reporting', '0011_JUnitReport_unique_build_per_project'),
]
operations = [
... | [
"django.db.models.FloatField",
"django.db.models.IntegerField"
] | [((432, 460), 'django.db.models.FloatField', 'models.FloatField', ([], {'default': '(0)'}), '(default=0)\n', (449, 460), False, 'from django.db import migrations, models\n'), ((587, 617), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'default': '(0)'}), '(default=0)\n', (606, 617), False, 'from django.d... |
from django.shortcuts import render
from .models import Course,CourseCategory,CourseOrder
from utils import restful
from django.conf import settings
from apps.xfzauth.decorators import xfz_login_required
from hashlib import md5
from django.shortcuts import reverse
from django.views.decorators.csrf import csrf_exempt
im... | [
"django.shortcuts.render",
"hmac.new",
"utils.restful.paramserror",
"os.path.splitext",
"django.shortcuts.reverse",
"utils.restful.ok",
"utils.restful.result",
"time.time"
] | [((445, 505), 'django.shortcuts.render', 'render', (['request', '"""course/course_index.html"""'], {'context': 'context'}), "(request, 'course/course_index.html', context=context)\n", (451, 505), False, 'from django.shortcuts import render\n'), ((762, 823), 'django.shortcuts.render', 'render', (['request', '"""course/c... |
import setuptools
with open("README.txt", "r", encoding="utf-8") as f:
long_description = f.read()
setuptools.setup(
name="clonefinder",
version="0.1",
author="<NAME>",
author_email="<EMAIL>",
description="Estimate clone genotypes and frequencies within a tumor sample using a phylogenetic ap... | [
"setuptools.find_packages"
] | [((741, 767), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (765, 767), False, 'import setuptools\n')] |
#-----------------------------------------------------------------------------
# This file is part of the 'axi-soc-ultra-plus-core'. It is subject to
# the license terms in the LICENSE.txt file found in the top-level directory
# of this distribution and at:
# https://confluence.slac.stanford.edu/display/ppareg/LICEN... | [
"click.secho",
"axi_soc_ultra_plus_core.SysMonLvAuxDet",
"surf.axi.AxiStreamMonAxiL",
"surf.xilinx.AxiSysMonUltraScale",
"axi_soc_ultra_plus_core.AxiVersion"
] | [((1185, 1224), 'axi_soc_ultra_plus_core.AxiVersion', 'core.AxiVersion', ([], {'offset': '(0)', 'expand': '(False)'}), '(offset=0, expand=False)\n', (1200, 1224), True, 'import axi_soc_ultra_plus_core as core\n'), ((1326, 1488), 'surf.xilinx.AxiSysMonUltraScale', 'xil.AxiSysMonUltraScale', ([], {'offset': '(65536)', 'X... |
import json
data = json.load(open("mongo_ready_exercises.json",encoding="utf8"))
ndata = []
for d in data:
d["name"] = d["name"].lower()
ndata.append(d)
fhand = open("mongo_ready_exercises_lower.json","w")
json.dump(ndata, fhand)
fhand.close() | [
"json.dump"
] | [((215, 238), 'json.dump', 'json.dump', (['ndata', 'fhand'], {}), '(ndata, fhand)\n', (224, 238), False, 'import json\n')] |
# import os
# from tqdm import tqdm
# from subprocess import call
# base_path = './data_imgs/rgb_target_imgs'
# filelist = os.listdir(base_path)
# for p_file in tqdm(filelist):
# filepath = os.path.join(base_path, p_file)
# new_file_name = 'cur_' + p_file.split('_')[1]
# new_file_name = os.path.join(base_path... | [
"os.listdir",
"os.path.join",
"tqdm.tqdm",
"shutil.copy"
] | [((776, 797), 'os.listdir', 'os.listdir', (['base_path'], {}), '(base_path)\n', (786, 797), False, 'import os\n'), ((815, 829), 'tqdm.tqdm', 'tqdm', (['filelist'], {}), '(filelist)\n', (819, 829), False, 'from tqdm import tqdm\n'), ((1813, 1834), 'os.listdir', 'os.listdir', (['base_path'], {}), '(base_path)\n', (1823, ... |
"""
LivingLogic Sphinx theme.
Based on Sphinx ReadTheDocs theme.
From https://github.com/ryan-roemer/sphinx-bootstrap-theme.
"""
from os import path
from sphinx.writers import html5
__version__ = '0.2'
__version_full__ = __version__
class HTML5Translator(html5.HTML5Translator):
def visit_desc_returns(self, node)... | [
"os.path.dirname"
] | [((644, 666), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (656, 666), False, 'from os import path\n'), ((892, 914), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (904, 914), False, 'from os import path\n')] |
__all__ = []
import datetime
import re
def _safe_getitem(dct, *keys):
for key in keys:
try:
dct = dct[key]
except (KeyError):
return None
return dct
class _dict(dict): # pragma: no cover
""" A simple dict subclass for use with Creds modelling. No surprises """
... | [
"datetime.datetime.strptime",
"re.findall",
"datetime.timedelta"
] | [((1395, 1424), 're.findall', 're.findall', (['""":(\\\\d{2})"""', 'tstr'], {}), "(':(\\\\d{2})', tstr)\n", (1405, 1424), False, 'import re\n'), ((1434, 1463), 're.findall', 're.findall', (['"""\\\\.(\\\\d+)"""', 'tstr'], {}), "('\\\\.(\\\\d+)', tstr)\n", (1444, 1463), False, 'import re\n'), ((2257, 2301), 'datetime.da... |
import csv, json
def writeNames():
given_names = { 'male': [], 'female': [] }
surnames = []
with open('ScandinavianNames.data.json', 'w', encoding='utf-8') as jsonFile:
given_names['male'] = parseNames('ScandinavianMaleNames.csv')
given_names['female'] = parseNames('ScandinavianFemaleNames.... | [
"csv.reader",
"json.dump"
] | [((368, 439), 'json.dump', 'json.dump', (["{'given_names': given_names, 'surnames': surnames}", 'jsonFile'], {}), "({'given_names': given_names, 'surnames': surnames}, jsonFile)\n", (377, 439), False, 'import csv, json\n'), ((558, 578), 'csv.reader', 'csv.reader', (['nameFile'], {}), '(nameFile)\n', (568, 578), False, ... |
"""Console script for install_webdrivers."""
import click
from . import webdrivers
@click.command()
@click.option(
'--path',
'-p',
default='.',
show_default=True,
help='Specify the installation directory',
)
@click.option('--chromedriver', is_flag=True, help='Only install chromedriver')
@click.op... | [
"click.option",
"click.echo",
"click.command"
] | [((87, 102), 'click.command', 'click.command', ([], {}), '()\n', (100, 102), False, 'import click\n'), ((104, 212), 'click.option', 'click.option', (['"""--path"""', '"""-p"""'], {'default': '"""."""', 'show_default': '(True)', 'help': '"""Specify the installation directory"""'}), "('--path', '-p', default='.', show_de... |
#coding:utf-8
#
# id: bugs.gh_7034
# title: Scroll cursor server crash
# decription:
# https://github.com/FirebirdSQL/firebird/issues/7034
#
# Confirmed bug (crash) on 5.0.0.279, 4.0.1.2649, 3.0.8.33525.
# Checked on intermediate s... | [
"pytest.mark.version",
"firebird.qa.db_factory",
"firebird.qa.isql_act"
] | [((638, 683), 'firebird.qa.db_factory', 'db_factory', ([], {'sql_dialect': '(3)', 'init': 'init_script_1'}), '(sql_dialect=3, init=init_script_1)\n', (648, 683), False, 'from firebird.qa import db_factory, isql_act, Action\n'), ((2052, 2114), 'firebird.qa.isql_act', 'isql_act', (['"""db_1"""', 'test_script_1'], {'subst... |
import requests
import re
from bs4 import BeautifulSoup
# fix: InsecureRequestWarning: Unverified HTTPS request is being made to host
import requests.packages.urllib3
from utility import tinyURL
url = "https://dictionary.cambridge.org/zht"
headers = {
'User-Agent': 'Mozilla/5.0 (Macintosh Intel Mac OS X 10_15_7... | [
"bs4.BeautifulSoup",
"utility.tinyURL.makeTiny",
"requests.get"
] | [((739, 777), 'requests.get', 'requests.get', (['wordURL'], {'headers': 'headers'}), '(wordURL, headers=headers)\n', (751, 777), False, 'import requests\n'), ((793, 824), 'bs4.BeautifulSoup', 'BeautifulSoup', (['res.text', '"""lxml"""'], {}), "(res.text, 'lxml')\n", (806, 824), False, 'from bs4 import BeautifulSoup\n')... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 12 14:16:29 2018
Script gathering functions related to the psd and fft calculations.
@author: misiak
"""
import numpy as np
def psd(fft, fs, weight=None):
"""
Computes the Power Spectral Density (PSD) from the Fast Fourier Transform
(... | [
"numpy.abs",
"numpy.sqrt",
"numpy.fft.fftfreq",
"numpy.conjugate",
"numpy.angle",
"numpy.exp",
"numpy.array",
"numpy.sum",
"numpy.concatenate",
"numpy.random.uniform",
"numpy.fft.ifft"
] | [((1254, 1284), 'numpy.fft.fftfreq', 'np.fft.fftfreq', (['nfft', '(fs ** -1)'], {}), '(nfft, fs ** -1)\n', (1268, 1284), True, 'import numpy as np\n'), ((1879, 1909), 'numpy.fft.fftfreq', 'np.fft.fftfreq', (['nfft', '(fs ** -1)'], {}), '(nfft, fs ** -1)\n', (1893, 1909), True, 'import numpy as np\n'), ((2402, 2433), 'n... |
################################################################################
# Copyright (c) 2019. ContinualAI. All rights reserved. #
# Copyrights licensed under the MIT License. #
# See the accompanying LICENSE file for terms. ... | [
"torch.utils.tensorboard.SummaryWriter",
"torch.as_tensor",
"numpy.tan",
"numpy.arange",
"numpy.random.random",
"json.dumps",
"numpy.zeros",
"numpy.cos",
"numpy.sin",
"torch.randn",
"torch.rand"
] | [((1300, 1322), 'torch.utils.tensorboard.SummaryWriter', 'SummaryWriter', (['log_dir'], {}), '(log_dir)\n', (1313, 1322), False, 'from torch.utils.tensorboard import SummaryWriter\n'), ((1436, 1483), 'json.dumps', 'json.dumps', (["{'mb_size': 12, 'inc_train_ep': 10}"], {}), "({'mb_size': 12, 'inc_train_ep': 10})\n", (1... |
import shutil
import sqlite3
from os import listdir
import os
import csv
from Logging_Layer.logger import app_logger
class dBOperation:
def __init__(self):
self.path = 'Training_Database/'
self.badFilePath = "Training_Raw_files_validated/Bad_Raw"
self.goodFilePath = "Training... | [
"Logging_Layer.logger.app_logger",
"os.listdir",
"sqlite3.connect",
"os.makedirs",
"shutil.move",
"os.path.isdir",
"csv.reader"
] | [((374, 386), 'Logging_Layer.logger.app_logger', 'app_logger', ([], {}), '()\n', (384, 386), False, 'from Logging_Layer.logger import app_logger\n'), ((474, 523), 'sqlite3.connect', 'sqlite3.connect', (["(self.path + DatabaseName + '.db')"], {}), "(self.path + DatabaseName + '.db')\n", (489, 523), False, 'import sqlite... |
#-*- coding: utf-8 -*-
""" OSD (on screen display) notification module """
import os
import platform
import sys
from tempfile import mkstemp
from voiceplay import __title__
from voiceplay.datasources.albumart import AlbumArt
from voiceplay.logger import logger
from .basehook import BasePlayerHook
class OSDNotificati... | [
"voiceplay.logger.logger.debug",
"os.environ.get",
"voiceplay.datasources.albumart.AlbumArt",
"platform.system",
"voiceplay.logger.logger.error",
"gi.repository.Notify.Notification.new",
"gi.repository.Notify.init",
"tempfile.mkstemp",
"os.remove"
] | [((764, 774), 'voiceplay.datasources.albumart.AlbumArt', 'AlbumArt', ([], {}), '()\n', (772, 774), False, 'from voiceplay.datasources.albumart import AlbumArt\n'), ((1427, 1449), 'gi.repository.Notify.init', 'Notify.init', (['__title__'], {}), '(__title__)\n', (1438, 1449), False, 'from gi.repository import Notify\n'),... |
from utils._type import *
import datetime as dt
import traceback
import discord
import humanize
import re
from discord.ext import commands, tasks
from utils.useful import Embed, Cooldown, send_traceback
from utils.json_loader import read_json
class Core(commands.Cog):
def __init__(self, bot):
... | [
"discord.ext.commands.Cog.listener",
"datetime.datetime.utcnow",
"utils.json_loader.read_json",
"re.fullmatch",
"utils.useful.Embed",
"datetime.timedelta",
"discord.ext.tasks.loop"
] | [((1972, 1995), 'discord.ext.commands.Cog.listener', 'commands.Cog.listener', ([], {}), '()\n', (1993, 1995), False, 'from discord.ext import commands, tasks\n'), ((6143, 6166), 'discord.ext.commands.Cog.listener', 'commands.Cog.listener', ([], {}), '()\n', (6164, 6166), False, 'from discord.ext import commands, tasks\... |
import pytest
from simpleconf import Config, ProfileConfig
pytest_plugins = ["tests.fixt_simpleconf"]
def test_nonprofile(ini_file, dict_obj):
config = Config.load(dict_obj)
assert config.default.a == 1
assert config.b == 2
with pytest.warns(UserWarning):
config = Config.load({"a": {"b": 2... | [
"simpleconf.ProfileConfig.base_profile",
"simpleconf.ProfileConfig.has_profile",
"simpleconf.ProfileConfig.pool",
"simpleconf.Config.load",
"simpleconf.ProfileConfig.use_profile",
"simpleconf.ProfileConfig.current_profile",
"simpleconf.ProfileConfig.profiles",
"simpleconf.ProfileConfig.load",
"simpl... | [((161, 182), 'simpleconf.Config.load', 'Config.load', (['dict_obj'], {}), '(dict_obj)\n', (172, 182), False, 'from simpleconf import Config, ProfileConfig\n'), ((447, 495), 'simpleconf.ProfileConfig.load', 'ProfileConfig.load', (['ini_file', 'ini_file_nodefault'], {}), '(ini_file, ini_file_nodefault)\n', (465, 495), F... |
# Generated by Django 2.1 on 2018-09-21 20:54
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='CommonInfo',
fields=[
... | [
"django.db.models.DateField",
"django.db.models.ForeignKey",
"django.db.models.AutoField",
"django.db.models.PositiveIntegerField",
"django.db.models.DecimalField",
"django.db.models.PositiveSmallIntegerField"
] | [((337, 430), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (353, 430), False, 'from django.db import migrations, models\... |
# -*- coding: utf-8 -*-
# @Date : 2018/3/29
# @Author : Shu
# @Email : <EMAIL>
from flask_wtf import FlaskForm
from wtforms import StringField, IntegerField
from wtforms.validators import Email, DataRequired, Length, Optional
from .validators import Unique,Exists
from ulord.models import Role
__all__ = ['AddRol... | [
"wtforms.validators.Length",
"wtforms.validators.DataRequired"
] | [((435, 449), 'wtforms.validators.DataRequired', 'DataRequired', ([], {}), '()\n', (447, 449), False, 'from wtforms.validators import Email, DataRequired, Length, Optional\n'), ((451, 465), 'wtforms.validators.Length', 'Length', ([], {'max': '(32)'}), '(max=32)\n', (457, 465), False, 'from wtforms.validators import Ema... |
############################################################
# -*- coding: utf-8 -*-
#
# # # # # # #
# ## ## # ## # #
# # # # # # # # # # #
# # ## # ## ## ######
# # # # # # #
#
# Python-based Tool for interaction with the 10micron mounts
# GUI with PyQT5 fo... | [
"pytest.fixture",
"mw4.test.test_units.setupQt.setupQt",
"unittest.mock.patch.object"
] | [((678, 722), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)', 'scope': '"""module"""'}), "(autouse=True, scope='module')\n", (692, 722), False, 'import pytest\n'), ((815, 824), 'mw4.test.test_units.setupQt.setupQt', 'setupQt', ([], {}), '()\n', (822, 824), False, 'from mw4.test.test_units.setupQt import ... |
import pandas as pd
import re
"""
数据预处理,生成training set
"""
def run():
df = pd.read_csv('houses.csv', delimiter='|', usecols=([1, 2, 4, 5, 6]))
df['type'] = df['type'].apply(
lambda x: int(re.findall('\d+', x)[0]) + int(re.findall('\d+', x)[1]))
df['floor'] = df['floor'].apply(lambda x: find_numbe... | [
"re.findall",
"pandas.read_csv"
] | [((82, 147), 'pandas.read_csv', 'pd.read_csv', (['"""houses.csv"""'], {'delimiter': '"""|"""', 'usecols': '[1, 2, 4, 5, 6]'}), "('houses.csv', delimiter='|', usecols=[1, 2, 4, 5, 6])\n", (93, 147), True, 'import pandas as pd\n'), ((481, 501), 're.findall', 're.findall', (['reg', 'str'], {}), '(reg, str)\n', (491, 501),... |
#
# The MIT License (MIT)
#
# Copyright 2019 AT&T Intellectual Property. All other rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software
# and associated documentation files (the "Software"), to deal in the Software without
# restriction, including without l... | [
"re.match",
"importlib.import_module",
"pkgutil.walk_packages"
] | [((1642, 1675), 'importlib.import_module', 'importlib.import_module', (['"""openc2"""'], {}), "('openc2')\n", (1665, 1675), False, 'import importlib\n'), ((1815, 1862), 'pkgutil.walk_packages', 'pkgutil.walk_packages', ([], {'path': 'path', 'prefix': 'prefix'}), '(path=path, prefix=prefix)\n', (1836, 1862), False, 'imp... |
import os
from typing import List
from termcolor import colored
from model.dt_def import ChordNode
from model.satb_elements import SATBChord, SATBSequence
class SolutionInterface:
def __init__(self, templ_padding: int = 4, seq_padding: int = 8):
self.templ_padding = templ_padding
self.seq_paddi... | [
"os.get_terminal_size",
"termcolor.colored"
] | [((434, 456), 'os.get_terminal_size', 'os.get_terminal_size', ([], {}), '()\n', (454, 456), False, 'import os\n'), ((2908, 2952), 'termcolor.colored', 'colored', (['"""Invalid choice. Try again."""', '"""red"""'], {}), "('Invalid choice. Try again.', 'red')\n", (2915, 2952), False, 'from termcolor import colored\n')] |
from django.contrib import admin
from exhibitors.models import Exhibitor, Workshop, WorkshopEvents, Stand, Editorial, Book, Author, Category, Award, Volunteer, BookRegistered
# Register your models here.
admin.site.register(Exhibitor)
admin.site.register(Workshop)
admin.site.register(WorkshopEvents)
admin.site.registe... | [
"django.contrib.admin.site.register"
] | [((205, 235), 'django.contrib.admin.site.register', 'admin.site.register', (['Exhibitor'], {}), '(Exhibitor)\n', (224, 235), False, 'from django.contrib import admin\n'), ((236, 265), 'django.contrib.admin.site.register', 'admin.site.register', (['Workshop'], {}), '(Workshop)\n', (255, 265), False, 'from django.contrib... |
import collections
import functools
def dfs(trie, lookup, i, curr):
if i == len(lookup):
return "-"
if len(trie) != len(lookup[i]):
for c in lookup[i]:
if c in trie:
continue
# generate unique word
curr.append(c)
nodes = trie.valu... | [
"functools.reduce",
"collections.defaultdict"
] | [((725, 755), 'collections.defaultdict', 'collections.defaultdict', (['_trie'], {}), '(_trie)\n', (748, 755), False, 'import collections\n'), ((983, 1029), 'functools.reduce', 'functools.reduce', (['dict.__getitem__', 'word', 'trie'], {}), '(dict.__getitem__, word, trie)\n', (999, 1029), False, 'import functools\n')] |
# coding: utf-8
import socketserver
import os
# Copyright 2013 <NAME>, <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
#
# Unle... | [
"os.path.abspath",
"socketserver.TCPServer",
"os.path.join"
] | [((4310, 4359), 'socketserver.TCPServer', 'socketserver.TCPServer', (['(HOST, PORT)', 'MyWebServer'], {}), '((HOST, PORT), MyWebServer)\n', (4332, 4359), False, 'import socketserver\n'), ((2275, 2300), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (2290, 2300), False, 'import os\n'), ((2416,... |
from django.contrib import admin
from .models import OrigamiModel
admin.site.register(OrigamiModel)
| [
"django.contrib.admin.site.register"
] | [((67, 100), 'django.contrib.admin.site.register', 'admin.site.register', (['OrigamiModel'], {}), '(OrigamiModel)\n', (86, 100), False, 'from django.contrib import admin\n')] |
from django.db import models
from decimal import Decimal
from django.utils.translation import gettext_lazy as _
from django.core.validators import (
MinValueValidator,
MaxValueValidator
)
from coupons.models import Coupon
from shop.models import Product
class Order(models.Model):
first_name=models.Cha... | [
"django.core.validators.MinValueValidator",
"django.core.validators.MaxValueValidator",
"django.db.models.ForeignKey",
"django.utils.translation.gettext_lazy",
"django.db.models.BooleanField",
"django.db.models.PositiveIntegerField",
"django.db.models.DateTimeField",
"django.db.models.DecimalField",
... | [((651, 690), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now_add': '(True)'}), '(auto_now_add=True)\n', (671, 690), False, 'from django.db import models\n'), ((703, 742), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now_add': '(True)'}), '(auto_now_add=True)\n', (723,... |
# Standard imports
import math
import secrets
from typing import Tuple
# Local imports
from oblivion.constants import (
HashBase,
HASH_LENGTH,
callback,
)
from oblivion.numeric_constants import (
PRIMES,
)
from oblivion.primitives import (
integer_to_octet_string_primitive,
)
def hash_func(msg: ... | [
"secrets.randbelow",
"math.gcd",
"oblivion.constants.HashBase",
"oblivion.constants.callback",
"secrets.token_bytes",
"oblivion.primitives.integer_to_octet_string_primitive",
"secrets.randbits"
] | [((503, 528), 'secrets.token_bytes', 'secrets.token_bytes', (['size'], {}), '(size)\n', (522, 528), False, 'import secrets\n'), ((2243, 2289), 'oblivion.constants.callback', 'callback', (['f"""generating prime with {bits} bits"""'], {}), "(f'generating prime with {bits} bits')\n", (2251, 2289), False, 'from oblivion.co... |
import csv
import random
def stdSim(cID):
number=range(1,101)
rnumber=random.sample(number,len(number)) #学籍番号を(ランダムに)生成
temlist=[]
for i in rnumber:
temNo= "S{:0>3}".format(i) #"S001" "S012"のように3桁表示
temlist.append(temNo) #temlistはS001からS100の100個の要素からなるリスト
#講義IDに一致した履修者csvを開く
s... | [
"csv.DictReader"
] | [((498, 515), 'csv.DictReader', 'csv.DictReader', (['p'], {}), '(p)\n', (512, 515), False, 'import csv\n')] |
# Generated by Django 2.1.7 on 2019-04-23 21:52
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('coursesystem', '0011_auto_20190423_1313'),
]
operations = [
migrations.AlterField(
model_name='... | [
"django.db.models.ForeignKey"
] | [((380, 485), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'default': 'None', 'on_delete': 'django.db.models.deletion.CASCADE', 'to': '"""coursesystem.Exams"""'}), "(default=None, on_delete=django.db.models.deletion.CASCADE,\n to='coursesystem.Exams')\n", (397, 485), False, 'from django.db import migrat... |
# -*-coding: utf-8 -*-
from __future__ import unicode_literals
import sys
import types
# python版本
PY2 = sys.version_info[0] == 2
_always_safe = (b'abcdefghijklmnopqrstuvwxyz'
b'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.-+')
# 判断系统版本,如果2.*版本,字符编码unicode,迭代方式,还有将字符转化为本地字符编码的to_native()方法
if PY2:
text_t... | [
"sys.getdefaultencoding",
"chardet.detect"
] | [((454, 478), 'sys.getdefaultencoding', 'sys.getdefaultencoding', ([], {}), '()\n', (476, 478), False, 'import sys\n'), ((734, 758), 'sys.getdefaultencoding', 'sys.getdefaultencoding', ([], {}), '()\n', (756, 758), False, 'import sys\n'), ((2097, 2117), 'chardet.detect', 'chardet.detect', (['html'], {}), '(html)\n', (2... |
""" The authentication views. """
import morepath
from onegov.core.markdown import render_untrusted_markdown
from onegov.core.security import Public, Personal
from onegov.org import _, OrgApp
from onegov.org import log
from onegov.org.elements import Link
from onegov.org.layout import DefaultLayout
from onegov.org.ma... | [
"onegov.org.layout.DefaultLayout",
"onegov.org.OrgApp.view",
"onegov.user.UserCollection",
"onegov.org.OrgApp.html",
"onegov.org.OrgApp.form",
"onegov.org._",
"webob.exc.HTTPNotFound"
] | [((955, 1053), 'onegov.org.OrgApp.form', 'OrgApp.form', ([], {'model': 'Auth', 'name': '"""login"""', 'template': '"""login.pt"""', 'permission': 'Public', 'form': 'LoginForm'}), "(model=Auth, name='login', template='login.pt', permission=\n Public, form=LoginForm)\n", (966, 1053), False, 'from onegov.org import _, ... |
# -*- coding: utf-8 -*-
# Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# Copyright 2008 <NAME> <<EMAIL>>
import os.path
from twisted.python import util
from twisted.web import resource, static
from coherence import __version__
from coherence.extern.et import ET, indent
from coh... | [
"coherence.extern.et.ET.Element",
"twisted.web.static.Data.__init__",
"twisted.web.resource.Resource.__init__",
"twisted.python.util.sibpath",
"twisted.web.static.File",
"coherence.extern.et.ET.SubElement",
"coherence.extern.et.ET.tostring"
] | [((468, 500), 'twisted.web.resource.Resource.__init__', 'resource.Resource.__init__', (['self'], {}), '(self)\n', (494, 500), False, 'from twisted.web import resource, static\n'), ((2300, 2318), 'coherence.extern.et.ET.Element', 'ET.Element', (['"""root"""'], {}), "('root')\n", (2310, 2318), False, 'from coherence.exte... |
from sklearn.feature_extraction.text import CountVectorizer
from biterm.utility import vec_to_biterms, topic_summuary
from biterm.cbtm import oBTM
import numpy as np
class BTM:
"""
https://pypi.org/project/biterm/
"""
def __init__(self, docs_in):
self.token_docs = docs_in
self.docs = [... | [
"sklearn.feature_extraction.text.CountVectorizer",
"biterm.utility.vec_to_biterms",
"biterm.utility.topic_summuary",
"biterm.cbtm.oBTM"
] | [((560, 577), 'sklearn.feature_extraction.text.CountVectorizer', 'CountVectorizer', ([], {}), '()\n', (575, 577), False, 'from sklearn.feature_extraction.text import CountVectorizer\n'), ((743, 760), 'biterm.utility.vec_to_biterms', 'vec_to_biterms', (['X'], {}), '(X)\n', (757, 760), False, 'from biterm.utility import ... |
from BlockChain.BlockChain import BlockChain
import os
import json
def p(data,color="blue"):
print(data)
class Election:
def __init__(self,place_id,choices):
self.place_id = place_id
self.choices = choices
self.len_choices = len(self.choices)
self.kernel = BlockChain(self.plac... | [
"BlockChain.BlockChain.BlockChain",
"json.dumps",
"os.system"
] | [((300, 325), 'BlockChain.BlockChain.BlockChain', 'BlockChain', (['self.place_id'], {}), '(self.place_id)\n', (310, 325), False, 'from BlockChain.BlockChain import BlockChain\n'), ((334, 350), 'os.system', 'os.system', (['"""cls"""'], {}), "('cls')\n", (343, 350), False, 'import os\n'), ((490, 506), 'os.system', 'os.sy... |
import torch
def truncated_normal(tensor, mean=0., std=1.):
shape = tensor.shape
sample = torch.randn(shape) * std + mean
is_truncated = (sample > (2. * std + mean)) | (sample < (-2. * std + mean))
while torch.any(is_truncated):
repick = torch.randn(sample[is_truncated].shape) * std + mean
... | [
"torch.any",
"torch.mean",
"torch.Tensor",
"torch.prod",
"torch.sum",
"torch.no_grad",
"torch.zeros",
"torch.randn"
] | [((224, 247), 'torch.any', 'torch.any', (['is_truncated'], {}), '(is_truncated)\n', (233, 247), False, 'import torch\n'), ((650, 687), 'torch.Tensor', 'torch.Tensor', (['[shape[d] for d in dim]'], {}), '([shape[d] for d in dim])\n', (662, 687), False, 'import torch\n'), ((850, 891), 'torch.zeros', 'torch.zeros', (['sha... |
from django.urls import path
from . import views
from blog.views import(
create_blog_view,
detail_blog_view,
edit_blog_view,
)
app_name = 'blog'
urlpatterns = [
path('create',create_blog_view, name="create"),
path('<slug>/',detail_blog_view, name="detail"),
path('<slug>/edit/',edit_blog_view, name="edit"),
pa... | [
"django.urls.path"
] | [((168, 215), 'django.urls.path', 'path', (['"""create"""', 'create_blog_view'], {'name': '"""create"""'}), "('create', create_blog_view, name='create')\n", (172, 215), False, 'from django.urls import path\n'), ((217, 265), 'django.urls.path', 'path', (['"""<slug>/"""', 'detail_blog_view'], {'name': '"""detail"""'}), "... |
import tkinter as tk
from tkinter import ttk
from tkinter import messagebox
import disciplina as disc
import os.path
import pickle
#Exceptions de tratamento
class PreenchaTudo(Exception):
pass
class FaltouAno(Exception):
pass
class FaltouCode(Exception):
pass
class FaltouSemestre(Exception):
pass
c... | [
"tkinter.Entry",
"pickle.dump",
"tkinter.Toplevel.__init__",
"pickle.load",
"tkinter.Button",
"disciplina.getCargaHoraria",
"tkinter.StringVar",
"disciplina.getCodigo",
"disciplina.getNome",
"tkinter.Label",
"tkinter.ttk.Combobox",
"tkinter.messagebox.showinfo",
"tkinter.Frame",
"tkinter.L... | [((1245, 1271), 'tkinter.Toplevel.__init__', 'tk.Toplevel.__init__', (['self'], {}), '(self)\n', (1265, 1271), True, 'import tkinter as tk\n'), ((1400, 1414), 'tkinter.Frame', 'tk.Frame', (['self'], {}), '(self)\n', (1408, 1414), True, 'import tkinter as tk\n'), ((1469, 1483), 'tkinter.Frame', 'tk.Frame', (['self'], {}... |
import urdf_parser_py
import os
import xml.etree.ElementTree as ET
data = 'random_urdfs'
def accesssizes(datapath):
newsize = "0.01 0.01 0.01"
for folder in os.listdir(datapath):
if 'DS_Store' not in folder:
for file in os.listdir(os.path.join(datapath, folder)):
if '.urdf... | [
"os.listdir",
"os.path.join"
] | [((167, 187), 'os.listdir', 'os.listdir', (['datapath'], {}), '(datapath)\n', (177, 187), False, 'import os\n'), ((262, 292), 'os.path.join', 'os.path.join', (['datapath', 'folder'], {}), '(datapath, folder)\n', (274, 292), False, 'import os\n'), ((367, 403), 'os.path.join', 'os.path.join', (['datapath', 'folder', 'fil... |