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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
276138230 | import asyncio
import sys
import socket
import os
import time
port = sys.argv[1]
dirs = '/Users/mario/IdeaProjects/pythonLearn/pytest/file/p1/server/'
if not os.path.exists(dirs):
os.makedirs(dirs)
async def echo(r, w):
msg = await r.read(1024)
addr = w.get_extra_info('peername')
print("Received %r f... | null | pytest/pytest_echoserver.py | pytest_echoserver.py | py | 1,187 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number... |
641150022 | from django.contrib import admin
from django.urls import path
from . import views
urlpatterns = [
path('<int:blog_id>',views.detail,name='detail'),
path('edit/<int:blog_id>',views.edit, name="edit"),
path('delete/<int:blog_id>',views.delete, name="delete"),
path('newblog/', views.blogpost, name="newblog... | null | blog/urls.py | urls.py | py | 436 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"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",
... |
522417123 | #!/usr/bin/env python3
from pydarknet import Detector, Image
import argparse
import cv2
import os
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Process an image.')
parser.add_argument('path', metavar='image_path', type=str, help='Path to source image')
parser.add_argument('output... | null | yolo_image.py | yolo_image.py | py | 1,423 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"li... |
601122953 | import logging
from backbone_server.errors.missing_key_exception import MissingKeyException
from backbone_server.errors.integrity_exception import IntegrityException
from backbone_server.study.gets import StudiesGet
from backbone_server.study.get import StudyGet
from backbone_server.study.put import StudyPut
from bac... | null | server/backbone_server/controllers/study_controller.py | study_controller.py | py | 2,455 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "backbone_server.controllers.base_controller.BaseController",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "backbone_server.study.gets.StudiesGet",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "backbone_server.study.get.StudyGet",
"line_n... |
386613464 | import django_tables2 as tables
from django.utils.safestring import mark_safe
from website.models import Instancia, Estudiante
class AsignaturasTable(tables.Table):
nombre = tables.Column(empty_values=())
carrera = tables.Column(accessor='asignatura.malla.carrera.nombre',
verbose_n... | null | website/tables.py | tables.py | py | 2,420 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django_tables2.Table",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django_tables2.Column",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django_tables2.Column",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "dj... |
3053519 | import numpy as np
from sklearn.datasets import load_boston
#1 데이터
dataset = load_boston()
x = dataset.data
y = dataset.target
# print(x.shape) # (506, 13)
# print(y.shape) # (506,)
# print('===================')
# print(x[:5])
# print(y[:10])
# print(np.max(x), np.min(x))
# print(dataset.feature_names)
# print(da... | null | keras/keras18_boston1.py | keras18_boston1.py | py | 1,640 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sklearn.datasets.load_boston",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.layers.Input",
"line_number": 25,
"usage_type": "ca... |
465589001 | import json
import sys, urllib.request as url
from html.parser import HTMLParser
#https://www.youtube.com/watch?v=ulzlXMZa8ak
#http://stackoverflow.com/questions/753052/strip-html-from-strings-in-python
#answer submitted by stackoverflow user eloff
class MLStripper(HTMLParser):
def __init__(self):
self.res... | null | Python/GetMapDirection.py | GetMapDirection.py | py | 1,522 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "html.parser.HTMLParser",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "html.parser",
"line_number": 21,
"usage_type": "argument"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "urllib.r... |
111141535 | import operator
from flask import abort, jsonify
from sqlalchemy.sql import func, case
from . import bp
from app import db
from app.models import (
Acceptance,
Author,
Barrel,
Batch,
Boil,
Btproduct,
Container,
Doctype,
Document,
Load,
Lot,
Manufacturer,
Manufacturer... | null | web/app/api/routes.py | routes.py | py | 6,422 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "app.models.Batch.get_name_date_plant_by_id",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "app.models.Batch",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "app.models.Product",
"line_number": 39,
"usage_type": "argument"
},
{
... |
150331567 | """
???+ note "Child classes which are `functionality`-by-`feature` products."
This could resemble template specialization in C++.
"""
from .functionality import (
BokehDataAnnotator,
)
from .feature import BokehForText
class BokehTextAnnotator(BokehDataAnnotator, BokehForText):
"""
???+ note "The tex... | null | hover/core/explorer/specialization.py | specialization.py | py | 910 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "functionality.BokehDataAnnotator",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "feature.BokehForText",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "feature.BokehForText.TOOLTIP_KWARGS",
"line_number": 16,
"usage_type": "attribute"
... |
418054407 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# BabyNames python coding exercise.
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
import sys
import re
import... | null | babynames.py | babynames.py | py | 1,980 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "re.findall",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_nu... |
506055926 | import random
import json
from websocket import create_connection
import time
import os
import stomper
from datetime import date
import timeout_decorator
import uuid
mac_address = '_'.join(['{:02x}'.format((uuid.getnode() >> ele) & 0xff) for ele in range(0,8*6,8)][::-1])
print(mac_address)
# import FakeRPi.GPIO as GP... | null | Scripts/ServiceScript.py | ServiceScript.py | py | 6,779 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "uuid.getnode",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO.setmode",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "RPi.GPIO.BCM",
"line_numbe... |
434556586 | from functools import partial
import torch
from torch import nn as nn
from torch.nn import functional as F
def conv3d(in_channels, out_channels, kernel_size, bias, padding):
"""
Create convolution layer
Inputs:
:param in_channels:
:param out_channels:
:param kernel_size:
... | null | model/layers.py | layers.py | py | 11,548 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.nn.Conv3d",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "torch.nn.ReLU",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": ... |
258592833 | #!/usr/bin/env python
import pystache
import os
import json
import codecs
import HTMLParser
API_DIR = "apis"
OUT_DIR = "aws-sdk"
def parse_operations(iterator_fn):
operations = []
for op_name, operation in iterator_fn():
if operation.get("deprecated") is not True:
doc = operation.get("do... | null | generate.py | generate.py | py | 3,533 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.listdir",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 88,
... |
368755387 | import numpy
import os
import shutil
import av
def load_video(
path=os.path.expanduser('/data/lisatmp4/dejoieti/data_colo/polyp_video_frames'),
crop=False,
data_augment=False,
split=[.5, .25],
normalize=False,
whiten=False,
rng=None,
nImg=None):
im_... | null | utils/VideoReading.py | VideoReading.py | py | 1,793 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.expanduser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
466058833 | #!/usr/bin/python
import urllib2
import xml.etree.ElementTree as ElementTree
import re
def refine_table(table):
result = table
result = re.sub(r"<td.*?>", "<td>", result)
result = re.sub(r"<tr.*?>", "<tr>", result)
result = re.sub(r"<a.*?>(.*?)</a>", "\\1", result)
result = re.sub(r"<span.*?>(.*?)... | null | MMLanScan/Data/build_port_services_list.py | build_port_services_list.py | py | 2,845 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "re.sub",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 12,
"usage_type":... |
413003560 | from datetime import datetime, timedelta
from decimal import Decimal
from casexml.apps.stock.models import StockTransaction, StockReport
from corehq.apps.commtrack.models import StockState
from corehq.apps.locations.tests.util import make_loc
from corehq.apps.products.models import SQLProduct, Product
from corehq.app... | null | custom/ewsghana/tests/test_reminders.py | test_reminders.py | py | 11,416 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.datetime.utcnow",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "casexml.apps.stock.models.StockReport.objects.create",
"line_number": 28,
"usage_type": "call"... |
32215700 | # coding=utf-8
"""Search SoundCloud playlists for audio."""
from __future__ import absolute_import
import os
import string
import sys
import requests
import soundcloud
from tqdm import tqdm
def sanitize(s):
valid = '-_.() {}{}'.format(string.ascii_letters, string.digits)
return ''.join(c for c in s if c in ... | null | audioscrape/soundcloud.py | soundcloud.py | py | 3,206 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "string.ascii_letters",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "string.digits",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.envir... |
25071322 | import os
import kmeans
from setuptools import setup
from distutils.extension import Extension
here = os.path.abspath(os.path.dirname(__file__))
ckmeans = Extension(
'lib',
sources=['lib.c'],
extra_compile_args=['-O3', '-std=c99']
)
def read(*filenames, **kwargs):
encoding = kwargs.get('encoding', 'u... | null | setup.py | setup.py | py | 1,413 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.abspath",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "distutils.extension.Extensi... |
574155818 | from __future__ import print_function
import sys
from itertools import combinations
__author__ = 'Joshua'
def opendata(data):
transfordata = []
input_data = data.readlines()
for data_line in input_data:
tmp = data_line.strip().split(',')
transfordata.append(tmp)
return transfordata # [['d', 'e', 'a'], ['d',... | null | Code2_Hash/bozhao_li_pcy.py | bozhao_li_pcy.py | py | 3,059 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "itertools.combinations",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
"line_number": 34,
"usage_type": "call"
}
] |
425579551 | # MODEL m15_4M_01 - NN CLASS
import torch
import torch.nn as nn
import numpy as np
import pandas as pd
# artificial neural network
class ANN(nn.Module):
def __init__(self, input_size_swl, input_size, hidden_size, output_size, num_lstm_layers, bias = True):
super(ANN, self).__init__()
self.num_lstm_la... | null | m15_4M_01/m15_4M_01_03_nn_class.py | m15_4M_01_03_nn_class.py | py | 1,537 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.nn.LSTM",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number... |
646526005 | import argparse
import csv
from pathlib import Path
def read_csv(src_file, output_file):
with open(src_file) as file_object:
reader = csv.reader(file_object)
header_row = next(reader)
if output_file:
f = open(output_file, "w")
for row in reader:
f.wr... | null | modules/ex2.py | ex2.py | py | 944 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "csv.reader",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"li... |
415903220 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""desc"""
import torch.nn as nn
import torch.nn.functional as F
from .attention import MultiHeadedAttention
from .utils import PositionwiseFeedForward
class TransformerEncoderLayer(nn.Module):
"""
Bidirectional Encoder = Transformer (self-attention)
Transfo... | null | bert_pytorch/model/transformer.py | transformer.py | py | 1,805 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.nn.Module",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "attention.MultiHeadedAttention",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "utils.Po... |
424472261 | from configparser import ConfigParser
def config(filename, section):
parser = ConfigParser()
parser.read(filename)
configs = {}
if parser.has_section(section):
params = parser.items(section)
for param in params:
configs[param[0]] = param[1]
else:
raise Exception... | null | config.py | config.py | py | 407 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 4,
"usage_type": "call"
}
] |
629166725 | ##############################################################################80
# #
# Raw-data Reader #
# ... | null | libpy/rawdata.py | rawdata.py | py | 9,915 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.isdir",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "git.Repo",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "git.Repo.clone_from",
"line_n... |
366246319 | from BugTracker.models import BugScreenShots, Bug
from django.http import HttpResponse
import logging
import json
import shutil
from TeamTrack.settings import STATIC_URL
log = logging.getLogger(__name__)
def UpdateScreenshots(sender, instance, **kwargs):
try:
BugScreenShotsObj = BugScreenShots.objects.filt... | null | BugTracker/Signals.py | Signals.py | py | 922 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "BugTracker.models.BugScreenShots.objects.filter",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "BugTracker.models.BugScreenShots.objects",
"line_number": 11,
"usage_typ... |
32506196 | #!/usr/local/bin/python3
# coding: UTF-8
# Author: David
# Email: youchen.du@gmail.com
# Created: 2017-05-09 18:43
# Last modified: 2017-05-09 18:51
# Filename: subprocess_streams.py
# Description:
import asyncio
import asyncio.subprocess
import sys
async def get_date():
code = 'import datetime; print(datetime.da... | null | Python/asyncio/subprocess_streams.py | subprocess_streams.py | py | 874 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "asyncio.create_subprocess_exec",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.executable",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "asyncio.subprocess",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_na... |
182488865 | from websocket import create_connection
import threading
import asyncio
active = True
server_message = ''
#variables from server:
#encounter_state (WAITING, IN_PROGRESS, ENDED_FAIL, ENDED_WIN, UDEAD)
#boss_balance (integer - balance remaining)
#num_musos (integer - how many musos are connected)
#muso_list (list - fro... | null | Client/lib_chestral.py | lib_chestral.py | py | 1,132 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "websocket.create_connection",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 42,
"usage_type": "call"
}
] |
529343989 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# combinator.py
#
# Copyright 2017 Bruno S <bruno@oac.unc.edu.ar>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the L... | null | properimage/combinator.py | combinator.py | py | 4,312 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pyfftw.interfaces",
"line_number": 48,
"usage_type": "attribute"
},
{
"api_name": "pyfftw.interfaces",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "numpy.fft",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name": "numpy.ff... |
227421340 | import datetime
from dateutil import parser
months = {1: 'January', 2: 'February', 3: 'March', 4: 'April', 5: 'May', 6: 'June', 7: 'July', 8: 'August', 9: 'September', 10: 'October', 11: 'November', 12: 'December'}
endings = {1: 'st', 2: 'nd', 3: 'rd'}
def toDate(date):
date = parser.parse(date)
ending = "th"... | null | toDate.py | toDate.py | py | 803 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "dateutil.parser.parse",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "dateutil.parser",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "dateti... |
309026448 | #Import
import cv2
import pdb
import numpy as np
import matplotlib.pyplot as plt
#Function:
def isColor(pixel, color):
if pixel[0] != color[0]:
return False
if pixel[1] != color[1]:
return False
if pixel[2] != color[2]:
return False
return True
def imgEdges(img, wri... | null | DetectWords/DetectLinesManyLines.py | DetectLinesManyLines.py | py | 4,421 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.cvtColor",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "cv2.Canny",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.HoughLinesP",
... |
587584537 | import copy
from ..parser import ast
from .definitions import Class
from .definitions import Function
from .utils import CompileError
from .utils import GenericType
from .utils import make_name
from .utils import make_types_string_parts
from .utils import mys_to_cpp_type_param
from .utils import split_dict_mys_type
... | null | mys/transpiler/generics.py | generics.py | py | 9,088 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "utils.split_dict_mys_type",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "parser.ast.NodeTransformer",
"line_number": 52,
"usage_type": "attribute"
},
{
"api_name": "parser.ast",
"line_number": 52,
"usage_type": "name"
},
{
"api_name": "... |
138964636 | import os
import datetime
from collections import namedtuple
SourceResult = namedtuple('SourceResult', ['path', 'size', 'modified'])
"""Named Tuple containing a sources path, size, and modified time."""
class Sources:
"""
File relationship manager for App instances. Source files must be registered, as well ... | null | pydgeot/app/sources.py | sources.py | py | 12,939 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.namedtuple",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 68,
"usage_type": "attribute"
},
{
"api_... |
309736655 | from __future__ import annotations
import hashlib
from neo3 import vm, contracts, settings
from neo3.network import payloads
from neo3.core import cryptography
from neo3.contracts.interop import register
from typing import cast, List
def stackitem_to_hash_data(engine: contracts.ApplicationEngine, stack_item: vm.Stack... | null | neo3/contracts/interop/crypto.py | crypto.py | py | 4,640 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "neo3.contracts.ApplicationEngine",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "neo3.contracts",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "neo3.vm.StackItem",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_n... |
240252817 | from . import ForecastMixin
from datetime import timedelta, datetime
import xml.etree.ElementTree as ET
class Forecast(ForecastMixin):
url = 'https://geoservices.atmosud.org/geoserver/ind_sudpaca/ows?service=WFS&version=1.1.0'
fr_date_format = '%d-%m-%Y 00:00:00'
@classmethod
def params(cls, date, ins... | null | indice_pollution/regions/Sud.py | Sud.py | py | 1,500 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "datetime.timedelta",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "xml.e... |
277185451 | import numpy as np
from sklearn.datasets import load_iris
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
dataset = load_iris()
print(dataset.DESCR)
print(dataset.feature_names)
x = dataset.data
y = dataset.target
print(x.shape , y.shape)
'''
from tensorflow.keras.utils impo... | null | ML/m01.py | m01.py | py | 1,931 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.MinMaxScaler",
"line_number": 26,
"usage_type": ... |
579980692 | #!/usr/bin/python
from pymatgen.util.testing import PymatgenTest
from pymatgen.core.operations import SymmOp
import numpy as np
class SymmOpTestCase(PymatgenTest):
def setUp(self):
self.op = SymmOp.from_axis_angle_and_translation([0, 0, 1], 30, False,
... | null | pymatgen/core/tests/test_operations.py | test_operations.py | py | 2,616 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pymatgen.util.testing.PymatgenTest",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "pymatgen.core.operations.SymmOp.from_axis_angle_and_translation",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pymatgen.core.operations.SymmOp",
"line_num... |
114038595 | from math import sqrt
from scipy.stats import t
from math_helper.mean import mean
from math_helper.variance import variance
def ttest(column,population_mean):
"""Calculates a two-way t-test
Args:
column: column to test
population_mean: the mean to test agains
Returns:
A list of t... | null | src/analyses/ttest.py | ttest.py | py | 916 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "math_helper.mean.mean",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "math_helper.variance.variance",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "scipy.s... |
637120121 | #!/usr/bin/python3
"""
Sample usage:
$ TEGAKI_API_KEY='xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' python delete_request.py request_id
"""
import os
import sys
import requests
TEGAKI_DELETE_REQUEST_ENDPOINT = ('delete', 'https://api.tegaki.ai/hwr/v2/request')
MY_API_KEY = os.getenv('TEGAKI_API_KEY')
# delete result... | null | delete_request.py | delete_request.py | py | 820 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.getenv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "requests.request",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 30,
"usage_type": "attribute"
}
] |
608133939 | import pandas as pd
import numpy as np
from plotly.subplots import make_subplots
import plotly.graph_objects as go
def conversion(path):
"""
Converts a tij.dat file into a np.array.
:param path: path of the tij.dat file
:type path: str
:return: np.array of the tij data
:rtype: np.array
""... | null | tij.py | tij.py | py | 14,440 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_numb... |
375335507 | #!/usr/bin/env python3
#
# Cyrius: CYP2D6 genotyper
# Copyright (c) 2019-2020 Illumina, Inc.
#
# Author: Xiao Chen <xchen2@illumina.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either ... | null | depth_calling/snp_count.py | snp_count.py | py | 7,095 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.namedtuple",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "utilities.open_alignment_file",
"line_number": 168,
"usage_type": "call"
},
{
"api_name": "utilities.open_alignment_file",
"line_number": 184,
"usage_type": "call"
}
] |
482229088 | # uncompyle6 version 3.7.4
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: /home/gyst/plonesocial.buildout/src/plonesocial.microblog/plonesocial/microblog/utils.py
# Compiled at: 2014-01-17 08:56:06
import time
from BTrees import LLBTre... | null | pycfiles/plonesocial.microblog-0.5.3/utils.py | utils.py | py | 2,225 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "interfaces.IMicroblogContext.providedBy",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "interfaces.IMicroblogContext",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "interfaces.IMicroblogContext.providedBy",
"line_number": 23,
"usage_... |
446145063 | import time
from threading import Thread
import json
import requests
from pprint import pprint
def parse(json1):
data = json1['data']
# data_id
return data
def gogo(page_idx, results):
url = 'https://data.mafra.go.kr/opendata/data/open/getDataListPage.do'
data = requests.post(url, data={
'... | null | ver.4/1_multithread_example_code.py | 1_multithread_example_code.py | py | 1,368 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.post",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number... |
308262569 | from argparse import ArgumentParser
import test_method1 as TM1
if __name__ == '__main__':
parser = ArgumentParser()
parser.add_argument('--addr', type=str, default='http://lando.sytes.net', help='Server domain name/ip address')
parser.add_argument('--port', type=int, default=8888, help='Server port number... | null | client/server-benchmark.py | server-benchmark.py | py | 1,166 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "test_method1.test1",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "test_method1.test2",
"line_number": 21,
"usage_type": "call"
}
] |
385399490 | from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import logging
import argparse
import time
def writeTofile(str, filename="novel.txt"):
with open(filename, 'a') as f:
f.write(str)
f.write("\n\n")
def log(logger):
logger.setLevel(logging.DEBUG)
fh = log... | null | novel/panlong.py | panlong.py | py | 1,606 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.DEBUG",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "logging.F... |
291315932 | #!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
#
# Copylefth (c) 2009, Grudejo:
# Aline Grazielle Silva Reis
# Julia Carmona Almeida Chaves
# Luziany Maria de Oliveira
# Joyce Karoline Dare
# Prof. Douglas Machado Tavares
#
import pygame
from pygame.constants import *
class Ator(... | null | src/etapa_03/jogo_v03.py | jogo_v03.py | py | 2,984 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.sprite",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite.Sprite.__init__",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "p... |
141813354 | import bpy
# Comprimentos (x, y e z) do degrau superior
length1 = 3
length2 = 2
length3 = 1
# Quantidade de degraus
steps = 5
def criaDegrau(length1, length2, length3, times):
if times == 0:
return times
# Replica o andar imediatamente superior e faz as translações necessárias para o degrau segu... | null | tower-recursion.py | tower-recursion.py | py | 2,278 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "bpy.ops.object.duplicate_move",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "bpy.ops",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "bpy.ops.transform.translate",
"line_number": 17,
"usage_type": "call"
},
{
"api_name":... |
186141521 | import argparse as arg
parser = arg.ArgumentParser()
parser.add_argument("--way", type=str, help="Имя/Путь файла для сортировки", default=None)
args = parser.parse_args()
def MergeSort(text:list)->None:
"""This function sorted something"""
if len(text) > 1:
half = len(text)//2
left_part = text[... | null | lab_2/17_lab_2_3.py | 17_lab_2_3.py | py | 999 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 2,
"usage_type": "call"
}
] |
397896335 | # Copyright 2019 Regents of the University of Minnesota.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | null | python/tests/io/test_json.py | test_json.py | py | 4,116 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "mtap.events.Event",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "mtap.events.Document",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "mtap.GenericLabel",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "mtap.Generic... |
464394400 | from mpl_toolkits.basemap import Basemap, cm, shiftgrid,interp
from netCDF4 import Dataset as NetCDFFile
import numpy as N
import matplotlib.pyplot as plt
import glob
import numpy.ma as ma
from scipy.interpolate import griddata
import scipy.stats
from matplotlib.dates import DateFormatter
import datetime
country=NetC... | null | plot/detrend/mai_ann_globe_p3.py | mai_ann_globe_p3.py | py | 3,013 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "netCDF4.Dataset",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "netCDF4.Dataset",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.ma.masked_where",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.ma",
... |
554968815 | #!/usr/bin/env python
# coding: utf-8
import argparse
import json
import os
import random
import cv2
import pandas as pd
from tqdm import tqdm
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("--deciding_only", action="store_true")
parser.add_argument("--bandwidth", type=int, def... | null | python/correspondence_matching/draw_matchings.py | draw_matchings.py | py | 2,810 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"... |
497243580 | from datetime import datetime
from GA import GA
from Colorharmony import ColorHarmony
import cv2
import numpy
import PIL as PIL
from PIL import ImageDraw,Image
from skimage.color import lab2rgb
import numpy as np
from sklearn.cluster import MeanShift, estimate_bandwidth
import time
class Solver:
##ganti nama ja... | null | Solver.py | Solver.py | py | 5,526 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PIL.Image.open",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_num... |
8599063 | #! python3
import openpyxl, smtplib, sys
wb = openpyxl.load_workbook('duesRecords.xlsx')
sheet = wb.get_sheet_by_name('Sheet1')
lastCol = sheet.get_highest_column()
latestMonth = sheet.cell(row=1, column=lastCol).value
for r in range(2, sheet.get_highest_row() + 1):
payment = sheet.cell(row=r, column=lastCol).val... | null | Automatetheboringstuff/email.py | email.py | py | 1,010 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "smtplib.SMTP",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 22,
"usage_type": "attribute"
}
] |
284830231 | from django.shortcuts import render, redirect
from django.http import HttpResponse
from street_biter_app.models import Street_biter
from django.contrib.auth.decorators import login_required
@login_required
def home(request):
if request.method == 'POST':
form = Street_biter(request.POST)
else:
r... | null | street_biter_app/views.py | views.py | py | 1,668 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "street_biter_app.models.Street_biter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.decorators.login_required",
"line_number": 6,
"usage_type... |
213842796 | import sys, os
import pandas as pd
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tfn.settings")
import django
django.setup()
from review.models import Whiskey,Distillery
def load_from_csv(row_of_csv):
whiskey=Whiskey()
whiskey.id=row_of_csv[0]
whiskey.distillery=Distillery.objects.get(id=row_of_csv[... | null | load_whiskey_base.py | load_whiskey_base.py | py | 742 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.environ.setdefault",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.setup",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "review.models.Whiskey... |
524017942 | import json
from collections import Counter
import requests
from bs4 import BeautifulSoup
GOOGLE_SCHOLAR = 'Google scholar'
HTTPS_SCHOLAR_GOOGLE_RU = 'https://scholar.google.ru'
EMPLOYERS_JSON = 'employers.json'
HTML_PARSER = 'html.parser'
JSON_INDENT = 2
LINKS = 'Ссылки'
def parse_scholar_articles():
with open... | null | parse_scholar_articles.py | parse_scholar_articles.py | py | 2,417 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"l... |
621016804 | import requests
from bs4 import BeautifulSoup
from tqdm import tqdm
to_process = []
with open("errors.txt", "r") as infile:
to_process = [int(l.strip()) for l in infile.read().splitlines()]
for i in tqdm(to_process): # latest document as of Feb 2 2018
# try:
tqdm.write("Processing document #" + str(i... | null | website/static/css/scrape.py | scrape.py | py | 963 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tqdm.tqdm",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm.write",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number":... |
653602125 | import discord
from discord.ext import commands, tasks
from transformers import AutoModelForCausalLM, AutoTokenizer, BigBirdForQuestionAnswering, BigBirdTokenizer
import torch
token = ''
client = commands.Bot(command_prefix='>')
channel = client.get_channel()
# GPT MODEL
#tokenizer = AutoTokenizer.from_pretrained("Pol... | null | Argo.py | Argo.py | py | 2,230 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "transformers.BigBirdTokenizer.from_pretrained",
"line_number": 14,
"usage_type": "call"
},
... |
151796368 | '''
Created on Jul 21, 2020
@author: vladislavkargin
'''
import numpy as np
from scipy import linalg as la
import matplotlib.pyplot as plt
import os
import rgs.pmaps.OrderedTree as ot
import rgs.mndrpy.Pairing as pg
import rgs.mndrpy.Meander as mr
import rgs.mndrpy.DyckPaths as dp
import rgs.mndrpy.Combinatorics as c... | null | rgs/mndrpy/Utility.py | Utility.py | py | 10,004 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.cumsum",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.min",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 4... |
115812409 | import pytest
from ptera import BaseOverlay, Overlay, Recurrence, select, tag, tooled
from ptera.core import Capture, Tap
from ptera.selector import Element, parse
from ptera.selfless import default
from ptera.tools import every
from .common import one_test_per_assert
@tooled
def brie(x, y) -> tag.Fromage:
"""B... | null | tests/test_core.py | test_core.py | py | 16,697 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "ptera.tag.Bouffe",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "ptera.tag",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "ptera.tooled",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "ptera.tag.Fromage",
... |
279687301 | #!/usr/bin/env python
import time
import numpy as np
from mujoco_py import load_model_from_xml, MjSim, MjViewer
XML = '''
<mujoco>
<worldbody>
<geom name='floor' pos='0 0 0' size='5 5 .125' type='plane' condim='3'/>
<body name='ball' pos='0 0 1'>
<joint type='free'/>
<geom ... | null | spinup/algos/ddpg_n_step/change_gravity_on_the_fly.py | change_gravity_on_the_fly.py | py | 685 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "mujoco_py.load_model_from_xml",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "mujoco_py.MjSim",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "mujoco_py.MjViewer",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pdb.... |
29648438 | from datetime import datetime
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Table, Column, Integer, String, DateTime, Sequence, ForeignKey, UniqueConstraint
from sqlalchemy.orm import relationship, backref
from sqlalchemy import event
from sqlalchemy import DDL
from ev_site import EVSit... | null | erovideo/old/models.012013/old/ev_actress.010913.py | ev_actress.010913.py | py | 5,524 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sqlalchemy.ext.declarative.declarative_base",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integer",
"line_number": 15,
"usage_type": "argument"
},
{
... |
293415917 | from gensim.models import KeyedVectors
import pandas as pd
from sklearn.manifold import TSNE
import numpy as np
import matplotlib.pyplot as plt
def show_words(words_list,lang_type): #词标签,词向量
# 加载转换文件
model = KeyedVectors.load_word2vec_format("./Word2Vec/%s_word2vec.txt"%lang_type, binary=False)
# 输出词向量
... | null | data/token_embed/visualization.py | visualization.py | py | 3,285 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "gensim.models.KeyedVectors.load_word2vec_format",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "gensim.models.KeyedVectors",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "sklearn.manifold.TSNE",
"line_number": 17,
"usage_type": "call... |
247955028 | # load projection and helper functions
import numpy as np
import skymapper as skm
import matplotlib.pylab as plt
class Point:
def __init__(self,x,y):
self.x = x
self.y = y
def __getitem__(self, i):
if i == 0:
return self.x
elif i == 1:
return self.y
... | null | examples/example1.py | example1.py | py | 4,929 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.random.normal",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "numpy.sqrt",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.arccos",
"... |
418785973 | #
# Copyright (c) 2017-2021, The Storage Networking Industry Association.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice,
# this list of conditi... | null | api_emulator/redfish/fa_ports_api.py | fa_ports_api.py | py | 9,153 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask_restful.Resource",
"line_number": 53,
"usage_type": "name"
},
{
"api_name": "logging.info",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "api_emulator.utils.create_path",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "ap... |
217053346 | import json
import time
from itertools import product
from random import randint
from pprint import pprint
import multiprocessing
def build_machines(m=3):
# Create machines
A = []
for i in range(m):
A.append([])
return A
def generate_jobs(n=10, min_time=1, max_time=10):
# Generate a list of random jobs
J =... | null | main.py | main.py | py | 3,551 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "random.randint",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "itertools.product",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "itertools.product",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Po... |
10072179 | import tkinter as tk
from tkinter import *
from tkinter import messagebox
from tkinter.filedialog import askopenfilename
from keras.models import model_from_json
import cv2
import numpy as np
from PIL import Image, ImageTk
top = tk.Tk()
top.minsize(100,100)
top.geometry('500x500')
top.maxsize(600,600)
top.configure(... | null | Cat_and_Dog_Classifier.py | Cat_and_Dog_Classifier.py | py | 1,770 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tkinter.Tk",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tkinter.filedialog.askopenfilename",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "keras.models.model_from_json",
"line_number": 29,
"usage_type": "call"
},
{
"api_na... |
288256488 | import numpy as np
import regreg.api as rr
import pandas as pd
import selection.api as sel
from selection.tests.instance import gaussian_instance
from selection.algorithms.lasso import lasso
import selection.tests.reports as reports
from selection.tests.flags import SMALL_SAMPLES, SET_SEED
from selection.tests.decorato... | null | selection/randomized/tests/test_naive.py | test_naive.py | py | 6,088 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.zeros",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "selection.tests.instance.gaussian_instance",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "nu... |
149849138 | import numpy
from datetime import datetime
import random
from scipy.spatial import distance as scipy_dist
class HierarchicalClustering():
"""This class will create an object with which has the necessary attributes and functions to perform bottom-up agglomerative hierarchical clustering on a set of provided ligand ... | null | clusters/algs.py | algs.py | py | 15,992 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.zeros",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.full",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": ... |
327779012 | from flask import Blueprint, request, jsonify, make_response
from app import db
from dotenv import load_dotenv
from app.models.card import Card
from app.models.board import Board
load_dotenv()
cards_bp = Blueprint('cards', __name__)
boards_bp = Blueprint('boards', __name__)
@boards_bp.route('/')
def root():
retu... | null | app/routes.py | routes.py | py | 3,857 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.Blueprint",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.Blueprint",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.request.method... |
392552580 | from rest_framework.viewsets import ModelViewSet
from api import permissions
class BaseModelViewSet(ModelViewSet):
http_method_names = ('get', 'post', 'put', 'delete')
lookup_field = 'id'
authentication_required = True
default_serializer_class = None
action_serializers = dict()
default_permissi... | null | api/base_viewset.py | base_viewset.py | py | 2,217 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "rest_framework.viewsets.ModelViewSet",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "api.permissions.IsLoggedIn",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "api.permissions",
"line_number": 37,
"usage_type": "name"
}
] |
277816006 | """PASCAL DOTA dataset."""
import os
import xml.etree.ElementTree
import tensorflow as tf
import tensorflow_datasets.public_api as tfds
_VOC_CITATION = """\
@misc{ding2021object,
title={Object Detection in Aerial Images: A Large-Scale Benchmark and Challenges},
author={Jian Ding and Nan Xue and Gui-Song Xia and Xia... | null | dota_voc.py | dota_voc.py | py | 5,371 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tensorflow.io.gfile.GFile",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "tensorflow.io",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "xml.etree.ElementTree.etree.ElementTree.parse",
"line_number": 50,
"usage_type": "call"
},... |
214823890 | from __future__ import print_function, division
from argparse import ArgumentParser
import yaml
import logging
import copy
import sys
import os
import time
from subprocess import call
from marmot.experiment.import_utils import call_for_each_element, build_object, build_objects, mk_tmp_dir
from marmot.experiment.prepr... | null | marmot/experiment/crf_experiment.py | crf_experiment.py | py | 12,883 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.basicConfig",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "marmot.experi... |
142165523 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 10 16:06:16 2020
@author: js
"""
import torch
import torch.nn as nn
from utils_down_resol import DownResolFunction, DownResolModule, DynamicDownResolModule, calcScale
num_bits = 8
class BasicBlock(nn.Module):
def __init__(self, in_plan... | null | srcs/model_quant.py | model_quant.py | py | 7,804 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.nn.Module",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
139691351 | # -*- coding: utf-8 -*-
#!/usr/bin/python3
import sys
import argparse
class NewickTree(object):
"""Newick Tree."""
def __init__(self):
self.root = None
self.node_dict = {}
def add_node(self, parent_name, node_name):
# First input as root
if not self.root:
if nod... | null | team_D1_zxu_ehuang/problem2.B.py | problem2.B.py | py | 7,492 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.stderr",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "sys.stderr",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "sys.stderr",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "sys.stderr",
"lin... |
573264646 | import pytest
from pyscipopt import Model, quicksum
from pyscipopt.scip import Expr, ExprCons
def test_string():
PI = 3.141592653589793238462643
NWIRES = 11
DIAMETERS = [0.207, 0.225, 0.244, 0.263, 0.283, 0.307, 0.331, 0.362, 0.394, 0.4375, 0.500]
PRELOAD = 300.0
MAXWORKLOAD = 1000.0
MAXDEFLEC... | null | tests/test_nonlinear.py | test_nonlinear.py | py | 1,907 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pyscipopt.Model",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pyscipopt.quicksum",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "pyscipopt.quicksum",
"line_number": 53,
"usage_type": "call"
}
] |
69503971 | from django.conf import settings
from django.test import Client
from django.test import LiveServerTestCase
from selenium import webdriver
from . import utils
from .pop import goalsPage
from .pop import indexPage
from .pop import rolesPage
from .pop import todosPage
from .pop import navbar
class InterfaceTests(LiveServ... | null | weekPlaner/calendarManager/tests/tests_interface.py | tests_interface.py | py | 1,597 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.test.LiveServerTestCase",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pop.goalsPage.goalsPage",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pop.goalsPage",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "... |
40642366 | import time
import tweepy as twitter
import os
superhour = time.localtime().tm_hour
hour = superhour % 12
if hour == 0:
hour = 12
sentence = "Tenho %d lágrima%s no canto do mostrador, %s nos Açores%s"
if superhour >= 12:
if hour == 1:
sentence = sentence % (hour, "", "12 lágrimas", "")
else:
sentence = sente... | null | bonga.py | bonga.py | py | 876 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "time.localtime",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 25,
... |
194858390 | __author__ = 'daniel'
import matplotlib.pyplot as plt
from scipy import ndimage
import numpy as np
import time
import threading
import random
global my_data
path = "/home/daniel/bt-img/test1/"
img = ["ball-1.jpg", "ball-2.jpg", "ball-3.jpg", "ball-4.jpg", "ball-5.jpg"]
my_data = ndimage.imread(path + random.choice... | null | code/img_handler/matplotlib_show_subplots.py | matplotlib_show_subplots.py | py | 1,678 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "scipy.ndimage.imread",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "scipy.ndimage",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "random.choice",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
... |
596805772 | import os
import sys
lib_dir = os.path.expanduser('~/proj/ml_lib/')
sys.path.append(lib_dir)
import numpy as np
import matplotlib.pyplot as plt
from kernel.kernel_ridge import KernelRidge
from kernel.kernels import gaussian_kernel
N = 1000
sigma_noise = 0.1
X = np.linspace(0, 2 * np.pi, N).reshape(-1, 1)
y = np.sin... | null | demo/kernel_ridge_demo.py | kernel_ridge_demo.py | py | 592 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.expanduser",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_num... |
192561299 | from flask import Flask, render_template, request
#from nocache import nocache
import ast, requests, boto3, os
from datetime import datetime
import csv
# import plots,copy,random,string
# access_key_id = 'ASIA37PBWIRNEDGEMZO2'
# secret_access_key = "+QT0v4mCGOxm7"
# session_token = '+dP/EIgDIcZgOUcuzlLHRY9glf+/SYI6CBvn... | null | app.py | app.py | py | 14,965 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "boto3.resource",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 153,
"usage_type": "attribute"
},
{
"api_name": "flask.request",... |
179634356 | import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import numpy as np
import cv2
import glob
import pickle
from sklearn.model_selection import train_test_split
import dataProcess as dp
from sklearn.preprocessing import StandardScaler
from sklearn.svm import LinearSVC
from sklearn.externals import joblib
c... | null | code/training.py | training.py | py | 2,033 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "dataProcess.dataRead",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "dataProcess.extract_features",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "dataProcess.extract_features",
"line_number": 30,
"usage_type": "call"
},
{
"ap... |
186711611 | from django import forms
from contactos.models import Pozo, Pertenece, Area, Atiende, Calificacion
from contactos.models import Nota, Recordatorio, Llamada
from contactos.models import NumeroTelefonico, TipoNumeroTelefonico
from empresas.models import Cliente
from principal.models import Vendedor
class PozoForm(forms.... | null | claand/contactos/forms.py | forms.py | py | 4,140 | python | en | code | null | code-starcoder2 | 83 | [
{
"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.CharField",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.f... |
566790456 | import os
import numpy as np
import pandas as pd
import pickle
import quandl
import time
from datetime import datetime
import plotly.offline as py
import plotly.graph_objs as go
import plotly.figure_factory as ff
def get_quandl_data(quandl_id):
'''Download and cache Quandl dataseries'''
cache_path = '{}.pkl'.... | null | DataScience/crypto-currency/PriceTracking.py | PriceTracking.py | py | 5,637 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pickle.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "quandl.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "plotly.graph_objs.Layout",
... |
100791602 | import torch
import torch.nn as nn
import torchvision
from . import resnet, resnext, mobilenet, hrnet
from lib.nn import SynchronizedBatchNorm2d
BatchNorm2d = SynchronizedBatchNorm2d
import math
class SegmentationModuleBase(nn.Module):
def __init__(self):
super(SegmentationModuleBase, self).__init__()
... | null | models/models.py | models.py | py | 13,391 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "lib.nn.SynchronizedBatchNorm2d",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.max",... |
199128348 | import numpy as np
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation, Flatten
from keras.layers.convolutional import Convolution2D, MaxPooling2D
from keras.optimizers import SGD
from load import DataLoader
from scipy.stats import itemfreq
loader = DataLoader()
loader.load_tr... | null | keras_cnn.py | keras_cnn.py | py | 1,640 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "load.DataLoader",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "keras.models.Sequential",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "keras.layers.convo... |
257560395 | from django.urls import path
from . import views
urlpatterns = [
path('', views.principal, name='cliente'),
path('crear_cliente/', views.crear),
path('modificar_cliente/', views.modificar),
path('borrar_cliente/', views.borrar),
path('cuentas_cliente/', views.cuentas),
path(r'crear_cuenta/(?P... | null | cooperativa2019/ape/modelo/urls.py | urls.py | py | 693 | python | en | code | null | code-starcoder2 | 83 | [
{
"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",
... |
508325791 | from discord.ext.commands import Bot as BotBase
from discord.ext import commands
import os
PRIFIX = "~"
class Bot(BotBase):
def __init__(self):
self.PRIFIX = PRIFIX
super().__init__(command_prefix=PRIFIX)
def setup(self):
for filename in os.listdir("./lib/cogs"):
if filen... | null | lib/bot/__init__.py | __init__.py | py | 974 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "os.listdir",
"line_number": 14,
"usage_type": "call"
}
] |
482993743 | import itertools as it
def erat3( ):
D = { 9: 3, 25: 5 }
yield 2
yield 3
yield 5
MASK= 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0,
MODULOS= frozenset( (1, 7, 11, 13, 17, 19, 23, 29) )
for q in it.compress(
it.islice(it.count(7), 0, None, 2),
it.cycle(MASK)):
... | null | Problems 31 - 40/problem 35/problem 35.py | problem 35.py | py | 1,908 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "itertools.compress",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "itertools.islice",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "itertools.count",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "itertools.cycle",... |
391603773 | from flask import Blueprint, session, abort, request, current_app, jsonify
from flask_login import LoginManager, login_required, current_user, logout_user, login_user
from dunder_funk import db
login_manager = LoginManager()
login_manager.login_view = 'authentication.login'
auth_blueprint = Blueprint('authentication... | null | dunder_funk/server/routes/auth.py | auth.py | py | 2,562 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask_login.LoginManager",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.Blueprint",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "dunder_funk.db.get_client_by_id",
"line_number": 14,
"usage_type": "call"
},
{
"api_name":... |
314833730 | from rodan.models.workflow import Workflow
from rest_framework import serializers
from rodan.serializers.page import MinimalPageSerializer
from rodan.serializers.workflowjob import WorkflowJobSerializer
from rodan.serializers.workflowrun import WorkflowRunSerializer
class WorkflowSerializer(serializers.HyperlinkedMod... | null | rodan/serializers/workflow.py | workflow.py | py | 1,837 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "rest_framework.serializers.HyperlinkedModelSerializer",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.HyperlinkedRelatedField",
"lin... |
18581393 | import unittest
import torch
import numpy as np
from nl2prog.nn.nl2code import Predictor, ActionSequenceReader
from nl2prog.nn.utils import rnn
class TestPredictor(unittest.TestCase):
def test_parameters(self):
reader = ActionSequenceReader(1, 1, 1, 2, 3)
predictor = Predictor(reader, 1, 2, 3, 5)... | null | test/nn/nl2code/test_predictor.py | test_predictor.py | py | 1,932 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "nl2prog.nn.nl2code.ActionSequenceReader",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "nl2prog.nn.nl2code.Predictor",
"line_number": 12,
"usage_type": "call"
},... |
34997065 | # -*- coding: utf-8 -*-
from scrapy.linkextractors import LinkExtractor
from scrapy.http import TextResponse
from scrapy.loader import XPathItemLoader
from scrapy.loader.processors import TakeFirst
from scrapy.selector import HtmlXPathSelector
from scrapy.spiders import CrawlSpider
from scrapy.spiders import Rule
from... | null | malaysia/Spiders/scrapy_Qatar2.py | scrapy_Qatar2.py | py | 2,827 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "scrapy.loader.XPathItemLoader",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "scrapy.loader.processors.TakeFirst",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "scrapy.spiders.CrawlSpider",
"line_number": 15,
"usage_type": "name"
}... |
339893920 | import requests
from projects.golem_api.pages.utils import url, headers
DELETE_SUITE_ENDPOINT = '/suite/delete'
DUPLICATE_SUITE_ENDPOINT = '/suite/duplicate'
RENAME_SUITE_ENDPOINT = '/suite/rename'
RUN_SUITE_ENDPOINT = '/suite/run'
SAVE_SUITE_ENDPOINT = '/suite/save'
RENAME_SUITE_DIRECTORY_ENDPOINT = '/suite/directo... | null | projects/golem_api/pages/suite.py | suite.py | py | 2,383 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.delete",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "projects.golem_api.pages.utils.url",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "projects.golem_api.pages.utils.headers",
"line_number": 16,
"usage_type": "call"
},
... |
340182951 | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from openapi_server.models.base_model_ import Model
from openapi_server.models.currency_stats import CurrencyStats
from openapi_server.models.stats_note import StatsNot... | null | openapi_server/models/stats.py | stats.py | py | 5,245 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "openapi_server.models.base_model_.Model",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "openapi_server.models.currency_stats.CurrencyStats",
"line_number": 43,
"usage_type":... |
532889033 | #!/usr/bin/env python3
'''
The MIT License (MIT)
Copyright (c) 2017, 2018 Erik Perillo <erik.perillo@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the 'Software'), to deal
in the Software without restriction, including wit... | null | deeppeek-train-infer/code/train.py | train.py | py | 8,439 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "random.seed",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "config.train",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "numpy.random.seed",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_n... |
508799213 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#生成二维码
from PIL import Image
import qrcode
def create_qr_code(data, version=7, box_size=10, border=4):
"""
参数 version 表示生成二维码的尺寸大小,取值范围是 1 至 40,
最小尺寸 1 会生成 21 * 21 的二维码,version 每增加 1,生成的二维码就会添加 4 尺寸,
例如 version 是 2,则生成 25 * 25 的二维码。
参数 error_correctio... | null | qr_code.py | qr_code.py | py | 2,376 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "qrcode.QRCode",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "qrcode.constants",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "qrcode.QRCode",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "qrcode.constants",
... |
467828372 | # coding=utf-8
import math
import logging
import getopt
import sys
logger = logging.getLogger()
def convert_axes(qax, qay, qaz, pa, ra, yaw_control=False):
"""
Axes: Convert the acceleration in g's to earth coordinates, then integrate to
convert to speeds in earth's X and Y axes meters per second.
M... | null | py/car/nodes/components/accel/qc/utils.py | utils.py | py | 11,237 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "math.cos",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "math.sin",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "math.cos",
"line_number": 37,
... |
447965413 | import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
import numpy as np
import json
from tqdm import tqdm, trange
from utils import TensorboardWriter
from network import AE
def save_checkpoint(epoch, model, optimizer, path):
state = {
'Epoch': epoch,
'... | null | original/autoencoder/solver.py | solver.py | py | 5,434 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.save",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.load",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.nn.Linear",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 3... |
289919892 | #!/home/daniel/anaconda3/bin/python
# -*- coding: utf-8 -*-
"""
================================================
main_process_trt_data.py
================================================
This program processes TRT data obtaining plots of time series of
parameters over the TRT cell trajectory
"""
# Author: fvj
# Lic... | null | src/pyrad_proc/pyrad/EGG-INFO/scripts/main_process_trt_data.py | main_process_trt_data.py | py | 10,006 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 68,
"usage_type": "attribute"
},
{
"api_name"... |
480854253 | from django.contrib import admin
from users.models import FoodPreference, UserFoodPreference
class FoodPreferenceAdmin(admin.ModelAdmin):
list_display = ('slug', 'name')
class UserFoodPreferenceAdmin(admin.ModelAdmin):
list_display = ('user_id', 'preference_id')
# Register your models here.
admin.site.reg... | null | users/admin.py | admin.py | py | 428 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 9,
"usage_type": "attribute"
}... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.