seq_id
string
text
string
repo_name
string
sub_path
string
file_name
string
file_ext
string
file_size_in_byte
int64
program_lang
string
lang
string
doc_type
string
stars
int64
dataset
string
pt
string
api
list
82546932
from classes import Interface, Position, Images from client.classes import Skill, Enemy, Objects, Scale import pygame import math import time import game all_enemies = Enemy.enemies class Boss: def rotate(self, original_image): img = pygame.transform.rotate(original_image, int(self.angle) + 270) ...
null
server/classes/Bosses.py
Bosses.py
py
6,225
python
en
code
null
code-starcoder2
66
[ { "api_name": "client.classes.Enemy.enemies", "line_number": 9, "usage_type": "attribute" }, { "api_name": "client.classes.Enemy", "line_number": 9, "usage_type": "name" }, { "api_name": "pygame.transform.rotate", "line_number": 14, "usage_type": "call" }, { "api_...
282706674
from datetime import datetime from sklearn_evaluation.Logger import Logger import pandas as pd from sqlalchemy import create_engine from lib_cinci.config import main from lib_cinci.predict_on_schema import predict_on_schema from lib_cinci.evaluation import add_inspections_results_for from lib_cinci.db import uri # g...
null
field_test_preparation/generate_list.py
generate_list.py
py
3,635
python
en
code
null
code-starcoder2
66
[ { "api_name": "sklearn_evaluation.Logger.Logger", "line_number": 36, "usage_type": "call" }, { "api_name": "lib_cinci.config.main", "line_number": 36, "usage_type": "name" }, { "api_name": "lib_cinci.config.main", "line_number": 37, "usage_type": "name" }, { "api_...
283335668
import requests import json from bs4 import BeautifulSoup class Ameblo: def __init__(self, ameba_id, ameba_password): self.ameba_id = ameba_id self.ameba_password = ameba_password self.session = requests.session() self.login() def login(self): try: data = {...
null
ameblo.py
ameblo.py
py
2,510
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.session", "line_number": 10, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 28, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 49, "usage_type": "call" }, { "api_name": "requests.get", ...
369049867
#!/bin/python """ REPLACE WITH DESCRIPTION Author : jkb (Jaime Kershaw Brown) Date : 21/10/2019 """ #! /usr/bin/env python3 try: import serial except ImportError as message: print("Failed to import serial reader, maybe it is not installed correctly? Error was: {}".format(message)) try: import dateti...
null
BB9.py
BB9.py
py
6,437
python
en
code
null
code-starcoder2
66
[ { "api_name": "BBX_Sensors.BBX", "line_number": 44, "usage_type": "name" }, { "api_name": "functools.reduce", "line_number": 68, "usage_type": "call" }, { "api_name": "functools.reduce", "line_number": 75, "usage_type": "call" }, { "api_name": "serial.Serial", ...
641520549
#!/usr/local/bin/python #-*-coding:utf-8-*- #Get market data from futures exchanges #designed and programed by lianxiangbin(LianZhang,qq785674410) #2014-10-21 import urllib.request import urllib.parse from pyquery import PyQuery import sqlite3 import datetime class MarketDataFromSHFE: #define the...
null
pyalgotrade/commodity/MarketDataFromSHFEV1.py
MarketDataFromSHFEV1.py
py
3,188
python
en
code
null
code-starcoder2
66
[ { "api_name": "urllib.request.request.urlopen", "line_number": 25, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 25, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 25, "usage_type": "name" }, { "api_nam...
148601405
# Creating a neural network in Keras for regression on a sample dataset # Import required libraries import numpy as np import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.datasets import make_regression from tensorflow.keras.models import Sequential, load_model from tensor...
null
1. Regression + Save, Load model/regression.py
regression.py
py
2,830
python
en
code
null
code-starcoder2
66
[ { "api_name": "sklearn.datasets.make_regression", "line_number": 12, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 16, "usage_type": "call" }, { "api_name": "tensorflow.keras.models.Sequential", "line_number": 26, "usage_...
80053878
# -*- coding: utf-8 -*- from importlib import import_module import logging log = logging.getLogger(__name__) # Dynamically import libraries based on user preferences def get_dynamic_class(finder_path): module_name, class_name = finder_path.rsplit('.', 1) module = import_module(module_name) log.debug("Im...
null
pyconverge/BaseClassLoader.py
BaseClassLoader.py
py
1,451
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "importlib.import_module", "line_number": 12, "usage_type": "call" } ]
552149474
#!/usr/bin/python # coding: UTF-8 # # TileCutter translation string finder # # Copyright © 2008-2011 Timothy Baldock. All Rights Reserved. import re, time, os, codecs import translator.w_newlines as w_newlines import translator.u_newlines as u_newlines import json VERSION_NUMBER = "0.4.2" COMPAT_VERSION_NUMBER = "0....
null
TileCutterTranslator.py
TileCutterTranslator.py
py
5,893
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.isdir", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path", "line_number": 33, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path.splitext", "line_nu...
612761603
import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt import pydotplus from sklearn.externals.six import StringIO from IPython.display import Image from sklearn.tree import DecisionTreeClassifier, export_graphviz from sklearn.metrics import make_scorer, f1_score, roc_curve, au...
null
.ipynb_checkpoints/visuals-checkpoint.py
visuals-checkpoint.py
py
1,473
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.DataFrame", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn.tree.DecisionTreeClassifier", "line_number": 22, "usage_type": "call" }, { "api_name": "sklearn.externals.six.StringIO", "line_number": 28, "usage_type": "call" }, { ...
92148407
# Under MIT License, see LICENSE.txt import time from collections import deque from RULEngine.Command.command import * COMMUNICATION_SLEEP = 0.001 MOVE_COMMAND_SLEEP = 0.05 class SerialCommandSender(object): def __init__(self): self.mcu_com = McuCommunicator(timeout=0.1) self.last_time = 0 ...
null
RULEngine/Communication/sender/serial_command_sender.py
serial_command_sender.py
py
2,387
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.deque", "line_number": 17, "usage_type": "call" }, { "api_name": "time.time", "line_number": 28, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 32, "usage_type": "call" }, { "api_name": "time.time", "line_number":...
543197655
import socket from select import * import sys import time import bluetooth import TcpNet import datetime HOST = "203.234.62.109" PORT = 11000 BUFSIZE=1024 bt_addr="98:D3:71:FD:7D:59" bt_port=1 # 아두이노 데이터 받기위한 블루투스 소켓 bt_s=bluetooth.BluetoothSocket(bluetooth.RFCOMM) bt_s.connect((bt_addr,bt_port)) send_data="" cnt=0 ...
null
Raspberry/client.py
client.py
py
1,829
python
en
code
null
code-starcoder2
66
[ { "api_name": "bluetooth.BluetoothSocket", "line_number": 17, "usage_type": "call" }, { "api_name": "bluetooth.RFCOMM", "line_number": 17, "usage_type": "attribute" }, { "api_name": "TcpNet.TcpNet", "line_number": 22, "usage_type": "call" }, { "api_name": "datetim...
534830003
"""Custom docutils / Sphinx directives specific to nengo.github.io.""" from docutils import nodes from docutils.parsers.rst import Directive, directives class Project(Directive): """The Project directive is used to describe Nengo projects. It attempts to give an attractive and uniform appearance to each...
null
custom.py
custom.py
py
3,838
python
en
code
null
code-starcoder2
66
[ { "api_name": "docutils.parsers.rst.Directive", "line_number": 7, "usage_type": "name" }, { "api_name": "docutils.parsers.rst.directives.unchanged_required", "line_number": 18, "usage_type": "attribute" }, { "api_name": "docutils.parsers.rst.directives", "line_number": 18, ...
90363843
import math import numpy as np import scipy.special from graphics import * class neural_network: def __init__(self, input_nodes, hidden_nodes, output_nodes, alpha): # Number of nodes per layer as given self.inodes = input_nodes self.hnodes = hidden_nodes self.onodes = output_nodes ...
null
neural_network.py
neural_network.py
py
6,682
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.random.normal", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 17, "usage_type": "attribute" }, { "api_name": "numpy.random.normal", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.rando...
239457023
""" Various utilities for data module """ from enum import Enum from typing import ( Any, Dict, ItemsView, KeysView, List, Optional, Tuple, Union, ValuesView) import numpy as np __all__ = [ 'padded_batch', 'connect_name', 'Batch', 'FieldBatch', '_LazyStrategy', '_CacheStrategy', ] def p...
null
texar/torch/data/data/dataset_utils.py
dataset_utils.py
py
3,728
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.Union", "line_number": 21, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 21, "usage_type": "name" }, { "api_name": "numpy.ndarray", "line_number": 21, "usage_type": "attribute" }, { "api_name": "typing.Optional", "li...
103306839
# simulates colour blindness from webcam from PIL import Image import numpy as np import numpy import cv2 #Restructuring laterally inverted image def normalise(editablePhoto,sizeX,sizeY): NormalPhoto = np.zeros((sizeX,sizeY,3),'float') x=sizeX-1 for i in range(0,sizeX): for j in range...
null
webcam.py
webcam.py
py
4,890
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.zeros", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 34...
98614003
import tkinter as tk from tkinter import filedialog import tensorflow as tf import tensorflow_addons as tfa import cv2 from tqdm import tqdm import numpy as np from tkinter.messagebox import showerror from moviepy.video.io.VideoFileClip import VideoFileClip import os # Load compressed models from tensorflow_hub class ...
null
algorithms/Morphing.py
Morphing.py
py
13,672
python
en
code
null
code-starcoder2
66
[ { "api_name": "tensorflow.keras", "line_number": 13, "usage_type": "attribute" }, { "api_name": "tensorflow.keras.layers.Conv2D", "line_number": 17, "usage_type": "call" }, { "api_name": "tensorflow.keras", "line_number": 17, "usage_type": "attribute" }, { "api_na...
280602282
""" The Application object. One application should be available. All important services are present in the application object: - plugin manager - undo manager - main window - UML element factory - action sets """ import logging import functools import pkg_resources from gaphor.event import ServiceInitializedEve...
null
gaphor/application.py
application.py
py
6,654
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "pkg_resources.iter_entry_points", "line_number": 76, "usage_type": "call" }, { "api_name": "gaphor.abc.Service", "line_number": 78, "usage_type": "argument" }, { "api_name...
443407437
import os import sys import glob import shutil import argparse import cv2 import numpy as np from keras.models import load_model from tqdm import trange from utils.datasets import get_labels from utils.inference import detect_faces from utils.inference import draw_text from utils.inference import draw_b...
null
src/run_demo_on_video.py
run_demo_on_video.py
py
5,910
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 23, "usage_type": "call" }, { "api_name": "os.mkdir", "line_number": 32, "usage_type": "call" }, { "api_name": "utils.datasets.get_labels", "line_number": 42, "usage_type": "call" }, { "api_name": "utils.data...
54634874
import os import numpy as np from dgl.data import DGLDataset from dgl.data.utils import download, extract_archive from dgl.convert import graph as dgl_graph from dgl.transform import to_bidirected from dgl import backend as F from rdkit import Chem from rdkit.Chem.rdchem import HybridizationType from rdkit.Chem.rdchem...
null
QM9Edge.py
QM9Edge.py
py
7,077
python
en
code
null
code-starcoder2
66
[ { "api_name": "dgl.backend.tensor", "line_number": 16, "usage_type": "call" }, { "api_name": "dgl.backend", "line_number": 16, "usage_type": "name" }, { "api_name": "dgl.data.DGLDataset", "line_number": 22, "usage_type": "name" }, { "api_name": "rdkit.Chem.rdchem....
95122019
# -*- coding: utf-8 -*- # ============================================================================= # AUTHOR: Manoel Brunnen, manoel.brunnen@gmail.com # CREATED: 14.07.2016 # LICENSE: MIT # FILE: agents.py # ============================================================================= """The agent mod...
null
hamas/agents.py
agents.py
py
14,034
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 26, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 47, "usage_type": "call" }, { "api_name": "asyncio.Queue", "line_number": 47, "usage_type": "attribute" }, { "api_name": "collecti...
293636231
# encoding: utf-8 # @Author : YNatsu # @Time : 2020/2/20 11:46 # @Title: : multi output import tensorflow as tf from sklearn.datasets import load_boston from sklearn.model_selection import train_test_split import pandas as pd import matplotlib.pyplot as plt import os import seaborn as sns sns.set() hou...
null
Regression/wide_deep_multi_output.py
wide_deep_multi_output.py
py
1,945
python
en
code
null
code-starcoder2
66
[ { "api_name": "seaborn.set", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn.datasets.load_boston", "line_number": 16, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 18, "usage_type": "call" }, { ...
483643818
import os,sys from subprocess import Popen, PIPE from ..StructFeatComputer import StructFeatComputer, FeatureComputerException from utils import myMakeDir, tryToRemove #utils is at the root of the package class PSAIAComputer(StructFeatComputer): ''' Extends StructFeatComputer class. Computes PSAIA (asa, hidrofobi...
null
computeFeatures/structStep/PSAIA/computePSAIA.py
computePSAIA.py
py
7,323
python
en
code
null
code-starcoder2
66
[ { "api_name": "StructFeatComputer.StructFeatComputer", "line_number": 7, "usage_type": "name" }, { "api_name": "StructFeatComputer.StructFeatComputer.__init__", "line_number": 19, "usage_type": "call" }, { "api_name": "StructFeatComputer.StructFeatComputer", "line_number": 19...
18801900
import numpy as np import matplotlib.pyplot as plt from replay import play_trajectory import utils import random from itertools import product ROWS = 15 COLS = 15 SEED = 43 COMPLEXITY = 1 DENSITY = 1 discount_fact = 1. def solve_maze_complete(maze_env): # run Floyd-Warshall algorithm to find the shortest...
null
src/build_maze_trajectories.py
build_maze_trajectories.py
py
7,251
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.ones", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 30, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 32, "usage_type": "call" }, { "api_name": "itertools.product", "line...
613880384
import logging import os import os.path import sys import click import six import tabulate from pkg_resources import get_distribution from pbr import packaging, version from skipper import git from skipper import runner from skipper import utils DOCKER_TAG_FOR_CACHE = "cache" @click.group() @click.option('-v', '--...
null
skipper/cli.py
cli.py
py
17,222
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.DEBUG", "line_number": 30, "usage_type": "attribute" }, { "api_name": "logging.INFO", "line_number": 30, "usage_type": "attribute" }, { "api_name": "skipper.utils.configure_logging", "line_number": 31, "usage_type": "call" }, { "api_name": "...
250749320
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^logout$', views.logout_view, name='logout'), url(r'^requests/new', views.new_request, name='new_request'), url(r'^requests/create', views.create_request, name='create_request'), url(r...
null
intake/urls.py
urls.py
py
1,728
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.co...
431852960
# %% 異なる平均を持つ正規分布でもよいことを確認 import numpy as np import matplotlib.pyplot as plt sigma = 2 mu = [1, 2] # mu = [8, 12] n = [10, 15] num_it = 1000 s2r_list = [] for it in range(num_it): x = [np.random.randn(n[i], 1) * sigma + mu[i] for i in range(2)] # %% xbar = [x[i].mean() for i in range(2)] # print(xba...
null
code/fdist/compare_Fdist.py
compare_Fdist.py
py
805
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.random.randn", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.sum", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.hist...
251950959
from flask_login import login_required from flask import url_for, render_template, current_app, request from app.models import Post from app.main import bp @bp.route('/', methods=['GET', 'POST']) @bp.route('/index', methods=['GET', 'POST']) @login_required def index(): page = request.args.get('page', 1, type=int) ...
null
app/main/routes/index.py
index.py
py
776
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.request.args.get", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 10, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 10, "usage_type": "name" }, { "api_name": "app.mode...
194411555
import networkx as nx import pandas as pd from node2vec import Node2Vec from gensim.models import KeyedVectors from collections import defaultdict from EvalUtils import EvalUtils # g = nx.read_weighted_edgelist("../datasets/redditdataset_75.txt", create_using=nx.DiGraph()) # gtest= nx.read_weighted_edgelist("../datase...
null
fof_embedding/test.py
test.py
py
2,382
python
en
code
null
code-starcoder2
66
[ { "api_name": "networkx.read_weighted_edgelist", "line_number": 15, "usage_type": "call" }, { "api_name": "networkx.DiGraph", "line_number": 15, "usage_type": "call" }, { "api_name": "networkx.read_weighted_edgelist", "line_number": 16, "usage_type": "call" }, { "...
247105887
import configparser import os.path import sys sys.argv[1:] cred_file_path='/root/.aws/credentials' def write_ini_section(cred_file_path,aws_access,aws_secret): config = configparser.ConfigParser() config.read(cred_file_path) if config.has_section('terraform'): config.set('terraform','aws_access_ke...
null
scripts/aws_conf.py
aws_conf.py
py
1,585
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 5, "usage_type": "attribute" }, { "api_name": "configparser.ConfigParser", "line_number": 9, "usage_type": "call" }, { "api_name": "configparser.ConfigParser", "line_number": 23, "usage_type": "call" }, { "api_name": "confi...
518902083
""" .. _tut-fnirs-cui: Signal enhancement techniques ============================= In this document we investigate the effect of different signal enhancement techniques on NIRS data. .. warning:: This is a work in progress. Suggestions of improvements are appreciated. I am finalising the code, then will...
null
examples/plot_20_cui.py
plot_20_cui.py
py
6,039
python
en
code
null
code-starcoder2
66
[ { "api_name": "mne.datasets.fnirs_motor.data_path", "line_number": 45, "usage_type": "call" }, { "api_name": "mne.datasets", "line_number": 45, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 46, "usage_type": "call" }, { "api_name": "os....
204459435
from glob import glob import json import pymongo mongo = pymongo.MongoClient("mongodb://localhost:27017/") artdb = mongo["art"] arttable = artdb["collection"] files = glob("art/**/*.jpg", recursive=True) data = {} for f in files: cleaner = f.replace("\\\\","\\") parts = cleaner.split("\\") category = part...
null
data.py
data.py
py
761
python
en
code
null
code-starcoder2
66
[ { "api_name": "pymongo.MongoClient", "line_number": 5, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 9, "usage_type": "call" } ]
351656614
from django.shortcuts import render, get_object_or_404 from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required from forms import SignatureForm from jungle.models import Code def profile(request, user_id=None, template_name="jungle/account/profile.html"): v...
null
code_jungle/jungle/accountviews.py
accountviews.py
py
1,203
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.shortcuts.get_object_or_404", "line_number": 13, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User", "line_number": 13, "usage_type": "argument" }, { "api_name": "django.shortcuts.render", "line_number": 23, "usage_type": "call" ...
533787973
import logging from .models import RequestLog, RequestCounter logger = logging.getLogger(__name__) class RequestLoggingMiddleware(object): META_FIELDS = ['REQUEST_METHOD', 'REMOTE_ADDR', 'HTTP_USER_AGENT', 'HTTP_REFERER', 'HTTP_ACCEPT_LA...
null
apps/hello/utils.py
utils.py
py
1,157
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 4, "usage_type": "call" }, { "api_name": "models.RequestCounter.objects.get", "line_number": 32, "usage_type": "call" }, { "api_name": "models.RequestCounter.objects", "line_number": 32, "usage_type": "attribute" }, { ...
321999774
from django.shortcuts import render_to_response from django.template import RequestContext from ..classes import site_mappers from ..exceptions import MapperError def set_section(request, **kwargs): """Plot items of a the whole ward to assign a ward section by selecting items. Filter points to plot by sendin...
null
edc/map/views/set_section.py
set_section.py
py
2,809
python
en
code
null
code-starcoder2
66
[ { "api_name": "classes.site_mappers.get_registry", "line_number": 18, "usage_type": "call" }, { "api_name": "classes.site_mappers", "line_number": 18, "usage_type": "name" }, { "api_name": "exceptions.MapperError", "line_number": 19, "usage_type": "call" }, { "api...
79958326
# # Copyright (c) 2023 Airbyte, Inc., all rights reserved. # import json from datetime import datetime from pathlib import Path from typing import Any, Dict, Iterable, List, Mapping, MutableMapping, Tuple, Union import pendulum import pytest from airbyte_cdk.models import AirbyteMessage, AirbyteStateMessage, AirbyteS...
null
dts/airbyte/airbyte-integrations/bases/connector-acceptance-test/connector_acceptance_test/tests/test_incremental.py
test_incremental.py
py
15,754
python
en
code
null
code-starcoder2
66
[ { "api_name": "pytest.skip", "line_number": 22, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 24, "usage_type": "call" }, { "api_name": "connector_acceptance_test.config.Config.TestStrictnessLevel", "line_number": 25, "usage_type": "attribute" }, ...
63165656
__author__ = 'root' from dbservices import apilogs from opsviewapi.models import ApiLog from exc.exceptions import ApiLogError from django.utils import timezone import logging logger = logging.getLogger(__name__) def write_api_log(log_obj=None, time_stamp=None, device_info=None, description=None, status=None, devic...
null
utils/apilog.py
apilog.py
py
1,137
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "django.utils.timezone.now", "line_number": 15, "usage_type": "call" }, { "api_name": "django.utils.timezone", "line_number": 15, "usage_type": "name" }, { "api_name": "opsv...
131932109
from mezzanine.pages.page_processors import processor_for from startupweekenddo.models import QuestionCategory, Event, PressRelease from collections import OrderedDict @processor_for('startup-weekend') def add_faq(request, page): cats = QuestionCategory.objects.all() questions = OrderedDict() for cat in ...
null
startupweekenddo/page_processors.py
page_processors.py
py
722
python
en
code
null
code-starcoder2
66
[ { "api_name": "startupweekenddo.models.QuestionCategory.objects.all", "line_number": 8, "usage_type": "call" }, { "api_name": "startupweekenddo.models.QuestionCategory.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "startupweekenddo.models.QuestionCategory...
75091956
#!/usr/bin/python #coding:utf-8 import wx """ app = wx.App() #创建一个主循环 frame = wx.Frame(None) #实例化一个窗口 frame.Show() #调用窗口的展示功能 app.MainLoop() #启动主循环 def test(event):#event 是必须加的参数 ''' get set ''' pathText.SetValue("你好") """ def test(event):#event 是必须加的参数 with open(pathText.G...
null
python/gui/wx/test.py
test.py
py
960
python
en
code
null
code-starcoder2
66
[ { "api_name": "wx.App", "line_number": 24, "usage_type": "call" }, { "api_name": "wx.Frame", "line_number": 25, "usage_type": "call" }, { "api_name": "wx.Button", "line_number": 26, "usage_type": "call" }, { "api_name": "wx.Button", "line_number": 27, "usa...
45645606
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Fri May 4 21:55:06 2018 This snippet is about using logistic regression for classification @author: pierre """ #%% Imports import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from sklearn import datasets from ...
null
supervised/linear_models/logistic_regression.py
logistic_regression.py
py
1,386
python
en
code
null
code-starcoder2
66
[ { "api_name": "sklearn.datasets.load_breast_cancer", "line_number": 25, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 25, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 35, "usage_type": "call" }, { "a...
597662577
import torch import torch.nn as nn import torch.nn.functional as F class EncoderRNN(nn.Module): def __init__(self, input_size, hidden_size, amp, n_layers, direction, dropout): super().__init__() self.n_layers = n_layers self.hidden_size = hidden_size self.direction = direction ...
null
early/_model.py
_model.py
py
2,972
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn.Module", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.nn.GRU", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.nn", "line_number"...
3678183
import pymongo from datetime import datetime from app_movie import conn from app_movie.models import User, Movie, Comment, InviteCode, LikedMovie # User def add_user(form): has_registered = conn.User.find_one({'username': form.username.data}) if has_registered: return None else: is_invite...
null
app_movie/db_helper.py
db_helper.py
py
5,681
python
en
code
null
code-starcoder2
66
[ { "api_name": "app_movie.conn.User.find_one", "line_number": 10, "usage_type": "call" }, { "api_name": "app_movie.conn.User", "line_number": 10, "usage_type": "attribute" }, { "api_name": "app_movie.conn", "line_number": 10, "usage_type": "name" }, { "api_name": "...
478509968
""" ShuffleNetV1 from the paper "ShuffleNet: An Extremely Efficient Convolutional Neural Network for Mobile Devices" by Xiangyu Zhang et al, Face++, CVPR 2018 """ # imports import torch import torch.nn as nn from torch.hub import load_state_dict_from_url # shufflenetv1 variants __all__ = [ 'ShuffleNetV...
null
model/shufflenetv1.py
shufflenetv1.py
py
17,609
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn.Conv2d", "line_number": 37, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 37, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 47, "usage_type": "call" }, { "api_name": "torch.nn", "line_number"...
431671103
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Ed Mountjoy # import sys import os import argparse import pandas as pd import requests import json from pprint import pprint def main(): # Parse args args = parse_args() # Get each study from the api data = [] for i, study in enumerate(yield_stud...
null
scripts/make_gwas_cat_study_table_API.py
make_gwas_cat_study_table_API.py
py
4,688
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.DataFrame", "line_number": 56, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 100, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 105, "usage_type": "call" }, { "api_name": "requests.get", "line_n...
456890575
import ctypes as ct import cairo import cv2 import numpy as np from PIL import Image _initialized = False def create_cairo_font_face_for_file(filename, faceindex=0, loadoptions=0): """given the name of a font file, and optional faceindex to pass to FT_New_Face" \ " and loadoptions to pass to cairo_ft_font_f...
null
digit_ocr.py
digit_ocr.py
py
16,691
python
en
code
null
code-starcoder2
66
[ { "api_name": "ctypes.CDLL", "line_number": 27, "usage_type": "call" }, { "api_name": "ctypes.CDLL", "line_number": 28, "usage_type": "call" }, { "api_name": "ctypes.c_void_p", "line_number": 29, "usage_type": "attribute" }, { "api_name": "ctypes.c_void_p", "l...
601107315
from django.db import models from django.db.models.signals import post_save from django.dispatch import receiver import web.tasks as tasks class RequestCrawling(models.Model): url = models.URLField(unique=True) is_finished = models.BooleanField(default=False) def __str__(self): return self.url ...
null
web/models.py
models.py
py
1,150
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.models.Model", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.models.URLField", "line_number": 8, "usage_type": "call" }, { "api_name": "d...
150478429
import os import uuid from flask import Flask, request, render_template, redirect, url_for, session, flash from Model.database import create_database_and_tables, get_books_by_text_and_col, \ save_book_to_cart, get_books_in_cart, remove_book_by_isbn_and_id, \ update_book_units_after_purchase, remove_all_books_i...
null
app.py
app.py
py
4,026
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "Model.database.create_database_and_tables", "line_number": 13, "usage_type": "call" }, { "api_name": "...
217176098
from distutils.dir_util import copy_tree import shutil from accounts.models import AdvertiserProfile from AdRecords.models import Image import json from django.template import loader class BlippingEngine: def blip_generator(self, request, image_property_id): global image_engine_path_json image_engi...
null
BlippingEngine/phase_one.py
phase_one.py
py
2,031
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.load", "line_number": 15, "usage_type": "call" }, { "api_name": "accounts.models.AdvertiserProfile.objects.all", "line_number": 21, "usage_type": "call" }, { "api_name": "accounts.models.AdvertiserProfile.objects", "line_number": 21, "usage_type": "att...
563726028
from datetime import datetime, timedelta from dateutil.relativedelta import relativedelta from .models import AdultInHome, Application from application.services.db_gateways import NannyGatewayActions, HMGatewayActions from django.conf import settings import logging log = logging.getLogger(__name__) def generate...
null
application/business_logic.py
business_logic.py
py
6,686
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 23, "usage_type": "name" }, { "api_name": "datetime.ti...
129612084
from django.shortcuts import render from django.http import HttpResponse, JsonResponse from django.contrib.auth.decorators import login_required from django.db.models import Count, Sum, Q from django.views.decorators.csrf import csrf_exempt # serializer from django.core.serializers import serialize # models from .mod...
null
property/views.py
views.py
py
5,328
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.ParcelInfo.objects.get", "line_number": 22, "usage_type": "call" }, { "api_name": "models.ParcelInfo.objects", "line_number": 22, "usage_type": "attribute" }, { "api_name": "models.ParcelInfo", "line_number": 22, "usage_type": "name" }, { "ap...
256595133
import collections # Definition for a binary tree node. class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right # Recursive - DFS class Solution: """ Time Complexity: O(N) where N is the number of nodes Space Comple...
null
Problems/Leetcode/1448_CountGoodNodesInBinaryTree.py
1448_CountGoodNodesInBinaryTree.py
py
1,376
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.deque", "line_number": 41, "usage_type": "call" } ]
144972575
import numpy as np import matplotlib.pyplot as plt from latent_crf import LatentGridCRF from latent_structured_svm import StupidLatentSVM import toy_datasets as toy from IPython.core.debugger import Tracer tracer = Tracer() def main(): #X, Y = toy.generate_crosses_latent(n_samples=25, noise=10) #X, Y = toy...
null
examples_latent_crf.py
examples_latent_crf.py
py
2,633
python
en
code
null
code-starcoder2
66
[ { "api_name": "IPython.core.debugger.Tracer", "line_number": 10, "usage_type": "call" }, { "api_name": "toy_datasets.generate_easy", "line_number": 16, "usage_type": "call" }, { "api_name": "latent_crf.LatentGridCRF", "line_number": 21, "usage_type": "call" }, { "...
199812421
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.db.models.fields.related_descriptors import ( ForwardManyToOneDescriptor, ManyToManyDescriptor, ) class TestClassesValidity(object): def test_categories_model_integrity(self): from tests.testproject.model...
null
tests/test_models.py
test_models.py
py
2,972
python
en
code
null
code-starcoder2
66
[ { "api_name": "tests.testproject.models.Category", "line_number": 14, "usage_type": "name" }, { "api_name": "tests.testproject.models.Category", "line_number": 15, "usage_type": "name" }, { "api_name": "django.db.models.fields.related_descriptors.ManyToManyDescriptor", "line_...
584409823
import inspect from dataclasses import dataclass from typing import Any, Callable, Dict, Iterable, List, Optional, Sequence from weakref import WeakKeyDictionary import catalogue from confit import Config, Registry from confit.registry import RegistryCollection import edspdf from edspdf.utils.collections import Froze...
null
edspdf/registry.py
registry.py
py
6,892
python
en
code
null
code-starcoder2
66
[ { "api_name": "weakref.WeakKeyDictionary", "line_number": 13, "usage_type": "call" }, { "api_name": "typing.Callable", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.Sequence", "line_number": 18, "usage_type": "name" }, { "api_name": "inspect.sig...
588240393
#!/usr/bin/python # -*- coding: utf-8 -*- # Python 2.7 # PaEllipse2016wx.pyw import wx, math conf__nCount = 40 conf__strColor = '#FFFF00' conf__strBackgroundColor = '#000000' PI2 = math.pi * 2 class PaEllipseDef: x, y, a, b, angle, rotate = (0, 0, 0, 0, 0, 0) def __init__(self): pass def __init__(self, x, y,...
null
Python-2016/Python-2016-wx/PaEllipse2016wx.pyw/PaEllipse2016wx.pyw
PaEllipse2016wx.pyw
pyw
2,860
python
en
code
null
code-starcoder2
66
[ { "api_name": "math.pi", "line_number": 12, "usage_type": "attribute" }, { "api_name": "wx.Frame", "line_number": 28, "usage_type": "attribute" }, { "api_name": "wx.Frame.__init__", "line_number": 30, "usage_type": "call" }, { "api_name": "wx.Frame", "line_num...
626654627
# プログラム2.12 import pandas as pd import numpy as np import matplotlib import matplotlib.pyplot as plt get_ipython().run_line_magic('matplotlib', 'inline') # データの準備 def prepare(): # 世界の気温を記録したデータをダウンロードして読み込む #!kaggle datasets download -d schedutron/global-temperatures get_ipython().system('unzip global-tem...
null
py/prog2-12.py
prog2-12.py
py
2,709
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 29, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure",...
376164300
from decimal import Decimal from random import randint from app_goods.models import Item from django.test import TestCase from django.urls import reverse NUMBER_OF_ITEMS = 10 class ItemsTest(TestCase): @classmethod def setUpTestData(cls): for item_index in range(NUMBER_OF_ITEMS): Item.obje...
null
board/app_goods/tests.py
tests.py
py
887
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.test.TestCase", "line_number": 9, "usage_type": "name" }, { "api_name": "app_goods.models.Item.objects.create", "line_number": 13, "usage_type": "call" }, { "api_name": "app_goods.models.Item.objects", "line_number": 13, "usage_type": "attribute" }...
467618681
#!/usr/bin/env python # -*- coding: utf-8 -*- """Multiple algorithms for sorting oTree players """ # ============================================================================= # IMPORTS # ============================================================================= import itertools import random f...
null
matching.py
matching.py
py
1,506
python
en
code
null
code-starcoder2
66
[ { "api_name": "six.moves.range", "line_number": 26, "usage_type": "call" }, { "api_name": "itertools.chain.from_iterable", "line_number": 34, "usage_type": "call" }, { "api_name": "itertools.chain", "line_number": 34, "usage_type": "attribute" }, { "api_name": "ra...
173250071
from datetime import datetime, timedelta from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart import json import smtplib from .format import format_figaro, format_gh, format_guardian, format_ph, format_weather today = datetime.now() yesterday = today - timedelta(1) with open("config.js...
null
mail/__init__.py
__init__.py
py
1,279
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.now", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 9, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 10, "usage_type": "call" }, { "api_name": "json.load", ...
511646979
import asyncio import socket from time import time import struct import logging import shlex import subprocess import re async def icmp_recv(expected=3): # Get a reference to the current event loop because # we want to access low-level APIs. loop = asyncio.get_running_loop() # Listen for ICMP packets ...
null
misc/pmtud.py
pmtud.py
py
3,656
python
en
code
null
code-starcoder2
66
[ { "api_name": "asyncio.get_running_loop", "line_number": 13, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 16, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 16, "usage_type": "attribute" }, { "api_name": "socket.SOC...
30485049
from os import path from flask import render_template, request, abort, redirect, url_for from . import app, db, search, reviews, twitter # home page @app.route("/") def home(): # verifica la presenza della cartella "instance" e del database in essa if not path.isdir(app.instance_path): return render_...
null
dimdb/pages.py
pages.py
py
3,659
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.isdir", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "name" }, { "api_name": "flask.render_template", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.isfile", "lin...
622639873
from game_character import GameCharacter from explorer import Explorer from medic import Medic from termcolor import colored, cprint import datetime import time import random # import winsound class Warrior(GameCharacter): def __init__(self, name, health, strength): self.popularity = 0 ...
null
warrior.py
warrior.py
py
4,466
python
en
code
null
code-starcoder2
66
[ { "api_name": "game_character.GameCharacter", "line_number": 10, "usage_type": "name" }, { "api_name": "termcolor.colored", "line_number": 23, "usage_type": "call" }, { "api_name": "termcolor.colored", "line_number": 24, "usage_type": "call" }, { "api_name": "term...
340513732
from flask import json from .base_test import BaseTest class TestUser(BaseTest): def test_user_signup(self): response = self.client.post("api/v2/auth/signup", data=json.dumps(self.sample_user), content_type="application/json") result = json.loads(response.data) print(result) self...
null
app/tests/v2/test_user.py
test_user.py
py
516
python
en
code
null
code-starcoder2
66
[ { "api_name": "base_test.BaseTest", "line_number": 5, "usage_type": "name" }, { "api_name": "flask.json.dumps", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.json", "line_number": 7, "usage_type": "name" }, { "api_name": "flask.json.loads", "l...
647727065
#!/usr/bin/env python3 """This module converts `csv` to `ledger`.""" import sys import csv import argparse import configparser LINE_LENGTH = 50 WHITESPACE_INDENT_LENGTH = 2 WHITESPACE_INDENT = ' ' * WHITESPACE_INDENT_LENGTH def get_parameters(): """Return the parameters.""" parser = argparse.ArgumentParser...
null
scripts/csv_to_ledger.py
csv_to_ledger.py
py
2,905
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "api_name": "configparser.ConfigParser", "line_number": 30, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 48, "usage_type": "attribute" }, { "api_name": "csv....
323560825
# redis has a client server architechture # uses request-response cycle # remote dictionary service import redis import datetime import random import logging r = redis.Redis() r.mset({"bd": 'dhaka', 'usa': 'washington dc'}) # output will show bytestring print(r.get('bd')) # so we may call like the following depending ...
null
RemoteDictService.py
RemoteDictService.py
py
3,890
python
en
code
null
code-starcoder2
66
[ { "api_name": "redis.Redis", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 16, "usage_type": "attribute" }, { "api_name": "random.seed", "...
419612912
import re import numpy as np import scipy from scipy import spatial f = open('sentences.txt', 'r') data = f.readlines() f.close() words = {} d=0 for line in data: l1 = re.split('[^a-z]', line.lower()) for x in l1: if x is not '': if x not in words: words...
null
distance cosine.py
distance cosine.py
py
865
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.split", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 23, "usage_type": "call" }, { "api_name": "re.split", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.ndarray", "line_number": 35, ...
491860364
import json from django.shortcuts import render from django.views.generic import View from django.http import Http404, JsonResponse from rest_framework import authentication, permissions, serializers, status from rest_framework.views import APIView from rest_framework.response import Response from rest_framework.parse...
null
src/orders/views.py
views.py
py
3,558
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework.views.APIView", "line_number": 18, "usage_type": "name" }, { "api_name": "rest_framework.authentication.SessionAuthentication", "line_number": 19, "usage_type": "attribute" }, { "api_name": "rest_framework.authentication", "line_number": 19, ...
79414487
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Oct 1 17:43:18 2018 @author: neha code for sumbission file creation """ import os import sys import random import pandas as pd import numpy as np import matplotlib.pyplot as plt plt.style.use('seaborn-white') import seaborn as sns sns.set_style("whit...
null
TGSsalt/submit_1ch_fold3.py
submit_1ch_fold3.py
py
22,163
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 17, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 17, "usage_type": "name" }, { "api_na...
404530882
# !/usr/bin/env python3 #coding=utf-8 ''' 智策apm ''' import configparser,os.path import os,subprocess from common.setCookie import Set_Cookie current_path = os.path.abspath(__file__) from common.logger import Logger logger = Logger(logger="run_apm_zhice_Test").get_log() #读写config.ini文件,初始化修改URL地址,区分线上和测试环境。 def modify...
null
run_haotian_apm_zhice_cases.py
run_haotian_apm_zhice_cases.py
py
1,374
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.abspath", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "common.logger.Logger", "line_number": 11, "usage_type": "call" }, { "api_name": "configparser.ConfigPa...
439682526
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Dec 28 10:04:34 2019 @author: npchen """ # Import PyQt Widgets for PyQt5 version from PyQt5.QtWidgets import QApplication, QMainWindow # Import pyqtSlot to connect sliders and DoubleSpinBox signals from PyQt5.QtCore import pyqtSlot # Import Ui_MainW...
null
demo_MainApp.py
demo_MainApp.py
py
15,779
python
en
code
null
code-starcoder2
66
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 35, "usage_type": "name" }, { "api_name": "UiMainApp.Ui_MainWindow", "line_number": 35, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QMainWindow.__init__", "line_number": 45, "usage_type": "call" }, ...
62380122
import psycopg2 from flask import Flask, g app = Flask(__name__) from giraffe_gui import index, db @app.before_request def get_db(): if not hasattr(g, 'conn'): with open('/usr/local/etc/giraffe-gui.config', 'rt') as f: dsn = f.read().strip() g.conn = psycopg2.connect(dsn) g.c...
null
gui/giraffe_gui/__init__.py
__init__.py
py
392
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.g", "line_number": 10, "usage_type": "argument" }, { "api_name": "flask.g.conn", "line_number": 14, "usage_type": "attribute" }, { "api_name": "flask.g", "line_number":...
631142945
"""root-3d-segmentation analysis.""" import os import json import logging import argparse from jicbioimage.core.io import AutoName, AutoWrite from jicbioimage.segment import SegmentedImage from jicbioimage.core.image import Image3D from setup_image_data import get_data_manager from utils import ColorImage3D from seg...
null
scripts/analyse_series.py
analyse_series.py
py
6,991
python
en
code
null
code-starcoder2
66
[ { "api_name": "jicbioimage.core.io.AutoName.prefix_format", "line_number": 27, "usage_type": "attribute" }, { "api_name": "jicbioimage.core.io.AutoName", "line_number": 27, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 32, "usage_type": "call" }, ...
344716802
# -*- coding: utf-8 -*- """ adam.domain.contact.py ~~~~~~~~~~~~~~~~~~~~~~ 'contact' resource and schema settings. :copyright: (c) 2016 by Nicola Iarocci and CIR2000. :license: BSD, see LICENSE for more details. """ import copy from collections import namedtuple from .topology import url_map from...
null
adam/domain/contact.py
contact.py
py
1,904
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.namedtuple", "line_number": 20, "usage_type": "call" }, { "api_name": "common.key.company", "line_number": 22, "usage_type": "attribute" }, { "api_name": "common.key", "line_number": 22, "usage_type": "name" }, { "api_name": "common.key....
230282638
from TermID import termID from DocumentID import documentID import json # creating a class to create the InvertedIndex. Using the termID List to make things easier. class invertedIndex: def __init__(self): self.termIDList = None self.termToDocStats = {} self.documentIDs = None #used to return the termID list ...
null
CS6200/Assignment2/InvertedIndex.py
InvertedIndex.py
py
3,337
python
en
code
null
code-starcoder2
66
[ { "api_name": "TermID.termID", "line_number": 42, "usage_type": "call" }, { "api_name": "DocumentID.documentID", "line_number": 44, "usage_type": "call" }, { "api_name": "DocumentID.documentID", "line_number": 75, "usage_type": "call" }, { "api_name": "json.dump",...
95511588
#!/usr/bin/python3 """ Base class """ import json import os class Base(): """Base class manager""" __nb_objects = 0 def __init__(self, id=None): """constructor""" if id is not None: self.id = id else: Base.__nb_objects += 1 self.id = Bas...
null
0x0C-python-almost_a_circle/models/base.py
base.py
py
2,018
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.dumps", "line_number": 28, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 45, "usage_type": "call" }, { "api_name": "models.square.Square", "line_number": 52, "usage_type": "name" }, { "api_name": "models.rectangle.Rectangle...
106165523
import os import boto3 from lakecli.iam.orm import TablePrivilege, DatabasePrivilege, init, model_db_close class Scanner: def __init__(self, aws_config, path): self.aws_config = aws_config self.path = os.path.expanduser(path) if os.path.exists(self.path): os.remove(self.path) ...
null
lakecli/iam/scanner.py
scanner.py
py
2,351
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.expanduser", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
451100614
from django.conf.urls import include, url from ribbit_app import views from livestreams_api.urls import urlpatterns as livestreams_api_urls from ribbit import settings from django.contrib import admin from django.http import HttpResponse from django.views.generic import TemplateView admin.autodiscover() # Uncomment t...
null
liveon/urls.py
urls.py
py
3,421
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 9, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 9, "usage_type": "name" }, { "api_name": "django.conf.urls.url", "line_number": 31, "usage_type": "call" }, { "api_nam...
214792273
import torch import torch.nn as nn from torch_geometric.nn import GCNConv from torch_geometric.data import Data as GraphData from torch_geometric.data import Batch as GraphBatch import torch.nn.functional as F from torch.nn import init import functools from torch.optim import lr_scheduler from torchvision import models...
null
models/networks2.py
networks2.py
py
29,911
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn.Module", "line_number": 33, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 33, "usage_type": "name" }, { "api_name": "functools.partial", "line_number": 48, "usage_type": "call" }, { "api_name": "torch.nn.BatchNorm2d"...
582330857
#!/usr/bin/python3 import json import math import sys from PIL import Image from jinja2 import Template PIXEL_SIZE = 5 WEBSITE_NAME = "pixelart.html" if len(sys.argv) == 2: sample_image = sys.argv[1] elif len(sys.argv) > 2: print("Usage: pxlator.py <image.jpg>") exit() else: sample_image = input("Ima...
null
pxlator.py
pxlator.py
py
2,456
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 14, "usage_type": "attribute" }, { "api_name": "math.sqrt", "line_numbe...
503600526
from core_model import LanguageInterpreter import tools as tls class BotCore(object): def __init__(self): self.interpreter = LanguageInterpreter() # Here the interpreter is an LanguageInterpreter object,which means that you have to use interpreter.interpreter # to get access to the real i...
null
bot_core.py
bot_core.py
py
1,283
python
en
code
null
code-starcoder2
66
[ { "api_name": "core_model.LanguageInterpreter", "line_number": 8, "usage_type": "call" }, { "api_name": "tools.counting_section", "line_number": 20, "usage_type": "call" }, { "api_name": "tools.judging_entity", "line_number": 21, "usage_type": "call" }, { "api_nam...
466151301
import bs4 import requests url = 'https://id.carousell.com/carousell_id/' contents = requests.get(url) #print(contents.text) response = bs4.BeautifulSoup(contents.text, 'html.parser') #print(response) data = response.find_all('div','D_afo D_aS M_hs D_aU M_hu') print(data[0].text)
null
start.py
start.py
py
288
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 5, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 8, "usage_type": "call" } ]
189379209
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @author: zparteka """ """ Calculate Measure of Concordance as described in Comparison of computational methods forthe identification of topologically associating domains Genome Biology 2018""" import argparse from tools.measure_of_concordance import calculate_moc, re...
null
moc.py
moc.py
py
1,184
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.basename", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "name" }, { "api_name": "os.path.basename", ...
447219975
#!/usr/bin/python3 """This is the base model class for AirBnB""" import uuid from datetime import datetime import models from sqlalchemy import Column, Integer, String, DateTime from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship kronos = "%Y-%m-%dT%H:%M:%S.%f" Base = decla...
null
models/base_model.py
base_model.py
py
2,607
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 12, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 20, "usage_type": "call" }, { "api_name": "sqlalchemy.String", "line_number": 20, "usage_type": "call" }, { "a...
115120280
#! /usr/bin/env python # -*- coding:utf-8 -*- import pika import sys credentials = pika.PlainCredentials("admin", "admin") connection = pika.BlockingConnection(pika.ConnectionParameters( "138.128.220.107", credentials=credentials, )) channel = connection.channel() channel.exchange_declare(exchange='logs', ...
null
pika_and_ribbitmq/emit_log.py
emit_log.py
py
591
python
en
code
null
code-starcoder2
66
[ { "api_name": "pika.PlainCredentials", "line_number": 7, "usage_type": "call" }, { "api_name": "pika.BlockingConnection", "line_number": 8, "usage_type": "call" }, { "api_name": "pika.ConnectionParameters", "line_number": 8, "usage_type": "call" }, { "api_name": "...
25722260
#Utility.py holds the draw function and future utility functions. #TDDUP pre-Alpha import pygame class screenDisplay(): # !!!!!!!!!!!!!!! private attributes !!!!!!!!!!!!!!! __defualtWidth = 1 __defualtHeight = 1 __black = (0,0,0) __priorityRefList = [] __initRun = False # !!!!!!!!!!!!!!...
null
source/utility.py
utility.py
py
3,626
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.display.Info", "line_number": 82, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 82, "usage_type": "attribute" }, { "api_name": "pygame.display.Info", "line_number": 85, "usage_type": "call" }, { "api_name": "pygame.di...
251744621
from n6sdk.data_spec.fields import * from necoma.common import * from datetime import datetime class DnsPcapsDataBackendApi(object): @staticmethod def parse(auth_data, params, query_result, **kwargs): for data in query_result: if data[2].find('.') > 1 or data[4].find('.') > 1: ...
null
dns_pcaps.py
dns_pcaps.py
py
1,174
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.utcfromtimestamp", "line_number": 25, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 25, "usage_type": "name" } ]
509229606
import komand import json import requests from .schema import UserInput, UserOutput class User(komand.Action): def __init__(self): super(self.__class__, self).__init__( name='user', description='Get user information', input=UserInput(), outpu...
null
bitbucket/komand_bitbucket/actions/user/action.py
action.py
py
1,755
python
en
code
null
code-starcoder2
66
[ { "api_name": "komand.Action", "line_number": 7, "usage_type": "attribute" }, { "api_name": "schema.UserInput", "line_number": 12, "usage_type": "call" }, { "api_name": "schema.UserOutput", "line_number": 13, "usage_type": "call" }, { "api_name": "json.dumps", ...
307582178
#! /usr/bin/env python # -*- coding: utf-8 -* import collections from census_data_downloader.core.tables import BaseTableConfig from census_data_downloader.core.decorators import register @register class EducationDownloader(BaseTableConfig): PROCESSED_TABLE_NAME = 'education' UNIVERSE = "population 25 Years a...
null
census_data_downloader/tables/education.py
education.py
py
4,046
python
en
code
null
code-starcoder2
66
[ { "api_name": "census_data_downloader.core.tables.BaseTableConfig", "line_number": 9, "usage_type": "name" }, { "api_name": "collections.OrderedDict", "line_number": 13, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 80, "usage_type": "cal...
478572359
# specfn.py - Average time-frequency energy representation using Morlet wavelet method # # v 1.10.2-py35 # rev 2017-02-21 (SL: fixed an issue with indexing) # last major: (SL: more comments on the units of Morlet Spec) import os import sys import numpy as np import scipy.signal as sps import matplotlib.pyplot as plt i...
null
specfn.py
specfn.py
py
37,901
python
en
code
null
code-starcoder2
66
[ { "api_name": "paramrw.read", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 61, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.get_cmap", "line_number": 85, "usage_type": "call" }, { "api_name": "matplotlib.pyplo...
442589783
import mock import pytest from distutils.errors import DistutilsSetupError from setuptools_git_version import format_version, set_package_info @pytest.mark.parametrize('git_describe, version', [ ('v25.6-879-gca0be43', 'v25.6.dev879+ca0be43'), ('28-0-gca0be43', '28'), ('28.0-0-gca0be43', '28.0'), ('28....
null
tests.py
tests.py
py
1,405
python
en
code
null
code-starcoder2
66
[ { "api_name": "setuptools_git_version.format_version", "line_number": 15, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 7, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 7, "usage_type": "attribute" }, { "api_...
403722413
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Project Euler Problem 88 ======================= A natural number, N, that can be written as the sum and product of a given set of at least two natural numbers, {a[1], a[2], ... , a[k]} is called a product-sum number: N = a[1] + a[2] + ... + a[k] = a[1] * a[2] * ... * ...
null
project-euler/solvers/euler088.py
euler088.py
py
1,711
python
en
code
null
code-starcoder2
66
[ { "api_name": "ntpath.basename", "line_number": 44, "usage_type": "call" }, { "api_name": "time.time", "line_number": 47, "usage_type": "call" }, { "api_name": "time.time", "line_number": 49, "usage_type": "call" }, { "api_name": "common.shared_functions.verify_so...
404509219
import cv2 import numpy as np def detect(filename): face_cascade = cv2.CascadeClassifier("haarcascade_frontalface_default.xml") eye_cascade = cv2.CascadeClassifier("haarcascade_eye.xml") gray = cv2.cvtColor(filename, cv2.COLOR_BGR2GRAY) faces = face_cascade.detectMultiScale(np.copy(gray), 1.3, 5) ...
null
Capitulo4/detecting-recognizing-faces-video.py
detecting-recognizing-faces-video.py
py
1,024
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.CascadeClassifier", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.CascadeClassifier", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2G...
543955558
import pandas as pd import numpy from sklearn.linear_model import LinearRegression from sklearn.preprocessing import LabelEncoder from sklearn.preprocessing import OneHotEncoder from sklearn.model_selection import train_test_split dataset = pd.read_csv('50_startups.csv') #print(dataset) y = dataset['Profit'] y = y...
null
mlcode.py
mlcode.py
py
1,111
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.LabelEncoder", "line_number": 22, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.OneHotEncoder", "line_number": 29, "usage_type": "call" }, { ...
468986477
import matplotlib.pyplot as plt import numpy as np from ROOT import TFile, TTree, TProfile, TH3F,TGraph, TProfile2D from mpl_toolkits.mplot3d import Axes3D from tools import * #importation des données filename = '../charged_hadrons_100k.root' root_file = TFile(filename) tree = root_file.Get('s') my_profile = TProfile...
null
brouillon/profile_data0.py
profile_data0.py
py
2,847
python
en
code
null
code-starcoder2
66
[ { "api_name": "ROOT.TFile", "line_number": 10, "usage_type": "call" }, { "api_name": "ROOT.TProfile2D", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.arange", "line_numbe...
31564394
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ 迭代器 """ from collections import Iterable # 可迭代对象:list,tuple,dict,set,str.... d = {'a': 1, 'b': 2, 'c': 3} # 默认迭代的是 key for key in d: print(key) # 迭代值 for value in d.values(): print(value) # 迭代值、对象 for k, v in d.items(): print(k, '--->', v) # 迭代字符串...
null
02.data_structure/ietarion.py
ietarion.py
py
744
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.Iterable", "line_number": 34, "usage_type": "argument" } ]
547093757
import numpy as np from sklearn.neighbors import KDTree import networkx as nx import matplotlib.pyplot as plt import pandas as pd from scipy.spatial.distance import pdist, euclidean from Data import Data """ Converts Cloud points to Graph """ class ToGraph: def __init__(self, Data): self.Data = Data ...
null
ToGraph.py
ToGraph.py
py
7,656
python
en
code
null
code-starcoder2
66
[ { "api_name": "Data.Data", "line_number": 19, "usage_type": "name" }, { "api_name": "scipy.spatial.distance.pdist", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.median", "line_number": 42, "usage_type": "call" }, { "api_name": "sklearn.neighbors...
180764081
"""Summary Attributes: contract_ranking (list): Description df (TYPE): Description per_cols (list): Description salary_cols (list): Description standardize (TYPE): Description """ import os import re #import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import plotly.offline as...
null
contract_comp_viz.py
contract_comp_viz.py
py
3,738
python
en
code
null
code-starcoder2
66
[ { "api_name": "data.SALARY_DATA_20_21", "line_number": 20, "usage_type": "name" }, { "api_name": "data.PER_DATA_20_21", "line_number": 21, "usage_type": "name" }, { "api_name": "data.TM_DATA_20_21", "line_number": 22, "usage_type": "name" }, { "api_name": "data.TM...
18401246
from __future__ import print_function import os import json from gumby.experiment import experiment_callback from gumby.modules.community_experiment_module import CommunityExperimentModule from gumby.modules.community_launcher import CommunityLauncher from gumby.modules.experiment_module import static_module from gum...
null
experiments/swarm_size/swarm_size_module.py
swarm_size_module.py
py
4,190
python
en
code
null
code-starcoder2
66
[ { "api_name": "gumby.modules.isolated_community_loader.IsolatedCommunityLoader", "line_number": 23, "usage_type": "name" }, { "api_name": "gumby.modules.community_launcher.CommunityLauncher", "line_number": 30, "usage_type": "name" }, { "api_name": "Tribler.community.swarmsize.co...
558397107
''' Run this command python3 excelAutomation.py sampleData.xlsx otherSampleData.xlsx ''' import openpyxl import pandas as pd import sys from datetime import date #path = input("Enter Path: ") path = sys.argv[1] otherFile = sys.argv[2] try: wbObj = openpyxl.load_workbook(path) except IOError: print('First F...
null
excelAutomation.py
excelAutomation.py
py
3,720
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 14, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 15, "usage_type": "attribute" }, { "api_name": "openpyxl.load_workbook", "line_number": 18, "usage_type": "call" }, { "api_name": "pandas.read_excel"...
640952017
import json import time from flask import Flask, make_response from flask import request app = Flask(__name__) @app.route('/send', methods=['POST']) def pwd(): with open('{}-{}.txt'.format(request.remote_addr, time.strftime('%Y%m%d%H%M%S', time.localtime())), 'a', encoding='utf-8') as f: f...
null
flask/get_pwd.py
get_pwd.py
py
559
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.request.remote_addr", "line_number": 12, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 12, "usage_type": "name" }, { "api_name": "time.strftime...
422820772
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import re import time import pexpect import deviceHelper from utils import Log from testcase import TestCase from Client import LogCapture, CommonUse from pdu import TelnetUtils, PduHelper class TestBinCheck(TestCase): """docstring for TestRcDC""" def _...
null
Python_Java_UIautomator/case/platform/system/test_sys_bin_check.py
test_sys_bin_check.py
py
3,988
python
en
code
null
code-starcoder2
66
[ { "api_name": "testcase.TestCase", "line_number": 15, "usage_type": "name" }, { "api_name": "Client.CommonUse", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_n...