code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from django.shortcuts import render, reverse
from django.http import HttpResponseRedirect
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from cryptography.fernet import Fernet
from accounts.models import UserPreferences
from . import forms... | [
"django.contrib.messages.add_message",
"accounts.models.UserPreferences.objects.get_or_create",
"django.shortcuts.render",
"django.contrib.messages.success",
"cryptography.fernet.Fernet",
"django.shortcuts.reverse"
] | [((1639, 1687), 'django.shortcuts.render', 'render', (['request', '"""form_semanticui.html"""', 'context'], {}), "(request, 'form_semanticui.html', context)\n", (1645, 1687), False, 'from django.shortcuts import render, reverse\n'), ((3353, 3401), 'django.shortcuts.render', 'render', (['request', '"""form_semanticui.ht... |
# Generated by Django 2.0.2 on 2018-09-20 17:10
from django.db import migrations, models
import django.db.models.deletion
import markdownx.models
class Migration(migrations.Migration):
initial = True
dependencies = [
('learning', '0001_initial'),
('tags', '0001_initial'),
]
operati... | [
"django.db.models.URLField",
"django.db.models.ManyToManyField",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.ImageField",
"django.db.models.DateField",
"django.db.models.DateTimeField"
] | [((2203, 2263), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'blank': '(True)', 'to': '"""projects.Technology"""'}), "(blank=True, to='projects.Technology')\n", (2225, 2263), False, 'from django.db import migrations, models\n'), ((432, 525), 'django.db.models.AutoField', 'models.AutoField', ([], ... |
from abc import ABCMeta, abstractmethod
import numpy as np
from core.net_errors import NetIsNotInitialized, NetIsNotCalculated
class Corrector:
__metaclass__ = ABCMeta
def __init__(self, nu):
self.nu = nu
@abstractmethod
def initialize(self, net_object):
if net_object.net[-1].get('... | [
"core.net_errors.NetIsNotInitialized",
"numpy.zeros",
"core.net_errors.NetIsNotCalculated"
] | [((583, 604), 'core.net_errors.NetIsNotInitialized', 'NetIsNotInitialized', ([], {}), '()\n', (602, 604), False, 'from core.net_errors import NetIsNotInitialized, NetIsNotCalculated\n'), ((664, 684), 'core.net_errors.NetIsNotCalculated', 'NetIsNotCalculated', ([], {}), '()\n', (682, 684), False, 'from core.net_errors i... |
from itertools import combinations
from scanner import Scanner, parse
def part1(data: list[str]) -> int:
beacons = {
beacon
for scanner in go(data)
for beacon in scanner.beacons
}
return len(beacons)
def part2(data: list[str]) -> int:
return int(max(
abs(x1 - x0) + ab... | [
"scanner.parse"
] | [((522, 533), 'scanner.parse', 'parse', (['data'], {}), '(data)\n', (527, 533), False, 'from scanner import Scanner, parse\n')] |
import numpy as np
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
from keras.models import Sequential
from keras.layers import *
from keras.models import load_model
import matplotlib.pyplot as plt
#################################################################
### Generate Data ################... | [
"pandas.DataFrame",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"pandas.read_csv",
"matplotlib.pyplot.legend",
"numpy.savetxt",
"sklearn.preprocessing.MinMaxScaler",
"matplotlib.pyplot.figure",
"numpy.sin",
"numpy.vstack",
"numpy.linspace",
"keras.models.Sequential",
"matplotlib.pypl... | [((448, 479), 'numpy.linspace', 'np.linspace', (['(0.0)', '(2 * np.pi)', '(20)'], {}), '(0.0, 2 * np.pi, 20)\n', (459, 479), True, 'import numpy as np\n'), ((480, 489), 'numpy.sin', 'np.sin', (['x'], {}), '(x)\n', (486, 489), True, 'import numpy as np\n'), ((545, 621), 'numpy.savetxt', 'np.savetxt', (['"""train_data.cs... |
# Generated by Django 3.0.5 on 2020-04-18 12:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('scraping', '0006_job_description'),
]
operations = [
migrations.AddField(
model_name='employee',
name='skills',
... | [
"django.db.models.CharField",
"django.db.models.TextField"
] | [((334, 361), 'django.db.models.TextField', 'models.TextField', ([], {'null': '(True)'}), '(null=True)\n', (350, 361), False, 'from django.db import migrations, models\n'), ((479, 506), 'django.db.models.TextField', 'models.TextField', ([], {'null': '(True)'}), '(null=True)\n', (495, 506), False, 'from django.db import... |
from handlers import Handler
from google.appengine.ext import db
class BlogHandler(Handler):
""" Handles the home page of the blog, which is the "/blog" url.
Gets 10 posts from the database and displays them """
def get(self):
posts = db.GqlQuery(
"select * from Post order by created ... | [
"google.appengine.ext.db.GqlQuery"
] | [((258, 323), 'google.appengine.ext.db.GqlQuery', 'db.GqlQuery', (['"""select * from Post order by created desc limit 10 """'], {}), "('select * from Post order by created desc limit 10 ')\n", (269, 323), False, 'from google.appengine.ext import db\n')] |
import logging
import os
from flask import jsonify, request, Flask
from .trace import send_trace
from sentry_sdk import init, capture_exception
APP_DSN = os.environ.get("APP_DSN")
if APP_DSN:
# XXX: Is this the right environment?
# This tracks errors and performance of the app itself rather than GH workflows... | [
"flask.Flask",
"os.environ.get",
"flask.jsonify",
"sentry_sdk.init",
"logging.getLogger"
] | [((157, 182), 'os.environ.get', 'os.environ.get', (['"""APP_DSN"""'], {}), "('APP_DSN')\n", (171, 182), False, 'import os\n'), ((407, 446), 'os.environ.get', 'os.environ.get', (['"""LOGGING_LEVEL"""', '"""INFO"""'], {}), "('LOGGING_LEVEL', 'INFO')\n", (421, 446), False, 'import os\n'), ((456, 483), 'logging.getLogger',... |
"""Download latest scanning scripts for Cyberwatch air gapped scans"""
import argparse
import os
import shutil
from configparser import ConfigParser
import requests
from cbw_api_toolbox.cbw_api import CBWApi
def connect_api():
'''Connect to the API and test connection'''
conf = ConfigParser()
conf.read(os... | [
"argparse.ArgumentParser",
"os.makedirs",
"os.path.dirname",
"os.path.exists",
"requests.get",
"configparser.ConfigParser",
"os.path.join"
] | [((289, 303), 'configparser.ConfigParser', 'ConfigParser', ([], {}), '()\n', (301, 303), False, 'from configparser import ConfigParser\n'), ((2480, 2533), 'requests.get', 'requests.get', (['url'], {'allow_redirects': '(True)', 'verify': '(False)'}), '(url, allow_redirects=True, verify=False)\n', (2492, 2533), False, 'i... |
"""
email_reply_parser is a python library port of GitHub's Email Reply Parser.
For more information, visit https://github.com/zapier/email_reply_parser
"""
import os
import re
import json
class EmailReplyParser(object):
""" Represents a email message that is parsed.
"""
def __init__(self, language='en')... | [
"json.load",
"os.path.dirname",
"json.append",
"re.sub",
"re.compile"
] | [((341, 366), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (356, 366), False, 'import os\n'), ((2136, 2154), 're.compile', 're.compile', (['"""(>+)"""'], {}), "('(>+)')\n", (2146, 2154), False, 'import re\n'), ((2184, 2372), 're.compile', 're.compile', (['(\'^[* ]*(\' + self.words_map[self.... |
from time import sleep
from picamera import PiCamera
camera = PiCamera()
camera.resolution = (320, 240)
camera.start_preview()
# Camera warm-up time
sleep(2)
camera.capture('1.jpg')
| [
"time.sleep",
"picamera.PiCamera"
] | [((63, 73), 'picamera.PiCamera', 'PiCamera', ([], {}), '()\n', (71, 73), False, 'from picamera import PiCamera\n'), ((150, 158), 'time.sleep', 'sleep', (['(2)'], {}), '(2)\n', (155, 158), False, 'from time import sleep\n')] |
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 11 19:41:15 2018
@author: <NAME>
Title: Satander starter
"""
###########################libraries################################
####################################################################
import pandas as pd
import numpy as np
import seaborn as sb
f... | [
"pandas.read_csv"
] | [((731, 771), 'pandas.read_csv', 'pd.read_csv', (["(data_location + 'train.csv')"], {}), "(data_location + 'train.csv')\n", (742, 771), True, 'import pandas as pd\n')] |
import torch
import math
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import settings.hparam as hp
from torch.autograd import Variable
from collections import OrderedDict
class SeqLinear(nn.Module):
"""
Linear layer for sequences
"""
def __init__(self, input_size, output_si... | [
"torch.nn.Dropout",
"numpy.floor",
"torch.nn.MaxPool1d",
"torch.cat",
"torch.nn.functional.sigmoid",
"torch.ones",
"torch.FloatTensor",
"torch.Tensor",
"torch.nn.Linear",
"torch.zeros",
"torch.nn.GRU",
"math.sqrt",
"torch.nn.ModuleList",
"torch.nn.Tanh",
"torch.nn.BatchNorm1d",
"torch.... | [((677, 711), 'torch.nn.Linear', 'nn.Linear', (['input_size', 'output_size'], {}), '(input_size, output_size)\n', (686, 711), True, 'import torch.nn as nn\n'), ((2938, 2953), 'torch.nn.ModuleList', 'nn.ModuleList', ([], {}), '()\n', (2951, 2953), True, 'import torch.nn as nn\n'), ((3588, 3603), 'torch.nn.ModuleList', '... |
#!/usr/bin/env python
import os
os.system("pip install elasticsearch")
import argparse
from functools import wraps
import hail
import logging
from pprint import pprint, pformat
import time
import sys
from hail_scripts.shared.elasticsearch_utils import ELASTICSEARCH_INDEX, \
ELASTICSEARCH_UPDATE, ELASTICSEARCH_U... | [
"hail_scripts.v01.utils.computed_fields.get_expr_for_vep_transcript_ids_set",
"pprint.pformat",
"argparse.ArgumentParser",
"hail_scripts.v01.utils.vds_utils.read_in_dataset",
"hail_scripts.v01.utils.add_primate_ai.add_primate_ai_to_vds",
"hail_scripts.v01.utils.elasticsearch_utils.wait_for_loading_shards_... | [((34, 72), 'os.system', 'os.system', (['"""pip install elasticsearch"""'], {}), "('pip install elasticsearch')\n", (43, 72), False, 'import os\n'), ((2719, 2788), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s %(levelname)-8s %(message)s"""'}), "(format='%(asctime)s %(levelname)-8s %(mes... |
import numpy as np
import scipy.stats as sps
def preprocess(X):
return X
def prob_model_data1_range():
return [-5,5]
def prob_model_data2_range():
return [-5,5]
def prob_model_poi_range(mode = 'eval'):
if mode == 'eval':
return [-3,3]
elif mode == 'train':
return [-5,5]
def prob... | [
"numpy.linalg.inv",
"numpy.array",
"scipy.stats.multivariate_normal"
] | [((467, 503), 'numpy.array', 'np.array', (['[[1.0, CORR], [CORR, 1.0]]'], {}), '([[1.0, CORR], [CORR, 1.0]])\n', (475, 503), True, 'import numpy as np\n'), ((510, 528), 'numpy.linalg.inv', 'np.linalg.inv', (['COV'], {}), '(COV)\n', (523, 528), True, 'import numpy as np\n'), ((565, 608), 'scipy.stats.multivariate_normal... |
from __future__ import annotations
import enum
from coredis.commands import CommandName
from coredis.exceptions import ReadOnlyError
from coredis.tokens import PrefixToken, PureToken
from coredis.typing import Literal
class BitFieldSubCommand(bytes, enum.Enum):
SET = PrefixToken.SET
GET = PrefixToken.GET
... | [
"coredis.exceptions.ReadOnlyError"
] | [((1377, 1392), 'coredis.exceptions.ReadOnlyError', 'ReadOnlyError', ([], {}), '()\n', (1390, 1392), False, 'from coredis.exceptions import ReadOnlyError\n'), ((1941, 1956), 'coredis.exceptions.ReadOnlyError', 'ReadOnlyError', ([], {}), '()\n', (1954, 1956), False, 'from coredis.exceptions import ReadOnlyError\n'), ((2... |
"""
This module implements evacuation planning using the LC-MAE algorithm
"""
import random
from typing import List, Tuple
from evacsim.graph.reservation_graph import ReservationGraph, Reservation, ReservationNode
from evacsim.level import Level
from .agent_factory import AgentFactory
from .agent import Agent
def st... | [
"random.shuffle",
"evacsim.graph.reservation_graph.ReservationGraph",
"random.seed",
"evacsim.graph.reservation_graph.Reservation"
] | [((487, 509), 'random.shuffle', 'random.shuffle', (['agents'], {}), '(agents)\n', (501, 509), False, 'import random\n'), ((1089, 1113), 'random.seed', 'random.seed', (['random_seed'], {}), '(random_seed)\n', (1100, 1113), False, 'import random\n'), ((1133, 1158), 'evacsim.graph.reservation_graph.ReservationGraph', 'Res... |
import os
from typing import Any
import h5py
import numpy as np
import pandas as pd
from h5py import File
from numpy import ndarray
from pandas import DataFrame
def save_data_as_h5(file_name: str, q_values: ndarray, reflectivity: ndarray, labels: DataFrame, number_of_layers: int):
"""Saves ``q_values``, ``reflec... | [
"os.path.splitext",
"h5py.File",
"pandas.read_hdf"
] | [((941, 966), 'h5py.File', 'h5py.File', (['file_name', '"""a"""'], {}), "(file_name, 'a')\n", (950, 966), False, 'import h5py\n'), ((1816, 1841), 'h5py.File', 'h5py.File', (['file_name', '"""a"""'], {}), "(file_name, 'a')\n", (1825, 1841), False, 'import h5py\n'), ((2148, 2173), 'h5py.File', 'h5py.File', (['file_name',... |
from bucket import bucket
from celery import shared_task
def all_bucket_objects_task():
result = bucket.get_objects()
return result
@shared_task
def delete_bucket_objetc_task(key):
bucket.delete_object(key)
@shared_task
def download_bucket_object_task(key):
bucket.download_object(key)
| [
"bucket.bucket.download_object",
"bucket.bucket.delete_object",
"bucket.bucket.get_objects"
] | [((103, 123), 'bucket.bucket.get_objects', 'bucket.get_objects', ([], {}), '()\n', (121, 123), False, 'from bucket import bucket\n'), ((197, 222), 'bucket.bucket.delete_object', 'bucket.delete_object', (['key'], {}), '(key)\n', (217, 222), False, 'from bucket import bucket\n'), ((279, 306), 'bucket.bucket.download_obje... |
import language_check
f1 = open('out.txt', 'r')
text = f1.read()
f1.close()
tool = language_check.LanguageTool('en-US')
matches = tool.check(text)
f2 = open('final.txt', 'w+')
f2.write(language_check.correct(text, matches))
f2.close()
| [
"language_check.LanguageTool",
"language_check.correct"
] | [((89, 125), 'language_check.LanguageTool', 'language_check.LanguageTool', (['"""en-US"""'], {}), "('en-US')\n", (116, 125), False, 'import language_check\n'), ((194, 231), 'language_check.correct', 'language_check.correct', (['text', 'matches'], {}), '(text, matches)\n', (216, 231), False, 'import language_check\n')] |
import torch
import torch.nn.functional as F
import torch.nn as nn
class MseLoss():
def __init__(self):
self.x = torch.FloatTensor([[1, 1],
[2, 2]])
self.x_hat = torch.FloatTensor([[0, 0],
[0, 0]])
def mse_using(s... | [
"torch.nn.MSELoss",
"torch.nn.functional.mse_loss",
"torch.FloatTensor"
] | [((127, 162), 'torch.FloatTensor', 'torch.FloatTensor', (['[[1, 1], [2, 2]]'], {}), '([[1, 1], [2, 2]])\n', (144, 162), False, 'import torch\n'), ((220, 255), 'torch.FloatTensor', 'torch.FloatTensor', (['[[0, 0], [0, 0]]'], {}), '([[0, 0], [0, 0]])\n', (237, 255), False, 'import torch\n'), ((1426, 1438), 'torch.nn.MSEL... |
import logging
from datalad.distribution import siblings as mod_siblings
from datalad.support.annexrepo import AnnexRepo
from datalad.support.exceptions import (
AccessDeniedError,
AccessFailedError,
CapturedException,
)
# use same logger as -core
lgr = logging.getLogger('datalad.distribution.siblings')
... | [
"datalad.support.exceptions.CapturedException",
"logging.getLogger"
] | [((268, 318), 'logging.getLogger', 'logging.getLogger', (['"""datalad.distribution.siblings"""'], {}), "('datalad.distribution.siblings')\n", (285, 318), False, 'import logging\n'), ((1603, 1623), 'datalad.support.exceptions.CapturedException', 'CapturedException', (['e'], {}), '(e)\n', (1620, 1623), False, 'from datal... |
from BaseAPI import Comparable, Iterable, Iterator
#/* *** ODSATag: CollectionADT *** */
class Collection(Iterable):
def isEmpty(self): """Returns true if the collection is empty."""
def size(self): """Returns the number of elements in this collection."""
#/* *** ODSAendTag: CollectionADT *** */
#/* **... | [
"collections.namedtuple"
] | [((6007, 6069), 'collections.namedtuple', 'namedtuple', (['"""Edge"""', "['start', 'end', 'weight']"], {'defaults': '[1.0]'}), "('Edge', ['start', 'end', 'weight'], defaults=[1.0])\n", (6017, 6069), False, 'from collections import namedtuple\n')] |
import os
import click
from ckanapi import RemoteCKAN
from urllib import request
from dpckan.functions import get_dataset
@click.command(name='get')
@click.argument('url', required=True)
@click.argument('path', default='.')
@click.pass_context
def get_dataset_cli(ctx, url, path):
"""
Get a dataset published in cka... | [
"dpckan.functions.get_dataset",
"click.argument",
"click.command"
] | [((124, 149), 'click.command', 'click.command', ([], {'name': '"""get"""'}), "(name='get')\n", (137, 149), False, 'import click\n'), ((151, 187), 'click.argument', 'click.argument', (['"""url"""'], {'required': '(True)'}), "('url', required=True)\n", (165, 187), False, 'import click\n'), ((189, 224), 'click.argument', ... |
import os
import sys
import typing
import numpy as np
import open3d as o3d
import data.io as dio
import skimage.io
from settings import process_arguments, Parameters
import image_processing
from warp_field.graph import DeformationGraphNumpy
from nnrt import compute_mesh_from_depth_and_flow as compute_mesh_from_dept... | [
"numpy.isin",
"numpy.moveaxis",
"data.io.save_float_image",
"nnrt.compute_mesh_from_depth",
"numpy.sum",
"data.io.save_int_image",
"numpy.ones",
"nnrt.compute_clusters",
"open3d.visualization.draw_geometries",
"nnrt.sample_nodes",
"nnrt.get_vertex_erosion_mask",
"os.path.join",
"nnrt.compute... | [((2599, 2703), 'image_processing.backproject_depth', 'image_processing.backproject_depth', (['depth_image', 'fx', 'fy', 'cx', 'cy'], {'depth_scale': 'depth_scale_reciprocal'}), '(depth_image, fx, fy, cx, cy, depth_scale\n =depth_scale_reciprocal)\n', (2633, 2703), False, 'import image_processing\n'), ((3680, 3756),... |
import speech_recognition as sr
import os
from gtts import gTTS
#Define the microphone function to record the user's voice and return the recognized speech
microphone = sr.Microphone()
recognition_listen = sr.Recognizer().listen
recognition_results = sr.Recognizer().recognize_google
#Google Speech to Text
def speak(t... | [
"os.remove",
"gtts.gTTS",
"os.system",
"speech_recognition.Microphone",
"speech_recognition.Recognizer"
] | [((170, 185), 'speech_recognition.Microphone', 'sr.Microphone', ([], {}), '()\n', (183, 185), True, 'import speech_recognition as sr\n'), ((207, 222), 'speech_recognition.Recognizer', 'sr.Recognizer', ([], {}), '()\n', (220, 222), True, 'import speech_recognition as sr\n'), ((252, 267), 'speech_recognition.Recognizer',... |
from tests.integration import asserts
from threescale_api.resources import Backends
from .asserts import assert_resource, assert_resource_params
def test_3scale_url_is_set(api, url, token):
assert url is not None
assert token is not None
assert api.url is not None
def test_backends_list(api):
backen... | [
"tests.integration.asserts.assert_resource",
"tests.integration.asserts.assert_resource_params"
] | [((635, 664), 'tests.integration.asserts.assert_resource', 'asserts.assert_resource', (['read'], {}), '(read)\n', (658, 664), False, 'from tests.integration import asserts\n'), ((669, 721), 'tests.integration.asserts.assert_resource_params', 'asserts.assert_resource_params', (['read', 'backend_params'], {}), '(read, ba... |
"""Created by sgoswami on 8/6/17."""
"""Given a string, sort it in decreasing order based on the frequency of characters.
Input:
"tree"
Output:
"eert"
Explanation:
'e' appears twice while 'r' and 't' both appear once.
So 'e' must appear before both 'r' and 't'. Therefore "eetr" is also a valid answer."""
import colle... | [
"collections.Counter"
] | [((469, 491), 'collections.Counter', 'collections.Counter', (['s'], {}), '(s)\n', (488, 491), False, 'import collections\n')] |
import base64
import os
import sys
from hashlib import sha256
from math import cos
from secret import FLAG, SECRET_PASSWORD
username = b''
session = b''
USERS = {}
USERS[b'Admin'] = SECRET_PASSWORD
USERS[b'Guest'] = b'No FLAG'
def mao192(s):
A = 0x41495333
B = 0x7b754669
C = 0x6e645468
D = 0x654561... | [
"os.urandom",
"math.cos",
"sys.exit"
] | [((1844, 1855), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (1852, 1855), False, 'import sys\n'), ((3086, 3097), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (3094, 3097), False, 'import sys\n'), ((804, 810), 'math.cos', 'cos', (['i'], {}), '(i)\n', (807, 810), False, 'from math import cos\n'), ((1691, 1705), 'o... |
# -*- coding: utf-8 -*-
from typing import Tuple
from domain import Domain3D
from cloudforms import CylinderCloud
import numpy as np
import time
from scipy.special import gamma
class Plank(Domain3D):
def __init__(self, kilometers: Tuple[float, float, float] = (50., 50., 10.),
nodes: Tuple[int, in... | [
"numpy.random.uniform",
"numpy.random.seed",
"numpy.power",
"numpy.zeros",
"time.time",
"numpy.isclose",
"numpy.max",
"numpy.arange",
"cloudforms.CylinderCloud",
"numpy.exp",
"scipy.special.gamma"
] | [((1729, 1749), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (1743, 1749), True, 'import numpy as np\n'), ((1861, 1886), 'numpy.arange', 'np.arange', (['Dm', '(0)', '(-Dm / r)'], {}), '(Dm, 0, -Dm / r)\n', (1870, 1886), True, 'import numpy as np\n'), ((4020, 4061), 'numpy.zeros', 'np.zeros', (['(s... |
# -*- coding: utf-8 -*-
# Copyright 2018 IBM.
#
# 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 agre... | [
"numpy.concatenate"
] | [((889, 911), 'numpy.concatenate', 'np.concatenate', (['arrays'], {}), '(arrays)\n', (903, 911), True, 'import numpy as np\n'), ((1021, 1043), 'numpy.concatenate', 'np.concatenate', (['labels'], {}), '(labels)\n', (1035, 1043), True, 'import numpy as np\n')] |
"""A setuptools based setup module.
See:
https://packaging.python.org/guides/distributing-packages-using-setuptools/
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
from os import path
# io.open is needed for projects that support Python 2... | [
"os.path.dirname",
"os.path.join",
"setuptools.find_packages"
] | [((534, 556), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (546, 556), False, 'from os import path\n'), ((617, 645), 'os.path.join', 'path.join', (['here', '"""README.md"""'], {}), "(here, 'README.md')\n", (626, 645), False, 'from os import path\n'), ((2539, 2590), 'setuptools.find_packages', ... |
from utils.simplelog import Logger
logger = Logger("tornadoserver", "tornadoserver.log").log()
| [
"utils.simplelog.Logger"
] | [((45, 89), 'utils.simplelog.Logger', 'Logger', (['"""tornadoserver"""', '"""tornadoserver.log"""'], {}), "('tornadoserver', 'tornadoserver.log')\n", (51, 89), False, 'from utils.simplelog import Logger\n')] |
import torch
import torch.nn as nn
# Based on
# https://github.com/tensorflow/models/blob/master/research/struct2depth/model.py#L625-L641
def _gradient_x(img: torch.Tensor) -> torch.Tensor:
if len(img.shape) != 4:
raise AssertionError(img.shape)
return img[:, :, :, :-1] - img[:, :, :, 1:]
def _grad... | [
"torch.mean",
"torch.abs"
] | [((2749, 2781), 'torch.abs', 'torch.abs', (['(idepth_dx * weights_x)'], {}), '(idepth_dx * weights_x)\n', (2758, 2781), False, 'import torch\n'), ((2815, 2847), 'torch.abs', 'torch.abs', (['(idepth_dy * weights_y)'], {}), '(idepth_dy * weights_y)\n', (2824, 2847), False, 'import torch\n'), ((2860, 2884), 'torch.mean', ... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Python implementation of the Oslo Ricepile model.
"""
import numpy as np
import pickle
import os
import binascii
class Oslo:
""" Docstring """
def __init__(self, L,mode = 'n'):
if type(L) != int:
raise ValueError("Grid size, L, must be in... | [
"pickle.dump",
"numpy.save",
"os.makedirs",
"numpy.zeros",
"numpy.shape",
"numpy.random.randint",
"numpy.arange",
"numpy.random.random",
"os.urandom",
"numpy.in1d"
] | [((395, 419), 'numpy.zeros', 'np.zeros', (['L'], {'dtype': '"""int"""'}), "(L, dtype='int')\n", (403, 419), True, 'import numpy as np\n'), ((440, 466), 'numpy.random.randint', 'np.random.randint', (['(1)', '(3)', 'L'], {}), '(1, 3, L)\n', (457, 466), True, 'import numpy as np\n'), ((1371, 1390), 'os.makedirs', 'os.make... |
#!/usr/bin/env python3
"""Naive HTTPS clinet"""
from socket import AF_INET, socket, SOCK_STREAM
from threading import Thread
import ssl
def https_get(host, path, port=443):
raw_socket = socket(AF_INET, SOCK_STREAM)
client_socket = ssl.wrap_socket(raw_socket)
client_socket.connect((host, port))
client_... | [
"socket.socket",
"ssl.wrap_socket"
] | [((192, 220), 'socket.socket', 'socket', (['AF_INET', 'SOCK_STREAM'], {}), '(AF_INET, SOCK_STREAM)\n', (198, 220), False, 'from socket import AF_INET, socket, SOCK_STREAM\n'), ((241, 268), 'ssl.wrap_socket', 'ssl.wrap_socket', (['raw_socket'], {}), '(raw_socket)\n', (256, 268), False, 'import ssl\n')] |
from travelperk_python_api_types.expenses.invoice_lines.invoice_lines import (
InvoiceLines,
)
from travelperk_python_api_types.expenses.invoice_lines.invoice_line import (
InvoiceLine,
)
from travelperk_python_api_types.expenses.invoice_lines.metadata import (
Metadata,
)
from travelperk_python_api_types.e... | [
"travelperk_python_api_types.expenses.invoices.invoices.Invoices",
"travelperk_python_api_types.expenses.invoice_profiles.invoice_profiles.InvoiceProfiles",
"travelperk_python_api_types.expenses.invoice_lines.invoice_lines.InvoiceLines"
] | [((1277, 2470), 'travelperk_python_api_types.expenses.invoice_lines.invoice_lines.InvoiceLines', 'InvoiceLines', ([], {}), "(**{'total': 1, 'offset': 0, 'limit': 10, 'invoice_lines': [{\n 'expense_date': '2020-02-13', 'description':\n 'FLIGHT for Trip ID 1687664', 'quantity': 1, 'unit_price':\n '20.00000000', ... |
from eternity_backend_server.extensions import db
class DATAMIN(db.Model):
__tablename__ = "datamin"
id = db.Column(db.Integer, primary_key=True)
type = db.Column(db.String(22), nullable=False)
datalist = db.Column(db.JSON, nullable=False)
class DATAMINFLAG(db.Model):
__tablename__ = "dataminflag... | [
"eternity_backend_server.extensions.db.String",
"eternity_backend_server.extensions.db.Column"
] | [((116, 155), 'eternity_backend_server.extensions.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_key=True)\n', (125, 155), False, 'from eternity_backend_server.extensions import db\n'), ((223, 257), 'eternity_backend_server.extensions.db.Column', 'db.Column', (['db.JSON'], {... |
# Generated by Django 3.2.4 on 2021-09-01 22:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('museum_site', '0073_auto_20210826_0019'),
]
operations = [
migrations.AddField(
model_name='profile',
name='accepted... | [
"django.db.models.CharField"
] | [((345, 388), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(10)'}), '(blank=True, max_length=10)\n', (361, 388), False, 'from django.db import migrations, models\n')] |
#!/usr/bin/env python3
# License : See LICENSE
# Modify for Centreon and python3 by Michael067
# Version 1.0.0 - 29/04/2020
import argparse
import requests
import json
VERSION = "1.0.0"
def parse():
parser = argparse.ArgumentParser(description='Sends alerts to Mattermost')
parser.add_argument('--url', help=... | [
"argparse.ArgumentParser",
"json.dumps"
] | [((216, 281), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Sends alerts to Mattermost"""'}), "(description='Sends alerts to Mattermost')\n", (239, 281), False, 'import argparse\n'), ((2500, 2519), 'json.dumps', 'json.dumps', (['payload'], {}), '(payload)\n', (2510, 2519), False, 'impor... |
# Copyright 2011 <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 in writing, softw... | [
"vec3.vec3"
] | [((1101, 1114), 'vec3.vec3', 'vec3', (['a', 'b', 'c'], {}), '(a, b, c)\n', (1105, 1114), False, 'from vec3 import vec3\n'), ((1121, 1134), 'vec3.vec3', 'vec3', (['d', 'e', 'f'], {}), '(d, e, f)\n', (1125, 1134), False, 'from vec3 import vec3\n'), ((794, 813), 'vec3.vec3', 'vec3', (['(7.0)', '(7.0)', '(7.0)'], {}), '(7.... |
"""
Codes for gas, oil, and water PVT correlations
@author: <NAME>
@email: <EMAIL>
"""
"""
GAS
"""
def gas_pseudoprops(temp, pressure, sg, x_h2s, x_co2):
"""
Calculate Gas Pseudo-critical and Pseudo-reduced Pressure and Temperature
* Pseudo-critical properties
For range: 0.57 < sg < 1.68
(Sutton, 1985)
... | [
"numpy.log",
"scipy.optimize.fsolve",
"numpy.exp"
] | [((2107, 2124), 'scipy.optimize.fsolve', 'fsolve', (['f', '[1, 1]'], {}), '(f, [1, 1])\n', (2113, 2124), False, 'from scipy.optimize import fsolve\n'), ((3563, 3590), 'numpy.exp', 'np.exp', (['(x * rhogas_lee ** y)'], {}), '(x * rhogas_lee ** y)\n', (3569, 3590), True, 'import numpy as np\n'), ((8948, 8963), 'numpy.exp... |
#!/usr/bin/env python
import os
from setuptools import setup, find_packages
import bansoko
setup(
name="bansoko",
version=bansoko.__version__,
author="<NAME>",
author_email="<EMAIL>",
url="https://github.com/kfurtak1024/bansoko",
description="Bansoko is a reimagined, space-themed... | [
"os.path.dirname",
"setuptools.find_packages"
] | [((1065, 1118), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['resbuilder', 'resbuilder.*']"}), "(exclude=['resbuilder', 'resbuilder.*'])\n", (1078, 1118), False, 'from setuptools import setup, find_packages\n'), ((474, 499), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (4... |
# Generated by Django 2.2.2 on 2019-06-26 07:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='user',
name='address',
field... | [
"django.db.models.CharField"
] | [((321, 423), 'django.db.models.CharField', 'models.CharField', ([], {'help_text': '"""Enter your area of residence"""', 'max_length': '(100)', 'verbose_name': '"""Address"""'}), "(help_text='Enter your area of residence', max_length=100,\n verbose_name='Address')\n", (337, 423), False, 'from django.db import migrat... |
import sys
from PyQt5 import QtCore, QtGui, QtWidgets
import doctor
from doctor import ProfileInfo
from doctor.TimeTable import TimeTable
from doctor.SubjectListUi import SubjectListUi
class Ui_MainWindow(object):
def __init__(self, data):
self.data = data
self.doctorName = data[2]
... | [
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtWidgets.QWidget",
"PyQt5.QtCore.QRect",
"doctor.SubjectListUi.SubjectListUi",
"PyQt5.QtWidgets.QMenu",
"PyQt5.QtWidgets.QStatusBar",
"PyQt5.QtWidgets.QPushButton",
"doctor.ProfileInfo.Ui_MainWindow",
"PyQt5.QtWidgets.QMainWindow",
"PyQt5.QtGui.QFont",
"PyQt5.Qt... | [((505, 535), 'PyQt5.QtWidgets.QWidget', 'QtWidgets.QWidget', (['self.window'], {}), '(self.window)\n', (522, 535), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((616, 652), 'PyQt5.QtWidgets.QLabel', 'QtWidgets.QLabel', (['self.centralwidget'], {}), '(self.centralwidget)\n', (632, 652), False, 'from PyQt5 im... |
import tensorflow as tf
import os
import numpy as np
from scipy.ndimage import imread
def sample_Z(m,n):
return np.random.uniform(-1., 1., size=[m,n])
def get_y(x):
return 10 + x*x;
def sample_data(n=10000, scale=100):
data = []
x = scale*(np.random.random_sample((n,))-0.5)
for i in range(n):
... | [
"numpy.random.uniform",
"numpy.size",
"numpy.random.random_sample",
"tensorflow.get_collection",
"tensorflow.global_variables_initializer",
"tensorflow.layers.dense",
"tensorflow.Session",
"tensorflow.variable_scope",
"numpy.expand_dims",
"tensorflow.train.RMSPropOptimizer",
"tensorflow.ones_lik... | [((118, 159), 'numpy.random.uniform', 'np.random.uniform', (['(-1.0)', '(1.0)'], {'size': '[m, n]'}), '(-1.0, 1.0, size=[m, n])\n', (135, 159), True, 'import numpy as np\n'), ((386, 400), 'numpy.array', 'np.array', (['data'], {}), '(data)\n', (394, 400), True, 'import numpy as np\n'), ((1557, 1577), 'numpy.array', 'np.... |
import sqlite3
class clock_db:
def __init__(self):
self.conn = sqlite3.connect('punchclock.db')
self.c = self.conn.cursor()
return
def generate_file(self):
sql_string="CREATE TABLE employee (emp_card text, emp_name text)"
self.c.execute(sql_string)
self.conn.commit()
sql_string="CREATE TABLE checkin... | [
"sqlite3.connect"
] | [((67, 99), 'sqlite3.connect', 'sqlite3.connect', (['"""punchclock.db"""'], {}), "('punchclock.db')\n", (82, 99), False, 'import sqlite3\n')] |
#!/usr/bin/env python
import scipy.spatial
import numpy as np
import sys
import glob
def get_sssa_components(coordinates):
hull = scipy.spatial.ConvexHull(coordinates, qhull_options='QJ')
return hull.volume, hull.area
def coordinate_array(fn):
lines = open(fn).readlines()
numatoms = int(lines[0])
coords = ... | [
"numpy.array",
"glob.glob"
] | [((639, 695), 'glob.glob', 'glob.glob', (['"""/mnt/c/Users/guido/data/qm9/coord/*/*/*.xyz"""'], {}), "('/mnt/c/Users/guido/data/qm9/coord/*/*/*.xyz')\n", (648, 695), False, 'import glob\n'), ((431, 447), 'numpy.array', 'np.array', (['coords'], {}), '(coords)\n', (439, 447), True, 'import numpy as np\n')] |
#!/usr/bin/env python
import os
import re
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def read(*names, **kwargs):
with open(os.path.join(os.path.dirname(__file__), *names), 'r') as fp:
return fp.read()
def find_version(*file_paths):
versi... | [
"os.path.dirname",
"re.search",
"pypandoc.convert"
] | [((368, 441), 're.search', 're.search', (['"""^__version__ = [\'\\\\"]([^\'\\\\"]*)[\'\\\\"]"""', 'version_file', 're.M'], {}), '(\'^__version__ = [\\\'\\\\"]([^\\\'\\\\"]*)[\\\'\\\\"]\', version_file, re.M)\n', (377, 441), False, 'import re\n'), ((909, 934), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(... |
import numpy as np
from io import SEEK_CUR
__all__ = ['imread', 'imwrite']
def imwrite(filename, image, write_order=None):
"""Write an image as a BMP.
Depending on the dtype and shape of the image, the image will either
be encoded with 1 bit per pixel (boolean 2D images), 8 bit per pixel
(uint8 2D i... | [
"numpy.full_like",
"numpy.right_shift",
"numpy.fromfile",
"numpy.empty",
"numpy.asarray",
"numpy.dtype",
"numpy.packbits",
"numpy.zeros",
"numpy.all",
"numpy.arange",
"numpy.take",
"numpy.linspace",
"numpy.unpackbits",
"numpy.array_equal",
"numpy.bitwise_and",
"numpy.copyto",
"numpy.... | [((21809, 21948), 'numpy.dtype', 'np.dtype', (["[('signature', '|S2'), ('filesize', '<u4'), ('reserved1', '<u2'), (\n 'reserved2', '<u2'), ('file_offset_to_pixelarray', '<u4')]"], {}), "([('signature', '|S2'), ('filesize', '<u4'), ('reserved1', '<u2'),\n ('reserved2', '<u2'), ('file_offset_to_pixelarray', '<u4')]... |
import os
import torch
from torch import nn
from torch.autograd import Variable
import torchvision
import torchvision.datasets as dsets
import torchvision.transforms as transforms
import utils
from arch import define_Gen, define_Dis
import numpy as np
from sklearn.metrics import mean_absolute_error
from skimage.metrics... | [
"arch.define_Gen",
"torch.cat",
"sklearn.metrics.mean_absolute_error",
"utils.print_networks",
"numpy.mean",
"torch.device",
"torchvision.transforms.Normalize",
"torch.no_grad",
"torch.utils.data.DataLoader",
"utils.load_checkpoint",
"utils.get_testdata_link",
"numpy.var",
"torchvision.datas... | [((682, 723), 'utils.get_testdata_link', 'utils.get_testdata_link', (['args.dataset_dir'], {}), '(args.dataset_dir)\n', (705, 723), False, 'import utils\n'), ((743, 804), 'torchvision.datasets.ImageFolder', 'dsets.ImageFolder', (["dataset_dirs['testA']"], {'transform': 'transform'}), "(dataset_dirs['testA'], transform=... |
import json
from collections import defaultdict
from typing import DefaultDict, List, Dict, Set
import time
from websocket_lx.websocket_manager import WebsocketManager
class LxWebsocketClient(WebsocketManager):
_ENDPOINT = 'wss://api.ledgerx.com/ws'
def __init__(self, api_key: str = None) -> None:
s... | [
"collections.defaultdict",
"json.loads",
"time.time_ns",
"time.time"
] | [((620, 636), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (631, 636), False, 'from collections import defaultdict\n'), ((847, 865), 'collections.defaultdict', 'defaultdict', (['float'], {}), '(float)\n', (858, 865), False, 'from collections import defaultdict\n'), ((923, 957), 'collections.defau... |
"""
RAMP backend API
Methods for interacting with the database
"""
from __future__ import print_function, absolute_import
import os
import numpy as np
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.engine.url import URL
from ..model import Model
from .query import sele... | [
"numpy.load",
"numpy.std",
"sqlalchemy.orm.sessionmaker",
"numpy.mean",
"numpy.loadfromtxt",
"sqlalchemy.create_engine",
"sqlalchemy.engine.url.URL"
] | [((1656, 1669), 'sqlalchemy.engine.url.URL', 'URL', ([], {}), '(**config)\n', (1659, 1669), False, 'from sqlalchemy.engine.url import URL\n'), ((1679, 1700), 'sqlalchemy.create_engine', 'create_engine', (['db_url'], {}), '(db_url)\n', (1692, 1700), False, 'from sqlalchemy import create_engine\n'), ((1758, 1774), 'sqlal... |
# Generated by Django 2.2 on 2019-05-16 16:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("cast", "0024_auto_20190428_0859")]
operations = [
migrations.AddField(
model_name="blog",
name="comments_enabled",
fiel... | [
"django.db.models.BooleanField"
] | [((322, 455), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(True)', 'help_text': '"""Whether comments are enabled for this blog."""', 'verbose_name': '"""comments_enabled"""'}), "(default=True, help_text=\n 'Whether comments are enabled for this blog.', verbose_name=\n 'comments_enabl... |
from dataclasses import dataclass
from marshmallow import Schema, fields, post_load
@dataclass()
class Client:
userId: str
robotId: str
sessionId: str
def __repr__(self):
return f"<Client(userId={self.userId}, robotId={self.robotId}, sessionId={self.sessionId})>" # noqa: E501, B950
def... | [
"marshmallow.fields.String",
"dataclasses.dataclass"
] | [((88, 99), 'dataclasses.dataclass', 'dataclass', ([], {}), '()\n', (97, 99), False, 'from dataclasses import dataclass\n'), ((561, 589), 'marshmallow.fields.String', 'fields.String', ([], {'required': '(True)'}), '(required=True)\n', (574, 589), False, 'from marshmallow import Schema, fields, post_load\n'), ((604, 632... |
"""Detection of country for authors affiliations."""
import requests
import json
import re
# from typing import Union, List, Dict, Any
def get_projects(funding_info):
if funding_info is None or len(funding_info) == 0:
return []
anr_regex = re.compile("ANR-[0-9]{2}-[A-Z0-9]{4}-[0-9]{4}", re.IGNORECAS... | [
"json.loads",
"requests.get",
"re.compile"
] | [((260, 322), 're.compile', 're.compile', (['"""ANR-[0-9]{2}-[A-Z0-9]{4}-[0-9]{4}"""', 're.IGNORECASE'], {}), "('ANR-[0-9]{2}-[A-Z0-9]{4}-[0-9]{4}', re.IGNORECASE)\n", (270, 322), False, 'import re\n'), ((339, 394), 're.compile', 're.compile', (['"""[0-9]{2}-[A-Z]{4}-[0-9]{4}"""', 're.IGNORECASE'], {}), "('[0-9]{2}-[A-... |
#An's imports
from adventurelib import *
from random import randint
number = 0
life = 2
print("You're falling into a dark, endless hole. You can't see nor hear anything. It feels like a dream, bt you cannot wake up. It's getting warmer and warmer, and suddenly, your back hits against the floor and you stop falling.")
... | [
"random.randint"
] | [((1719, 1733), 'random.randint', 'randint', (['(2)', '(12)'], {}), '(2, 12)\n', (1726, 1733), False, 'from random import randint\n')] |
from application import db
class Indicator(db.Model):
__tablename__ = 'fa_indicator'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(256))
unit = db.Column(db.String(16))
unit2 = db.Column(db.String(16))
quantity = db.Column(db.String(8))
def __init__(self, id, na... | [
"application.db.ForeignKey",
"application.db.Column",
"application.db.String",
"application.db.relationship"
] | [((100, 139), 'application.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_key=True)\n', (109, 139), False, 'from application import db\n'), ((722, 763), 'application.db.relationship', 'db.relationship', (['"""Company"""'], {'lazy': '"""joined"""'}), "('Company', lazy='joined... |
#!/usr/bin/python2.7
import os
import subprocess as sp
output_dir = '../res'
if not os.path.exists(output_dir):
os.makedirs(output_dir)
run_times = 10
bench_progs = ['bench_seq', 'bench_matrix', 'bench_revseq', 'bench_revmatrix', 'bench_random']
pager_progs = {
'apager': ['./apager'],
'dpager': ['./dpage... | [
"os.path.join",
"subprocess.call",
"os.makedirs",
"os.path.exists"
] | [((438, 493), 'subprocess.call', 'sp.call', (['"""make clean && make release bench"""'], {'shell': '(True)'}), "('make clean && make release bench', shell=True)\n", (445, 493), True, 'import subprocess as sp\n'), ((86, 112), 'os.path.exists', 'os.path.exists', (['output_dir'], {}), '(output_dir)\n', (100, 112), False, ... |
from pathlib import Path
from typing import List
import toml
def read_config(root: Path):
return toml.load(root / 'config.toml')
def parse_package_names(db, packages: List[str]):
invalid_packages = [p for p in packages if p.count('@') >= 2]
if invalid_packages:
print('The following package name... | [
"building.get_metadata",
"toml.load"
] | [((103, 134), 'toml.load', 'toml.load', (["(root / 'config.toml')"], {}), "(root / 'config.toml')\n", (112, 134), False, 'import toml\n'), ((5270, 5291), 'building.get_metadata', 'get_metadata', (['db', 'pkg'], {}), '(db, pkg)\n', (5282, 5291), False, 'from building import get_metadata\n')] |
import sys
sys.path.insert(0, ".")
sys.path.insert(0, "..")
from local_lib import create_embedded_dataset, load_vectorizer
from hover.recipes.experimental import active_learning
from hover.core.neural import VectorNet
from hover.utils.common_nn import LogisticRegression
from bokeh.io import curdoc
TASK_MODULE = "mod... | [
"hover.core.neural.VectorNet",
"hover.recipes.experimental.active_learning",
"sys.path.insert",
"bokeh.io.curdoc",
"local_lib.create_embedded_dataset",
"local_lib.load_vectorizer"
] | [((12, 35), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""."""'], {}), "(0, '.')\n", (27, 35), False, 'import sys\n'), ((36, 60), 'sys.path.insert', 'sys.path.insert', (['(0)', '""".."""'], {}), "(0, '..')\n", (51, 60), False, 'import sys\n'), ((507, 535), 'local_lib.load_vectorizer', 'load_vectorizer', (['TASK_MO... |
"""
Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
# ComponentPropertyCommands test case visibility
import azlmbr.bus as bus
import azlmbr.editor as editor
impor... | [
"azlmbr.editor.EditorToolsApplicationRequestBus",
"azlmbr.entity.SearchFilter",
"azlmbr.entity.SearchBus",
"azlmbr.entity.EntityType",
"azlmbr.editor.EditorComponentAPIBus"
] | [((362, 460), 'azlmbr.editor.EditorToolsApplicationRequestBus', 'editor.EditorToolsApplicationRequestBus', (['bus.Broadcast', '"""OpenLevelNoPrompt"""', '"""ocean_component"""'], {}), "(bus.Broadcast, 'OpenLevelNoPrompt',\n 'ocean_component')\n", (401, 460), True, 'import azlmbr.editor as editor\n'), ((1051, 1072), ... |
from power_planner.utils.utils import get_distance_surface, rescale, normalize
import numpy as np
import matplotlib.pyplot as plt
import rasterio
class CorridorUtils():
def __init__(self):
pass
@staticmethod
def get_middle_line(start_inds, dest_inds, instance_corr, num_points=2):
vec = (... | [
"numpy.absolute",
"rasterio.open",
"numpy.quantile",
"numpy.sum",
"matplotlib.pyplot.show",
"numpy.log",
"matplotlib.pyplot.imshow",
"numpy.argsort",
"numpy.sort",
"matplotlib.pyplot.figure",
"numpy.where",
"power_planner.utils.utils.rescale",
"numpy.array",
"numpy.linalg.norm",
"numpy.a... | [((510, 533), 'numpy.where', 'np.where', (['instance_corr'], {}), '(instance_corr)\n', (518, 533), True, 'import numpy as np\n'), ((2159, 2187), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(20, 10)'}), '(figsize=(20, 10))\n', (2169, 2187), True, 'import matplotlib.pyplot as plt\n'), ((2196, 2215), 'matp... |
# coding: utf-8
import socketserver
import os
import mimetypes
# 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/LICEN... | [
"os.path.abspath",
"os.path.basename",
"os.path.realpath",
"os.path.exists",
"os.path.isfile",
"mimetypes.MimeTypes",
"socketserver.TCPServer"
] | [((6665, 6714), 'socketserver.TCPServer', 'socketserver.TCPServer', (['(HOST, PORT)', 'MyWebServer'], {}), '((HOST, PORT), MyWebServer)\n', (6687, 6714), False, 'import socketserver\n'), ((6438, 6465), 'os.path.realpath', 'os.path.realpath', (['self.ROOT'], {}), '(self.ROOT)\n', (6454, 6465), False, 'import os\n'), ((4... |
from glouton.infrastructure.satnogNetworkClient import SatnogNetworkClient
from glouton.commands.download.downloadCommand import DownloadCommand
from glouton.commands.module.observationModuleCommandParams import ObservationModuleCommandParams
from glouton.commands.module.observationModuleCommand import ObservationModul... | [
"glouton.commands.download.downloadCommand.DownloadCommand.__init__",
"glouton.commands.module.observationModuleCommandParams.ObservationModuleCommandParams",
"glouton.commands.module.observationModuleCommand.ObservationModuleCommand",
"glouton.infrastructure.satnogNetworkClient.SatnogNetworkClient"
] | [((462, 518), 'glouton.commands.download.downloadCommand.DownloadCommand.__init__', 'DownloadCommand.__init__', (['self', 'params', 'modules_commands'], {}), '(self, params, modules_commands)\n', (486, 518), False, 'from glouton.commands.download.downloadCommand import DownloadCommand\n'), ((580, 601), 'glouton.infrast... |
# Copyright (c) 2017 <NAME> <<EMAIL>>
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, me... | [
"os.path.abspath",
"application.business.Business",
"application.models.Corpus.objects.get",
"django.urls.reverse",
"django.shortcuts.render"
] | [((2388, 2414), 'application.business.Business', 'app_ctrl.Business', (['request'], {}), '(request)\n', (2405, 2414), True, 'import application.business as app_ctrl\n'), ((2432, 2496), 'application.models.Corpus.objects.get', 'app_models.Corpus.objects.get', ([], {'user__id': 'bl.user.id', 'pk': 'corpus_pk'}), '(user__... |
#!/usr/bin/env python
from markovLatex.markov import TextGenerator
from markovLatex.tex import Document as doc
from random import randint
import argparse, sys
def main(args):
parser = argparse.ArgumentParser(description="Access the Will of the Gods from the command line.")
parser.add_argument('files', type=str, na... | [
"markovLatex.tex.Document",
"random.randint",
"argparse.ArgumentParser",
"markovLatex.markov.TextGenerator"
] | [((188, 282), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Access the Will of the Gods from the command line."""'}), "(description=\n 'Access the Will of the Gods from the command line.')\n", (211, 282), False, 'import argparse, sys\n'), ((640, 667), 'markovLatex.tex.Document', 'doc... |
# -*- encoding: utf-8 -*-
# ! python3
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
urlpatterns = [
url(r'^', include('web.urls', namespace='web')),
url(r'^admin/', admin.site.urls),
# url(r'^accounts/... | [
"django.conf.urls.static.static",
"django.conf.urls.url",
"django.conf.urls.include"
] | [((264, 295), 'django.conf.urls.url', 'url', (['"""^admin/"""', 'admin.site.urls'], {}), "('^admin/', admin.site.urls)\n", (267, 295), False, 'from django.conf.urls import include, url\n'), ((749, 810), 'django.conf.urls.static.static', 'static', (['settings.MEDIA_URL'], {'document_root': 'settings.MEDIA_ROOT'}), '(set... |
"""taskorganizer.config.settings.base ."""
import os
import json
# Normally you should not import ANYTHING from Django directly
# into your settings, but ImproperlyConfigured is an exception.
from django.core.exceptions import ImproperlyConfigured
# Build paths inside the project like this: os.path.join(BASE_DIR, ..... | [
"os.path.abspath",
"os.path.join"
] | [((1626, 1667), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""tasklist/static"""'], {}), "(BASE_DIR, 'tasklist/static')\n", (1638, 1667), False, 'import os\n'), ((387, 412), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (402, 412), False, 'import os\n'), ((1880, 1925), 'os.path.join', 'o... |
from solutions.common import TreeNode
class Solution1:
def deepest_leaves_sum(self, root: TreeNode) -> int:
if root is None:
return 0
queue = [root]
while queue:
count = len(queue)
summation = 0
while count > 0:
node = queue.p... | [
"solutions.common.TreeNode.from_list"
] | [((717, 749), 'solutions.common.TreeNode.from_list', 'TreeNode.from_list', (['tree_in_list'], {}), '(tree_in_list)\n', (735, 749), False, 'from solutions.common import TreeNode\n')] |
import backtrader.indicators as btind
from . import compare_price as compare
from .base_indicator import iBaseIndicator
class iPctChangeCompare(iBaseIndicator):
'''
因子:平均移动线比较数值
传入参数:
rule = {"args": ["5"], #ema周期
"logic":{"compare": "eq","byValue": 1,"byMax": 5,}, # 周期结果比较
... | [
"backtrader.indicators.CrossOver",
"backtrader.indicators.PercentChange"
] | [((491, 548), 'backtrader.indicators.PercentChange', 'btind.PercentChange', (['self.data.close'], {'period': 'self.args[0]'}), '(self.data.close, period=self.args[0])\n', (510, 548), True, 'import backtrader.indicators as btind\n'), ((1205, 1262), 'backtrader.indicators.PercentChange', 'btind.PercentChange', (['self.da... |
#!/usr/bin/env python3
# coding=utf-8
# date 2019-11-22 09:11:49
# author calllivecn <<EMAIL>>
import os
import sys
import time
import base64
import hashlib
import json
import hmac
import logging
import pprint
import urllib
from urllib import request
from urllib import parse
#import configparser
# Set the global ... | [
"urllib.request.Request",
"urllib.parse.urlencode",
"logging.StreamHandler",
"urllib.parse.urlparse",
"urllib.request.urlopen",
"time.sleep",
"logging.Formatter",
"os.environ.get",
"time.time",
"sys.exit",
"logging.getLogger"
] | [((538, 565), 'logging.getLogger', 'logging.getLogger', (['"""logger"""'], {}), "('logger')\n", (555, 565), False, 'import logging\n'), ((578, 699), 'logging.Formatter', 'logging.Formatter', (['"""%(asctime)s %(filename)s:%(lineno)d %(levelname)s: %(message)s"""'], {'datefmt': '"""%Y-%m-%d-%H:%M:%S"""'}), "(\n '%(as... |
import unicodedata
import re
# Used to generate the horrible characters.txt, from the confusables file
# see https://util.unicode.org/UnicodeJsps/confusables.jsp
def generate_chars():
match = re.compile("^[a-zA-Z]*$")
characters = ""
with open("./uglier/confusables.txt", "r") as f:
for line in f.re... | [
"unicodedata.normalize",
"re.match",
"re.compile"
] | [((197, 222), 're.compile', 're.compile', (['"""^[a-zA-Z]*$"""'], {}), "('^[a-zA-Z]*$')\n", (207, 222), False, 'import re\n'), ((446, 481), 'unicodedata.normalize', 'unicodedata.normalize', (['"""NFKC"""', 'char'], {}), "('NFKC', char)\n", (467, 481), False, 'import unicodedata\n'), ((501, 528), 're.match', 're.match',... |
from world_viewer.synthetic_world import SyntheticWorld
from world_viewer.glasses import Glasses
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import networkx as nx
from matplotlib.colors import LogNorm
from sklearn.utils import shuffle
import matplotlib.dates as mdates
from matplotlib.figure i... | [
"pandas.read_pickle",
"world_viewer.synthetic_world.SyntheticWorld",
"pandas.concat",
"world_viewer.glasses.Glasses"
] | [((597, 683), 'world_viewer.synthetic_world.SyntheticWorld', 'SyntheticWorld', ([], {'path': '"""data/Synthetisch/avm_final_5k"""', 'run': 'run', 'number_of_nodes': '(851)'}), "(path='data/Synthetisch/avm_final_5k', run=run,\n number_of_nodes=851)\n", (611, 683), False, 'from world_viewer.synthetic_world import Synt... |
from gym_snake.register import register
for num_players in ['']:
for style in ['']:
for grid_size in ['4x4', '8x8', '16x16']:
for grid_type in ['']:
env_id = '-'.join(['Snake', grid_type, grid_size, style, num_players]) + '-v0'.replace('--', '-')
entry_point = 'g... | [
"gym_snake.register.register"
] | [((617, 684), 'gym_snake.register.register', 'register', ([], {'id': '"""Snake-4x4-v0"""', 'entry_point': '"""gym_snake.envs:Snake_4x4"""'}), "(id='Snake-4x4-v0', entry_point='gym_snake.envs:Snake_4x4')\n", (625, 684), False, 'from gym_snake.register import register\n'), ((696, 763), 'gym_snake.register.register', 'reg... |
import numpy as np
import pandas as pd
from vnpy.app.cta_strategy.strategies.ma_trend.constant import DataSignalName, DataMethod
from vnpy.app.cta_strategy.strategies.ma_trend.data_center import DataCreator
from vnpy.trader.utility import ArrayManager
class MaInfoCreator(DataCreator):
parameters = ["ma_level", "... | [
"pandas.DataFrame",
"pandas.to_datetime",
"numpy.array",
"numpy.var"
] | [((405, 419), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (417, 419), True, 'import pandas as pd\n'), ((1453, 1478), 'numpy.array', 'np.array', (['ma_lvl_tag[:-1]'], {}), '(ma_lvl_tag[:-1])\n', (1461, 1478), True, 'import numpy as np\n'), ((1910, 1930), 'numpy.array', 'np.array', (['ma_lvl_tag'], {}), '(ma_lv... |
# vim: set ts=4 sw=4 expandtab:
from puremvc.patterns.command import SimpleCommand
from libtimesheet.model.TimeProxy import TimeProxy
from libtimesheet.view.DialogMediator import DialogMediator
from libtimesheet.view.MenuMediator import MenuMediator
from libtimesheet.view.DatePickerMediator import DatePickerMediato... | [
"libtimesheet.view.MenuMediator.MenuMediator",
"libtimesheet.view.SummaryMediator.SummaryMediator",
"libtimesheet.view.TimeGridMediator.TimeGridMediator",
"libtimesheet.view.DialogMediator.DialogMediator",
"libtimesheet.view.DatePickerMediator.DatePickerMediator",
"libtimesheet.model.TimeProxy.TimeProxy"
... | [((548, 559), 'libtimesheet.model.TimeProxy.TimeProxy', 'TimeProxy', ([], {}), '()\n', (557, 559), False, 'from libtimesheet.model.TimeProxy import TimeProxy\n'), ((634, 659), 'libtimesheet.view.DialogMediator.DialogMediator', 'DialogMediator', (['mainPanel'], {}), '(mainPanel)\n', (648, 659), False, 'from libtimesheet... |
from mine import *
from sys import argv
from random import randint
DIRS = ((1,0),(0,1),(-1,0),(0,-1))
def generateMaze(xSize, ySize, start=(0,0), dirs=DIRS, inside=None):
if inside == None:
inside = lambda xy : 0 <= xy[0] < xSize and 0 <= xy[1] < ySize
def move(pos, dir):
r... | [
"random.randint"
] | [((1366, 1392), 'random.randint', 'randint', (['(0)', '(nUnvisited - 1)'], {}), '(0, nUnvisited - 1)\n', (1373, 1392), False, 'from random import randint\n')] |
import numpy as np
def relu(x):
return np.maximum(0, x)
def sigmoid(x):
return 1 / (1 + np.exp(-np.clip(x, -10, 10)))
def logexp(x):
return np.where(x > 100, x, np.log(1 + np.exp(x)))
def binary_cross_entropy(x, y):
loss = y * logexp(-x) + (1 - y) * logexp(x)
return loss
| [
"numpy.maximum",
"numpy.exp",
"numpy.clip"
] | [((45, 61), 'numpy.maximum', 'np.maximum', (['(0)', 'x'], {}), '(0, x)\n', (55, 61), True, 'import numpy as np\n'), ((190, 199), 'numpy.exp', 'np.exp', (['x'], {}), '(x)\n', (196, 199), True, 'import numpy as np\n'), ((108, 127), 'numpy.clip', 'np.clip', (['x', '(-10)', '(10)'], {}), '(x, -10, 10)\n', (115, 127), True,... |
###############################################################################
# #
# file: .py #
# #
... | [
"networktables.NetworkTables.getTable",
"threading.Thread.__init__",
"cv2.VideoWriter_fourcc",
"logging.basicConfig",
"cv2.waitKey",
"time.time",
"threading.Lock",
"cv2.VideoCapture",
"networktables.NetworkTables.initialize",
"threading.Thread.start",
"cv2.imshow"
] | [((13715, 13755), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (13734, 13755), False, 'import logging\n'), ((13789, 13833), 'networktables.NetworkTables.initialize', 'NetworkTables.initialize', ([], {'server': '"""localhost"""'}), "(server='localhost')\n", (... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... | [
"numpy.pad",
"os.mkdir",
"numpy.load",
"argparse.ArgumentParser",
"os.path.exists",
"os.path.join",
"os.listdir"
] | [((783, 828), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""MelGAN"""'}), "(description='MelGAN')\n", (806, 828), False, 'import argparse\n'), ((1507, 1527), 'os.listdir', 'os.listdir', (['path_all'], {}), '(path_all)\n', (1517, 1527), False, 'import os\n'), ((1303, 1336), 'os.path.exis... |
from __future__ import unicode_literals
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
from rest_framework import serializers
class GroupSerializer(serializers.HyperlinkedModelSerializer):
users_count = serializers.SerializerMethodField()
class Meta:
ext... | [
"rest_framework.serializers.CharField",
"django.contrib.auth.get_user_model",
"rest_framework.serializers.SerializerMethodField"
] | [((256, 291), 'rest_framework.serializers.SerializerMethodField', 'serializers.SerializerMethodField', ([], {}), '()\n', (289, 291), False, 'from rest_framework import serializers\n'), ((681, 752), 'rest_framework.serializers.CharField', 'serializers.CharField', ([], {'required': '(False)', 'style': "{'input_type': 'pa... |
# The Leginon software is Copyright 2004
# The Scripps Research Institute, La Jolla, CA
# For terms of the license agreement
# see http://ami.scripps.edu/software/leginon-license
#
import wx
import wx.lib.filebrowsebutton as filebrowse
from leginon.gui.wx.Entry import Entry,IntEntry
import leginon.gui.wx.Node
import ... | [
"wx.Colour",
"leginon.gui.wx.Entry.Entry",
"wx.StaticBox",
"wx.CheckBox",
"wx.GridBagSizer",
"wx.StaticText",
"wx.StaticBoxSizer",
"wx.Frame",
"leginon.gui.wx.Entry.IntEntry"
] | [((3977, 4011), 'wx.StaticBox', 'wx.StaticBox', (['self', '(-1)', '"""Settings"""'], {}), "(self, -1, 'Settings')\n", (3989, 4011), False, 'import wx\n'), ((4021, 4055), 'wx.StaticBoxSizer', 'wx.StaticBoxSizer', (['sb', 'wx.VERTICAL'], {}), '(sb, wx.VERTICAL)\n', (4038, 4055), False, 'import wx\n'), ((4064, 4086), 'wx.... |
# A unified diff includes only the modified lines and a bit of context
import difflib
from difflib_data import *
diff = difflib.unified_diff(
text1_lines,
text2_lines,
lineterm=''
)
# The lineterm argument is used to tell unified_diff() to skip appending
# newlines to the control lines that it retur... | [
"difflib.unified_diff"
] | [((128, 187), 'difflib.unified_diff', 'difflib.unified_diff', (['text1_lines', 'text2_lines'], {'lineterm': '""""""'}), "(text1_lines, text2_lines, lineterm='')\n", (148, 187), False, 'import difflib\n')] |
import unittest
from orsopy.slddb.material import Formula
class TestFormula(unittest.TestCase):
def test_valid(self):
Formula("NaCl")
Formula("H2 O")
Formula("Cr3O4")
Formula("H12 C5O8")
Formula("H2O")
def test_isotopes(self):
Formula("B[10]4C")
Formul... | [
"orsopy.slddb.material.Formula"
] | [((133, 148), 'orsopy.slddb.material.Formula', 'Formula', (['"""NaCl"""'], {}), "('NaCl')\n", (140, 148), False, 'from orsopy.slddb.material import Formula\n'), ((157, 172), 'orsopy.slddb.material.Formula', 'Formula', (['"""H2 O"""'], {}), "('H2 O')\n", (164, 172), False, 'from orsopy.slddb.material import Formula\n'),... |
# Copyright 2016 Symantec, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | [
"os.environ.get",
"ConfigParser.ConfigParser",
"os.getcwd",
"json.loads"
] | [((700, 722), 'os.environ.get', 'os.environ.get', (['"""HOME"""'], {}), "('HOME')\n", (714, 722), False, 'import os\n'), ((767, 778), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (776, 778), False, 'import os\n'), ((1441, 1458), 'json.loads', 'json.loads', (['value'], {}), '(value)\n', (1451, 1458), False, 'import json\... |
import argparse
import matplotlib.pyplot as plt
def main():
# Construct the argument parser and parse the arguments.
ap = argparse.ArgumentParser()
ap.add_argument("-f", "--file", required=True, help="data file name")
args = vars(ap.parse_args())
title = ""
x_label = ""
y_label = ""
... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"argparse.ArgumentParser",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid"
] | [((133, 158), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (156, 158), False, 'import argparse\n'), ((4419, 4438), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['x_label'], {}), '(x_label)\n', (4429, 4438), True, 'import matplotlib.pyplot as plt\n'), ((4447, 4466), 'matplotlib.pyplot.ylabel', '... |
import json
def get_time_between_blocks(blocks_file_path):
"""
Return the time between blocks in a file.
"""
timestamps = []
with open(blocks_file_path) as blocks_file:
for line in blocks_file:
block = json.loads(line)
time = block['time']
timestamps.app... | [
"json.loads"
] | [((244, 260), 'json.loads', 'json.loads', (['line'], {}), '(line)\n', (254, 260), False, 'import json\n')] |
LICNECE = """
Copyright © 2021 Drillenissen#4268
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,... | [
"requests.post",
"colored.fg",
"time.sleep"
] | [((1148, 1155), 'colored.fg', 'fg', (['(241)'], {}), '(241)\n', (1150, 1155), False, 'from colored import fg, attr\n'), ((1186, 1193), 'colored.fg', 'fg', (['(255)'], {}), '(255)\n', (1188, 1193), False, 'from colored import fg, attr\n'), ((1199, 1205), 'colored.fg', 'fg', (['(31)'], {}), '(31)\n', (1201, 1205), False,... |
from straindesign import StrainDesigner
from straindesign.names import *
from cobra import Model
from typing import Dict, List, Tuple
import json
def gpr_to_reac_sd(model,strain_designs):
pass
print('lol')
return True
def compute_strain_designs(model: Model, **kwargs):
## Two computation modes:
# ... | [
"straindesign.StrainDesigner",
"json.load"
] | [((2160, 2203), 'straindesign.StrainDesigner', 'StrainDesigner', (['model', 'sd_modules'], {}), '(model, sd_modules, **kwargs)\n', (2174, 2203), False, 'from straindesign import StrainDesigner\n'), ((669, 682), 'json.load', 'json.load', (['fs'], {}), '(fs)\n', (678, 682), False, 'import json\n')] |
import os
import requests
USER = os.getenv('PYTEST_USER', 'root')
PASSWORD = os.getenv('PYTEST_PASSWORD', '<PASSWORD>')
HOST = os.getenv('PYTEST_HOST', 'localhost')
PORT = os.getenv('PYTEST_PORT', 8086)
DATABASE = os.getenv('PYTEST_DATABASE', None)
SSL = os.getenv('PYTEST_SSL', False)
SSLCERT = os.getenv('PYTEST_SSLC... | [
"requests.post",
"requests.head",
"os.getenv",
"requests.get"
] | [((35, 67), 'os.getenv', 'os.getenv', (['"""PYTEST_USER"""', '"""root"""'], {}), "('PYTEST_USER', 'root')\n", (44, 67), False, 'import os\n'), ((79, 121), 'os.getenv', 'os.getenv', (['"""PYTEST_PASSWORD"""', '"""<PASSWORD>"""'], {}), "('PYTEST_PASSWORD', '<PASSWORD>')\n", (88, 121), False, 'import os\n'), ((129, 166), ... |
from utils.utils_profiling import * # load before other local modules
import argparse
import os
import sys
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
import dgl
import numpy as np
import torch
import wandb
import time
import datetime
from torch import optim
import torch.nn as nn... | [
"wandb.log",
"pdb.post_mortem",
"utils.utils_logging.write_info_file",
"numpy.linalg.qr",
"numpy.mean",
"experiments.nbody.nbody_models.__dict__.get",
"os.path.join",
"torch.isnan",
"torch.nn.MSELoss",
"traceback.print_exc",
"warnings.simplefilter",
"torch.utils.data.DataLoader",
"experiment... | [((126, 188), 'warnings.simplefilter', 'warnings.simplefilter', ([], {'action': '"""ignore"""', 'category': 'FutureWarning'}), "(action='ignore', category=FutureWarning)\n", (147, 188), False, 'import warnings\n'), ((1014, 1026), 'numpy.mean', 'np.mean', (['_sq'], {}), '(_sq)\n', (1021, 1026), True, 'import numpy as np... |
# Built-in
from turtle import Turtle, Screen
from time import sleep
from random import randint
# My own
from racket import Racket
from ball import Ball
from scoreboard import Scoreboard
START_LINE_POS = (0, -280)
DRAW_LINE = 300
SPACING_DASHED_LINE = 10
ANGLE_UP = 90
PLAYER_RIGHT_START_POS = (380, 0)
P... | [
"racket.Racket",
"turtle.Turtle",
"ball.Ball",
"time.sleep",
"turtle.Screen",
"scoreboard.Scoreboard"
] | [((472, 480), 'turtle.Screen', 'Screen', ([], {}), '()\n', (478, 480), False, 'from turtle import Turtle, Screen\n'), ((631, 639), 'turtle.Turtle', 'Turtle', ([], {}), '()\n', (637, 639), False, 'from turtle import Turtle, Screen\n'), ((980, 988), 'racket.Racket', 'Racket', ([], {}), '()\n', (986, 988), False, 'from ra... |
import functools
import os
import re
import sys
import yaml
from argparse import ArgumentParser
from datetime import date
from datetime import timedelta
from os import path
from pathlib import Path
from time import time
import jinja2
import pandas as pd
from loguru import logger as log
from vcrypto import Cipher
fr... | [
"vcrypto.Cipher",
"argparse.ArgumentParser",
"loguru.logger.configure",
"os.path.exists",
"datetime.date.today",
"loguru.logger.enable",
"re.match",
"os.environ.get",
"loguru.logger.info",
"pathlib.Path",
"os.path.endswith",
"time.time",
"yaml.safe_load",
"functools.wraps",
"jinja2.Envir... | [((1080, 1103), 'loguru.logger.configure', 'log.configure', ([], {}), '(**CONFIG)\n', (1093, 1103), True, 'from loguru import logger as log\n'), ((1104, 1124), 'loguru.logger.enable', 'log.enable', (['"""vtasks"""'], {}), "('vtasks')\n", (1114, 1124), True, 'from loguru import logger as log\n'), ((1311, 1327), 'argpars... |
import discord
from discord.ext import commands
import datetime
""" Class | Template
This is a template put in place to be used
when creating a new Cog file.
"""
class New(commands.Cog, name = "New"):
def __init__(self, bot):
self.bot = bot
print(f"{bot.OK} {bot.TIMELOG()} Loaded New Cog.")
d... | [
"discord.ext.commands.guild_only",
"discord.ext.commands.command",
"discord.ext.commands.Cog.listener"
] | [((499, 520), 'discord.ext.commands.guild_only', 'commands.guild_only', ([], {}), '()\n', (518, 520), False, 'from discord.ext import commands\n'), ((526, 632), 'discord.ext.commands.command', 'commands.command', ([], {'name': '"""SAMPLE"""', 'help': '"""Just a placeholder."""', 'brief': '"""If parameters then examples... |
import random
from core.sensors_abc import Sensor
class TemperatureSensor(Sensor):
def __init__(self):
super().__init__()
self._temperature = 20
@property
def temperature(self) -> int:
return self._temperature
@temperature.setter
def temperature(self, value: int):
... | [
"random.randint"
] | [((419, 440), 'random.randint', 'random.randint', (['(-1)', '(1)'], {}), '(-1, 1)\n', (433, 440), False, 'import random\n'), ((648, 669), 'random.randint', 'random.randint', (['(-5)', '(5)'], {}), '(-5, 5)\n', (662, 669), False, 'import random\n')] |
# -*- coding: utf-8 -*-
from aiida.engine import calcfunction
from aiida.orm import Int
@calcfunction
def add(x, y):
return x + y
@calcfunction
def multiply(x, y):
return x * y
result = multiply(add(Int(1), Int(2)), Int(3))
| [
"aiida.orm.Int"
] | [((227, 233), 'aiida.orm.Int', 'Int', (['(3)'], {}), '(3)\n', (230, 233), False, 'from aiida.orm import Int\n'), ((210, 216), 'aiida.orm.Int', 'Int', (['(1)'], {}), '(1)\n', (213, 216), False, 'from aiida.orm import Int\n'), ((218, 224), 'aiida.orm.Int', 'Int', (['(2)'], {}), '(2)\n', (221, 224), False, 'from aiida.orm... |
from pychesscom.clients.base_client import BaseClient
from pychesscom.utils.response import Response
from pychesscom.utils.route import Route
class Puzzle:
"""
Class for handling endpoints of puzzle information.
Args:
client(BaseClient): HTTP client for API requests
"""
def __init__(self,... | [
"pychesscom.utils.route.Route"
] | [((863, 878), 'pychesscom.utils.route.Route', 'Route', (['"""puzzle"""'], {}), "('puzzle')\n", (868, 878), False, 'from pychesscom.utils.route import Route\n'), ((1458, 1480), 'pychesscom.utils.route.Route', 'Route', (['"""puzzle/random"""'], {}), "('puzzle/random')\n", (1463, 1480), False, 'from pychesscom.utils.route... |
from django.conf.urls import url
from django.contrib.auth.views import logout
from user.views import user_login, user_register, user_settings, user_profile, user_area51
urlpatterns = [
url(r'register$', user_register, name='user_register'),
url(r'login$', user_login, name='user_login'),
url(r'logout$', lo... | [
"django.conf.urls.url"
] | [((191, 244), 'django.conf.urls.url', 'url', (['"""register$"""', 'user_register'], {'name': '"""user_register"""'}), "('register$', user_register, name='user_register')\n", (194, 244), False, 'from django.conf.urls import url\n'), ((251, 295), 'django.conf.urls.url', 'url', (['"""login$"""', 'user_login'], {'name': '"... |
from dataclasses import dataclass, replace, is_dataclass
from typing import List
@dataclass(order=True, frozen=True)
class A:
a: str
b: str
c: str
d: int = 4
@dataclass(frozen=True)
class B(A):
d: str = "abc"
e: str = "def"
a = A('foo', 'bar', 'baz')
b = B('foo', 'bar', 'bonk')
c = replace... | [
"dataclasses.replace",
"dataclasses.dataclass"
] | [((84, 118), 'dataclasses.dataclass', 'dataclass', ([], {'order': '(True)', 'frozen': '(True)'}), '(order=True, frozen=True)\n', (93, 118), False, 'from dataclasses import dataclass, replace, is_dataclass\n'), ((179, 201), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (188, 201), ... |