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
318794844
from sklearn.model_selection import train_test_split from sklearn.metrics import classification_report from sklearn.datasets import make_blobs import matplotlib.pyplot as plt import numpy as np import argparse def sigmoid_activation(x): # compute the sigmoid activation value for a given input return 1.0 / (1 + np.e...
null
sgd.py
sgd.py
py
3,766
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.exp", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 28, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 32, "usage_type": "call" }, { "api_name": "sklearn.datasets.make_...
630583416
import PIL from PIL import Image import os import random import numpy as np import tkinter as tk import cv2 import matplotlib.pyplot as plt list_backgrounds = os.listdir('../BaseImages/paysages décors fonds/') if '.DS_Store' in list_backgrounds: list_backgrounds.remove('.DS_Store') image_path = random.choice(list...
null
analyze_dominant_colors.py
analyze_dominant_colors.py
py
2,711
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.listdir", "line_number": 10, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number":...
27998502
#!/usr/bin/env python #-*- coding:utf8 -*- import os, sys, logging, shutil from datetime import date import MySQLdb as mdb logging.basicConfig( level=logging.DEBUG, format='%(asctime)s %(levelname)s %(message)s', filename='/var/log/teleport_clean_logs.log' ) def clean_logs(): SSH_DIR = '/usr/local/te...
null
teleport_clean_logs.py
teleport_clean_logs.py
py
1,412
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.basicConfig", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 9, "usage_type": "attribute" }, { "api_name": "datetime.date.today", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.dat...
344032667
from flask import Flask, request from flask_restful import Resource, Api app = Flask(__name__) api = Api(app) users = {} class User(Resource): # metode-metode yang ada di classnya udah otomatis restfull seperti get put dll def get(self, user_id): return {'name':users[user_id]} # Metode untu me...
null
example.py
example.py
py
715
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask_restful.Api", "line_number": 5, "usage_type": "call" }, { "api_name": "flask_restful.Resource", "line_number": 9, "usage_type": "name" }, { "api_name": "flask.request.form"...
271846259
from django.conf import settings from django.db import models from django.core.validators import RegexValidator # Backwards compatible settings.AUTH_USER_MODEL USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User') class ExtraInfo(models.Model): """ This model contains two extra fields that will be sa...
null
custom_reg_form/models.py
models.py
py
844
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.settings", "line_number": 5, "usage_type": "argument" }, { "api_name": "django.db.models.Model", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 8, "usage_type": "name" }, { "api_name": "dj...
162525122
import requests import json data = { "Destino": { "address": "Antonio varas", "ciudad": "santiago", "comuna": "providencia", "number": "880", "pais": "chile" }, "Inicio": { "address": "apoquindo", "ciudad": "santiago", "comuna": "las condes", "number": "4820", "pais": "chi...
null
test.py
test.py
py
590
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.post", "line_number": 23, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 23, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 24, "usage_type": "call" } ]
444521147
# root/app/db/schemas/entities.py from typing import Optional from pydantic import BaseModel, Field class Entity(BaseModel): id: int name: str = Field(..., example="Dia") class Config: orm_mode = True schema_extra = { "example": { "id": 0, "nam...
null
app/db/schemas/entities.py
entities.py
py
719
python
en
code
null
code-starcoder2
66
[ { "api_name": "pydantic.BaseModel", "line_number": 7, "usage_type": "name" }, { "api_name": "pydantic.Field", "line_number": 9, "usage_type": "call" }, { "api_name": "pydantic.BaseModel", "line_number": 21, "usage_type": "name" }, { "api_name": "pydantic.Field", ...
85656462
from django import template register = template.Library() @register.simple_tag(takes_context=True) def template_filename(context): '''Returns template filename with the extension''' return context.template_name @register.simple_tag(takes_context=True) def user_class(context): '''Defines a class-string ...
null
kernel/templatetags/base_tags.py
base_tags.py
py
823
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.template.Library", "line_number": 3, "usage_type": "call" }, { "api_name": "django.template", "line_number": 3, "usage_type": "name" } ]
463793757
#!/usr/bin/env python3 # encoding utf-8 from DiscreteHFO.HFOAttackingPlayer import HFOAttackingPlayer from DiscreteHFO.Agent import Agent import argparse class MonteCarloAgent(Agent): def __init__(self, discountFactor, epsilon, initVals=0.0): super(MonteCarloAgent, self).__init__() self.discountFactor=discountFa...
null
MonteCarloBase.py
MonteCarloBase.py
py
3,397
python
en
code
null
code-starcoder2
66
[ { "api_name": "DiscreteHFO.Agent.Agent", "line_number": 8, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 89, "usage_type": "call" }, { "api_name": "DiscreteHFO.HFOAttackingPlayer.HFOAttackingPlayer", "line_number": 98, "usage_type": "call...
644659406
from django.shortcuts import render from rest_framework.views import APIView from .serializers import LoginSerializer, SignUpSerializer, AddTodoSerializer, TodoSerializer, TypeSerializer from django.contrib.auth import login, logout from django.http import HttpResponse, JsonResponse from django.contrib.auth.models imp...
null
taskApp/views.py
views.py
py
6,338
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework.views.APIView", "line_number": 23, "usage_type": "name" }, { "api_name": "serializers.LoginSerializer", "line_number": 25, "usage_type": "call" }, { "api_name": "django.contrib.auth.login", "line_number": 30, "usage_type": "call" }, { ...
407435787
#!/usr/bin/env python # -*- coding: utf-8 import logging import pytest from fiaas_deploy_daemon.log_extras import StatusHandler, set_extras, get_final_logs TEST_MESSAGE = "This is a test log message" class TestLogExtras(object): def test_status_log_has_extra(self, app_spec): set_extras(app_spec) ...
null
tests/fiaas_deploy_daemon/test_log_extras.py
test_log_extras.py
py
1,584
python
en
code
null
code-starcoder2
66
[ { "api_name": "fiaas_deploy_daemon.log_extras.set_extras", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "fiaas_deploy_daemon.log_extras.StatusHandler", "line_number": 16, "usage_type...
88433086
import os, sys, time, csv, math, uuid, atexit, pdb, warnings import subprocess as sp import numpy as np from numpy import nan import pandas as pd # Global Variables: (ensures safe R/W of smashmatch) prefix = str(uuid.uuid4()) prefix = prefix.replace("-", "") temp_dir = str(uuid.uuid4()) cwd = os.getcwd() # prefix = ...
null
cw8.py
cw8.py
py
26,470
python
en
code
null
code-starcoder2
66
[ { "api_name": "uuid.uuid4", "line_number": 10, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 12, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 5...
126292643
"""Base class for a derived property.""" from ..constants import PropertyType from ..topics import EXTENDED_PROPERTIES_CHANGED from ..utils import subscribe_topic from .device_flag import DeviceFlagBase class DerivedProperty(DeviceFlagBase): """Base class for a derived property.""" def __init__( sel...
null
pyinsteon/config/derived_property.py
derived_property.py
py
1,130
python
en
code
null
code-starcoder2
66
[ { "api_name": "device_flag.DeviceFlagBase", "line_number": 9, "usage_type": "name" }, { "api_name": "constants.PropertyType.DERIVED", "line_number": 28, "usage_type": "attribute" }, { "api_name": "constants.PropertyType", "line_number": 28, "usage_type": "name" }, { ...
624791976
from http.server import HTTPServer, BaseHTTPRequestHandler from time import strftime class CS2610Assn1(BaseHTTPRequestHandler): """ Your task is to define this class such that it fulfills the assingment requirements. Refer to the official Python documentation for the `http.server` class for detail...
null
server.py
server.py
py
3,327
python
en
code
null
code-starcoder2
66
[ { "api_name": "http.server.BaseHTTPRequestHandler", "line_number": 4, "usage_type": "name" }, { "api_name": "time.strftime", "line_number": 20, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": 29, "usage_type": "call" }, { "api_name": "time.st...
208274150
import mss import numpy as np import cv2 import keyboard import torch import pyautogui import torchvision import time # SETUP. Load the YOLOv5 model model = torch.hub.load('ultralytics/yolov5', 'custom', path='C:/Users/Admin/Desktop/best5.pt') #model = torch.hub.load('ultralytics/yolov5', 'yolov5s', pretrained=True) ...
null
Projects/Aimbot Refined Rebuilt Edition/Aimbot8.py
Aimbot8.py
py
2,193
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.hub.load", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.hub", "line_number": 11, "usage_type": "attribute" }, { "api_name": "mss.mss", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.array", "line_number"...
4322807
from django.db import models from django.conf import settings from django.utils.translation import gettext_lazy as _ def _get_uuid(): import uuid return uuid.uuid4() class BaseModel(models.Model): class Meta: abstract = True created = models.DateTimeField( _('created at'), a...
null
md_erp/core/models.py
models.py
py
632
python
en
code
null
code-starcoder2
66
[ { "api_name": "uuid.uuid4", "line_number": 8, "usage_type": "call" }, { "api_name": "django.db.models.Model", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 11, "usage_type": "name" }, { "api_name": "django.db.mode...
624768375
# testing filereader import numpy as np import scipy import scipy.linalg def populate(rows,cols,coef=10): return np.random.random(size=(rows,cols)) * coef def stringify(elem): flat = elem.flatten() lst = [str(x) for x in flat.tolist()] s = ','.join(lst) return s def prefix(mtx): r,c = mtx.shape[0],mtx.s...
null
test/test.py
test.py
py
2,065
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.random.random", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numpy.cov", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.linalg.cholesky...
87519749
from django import forms from dataimport.models import * from .models import * from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit class ReserveForm(forms.ModelForm): class Meta: model = Orders fields = '__all__' widgets = { 'order_createdate' : forms.DateInput(attrs={'type': '...
null
Project/reservation/forms.py
forms.py
py
1,573
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.forms.ModelForm", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 8, "usage_type": "name" }, { "api_name": "django.forms.DateInput", "line_number": 13, "usage_type": "call" }, { "api_name": "django....
614173615
import requests import collections import logbook import time MovieResult = collections.namedtuple( 'MovieResult', 'imdb_code,title,director,keywords,duration,genres,rating,year,imdb_score' ) api_log = logbook.Logger('API') def find_movies(search_text): t0 = time.time() api_log.trace(f'Starting sear...
null
D31/api.py
api.py
py
1,026
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.namedtuple", "line_number": 6, "usage_type": "call" }, { "api_name": "logbook.Logger", "line_number": 11, "usage_type": "call" }, { "api_name": "time.time", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.get", "li...
335251936
#!/usr/bin/python """ Copyright (c) 2015 Finn Ellis, licensed under the MIT License. (See accompanying LICENSE file for details.) The functions in this file are based on Bart Massey's pseudocode: https://github.com/BartMassey/ciphersaber2 """ import random import time # Use OS-provided randomness instead of only s...
null
ciphersaber2.py
ciphersaber2.py
py
6,499
python
en
code
null
code-starcoder2
66
[ { "api_name": "random.SystemRandom", "line_number": 16, "usage_type": "call" }, { "api_name": "time.clock", "line_number": 16, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 184, "usage_type": "call" } ]
552421946
import sqlite3 import urllib.error import ssl from urllib.parse import urljoin from urllib.parse import urlparse from urllib.request import urlopen from bs4 import BeautifulSoup # Ignore SSL certificate errors ctx = ssl.create_default_context() ctx.check_hostname = False ctx.verify_mode = ssl.CERT_NONE c...
null
Web_Spider/Crawler.py
Crawler.py
py
4,238
python
en
code
null
code-starcoder2
66
[ { "api_name": "ssl.create_default_context", "line_number": 10, "usage_type": "call" }, { "api_name": "ssl.CERT_NONE", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sqlite3.connect", "line_number": 14, "usage_type": "call" }, { "api_name": "urllib....
191121366
# kong_hmac.py import base64 import hashlib import hmac import re from wsgiref.handlers import format_date_time from datetime import datetime from time import mktime def create_date_header(): now = datetime.now() stamp = mktime(now.timetuple()) return format_date_time(stamp) def get_headers_string(sign...
null
kong_hmac.py
kong_hmac.py
py
3,222
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.now", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "name" }, { "api_name": "time.mktime", "line_number": 14, "usage_type": "call" }, { "api_name": "wsgiref.handlers....
345799233
# coding=utf-8 import requests from bs4 import BeautifulSoup import re def scan(url, domain, page, Cookie): headers = {'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36',\ 'Host': 'www.baidu.com', 'Connection...
null
scan.py
scan.py
py
1,422
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 16, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 22, "usage_type": "call" } ]
162563397
#!/usr/bin/env python # -*- coding:utf-8 -*- from flask import jsonify, request,url_for, current_app, g from ..models import Video, User, Comment, Video_topic from . import api, jsonify_success from .authentication import auth from app import db from .errors import unauthorized, forbidden import time, json from json.d...
null
app/api/videos.py
videos.py
py
4,695
python
en
code
null
code-starcoder2
66
[ { "api_name": "errorCode.errorCode", "line_number": 13, "usage_type": "name" }, { "api_name": "flask.request.args.get", "line_number": 57, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 57, "usage_type": "attribute" }, { "api_name": "fl...
77738539
# -*- coding: utf-8 -*- from bs4 import BeautifulSoup import pandas as pd import zipfile, sys """ Beta Build ---------- For the purposes of the CMD beta we've combined bearly all NPP data into a single dataset. We have not used cross border rates. We have also ended the age ranges at 104, as there are c...
null
National Population Projections/natPP.py
natPP.py
py
7,292
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.DataFrame.from_dict", "line_number": 116, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 116, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame", "line_number": 166, "usage_type": "call" }, { "api_name": "...
379799972
from __future__ import annotations import typing from typing import Any, Optional, Dict, List, Union, Optional from dataclasses import asdict try: from typing import Literal except ImportError: from typing_extensions import Literal #type: ignore if typing.TYPE_CHECKING: from dataclasses import dataclass ...
null
haystack/schema.py
schema.py
py
23,967
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 12, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 27, "usage_type": "call" }, { "api_name": "pydantic.BaseConfig.arbitrary_types_allowed", "line_number": 31, "usage_type": "attribute" ...
180543732
from django.http.request import HttpRequest import json import time import hashlib from datetime import datetime, timedelta, date import pytz from .settings import ISO8601 import requests import os import logging logger = logging.getLogger('tropo_outcall') def get_client_ip_address(request): """ :param HttpR...
null
packages/tropo/utils.py
utils.py
py
19,694
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "hashlib.sha1", "line_number": 33, "usage_type": "call" }, { "api_name": "time.time", "line_number": 33, "usage_type": "call" }, { "api_name": "hashlib.sha1", "line_num...
424595982
from __future__ import division import pandas as pd import os import numpy as np import sys import cPickle as pickle import loadmat import pdb from scipy import stats def shadeplots_elecs_stats(): """ calculates mean, peak, latency, and std per trial for all electrodes in an active cluster - added medians and...
null
ShadePlots/ShadePlots_elecs_stats.py
ShadePlots_elecs_stats.py
py
12,448
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.join", "line_nu...
470917649
import torch import torch.nn as nn import torch.optim as optim from modules.net.feature_extractors import ResNet50 from modules.net.classifiers import SimpleFeatureClassifier device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu') class SrcOnly(object): def __init__(self, class_num=31, alpha=1.0,...
null
model/srconly.py
srconly.py
py
2,269
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.device", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 8, "usage_type": "attribute" }, { "api_name": "modules.net.feature...
169321987
# Copyright (c) 2021 Mira Geoscience Ltd. # # This file is part of geoapps. # # geoapps is distributed under the terms and conditions of the MIT License # (see LICENSE file at the root of this source code package). import numpy as np from geoh5py.io import H5Writer from geoh5py.objects import Curve, Grid2D from ge...
null
geoapps/processing/edge_detection.py
edge_detection.py
py
12,008
python
en
code
null
code-starcoder2
66
[ { "api_name": "geoapps.plotting.PlotSelection2D", "line_number": 31, "usage_type": "name" }, { "api_name": "geoh5py.objects.Grid2D", "line_number": 60, "usage_type": "name" }, { "api_name": "ipywidgets.Button", "line_number": 64, "usage_type": "call" }, { "api_nam...
78926154
from typing import Callable import jax.numpy as jnp from jax.scipy.linalg import solve_triangular from multipledispatch import dispatch from ..gps import SpectralPosterior from ..types import Dataset from ..utils import I, concat_dictionaries @dispatch(SpectralPosterior) def marginal_ll( gp: SpectralPosterior, ...
null
gpjax/objectives/spectral.py
spectral.py
py
1,536
python
en
code
null
code-starcoder2
66
[ { "api_name": "gps.SpectralPosterior", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Callable", "line_number": 15, "usage_type": "name" }, { "api_name": "types.Dataset", "line_number": 18, "usage_type": "name" }, { "api_name": "utils.concat_dict...
417122940
# -*- coding: UTF-8 -*- #开发一个日志系统, 既要把日志输出到控制台, 还要写入日志文件 import logging import logging.handlers class Logger(): #def __init__(self, logname, loglevel, logger): def __init__(self): logger='searchPrint' logfile='googleResult.txt' # 创建一个logger self.logger = logging.getL...
null
googleSearch/loggergoogle.py
loggergoogle.py
py
1,399
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 14, "usage_type": "attribute" }, { "api_name": "logging.handlers.TimedRotatingFileHandler", "line_number": 17, "usage_type": "call" }, { "ap...
90947068
import git import tempfile import os import uuid from shutil import copyfile from pathlib import Path, PureWindowsPath uid = str(uuid.uuid4()) #PATH_OF_GIT_REPO = os.path.join(tempfile.gettempdir(), uid) folder = os.path.join(os.path.dirname(__file__)) PATH_OF_GIT_REPO = os.path.join(folder, uid) COMMIT_MESSAGE = '[AU...
null
test.py
test.py
py
2,865
python
en
code
null
code-starcoder2
66
[ { "api_name": "uuid.uuid4", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_numbe...
461921011
import heapq, time import random import pygame BLACK = ( 0, 0, 0) WHITE = ( 255, 255, 255) GREEN = ( 0, 255, 0) RED = ( 255, 0, 0) BLUE = ( 0, 0, 255) YELLOW = ( 255, 255, 153) #-- ORANGE = (255, 165, 0) width = 25 height = 25 margin = 1 ##size = [708, 708] size = [(21*26)+1, (...
null
Arena_wPlayer.py
Arena_wPlayer.py
py
7,467
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.display.set_mode", "line_number": 19, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 19, "usage_type": "attribute" }, { "api_name": "heapq.heapify", "line_number": 39, "usage_type": "call" }, { "api_name": "pygame.disp...
168002597
#Takes care of travelling through the path in our dragram. from connection import Connection from packet import Packet import sys import time import logging class Pipe: DEFAULT_SEQUENCE_START = 1000 DEFAULT_ACK_START = 2000 MAX_CONTER_NUMBER = sys.maxint # CONNECTION_TIMEOUT = 3 CONNECTION_TIMEOU...
null
Code/pipe.py
pipe.py
py
2,530
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.maxint", "line_number": 13, "usage_type": "attribute" }, { "api_name": "logging.debug", "line_number": 33, "usage_type": "call" }, { "api_name": "time.time", "line_number": 37, "usage_type": "call" }, { "api_name": "time.time", "line_number"...
561221307
# Identify Coins # Asante and Maddy count some coins: import cv2 import numpy as np from scipy import ndimage import scipy.misc import matplotlib.pyplot as plt import picamera import AM_func as am ###################################################### # Read in comparision table ComTab =np.loadtxt("Com_Tab_write2.txt"...
null
IdentifyF.py
IdentifyF.py
py
3,759
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.loadtxt", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 26, "usage_type": "call" }, { "api_name": "cv2.split", "line_number": 27...
5759266
# -*- encoding:utf-8 -*- from qiniu import Auth,put_file,etag,BucketManager import qiniu.config import os,sys import wx,re from distutils.core import setup import py2exe class Frame(wx.Frame): def __init__(self,parent=None,id=-1,title="Hello"): wx.Frame.__init__(self,parent,id,title) self.panel=wx....
null
image.py
image.py
py
3,567
python
en
code
null
code-starcoder2
66
[ { "api_name": "wx.Frame", "line_number": 9, "usage_type": "attribute" }, { "api_name": "wx.Frame.__init__", "line_number": 11, "usage_type": "call" }, { "api_name": "wx.Frame", "line_number": 11, "usage_type": "attribute" }, { "api_name": "wx.Panel", "line_num...
630967240
import numpy as np import pandas as pd import matplotlib.pyplot as plt import os from website import settings def message_by_year_graph(): path = settings.MEDIA_ROOT messages = pd.read_csv(os.path.join(path, "csv/messageboards.csv")) messages['creator.created_at'].head() messages.info() messages...
null
scripts/message_by_year.py
message_by_year.py
py
2,398
python
en
code
null
code-starcoder2
66
[ { "api_name": "website.settings.MEDIA_ROOT", "line_number": 9, "usage_type": "attribute" }, { "api_name": "website.settings", "line_number": 9, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "os.pa...
489621610
from django.conf.urls import include, url from django.template.response import TemplateResponse class DjgWebViews: """ Implementation of web rendering under host/djgweb/... """ def __init__(self): self.base_context = dict( site_title='Djgweb Site', site_header='Djgweb',...
null
djgweb/views.py
views.py
py
1,155
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.url", "line_number": 19, "usage_type": "call" }, { "api_name": "django.template.response.TemplateResponse", "line_number": 38, "usage_type": "call" } ]
96046136
#! /usr/bin/env python from scipy import linalg from sklearn.utils.extmath import safe_sparse_dot import numpy as np def randomized_krylov_svd(A, n_components, n_iter=8): m, n = A.shape # oversample a bit num_sample = n_components + 12 # Random block initialization G = np.random.normal(size=(A....
null
approx_svd/randomized_block_krylov.py
randomized_block_krylov.py
py
1,062
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.random.normal", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 15, "usage_type": "attribute" }, { "api_name": "scipy.linalg.qr", "line_number": 18, "usage_type": "call" }, { "api_name": "scipy.linalg", ...
154302351
from flask import Flask, render_template, request, flash, redirect, send_from_directory from tinydb import TinyDB import functools import os app = Flask(__name__) db = TinyDB('database.json') tabela = db.table("investimentos") app.secret_key = 'some_secret' @app.route('/favicon.ico') def favicon(): return send_...
null
app.py
app.py
py
1,543
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "tinydb.TinyDB", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.send_from_directory", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", ...
445778914
__author__ = 'glucero' import argparse from rest.app import app from bottle import debug as bottle_debug from helpers.status import setLogger, setLoggerInfo from paste import httpserver def main(): # Parser arguments parser = argparse.ArgumentParser() parser.add_argument('--host', required=False, defaul...
null
server_app.py
server_app.py
py
809
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "helpers.status.setLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "bottle.debug", "line_number": 24, "usage_type": "call" }, { "api_name": "paste.h...
206068764
# -*- coding: utf-8 -*- """ Created on Sun Nov 9 21:07:46 2014 @author: alejandro """ import matplotlib.pyplot as plt from RLC import RLCcircuit # Import RLCcircuit class circuit1 = RLCcircuit(1, 1, 1, 0, 0) # Arguments: resistence in ohms, # inductance in henries, capacitance in Faradies, initial current...
null
Main.py
Main.py
py
1,212
python
en
code
null
code-starcoder2
66
[ { "api_name": "RLC.RLCcircuit", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplot", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 22, "usage_type": "name" }, { "api_name": "matplotlib...
588600978
"""pters URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-base...
null
pters_project/configs/urls.py
urls.py
py
3,605
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.url", "line_number": 24, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 25, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 26, "usage_type": "call" }, { "api_name": "django...
267550488
from django.shortcuts import render, redirect from django.http import HttpResponse, Http404 from .models import Posts, PostDetails from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required from .forms import CreateBlogpostForm, SearchForm from django.db.models import Q fro...
null
blogWebsite/blog/views.py
views.py
py
4,413
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.Posts.objects.all", "line_number": 22, "usage_type": "call" }, { "api_name": "models.Posts.objects", "line_number": 22, "usage_type": "attribute" }, { "api_name": "models.Posts", "line_number": 22, "usage_type": "name" }, { "api_name": "math....
43882540
import json import subprocess import os from copy import copy from tempfile import NamedTemporaryFile ZOOKEEPER_ADDRESS = '192.168.100.3:2181' def calculate_ranges(integer, num_ranges): overall_range = (2, integer // 2) overall_difference = overall_range[1] - overall_range[0] segment_difference = overall_...
null
verify_prime_map_reduce/start.py
start.py
py
2,422
python
en
code
null
code-starcoder2
66
[ { "api_name": "copy.copy", "line_number": 47, "usage_type": "call" }, { "api_name": "copy.copy", "line_number": 54, "usage_type": "call" }, { "api_name": "tempfile.NamedTemporaryFile", "line_number": 64, "usage_type": "call" }, { "api_name": "json.dumps", "lin...
302002152
import enchant, json import numpy from random import randint, shuffle from player import Player import copy global_words_on_board = [] class Game: def __init__(self, ID, players=None): """ Initializes an instance of the Game class. :param board: board object :param players: set of ...
null
Final Implementation/game.py
game.py
py
13,197
python
en
code
null
code-starcoder2
66
[ { "api_name": "enchant.Dict", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 55, "usage_type": "call" }, { "api_name": "player.client_host_id", "line_number": 126, "usage_type": "attribute" }, { "api_name": "player.client_ho...
142288596
# -*- coding: utf-8 -*- import logging import jsonstruct from django.http import HttpResponse from django.template import loader from django.views.decorators.http import require_http_methods import apps.auth.service as auth_service from apps.common.constant.etc import HttpRequest logger = logging.getLogger("logger.d...
null
apps/auth/controller.py
controller.py
py
1,123
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "django.template.loader.get_template", "line_number": 17, "usage_type": "call" }, { "api_name": "django.template.loader", "line_number": 17, "usage_type": "name" }, { "api_...
437913135
# utf-8 from easyquant import RedisIo from easyquant.indicator.base import * from ctypes import * # cdll, c_int import numpy as np import pandas as pd lib = cdll.LoadLibrary('./easyquant/czsc_cpp/czsc.so') r=RedisIo('redis.conf') # addBuf = lib.addBuf # func2=lib.Func2 a1=r.get_day_df('000001', startpos=1000) ncoun...
null
czsc.py
czsc.py
py
4,083
python
en
code
null
code-starcoder2
66
[ { "api_name": "easyquant.RedisIo", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 26, "usage_type": "attribute" }, { "api_name": "numpy.asarray", ...
451513351
import argparse import math import time import sys import os import random import chainer import chainer.functions as cf import cupy import numpy as np from chainer.backends import cuda sys.path.append(os.path.join("..", "..", "..")) import gqn sys.path.append(os.path.join("..")) from hyperparams import HyperParamet...
null
generative_query_network/run/train_rooms_and_shepard-matzler/experiments/diferent_distribution.py
diferent_distribution.py
py
10,527
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.append", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number...
15941529
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
null
vsts/vsts/build/v4_1/models/folder.py
folder.py
py
2,329
python
en
code
null
code-starcoder2
66
[ { "api_name": "msrest.serialization.Model", "line_number": 12, "usage_type": "name" } ]
180281631
from __future__ import print_function import argparse import os import numpy as np from PIL import Image import torch from torch.utils import data import torch.backends.cudnn as cudnn import torch.optim as optim from torch import nn import torchvision.utils as vutils from torch.autograd import Variable import torch.nn....
null
evaluate.py
evaluate.py
py
4,279
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 22, "usage_type": "call" }, { "api_name": "os.makedirs", "line_number": 34, "usage_type": "call" }, { "api_name": "LoadData.loader", "line_number": 39, "usage_type": "call" }, { "api_name": "LoadData.Dataset_...
228035352
from django.urls import path from . import views urlpatterns = [ path("", views.home, name="index"), path("about/", views.about, name="aboutus"), path("contact/", views.contact, name="contact"), path("blogpost/<int:id>", views.blogpost, name="blogpost"), ] #path("blogpost/<int:id>", views.blogp...
null
cms/hub/urls.py
urls.py
py
343
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", ...
17021646
""" Created on Nov 15, 2016 @author: jvazquez """ import logging from flask import g logger = logging.getLogger(__name__) def clean_up_mongo_db(response): if hasattr(g, "db_mongo") is True: logger.info("Closing a mongo db instance connection") g.db_mongo.close() return response
null
utils/helpers/tenant/cleanup.py
cleanup.py
py
308
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.g", "line_number": 14, "usage_type": "argument" }, { "api_name": "flask.g.db_mongo.close", "line_number": 16, "usage_type": "call" }, { "api_name": "flask.g.db_mongo...
540666094
# Databricks notebook source # MAGIC %md # MAGIC # Maple Lake "stabilization" helper notebook # COMMAND ---------- # MAGIC %run ../../includes/ml_helper_v2_settings # COMMAND ---------- from datetime import datetime from pyspark.sql.types import * from pyspark.sql.functions import * print("loading ml_XTL_v2_helpe...
null
C1-SIT3/edw_intg/maplelake/ml_utilities/includes/ml_XTL_v2_helper.py
ml_XTL_v2_helper.py
py
9,863
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.strptime", "line_number": 33, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 33, "usage_type": "name" }, { "api_name": "datetime.datetime.strptime", "line_number": 35, "usage_type": "call" }, { "api_name"...
261110048
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('dbuck', '0005_features'), ] operations = [ migrations.AddField( model_name='features', name='rlt', ...
null
dbuck/migrations/0006_features_rlt.py
0006_features_rlt.py
py
432
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AddField", "line_number": 14, "usage_type": "call" }, { ...
337701073
import numpy as np import math as math import matplotlib.pyplot as plt import scipy as sci import seaborn as sns from typing import Tuple, Optional import pandas as pd from krdiff.old_icaros_IC import hist2d_profile #from krcal.core.histo_functions import h1, h1d, h2, h2d, plot_...
null
krdiff/fit_diffusion.py
fit_diffusion.py
py
24,822
python
en
code
null
code-starcoder2
66
[ { "api_name": "seaborn.set", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 45, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 94, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 146...
306568103
"""empty message Revision ID: 1faa55d5c85d Revises: 36247dc133f7 Create Date: 2020-01-28 06:25:53.139188 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '1faa55d5c85d' down_revision = '36247dc133f7' branch_labels = None depends_on = None def upgrade(): # ...
null
migrations/versions/1faa55d5c85d_.py
1faa55d5c85d_.py
py
982
python
en
code
null
code-starcoder2
66
[ { "api_name": "alembic.op.create_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...
53993863
""" There are several different types of events. There are contestable events which occur when a player makes a decision that can be contested by another player. There are incontestable events that cannot be contested, only resolved. Contestable events require resolution from every player, whether it is simply an acce...
null
gamebot/coup/game.py
game.py
py
7,139
python
en
code
null
code-starcoder2
66
[ { "api_name": "gamebot.game.BaseGame", "line_number": 40, "usage_type": "name" }, { "api_name": "gamebot.coup.events.EventQueue", "line_number": 57, "usage_type": "call" }, { "api_name": "gamebot.coup.influence.contessa", "line_number": 61, "usage_type": "name" }, { ...
378082832
#!/usr/bin/env python import rospy from sensor_msgs.msg import LaserScan from geometry_msgs.msg import Twist, Point from nav_msgs.msg import Odometry from tf import transformations import math # robot state variables position_mobilebot = Point() yaw_mobilebot = 0 # mobilebot state state_mobielebot = 0 # goal desired...
null
mobilebot_control/scripts/go_to_point.py
go_to_point.py
py
3,606
python
en
code
null
code-starcoder2
66
[ { "api_name": "geometry_msgs.msg.Point", "line_number": 12, "usage_type": "call" }, { "api_name": "geometry_msgs.msg.Point", "line_number": 17, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 22, "usage_type": "attribute" }, { "api_name": "geometry...
335886530
from gardena.base_gardena_class import BaseGardenaClass class BaseGardenaAbilityClass(BaseGardenaClass): """Base class for Gardena devices""" abilities = {} def __init__(self, smart_system=None, location=None): """Constructor, create instance of a gardena location""" super(BaseGardenaAbi...
null
src/gardena/devices/abilities/base_gardena_ability_class.py
base_gardena_ability_class.py
py
2,920
python
en
code
null
code-starcoder2
66
[ { "api_name": "gardena.base_gardena_class.BaseGardenaClass", "line_number": 4, "usage_type": "name" } ]
251554942
#! /usr/bin/env python3 """ usage: bactopia tools summary [-h] [--gold_coverage FLOAT] [--gold_quality INT] [--gold_read_length INT] [--gold_contigs INT] [--silver_coverage FLOAT] [--silver_quality INT] ...
null
tools/summary/bin/bactopia-summary.py
bactopia-summary.py
py
25,941
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.dirname", "line_number": 84, "usage_type": "call" }, { "api_name": "os.path", "line_number": 84, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 84, "usage_type": "call" }, { "api_name": "logging.addLevelName", ...
52689390
from __future__ import print_function import numpy as np from scipy.spatial import distance a = [10,10,20,20] b = [5,15,11,50] c = [] c.append(a) c.append(b) print(c) tt = np.array(c) print(tt[0:2,0:3]) '''Determine if two rectangles overlap each other''' def intersect(a,b): if a[0] > b[2] or a[2] < b[0] or a...
null
test.py
test.py
py
1,116
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.array", "line_number": 14, "usage_type": "call" }, { "api_name": "scipy.spatial.distance.euclidean", "line_number": 30, "usage_type": "call" }, { "api_name": "scipy.spatial.distance", "line_number": 30, "usage_type": "name" }, { "api_name": "n...
602237233
import json from matplotlib import pyplot as plt def main(file_path): with open(file_path, 'r') as data_file: data_dict = json.load(data_file) account = data_dict['account'] cash = account['cash'] total_value = account['total value'] times = account['times'] positions = account['posit...
null
tests/post_processing_test.py
post_processing_test.py
py
478
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.load", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 15, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.s...
341611155
#!/usr/bin/python import unittest import tempfile import os import unittest_base import sys import shutil import xenapi_mock from autocertkit import utils from datetime import datetime utils.configure_logging('ack_tests') K = 1024 M = K * 1024 G = M * 1024 class ExpressionMatchingTests(unittest_base.DevTestCase): ...
null
autocertkit/tests/utils_tests.py
utils_tests.py
py
8,519
python
en
code
null
code-starcoder2
66
[ { "api_name": "autocertkit.utils.configure_logging", "line_number": 13, "usage_type": "call" }, { "api_name": "autocertkit.utils", "line_number": 13, "usage_type": "name" }, { "api_name": "unittest_base.DevTestCase", "line_number": 19, "usage_type": "attribute" }, { ...
482749483
import json import logging from django.db import models from django.db.models import QuerySet from data_portal.models.base import PortalBaseManager, PortalBaseModel from data_portal.models.labmetadata import LabMetadata from data_portal.models.sequencerun import SequenceRun logger = logging.getLogger(__name__) cla...
null
data_portal/models/fastqlistrow.py
fastqlistrow.py
py
4,129
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "data_portal.models.base.PortalBaseManager", "line_number": 14, "usage_type": "name" }, { "api_name": "django.db.models.QuerySet", "line_number": 17, "usage_type": "name" }, { ...
654252920
from abc import ABC, abstractmethod import logging import requests import json class BaseParserApi(ABC): logger = logging.getLogger(__name__) def __init__(self, fio, inn, ogrn, name): self.domain = 'http://81.177.175.19:8080' self.fio = fio self.inn = inn self.ogrn = ogrn ...
null
passport_app/data_sources/parserApi/BaseParserApi.py
BaseParserApi.py
py
1,432
python
en
code
null
code-starcoder2
66
[ { "api_name": "abc.ABC", "line_number": 7, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "abc.abstractmethod", "line_number": 23, "usage_type": "name" }, { "api_name": "abc.abstractmethod", "...
236554854
""" Async Yadacoin node poc """ import importlib import pkgutil import json import logging import os import ssl import ntpath from asyncio import sleep as async_sleep from hashlib import sha256 from logging.handlers import RotatingFileHandler from os import path from sys import exit, stdout from time import time impor...
null
tnode.py
tnode.py
py
11,311
python
en
code
null
code-starcoder2
66
[ { "api_name": "tornado.web.Application", "line_number": 52, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 55, "usage_type": "call" }, { "api_name": "os.path", "line_number": 55, "usage_type": "name" }, { "api_name": "os.path.dirname", "l...
638667730
from __future__ import unicode_literals from django.forms import ModelForm, TextInput, CheckboxSelectMultiple from apps.banners.models import Banner from apps.pages.models import Page class BannerForm(ModelForm): class Meta: model = Banner fields = '__all__' widgets = { 'redir...
null
apps/banners/forms.py
forms.py
py
605
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.forms.ModelForm", "line_number": 7, "usage_type": "name" }, { "api_name": "apps.banners.models.Banner", "line_number": 9, "usage_type": "name" }, { "api_name": "django.forms.TextInput", "line_number": 13, "usage_type": "call" }, { "api_name":...
233335871
# -*- coding: utf-8 -*- import cv2 import numpy as np def nothing(x): pass mousePosX = 0 mousePosY = 0 mouseClick = () mouseRelease = () leftClick = False def mouse_event(event, x, y, flags, param): global mousePos, mouseClick, mouseRelease, leftClick # if event == cv2.EVENT_MOUSEMOVE: # mouseP...
null
PersonalOpenCVProject/Project9.py
Project9.py
py
2,342
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.EVENT_LBUTTONDOWN", "line_number": 20, "usage_type": "attribute" }, { "api_name": "cv2.EVENT_LBUTTONUP", "line_number": 25, "usage_type": "attribute" }, { "api_name": "cv2.namedWindow", "line_number": 32, "usage_type": "call" }, { "api_name": "c...
429746573
import os from flask import Flask from flask import render_template from flask_injector import FlaskInjector from app.providers.fam import FamProvider from app.providers.couchdb import CouchDBProvider from app.providers.user import UserCouchDBProvider from app.providers.user import UserFamProvider from app.providers....
null
app/main.py
main.py
py
1,357
python
en
code
null
code-starcoder2
66
[ { "api_name": "app.providers.fam", "line_number": 17, "usage_type": "name" }, { "api_name": "flask.Flask", "line_number": 17, "usage_type": "call" }, { "api_name": "app.providers.fam.config.from_mapping", "line_number": 19, "usage_type": "call" }, { "api_name": "a...
630860517
from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.action_chains import ActionChains from datet...
null
stocksdata.py
stocksdata.py
py
2,461
python
en
code
null
code-starcoder2
66
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 8, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 8, "usage_type": "name" }, { "api_name": "datetime.date", "line_number": 12, "usage_type": "call" }, { "api_name": "selenium.web...
62898442
import torch import torch.nn as nn import numpy as np def triplet_loss(emb_anchor, emb_positive, emb_negative, margin = 0.2): max_fn = nn.ReLU() positive_pair_loss = torch.sum((emb_anchor - emb_positive)**2, dim = 1) negative_pair_loss = torch.sum((emb_anchor - emb_negative)**2, dim = 1) loss = max_fn(margin + p...
null
loss_functions.py
loss_functions.py
py
7,102
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn.ReLU", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.sum", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.sum", "line_number": 9, "...
477714298
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net) # # This software is licensed under the "BSD" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licenses/bsd_license import sys import SimpleXMLRPCServer ...
null
modpythonhandler.py
modpythonhandler.py
py
1,217
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.basicConfig", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 16, "usage_type": "attribute" }, { "api_name": "SimpleXMLRPCServer.SimpleXMLRPCDispatcher", "line_number": 22, "usage_type": "call" }, { "a...
566760413
from django.db import models from django.utils import timezone from UserManagement.models import Contact class Landlord(models.Model): contact = models.ForeignKey( Contact, on_delete=models.CASCADE, # think about blank and null ) tenancy_services_id = models.CharField( max...
null
property_listing/models.py
models.py
py
4,486
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.models.Model", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 6, "usage_type": "name" }, { "api_name": "django.db.models.ForeignKey", "line_number": 7, "usage_type": "call" }, { "api_name": ...
458336580
import os import sys from chalice import Chalice pkg_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "chalicelib")) # noqa sys.path.insert(0, pkg_root) # noqa from cloudfront_invalidator.cloudfront import get_cloudfront_distribution, invalidate_distributions app = Chalice(app_name="cloudfront_inval...
null
backend/chalice/cloudfront_invalidator/app.py
app.py
py
768
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.abspath", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_nu...
463867926
# Yelp DLA project step 4, version 2 # Created by Heejo Clare Keum import nltk import nltk.corpus from nltk.collocations import * import mysql.connector from mysql.connector import errorcode import collections # Step4.1 is already completed from Step 2 # Please look at step2.py # Step4.1: counts the number of times a g...
null
step4v2.py
step4v2.py
py
13,575
python
en
code
null
code-starcoder2
66
[ { "api_name": "mysql.connector.connector.connect", "line_number": 17, "usage_type": "call" }, { "api_name": "mysql.connector.connector", "line_number": 17, "usage_type": "attribute" }, { "api_name": "mysql.connector", "line_number": 17, "usage_type": "name" }, { "...
541240185
import matplotlib.pyplot as plt import numpy as np fig, axes = plt.subplots(nrows=1, ncols=2) plt.tight_layout() x = np.linspace(0, 5, 11) y = x ** 2 axes[0].plot(x, y) axes[1].plot(y, x) fig = plt.figure(figsize=(4, 4)) axes = fig.add_axes([0, 0, 1, 1]) axes.plot(x, y, label='X Sqaured') axes.plot(y, x, label='X Cub...
null
dataSciencePackage/matplotLibPackage/matplotLibPart2.py
matplotLibPart2.py
py
389
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 4, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.tight_layout", "line_number": 5, "usage_type": "call" }, { "api_name...
303451470
from django.urls import path from . import views app_name='rostertools' urlpatterns = [ path('', views.RosterListView.as_view(), name='index'), path('roster/<int:pk>/', views.RosterDetailView.as_view(), name='view roster'), path('users/', views.UsersListView.as_view(), name='users'), path('users/<str:u...
null
rostertools/urls.py
urls.py
py
446
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
174004481
import shutil import sqlite3 from datetime import datetime from os import listdir import os import csv import pymongo import pandas as pd import json from application_logging.logger import App_Logger from datetime import datetime as dt from logs_insertion_to_db.training_log_insertion_to_db import training_log_insertion...
null
DataTypeValidation_Insertion_Prediction/DataTypeValidationPrediction.py
DataTypeValidationPrediction.py
py
7,444
python
en
code
null
code-starcoder2
66
[ { "api_name": "logs_insertion_to_db.training_log_insertion_to_db.training_log_insertion_to_db", "line_number": 29, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 83, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 83, ...
407668080
from ortools.linear_solver import pywraplp def main(): data = [ ['qegy', 0, 1, 0, 1, 0], ['qketto', 1, 1, 1, 1, 0], ['qharom', 1, 1, 1, 1, 1], ['qnegy', 0, 0, 0, 0, 0], ['qot', 0, 0, 1, 0, 1] ]; nutrients = [ ['egy', 2], ['ketto', 2], ['harom...
null
CPsolver.py
CPsolver.py
py
1,932
python
en
code
null
code-starcoder2
66
[ { "api_name": "ortools.linear_solver.pywraplp.Solver", "line_number": 20, "usage_type": "call" }, { "api_name": "ortools.linear_solver.pywraplp", "line_number": 20, "usage_type": "name" } ]
319029271
import sys import operator import random import math import numpy as np sys.path.insert(0, '../bomberman') # Import necessary stuff from entity import CharacterEntity from entity import AIEntity from entity import MovableEntity from colorama import Fore, Back, Style, init from sensed_world import SensedWorld from even...
null
Bomberman/groupNN/scenario1/qlearning_good.py
qlearning_good.py
py
11,100
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.insert", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "colorama.init", "line_number": 15, "usage_type": "call" }, { "api_name": "entity.CharacterEntity", ...
545382456
""" HDF5 file writing """ from __future__ import annotations import typing as T from pathlib import Path from datetime import datetime import logging import h5py import numpy as np import xarray from ..utils import datetime2stem, to_datetime CLVL = 3 # GZIP compression level: larger => better compression, slower t...
null
src/gemini3d/hdf5/write.py
write.py
py
9,655
python
en
code
null
code-starcoder2
66
[ { "api_name": "pathlib.Path", "line_number": 20, "usage_type": "name" }, { "api_name": "xarray.Dataset", "line_number": 20, "usage_type": "attribute" }, { "api_name": "logging.info", "line_number": 32, "usage_type": "call" }, { "api_name": "h5py.File", "line_n...
620133420
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('todo', '0010_todo_score'), ] operations = [ migrations.AddField( model_name='todo', name='difficulty...
null
apps/todo/migrations/0011_auto_20160227_2212.py
0011_auto_20160227_2212.py
py
1,184
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AddField", "line_number": 14, "usage_type": "call" }, { ...
477236929
from django import template register = template.Library() @register.filter(name='is_in_cart') def is_in_cart(product,cart): keys = cart.keys() # print('product',product) # print('cart',cart) for id in keys: if int(id) == product.id: return True return False @register....
null
index/templatetags/cart.py
cart.py
py
1,105
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.template.Library", "line_number": 3, "usage_type": "call" }, { "api_name": "django.template", "line_number": 3, "usage_type": "name" } ]
463899085
from typing import Dict, List, Any import faiss import logging import torch import torch.nn.functional as F import torch.nn.parallel import numpy as np import os from allennlp.data.vocabulary import Vocabulary from allennlp.models.model import Model from allennlp.modules import TextFieldEmbedder, Seq2SeqEncoder, FeedF...
null
models/multiatt/model_kv.py
model_kv.py
py
14,987
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.basicConfig", "line_number": 23, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 23, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 24, "usage_type": "call" }, { "api_name": "allennlp.mode...
389259157
#!/usr/bin/python # -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt from sklearn.decomposition import PCA def toy_example_pca(): rng = np.random.RandomState(1) X = np.dot(rng.rand(2, 2), rng.randn(2, 200)).T # do the plotting plt.scatter(X[:, 0], X[:, 1]) plt.xlabel('$x_1$', fontsize...
null
Lab5/src/pca_utils.py
pca_utils.py
py
1,899
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.random.RandomState", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.dot", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplo...
391001012
import os import boto3 import re import time import netaddr import utils from botocore.config import Config from botocore.exceptions import ClientError from utils import Global logger = utils.get_logger() class EC2: def __init__(self, aws, region): self.aws = aws self.region = region con...
null
lib/aws_EC2.py
aws_EC2.py
py
42,710
python
en
code
null
code-starcoder2
66
[ { "api_name": "utils.get_logger", "line_number": 11, "usage_type": "call" }, { "api_name": "botocore.config.Config", "line_number": 19, "usage_type": "call" }, { "api_name": "boto3.resource", "line_number": 20, "usage_type": "call" }, { "api_name": "boto3.client",...
321362124
# Copyright (C) 2016 G. H. Collin (ghcollin) # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. import tensorflow as tf import numpy as np import tables import tempfile import os import shutil import tqdm import tftables test_table_col_A_sha...
null
tftables_test.py
tftables_test.py
py
8,953
python
en
code
null
code-starcoder2
66
[ { "api_name": "fractions.gcd", "line_number": 22, "usage_type": "call" }, { "api_name": "tables.IsDescription", "line_number": 25, "usage_type": "attribute" }, { "api_name": "tables.UInt32Col", "line_number": 26, "usage_type": "call" }, { "api_name": "tables.Float...
583153055
# Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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 applicabl...
null
libra/admin_api/stats/stats_sched.py
stats_sched.py
py
7,721
python
en
code
null
code-starcoder2
66
[ { "api_name": "libra.openstack.common.log.getLogger", "line_number": 27, "usage_type": "call" }, { "api_name": "libra.openstack.common.log", "line_number": 27, "usage_type": "name" }, { "api_name": "oslo.config.cfg.CONF", "line_number": 32, "usage_type": "attribute" }, ...
198863621
import pandas as pd import numpy as np import matplotlib.pyplot as plt df_e = pd.read_csv("csv_files/nhits/eminus_10k_500MeV_nhits.csv") df_mu = pd.read_csv("csv_files/nhits/muminus_10k_500MeV_nhits.csv") csv_array_e = df_e.values csv_array_mu = df_mu.values n_hits_e = csv_array_e[:-1,0] n_thits_e = csv_array_e[:-1,...
null
nhits_hist.py
nhits_hist.py
py
602
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.hist", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplo...
537419249
import sys import os import json import stat import subprocess import platform if __name__ == '__main__': inputArgs = sys.argv mainScriptPath = inputArgs[0] tmpSimCenterDir = inputArgs[1] templateDir = inputArgs[2] runType = inputArgs[3] # either "runningLocal" or "runningRemote" # Change p...
null
backend/modules/performUQ/UCSD_UQ/processInputs.py
processInputs.py
py
1,528
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "platform.system", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number...
422503775
#!/usr/bin/env python3 import datetime import sys if len(sys.argv) != 2 or sys.argv[1] not in ['days','hours','minutes','seconds']: # usage print("USAGE ERROR: following the program name, \n") print("\t 'days' will return days.") print("\t 'hours' will return hours.") print("\t 'minutes' will ret...
null
OHSU_Spring_2019/CS527/HW3/end_of_year.py
end_of_year.py
py
1,246
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 6, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "attribute" }, { "api_name": "datetime.da...
507260821
import sys import time import logging import os import tempfile import shutil import unittest import rem_server import rem.context import rem.storages from rem.callbacks import ETagEvent LEAVE_WORK_DIR = bool(os.getenv('LEAVE_WORK_DIR', False)) CLOUD_TAGS_SERVER = 'nanny://47821a5802574cdf9e23db6d15ec9b0d@nanny.ya...
null
tests/test_18.py
test_18.py
py
17,080
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.getenv", "line_number": 17, "usage_type": "call" }, { "api_name": "tempfile.mkdtemp", "line_number": 27, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 29, "usage_type": "attribute" }, { "api_name": "shutil.rmtree", "line_...
582921739
# -*- coding:utf-8 -*- import json import pdfplumber import sys def format_digit(str_num): return None if str_num is None else str_num.replace(',', '') def parser_summary_item(cells): ''' ['TRANSACTION TYPE', 'PAID IN', 'PAID OUT'] ''' if cells[0] is not None and 'TRANSACTION' in cells[0].upper(): ...
null
parser_test/parser.py
parser.py
py
5,173
python
en
code
null
code-starcoder2
66
[ { "api_name": "pdfplumber.open", "line_number": 63, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 123, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 127, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_...
536457492
""" Tests for recipe APIs. """ import tempfile import os from PIL import Image from decimal import Decimal from django.contrib.auth import get_user_model from django.test import TestCase from django.urls import reverse from rest_framework import status from rest_framework.test import APIClient from core.models i...
null
app/recipe/tests/test_recipe_api.py
test_recipe_api.py
py
16,783
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.reverse", "line_number": 32, "usage_type": "call" }, { "api_name": "django.urls.reverse", "line_number": 37, "usage_type": "call" }, { "api_name": "django.urls.reverse", "line_number": 42, "usage_type": "call" }, { "api_name": "decimal.D...
476581324
import matplotlib.pyplot as plt import matplotlib.animation as animation import matplotlib matplotlib.rcParams['toolbar'] = 'None' img = plt.imread("map.jpg") fig, ax1 = plt.subplots() plt.subplots_adjust(left=0,bottom=0,right=1,top=1) figManager = plt.get_current_fig_manager() figManager.full_screen_toggle() def a...
null
LTM.py
LTM.py
py
1,141
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.rcParams", "line_number": 5, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 6, "usage_type": "name" }, { "api_name": "matp...
530044803
from datetime import datetime, timedelta from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin from django.shortcuts import redirect, render from django.views import View from report.models import Report class ReportIndex(LoginRequiredMixin, View): def get(self, request):...
null
report/views.py
views.py
py
1,616
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.auth.mixins.LoginRequiredMixin", "line_number": 11, "usage_type": "name" }, { "api_name": "django.views.View", "line_number": 11, "usage_type": "name" }, { "api_name": "report.models", "line_number": 15, "usage_type": "name" }, { "api...
651349169
""" 初始程序 -抓取猫眼电影top100 xpath 出来的都是列表 """ import requests from lxml import etree import time import random # from lxml import e class MaoYanSpider: def __init__(self): self.url = "https://trade.maoyan.com/board/4?offset={}" self.header = {'User-Agent':"Win7:Mozilla/5.0 " "(W...
null
Spider/day03/04_lxml.py
04_lxml.py
py
1,881
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "lxml.etree.HTML", "line_number": 22, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number": 22, "usage_type": "name" }, { "api_name": "time.sleep", "line_number...
138412683
from django import forms from .models import Product, Review class ProductChooseForm(forms.ModelForm): COLOURS = ( ("Black", "Black"), ("Blue", "Blue"), ("Grey", "Grey"), ("Red", "Red"), ("White", "White") ) colour = forms.ChoiceField(choices=COLOURS) class M...
null
products/forms.py
forms.py
py
725
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.forms.ModelForm", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 5, "usage_type": "name" }, { "api_name": "django.forms.ChoiceField", "line_number": 15, "usage_type": "call" }, { "api_name": "djang...