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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
256322667 | import argparse
import os
import random
import shutil
import time
import warnings
import sys
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.distributed as dist
import torch.optim
import torch.multiprocessing as mp
import torch.utils.data
import torch.utils... | null | python/imagenet/vgg16_predictor.py | vgg16_predictor.py | py | 6,513 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 56,
"usage_type": "attribute"
},
{
"api_name": "clr.AddReferenc... |
58533316 | # -*- coding: utf-8 -*-
import io
import os
import subprocess
import sys
import click
import pydevf
PATTERNS = {
'*.py',
'*.cpp',
'*.c',
'*.h',
'*.hpp',
'*.hxx',
'*.cxx',
'*.java',
'*.js',
'*.pyx',
'*.pxd',
'CMakeLists.txt',
'*.cmake',
}
def should_format(filename... | null | esss_fix_format/cli.py | cli.py | py | 8,630 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "fnmatch.fnmatch",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path.split",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "pydevf.start_format_server... |
385184981 | import inject
import os.path
import logging
from freyja.config import Config
from freyja.graph import Singleton
from hephaestus.steps import (
FindOrCopyApp,
FindOrCopyFilesByName,
SBApi,
FindOrCreateProject,
)
class Context(metaclass=Singleton):
"""Singleton class to store global variables for au... | null | examples/sample-qc/sampleqc/context.py | context.py | py | 2,502 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "freyja.graph.Singleton",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "inject.instance",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "freyja.config.Config",
"line_number": 25,
"usage_type": "argument"
},
{
"api_name": "hepha... |
647403369 | from selenium import webdriver
import time
browser = webdriver.Chrome("C:\\Users\\Gorshok\\Downloads\\chromedriver_win32\\chromedriver.exe")
link = "https://SunInJuly.github.io/execute_script.html"
browser.get(link)
button = browser.find_element_by_tag_name("button")
browser.execute_script("return arguments[0].scrollIn... | null | main1.py | main1.py | py | 389 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 9,
"usage_type": "call"
}
] |
406857281 | # Copyright (c) 2014, Adaptiv Design
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the ... | null | sellmo/apps/cart/routines.py | routines.py | py | 3,168 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sellmo.core.chaining.forward",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "sellmo.core.chaining",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "models.Cart.objects.try_get_tracked",
"line_number": 46,
"usage_type": "call"
},... |
507042088 | from django.urls import include, path
from . import views
# from rest_framework import routers
# router = routers.DefaultRouter()
# router.register(r'records', views.RecordViewSet)
# router.register(r'tenders', views.TenderViewSet)
app_name = 'vbp'
urlpatterns = [
path('', views.index, name='index'),
path(r'b... | null | vbp/urls.py | urls.py | py | 667 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.urls.path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.urls.path",... |
86487420 | import json
from pyshgp.push.atoms import CodeBlock, Closer, Literal, InstructionMeta, Input
from pyshgp.push.interpreter import PushInterpreter
from pyshgp.push.instruction_set import InstructionSet
from pyshgp.gp.genome import Genome, genome_to_code
def _deserialize_atoms(lst, instr_set: InstructionSet):
type_... | null | tests/gp/test_translate_validation.py | test_translate_validation.py | py | 2,528 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pyshgp.push.instruction_set.InstructionSet",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "pyshgp.push.atoms.CodeBlock",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pyshgp.push.atoms.Closer",
"line_number": 19,
"usage_type": "call"
... |
547835525 | import os, sys, optparse
import scipy.io
import pdb
import numpy as np
from caffe.proto import caffe_pb2
import caffe
optparser = optparse.OptionParser()
optparser.add_option("-o", "--output", dest="output", default="all-4_pred.mat", help="Output data name")
optparser.add_option("-m", "--mode", dest="mode", type=int, ... | null | code/extract_feature.py | extract_feature.py | py | 2,795 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "optparse.OptionParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"li... |
352308893 | from rest_framework import serializers
from .models import CategoryType, CategoryField
from posts.serializers import PostSerializer
from posts.models import Post
class CategoryTypeSerializer(serializers.ModelSerializer):
category = serializers.CharField(source="category_type", read_only=True, max_length=200)
... | null | schoolprojectv2/categories/serializers.py | serializers.py | py | 1,484 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.CharField",
"line_number": 8,
"usage_... |
124035040 | #!/usr/bin/env python3
# requires flickrapi, threadpool
# Baesd on http://nathanvangheem.com/scripts/migrateflickrtopicasanokeyresize.py
import os
import os.path
import re
import shutil
import datetime
import dateutil.parser
import argparse
import urllib.request
import flickrapi
import flickrapi.exceptions
import thre... | null | flickrbackup.py | flickrbackup.py | py | 20,145 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "threading.RLock",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 167,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_n... |
176397617 | from django.conf import settings
from django.shortcuts import render, redirect
from django.core.urlresolvers import reverse_lazy
from django.http import HttpResponseNotFound, HttpResponse
from django.views.generic import View
from django.views.generic.base import TemplateView
from django.core import mail
from inta... | null | intake/views.py | views.py | py | 6,822 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.views.generic.base.TemplateView",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "django.views.generic.View",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render",
"line_number": 25,
"usage_type": "call"
},
... |
61252159 | import os
from PIL import ImageFont
from PIL import Image
from PIL import ImageDraw
WHITE = (0, 0, 0)
BLACK = (255, 255, 255)
FONT_PATH = "static/fonts/Impact.ttf"
TEMPLATES_PATH = "static/templates"
MEME_PATH_FORMAT = "static/memes/%s.png"
def gen_meme(image_name, top, bottom, meme_id):
top = top.upper()
... | null | memegenerator.py | memegenerator.py | py | 1,931 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.join",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image.open",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number... |
191060018 | import numpy as np
from bokeh.layouts import layout, column
from bokeh.models import Select, Span
from ctapipe.core import Component
from ctapipe.visualization.bokeh import CameraDisplay, WaveformDisplay
class BokehEventViewerCamera(CameraDisplay):
def __init__(self, event_viewer, fig=None):
"""
A... | null | ctapipe/plotting/bokeh_event_viewer.py | bokeh_event_viewer.py | py | 11,932 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "ctapipe.visualization.bokeh.CameraDisplay",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "bokeh.models.Select",
"line_number": 144,
"usage_type": "call"
},
{
"api_name": "bokeh.layouts.column",
"line_number": 146,
"usage_type": "call"
},
{
... |
57916454 | import TSD_Checker_V8_6
from lxml import etree, objectify
import xlrd
def DOC9Parser(TSDApp, ExcelApp, DOC9Path):
try:
DOC9 = xlrd.open_workbook(DOC9Path, on_demand=True)
except:
TSDApp.tab1.textbox.setText("ERROR: when trying to parse the criticity file " + DOC9Path.split('/')[-1])
ret... | null | TSD_Checker_Beta/OptionalFilesParser.py | OptionalFilesParser.py | py | 7,170 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "xlrd.open_workbook",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "xlrd.open_workbook",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "xlrd.open_workbook",
"line_number": 115,
"usage_type": "call"
},
{
"api_name": "lxml.etree.X... |
486948747 | # <<BEGIN-copyright>>
# Copyright 2022, Lawrence Livermore National Security, LLC.
# See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
# <<END-copyright>>
'''
This module contains the :class:`MultiExecuteFunction`. This class supports running many Python functions in parallel usi... | null | LUPY/multiExecuteFunction.py | multiExecuteFunction.py | py | 5,638 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.stdout",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "traceback.print_exc",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "traceback.print_exc",
... |
546198469 | import logging
from datetime import datetime
from google.appengine.api import search as gsearch
from google.appengine.ext import ndb
from endpoints import get_current_user as get_current_guser
from protorpc import messages
import ferris3 as f3
from framework.utils import t_ndb, set_namespace, \
get_namespace, ha... | null | backend-version-tz/app/timetracker/timetracker_project_service.py | timetracker_project_service.py | py | 13,479 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "ferris3.model_message",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "app.timetracker.timetracker_models.Project",
"line_number": 18,
"usage_type": "argument"
},
{
"api_name": "ferris3.list_message",
"line_number": 19,
"usage_type": "call"
},
... |
50537188 | # Copyright (c) 2015 App Annie Inc. All rights reserved.
from tests.schema_check.apis.storestats.check_email import CheckEmailAPI
from tests.schema_check.base import BaseAPITestCase
from tests.schema_check.constants.constants import SCHEMAS
from tests.schema_check.utils.schema_utils import SchemaDelegate
from tests.sch... | null | tests/schema_check/cases/internal/test_check_email_internal_api.py | test_check_email_internal_api.py | py | 2,073 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tests.schema_check.base.BaseAPITestCase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "tests.schema_check.mixins.smoke_user_mixin.SmokeUserMixin",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "tests.schema_check.constants.constants.SCHEMAS"... |
169872186 | from collections import OrderedDict
from robot import BaseRobot
import pandas as pd
from datetime import date
class ExtratorAno(BaseRobot):
def __init__(self, driver, ano, usuario, senha):
self.driver = driver
self.ano = ano
self.periodos = self.gerar_periodos(self.ano)
self.senha... | null | robo_deferidos/extractor_ano.py | extractor_ano.py | py | 3,155 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "robot.BaseRobot",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "collections.OrderedDict",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "datetime.date.today",
"line_number": 89,
"usage_type": "call"
},
{
"api_name": "datetime.d... |
301811342 | import click
def obtener_datos():
""" Obtiene la lista de recorridos y el total """
# Obteniendo datos
recorridos = [
{ # 0
"ORIGEN":"Roma Norte",
"DESTINO":"Tabacalera",
"TIEMPO":"15:00"
},
{ # 1
"ORIGEN":"Reforma",
"DES... | null | Sesion-03/recorridos.py | recorridos.py | py | 3,170 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "click.command",
"line_number": 95,
"usage_type": "call"
},
{
"api_name": "click.option",
"line_number": 96,
"usage_type": "call"
},
{
"api_name": "click.option",
"line_number": 98,
"usage_type": "call"
}
] |
25220302 | import json
def setErrorJson(cfg, response, status_code, message):
''' Generic method for creating standardised JSON error responses. '''
setJson(cfg, response, status_code, None, message)
return None
def setJson(cfg, response, status_code, data, message):
''' Wrapper method for creating standardised ... | null | src/api/responses.py | responses.py | py | 1,256 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.dumps",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 21,
"usage_type": "call"
}
] |
521827313 | from datetime import timedelta
from django.core.management.base import BaseCommand
from django.utils import timezone
from roulette.models import Match, MatchRejectReasons
class Command(BaseCommand):
help = "fails matches that haven't been answered (by one party) for more than 30 seconds"
def handle(self, *... | null | backend/naklar-io/roulette/management/commands/delete_old_matches.py | delete_old_matches.py | py | 1,052 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "roulette.models.Match.objects.filter",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "roulette.models.Match.objects",
"line_number": 13,
"usage_typ... |
506533490 | import torch
import utilfunc
class Agent:
"""
ActionModelに基づき行動を決定する. そのために、世界モデルを用いて状態表現をリアルタイムで推論して維持するクラス
"""
def __init__(self, encoder, rssm, action_model):
self.encoder = encoder
self.rssm = rssm
self.action_model = action_model
self.device = next(self... | null | Dreamer/agent.py | agent.py | py | 1,577 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.zeros",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "utilfunc.preprocess_obs",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.as_tensor",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.no_grad",
... |
15837562 | import requests
import os
import json
from bs4 import BeautifulSoup
import socket
import urllib
from selenium import webdriver
import re
import time
import logging
import sys
songStorageDir = "X:/music/cachedownload"
songStorageDir = "H:/musicDownload"
songIdDir = "/`````songid"
#loudMusicCacheDir = os.environ['L... | null | python/CloudMusicCacheParser/cloudMusic.py | cloudMusic.py | py | 15,929 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.FirefoxProfile",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "... |
429700130 | import sqlite3
# Create connection and cursor
conn = sqlite3.connect('demo_data.sqlite3')
curs = conn.cursor()
# Create demo table
create_demo_table = """
CREATE TABLE demo_data (
s VARCHAR(10),
x INT,
y INT
)
"""
curs.execute(create_demo_table)
insert_1 = """
INSERT INTO demo_data
VALUES""" + '("g", 3, 9... | null | Sprint_Challenge/demo_data.py | demo_data.py | py | 1,060 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sqlite3.connect",
"line_number": 4,
"usage_type": "call"
}
] |
168644102 | import os
import xml.etree.ElementTree as ET
from mmdet.datasets.shell import ShellDataset
from mmdet.datasets.rosegold import RoseGoldDataset
def parse_xml(xml_path):
tree = ET.parse(xml_path)
root = tree.getroot()
objs = root.findall('object')
coords = list()
for ix, obj in enumerate(objs):
... | null | util/label_statistics.py | label_statistics.py | py | 1,528 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "os.walk",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path.join"... |
298412398 | #!/usr/bin/env python
""" This script defines the HST Advanced Products (HAP) generation portion of the
calibration pipeline. This portion of the pipeline produces mosaic and catalog
products. This script provides similar functionality as compared to the Hubble
Legacy Archive (HLA) pipeline in that it pro... | null | drizzlepac/hapsequencer.py | hapsequencer.py | py | 18,313 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "stsci.tools.logutil.create_logger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "stsci.tools.logutil",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "stsci.tools.logutil.logging",
"line_number": 23,
"usage_type": "attribute"
},
{... |
64782781 | # @Time : 2019.01.28
# @Author : kawa Yeung
# @Licence : bio-totem
import cv2
import numpy as np
from interval import Interval
from shapely.geometry import Point
from shapely.geometry import JOIN_STYLE
from utils.opencv_utils import OpenCV
from utils.concave_hull_utils import alpha_shape
def concave_hull_matri... | null | maskrcnn/utils/binmat_conhull_utils.py | binmat_conhull_utils.py | py | 3,024 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.findContours",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "cv2.RETR_EXTERNAL",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "cv2.CHAIN_APPROX_... |
566286588 | # -*- coding: utf-8 -*-
"""
Generic Unix/Linux module
"""
__author__ = 'Marcin Usielski, Michal Ernst'
__copyright__ = 'Copyright (C) 2018, Nokia'
__email__ = 'marcin.usielski@nokia.com, michal.ernst@nokia.com'
import abc
import logging
import re
import six
from moler.cmd import RegexHelper
from moler.command impor... | null | moler/cmd/commandtextualgeneric.py | commandtextualgeneric.py | py | 6,196 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "moler.command.Command",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "re.compile",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "moler.cmd.RegexHelper",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "re.escape",
... |
154559160 | """
Example FluidDATA API Flask application.
"""
from flask import Flask
from flask import request
from flask import render_template
from flask import redirect, url_for
from fluiddata import Fluid
app = Flask(__name__)
app.config.from_object('settings')
FLUID_TOKEN = app.config['FLUID_TOKEN']
FLUID_RSS_URL = app.... | null | fluiddata_flask.py | fluiddata_flask.py | py | 2,881 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "fluiddata.Fluid",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "flask.url_for",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "flask.url_for",
"line_n... |
52653249 | from django.shortcuts import get_object_or_404, render
from catalog.models import Student, Classroom, Teacher, Beacon, StudentList, Class,Course
from rest_framework import serializers, viewsets,permissions, status
from .serializers import StudentSerializer,ClassroomSerializer, BeaconSerializer,CourseSerializer, ClassSe... | null | fypiBeaconCMS/fypiBeaconCMS/api/views.py | views.py | py | 7,606 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.viewsets.ModelViewSet",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.viewsets",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "catalog.models.Student.objects.all",
"line_number": 25,
"usage_type": "... |
212065376 | import numpy as np
import math as m
import random as rnd
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import animation
import integration_functions as fncs
n = int(input ("2pi/n, n = ...")) #try n = 50
K = 5
r = [1.1, 2, 3]
initials = [0.05]
timescale = (2*m... | null | Logistic/logistic_continuous.py | logistic_continuous.py | py | 1,821 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "math.pi",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "math.ceil",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "math.pi",
"line_number": 20,
... |
241816983 | from decimal import Decimal
from abstract_scraper import AbstractScraper
import time
import datetime
import requests
from bs4 import BeautifulSoup
class NadjiDomRsScraper(AbstractScraper):
url = 'http://www.nadjidom.com/sr/search?mode=detail&validate=Pretraga&ad_type=1&description=&id_city=2&id_type=&min_price=4... | null | scraper/nadjidom_rs_scraper.py | nadjidom_rs_scraper.py | py | 3,868 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "abstract_scraper.AbstractScraper",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "bs4.Be... |
591814738 | from tensorflow.keras.models import load_model
import tensorflow_hub as hub
import pandas as pd
import numpy as np
from Bert.model import Model
from tokenizers import BertWordPieceTokenizer
class SentimentAnalyzer:
def adjust(self, df_line):
if 'funn' in df_line['sentence'].lower() or 'wtf' in df_line['sen... | null | Bert/sentiment_analyze.py | sentiment_analyze.py | py | 3,881 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.argmax",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "Bert.model.Model",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.models.load_model",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tens... |
529722218 | # !/usr/bin/env python3
# -*- coding:utf-8 -*-
# @Time : 2021/03/18 19:51
# @Author : yilinzhi
# @FileName: train_internal_1st.py
"""
TODO(Yi):
1.需要再次检查,打乱后image/mask是否对应?
2.数据增强:目前采用,翻转+旋转+缩放+仿射,对多样本/少样本是否有效?
3.损失函数:focal loss过于小,如何起作用?
4.处理对象:小尺度对象=>合适的loss?,正负样本是否按比例采样?
5.分割预测错误问题:有些没有学出来,... | null | train/first_version/train_internal_1st.py | train_internal_1st.py | py | 23,990 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "random.seed",
"line... |
549801792 | from functools import reduce
from typing import Any, Dict, List, Optional, Tuple, Union
import numpy as np
from numpy import ndarray
from scipy.optimize import linprog
from .constraints import (
EqConstraint,
LeConstraint,
_Constraint,
pack_constraint,
)
from .exceptions import (
Inc... | null | mat_dp_core/maths_core/solve.py | solve.py | py | 8,460 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "processes.Processes",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "constraints._Constraint",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "numpy.zeros",... |
588812867 | from pdf2docx import Converter
from configparser import ConfigParser
import os
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import Qt
from xlrd import *
import fitz
import os
import pandas as pd
import sys
import openpyxl
from win32com.client import constants, gencache
class Main_Win(QWid... | null | file-tool/pdf_util.py | pdf_util.py | py | 17,264 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.getcwd",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCore.Qt.AlignCenter",
"line... |
48773588 | import pytest
from django.urls import reverse
from django.db import transaction
from django.db.utils import IntegrityError
from django.core.exceptions import ValidationError
from ..models import Message, FOIRequest, PublicBody
class TestMessage(object):
@pytest.mark.django_db()
def test_creating_message_crea... | null | web/foi_requests/tests/test_models.py | test_models.py | py | 3,638 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "models.Message",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pytest.mark.django_db",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "models.FOIReque... |
29457013 | #Abhirup Bhattacharya
import cv2
import numpy as np
import face_recognition
imgElon = face_recognition.load_image_file('GIVE THE 1st IMAGE FILE PATH')
imgElon = cv2.cvtColor(imgElon,cv2.COLOR_BGR2RGB) #here we are converting color
imgTest = face_recognition.load_image_file('GIVE THE 2nd IMAGE FILE PATH')
imgTest ... | null | DaZZler12/Day5/Ai Project/basicfacerecogintion.py | basicfacerecogintion.py | py | 1,953 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "face_recognition.load_image_file",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2RGB",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "fac... |
203041245 | #!/usr/bin/env python3
import argparse
import inspect
import os
import sys
from commands import (has_file, project_exists, simulation_mode_disclaimer,
use_service_account, use_service_account_disclaimer)
from datetime import datetime
import helpers
from creator import (main_creator, main_creator... | null | securitycenter/setup-scripts/run_setup_creator.py | run_setup_creator.py | py | 4,119 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "commands.project_exists",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "os.path.isfi... |
471866138 | """
Jinja filter to convert xml string to the ansible dict
source: http://code.activestate.com/recipes/410469-xml-as-dictionary/
"""
class XmlListConfig(list):
def __init__(self, aList):
for element in aList:
if element:
# treat like dict
if len(element) == 1 o... | null | infrared/common/filter_plugins/from_xml.py | from_xml.py | py | 2,703 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "xml.etree.ElementTree.XML",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 60,
"usage_type": "name"
}
] |
124320308 | #!/usr/bin/env python
from __future__ import division
import argparse
from cyvcf2 import VCF
import csv
from scipy.stats import chisquare
# This script outputs a filtered geno table for linkage mapping
# Genotypes are converted to parental genotype (A|B|H|-)
# Warning: this is not a generic script intended for genera... | null | scripts/vcf2gt.py | vcf2gt.py | py | 3,461 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cyvcf2.VCF",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "scipy.stats.chisquare",... |
228365045 | # This code is based on: https://github.com/SimonKohl/probabilistic_unet
from unet.unet_blocks import *
from torch.distributions import Normal, Independent, kl
from unet.unet import UNet
from prob_unet.ConvGaussian import IsotropicGaussian, AxisAlignedGaussian
from prob_unet.Fcomb import Fcomb
from prob_unet.Encoders ... | null | prob_unet/probabilistic_unet.py | probabilistic_unet.py | py | 5,846 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "configs.num_convs_per_block",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "configs.num_convs_fcomb",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "unet.unet.UNet",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "pr... |
382357550 | import time
import libtorrent
from ..settings import config
class DownloadHandler(object):
"""Download handler"""
def __init__(self, session, handle):
self._session = session
self._handle = handle
@property
def finished(self):
"""Is finished"""
return self._handle.sta... | null | series_list/downloads/series.py | series.py | py | 1,243 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "libtorrent.torrent_status",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "libtorrent.session",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "libtorrent.add_magnet_uri",
"line_number": 38,
"usage_type": "call"
},
{
"api_n... |
310565661 | ### Python Udemy class
#birth_year = input('what year were you born?')
#age = 2020 - int(birth_year)
#print(f'your age is : {age}')
### Exercise: Password
#username = input('What is your username?')
#password = input('What is your password?')
#password_len = len(password)
#hidden_password = '*' * pass... | null | Udemy-class.py | Udemy-class.py | py | 26,294 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "functools.reduce",
"line_number": 560,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 593,
"usage_type": "call"
}
] |
609560642 | import numpy as np
import datetime as dt
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
from collections import defaultdict
from flask import Flask, jsonify
#################################################
# Database ... | null | app.py | app.py | py | 4,470 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.ext.automap.automap_base",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 28,
"usage_type": "call"
},
{
"api_name... |
542743795 | # -*- coding: utf-8 -*-
# Copyright 2019 The Blueoil Authors. All Rights Reserved.
#
# 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
#
# Unles... | null | lmnet/lmnet/networks/optical_flow_estimation/data_augmentor.py | data_augmentor.py | py | 10,972 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "abc.ABCMeta",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "numpy.random.uniform",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "numpy.random",
... |
214331920 | from uuid import uuid1
from agent_based_modelling.Utils.types import order_status, request_response
import pandas as pd
class Market(object):
"""Market for buying and selling goods via hosted orders."""
def __init__(self):
self.listings = pd.DataFrame(columns=['id',
... | null | Solution/agent_based_modelling/Market.py | Market.py | py | 2,525 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.DataFrame",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "uuid.uuid1",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "agent_based_modelling.Utils.types.order_status.open",
"line_number": 27,
"usage_type": "attribute"
},
{
... |
581126106 | import pandas as pd
import numpy as np
from sklearn.neighbors import KNeighborsClassifier
from sklearn.model_selection import train_test_split
from sklearn.model_selection import cross_val_score
from sklearn.metrics import accuracy_score, confusion_matrix
from sklearn import preprocessing
data = pd.read_csv('data/cred... | null | KNN_Credit_Cross.py | KNN_Credit_Cross.py | py | 1,215 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.MinMaxScaler",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing",
"line_number": 18,
"usage_type": "name"
},
{
"api_name"... |
219181507 | import math
import numpy as np
from sklearn.metrics import confusion_matrix
from graphing_helpers import plot_confusion_matrix
from models.base.base_emotion_model import BaseEmotionModel
from nlp_helpers import (determine_pronoun, determine_tense, flatten,
ngrams_and_remove_stop_words, normal... | null | models/AV_model.py | AV_model.py | py | 12,000 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.seterr",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.base.base_emotion_model.BaseEmotionModel",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "nlp_helpers.tokenize",
"line_number": 87,
"usage_type": "call"
},
{
... |
235963932 | #! /usr/bin/env python3
from utils import get_soup, logger, config
if 'bcy_cookies' in config.keys():
cookies = {"LOGGED_USER": config['bcy_cookies']}
else:
cookies = {}
logger.debug('bcy_cookies not set in config.json')
def check_old(filename, author, title):
import os
from utils import fixpath,... | null | sites/bcy.py | bcy.py | py | 2,720 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "utils.config.keys",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "utils.config",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "utils.config",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "utils.logger.debug",
"li... |
267433507 | from redis import StrictRedis
from typing import Union
def load(host='127.0.0.1', port=6379):
"""
Open a connection to Redis.
:param host: Redis' server IP
:param port: Redis' server port
:return: Redis connection object.
"""
connection = StrictRedis(host=host, port=port)
return con... | null | kernel/db.py | db.py | py | 1,913 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "redis.StrictRedis",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "redis.StrictRedis",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 46,
"usage_type": "name"
}
] |
548773272 | import copy
import logging
from couchdbkit import ResourceNotFound
import datetime
import redis
from casexml.apps.case.signals import cases_received, case_post_save
from corehq.toggles import LOOSE_SYNC_TOKEN_VALIDATION
from casexml.apps.case.util import iter_cases
from couchforms.models import XFormInstance
from case... | null | corehq/ex-submodules/casexml/apps/case/xform.py | xform.py | py | 12,451 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.settings",
"line_number": 33,
"usage_type": "argument"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name... |
232347716 | # -*- coding: utf-8 -*-
import logging
import uuid
import json
from hashlib import md5
from werkzeug import urls
from datetime import datetime
from odoo import api, fields, models, _
from odoo.addons.payment.models.payment_acquirer import ValidationError
from odoo.tools.float_utils import float_compare
import requests... | null | web_sale_extended/models/payu_latam_api.py | payu_latam_api.py | py | 11,813 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "odoo.models.TransientModel",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "odoo.fi... |
365412282 | import matplotlib.pyplot as plt, numpy as np
raw_data = open('task31_err.dat','r')
h = []
feps_tot = []
deps_tot = []
for line in raw_data:
numbers = [float(i) for i in line.split()]
h.append(numbers[0])
feps_tot.append(numbers[1])
deps_tot.append(numbers[2])
# plt.plot(np.log10(h),np.log10(feps_tot))
# plt.pl... | null | Ukesoppgaver/task31_error_grapher.py | task31_error_grapher.py | py | 622 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "numpy.log10",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplo... |
14041703 | from bs4 import BeautifulSoup
from get_html import get_html
import requests
from transliterate import translit, get_available_language_codes
def get_recipe(url, what_to_return='recipe_text'):
html = get_html(url)
bs = BeautifulSoup(html, 'html.parser')
if what_to_return == 'recipe_text':
# парси... | null | parsing.py | parsing.py | py | 4,420 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "get_html.get_html",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "get_html.get_html",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSou... |
613095366 | from numba import jit
from numpy import sin, cos, pi, exp
import numpy as np
import logging
import matplotlib.patches as patches
import matplotlib.pyplot as plt
FORMAT = '%(asctime)-15s [%(levelname)s] [%(filename)s:%(lineno)s] %(message)s'
logging.basicConfig(format=FORMAT, level=logging.INFO)
Wn = 1000
Wc = 0.5
Cg_... | null | src/planner/Astar_nojit.py | Astar_nojit.py | py | 20,952 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.int",
"line... |
253261139 | import os
import orjson
from blacksheep import Content, Request, Response, Application
from modules.rand import randimg
from modules import ip_todo, SelfSqlite, qq_todo, yiyan_todo
from app import docs, router
from blacksheep.plugins import json
# Config: _ApiConfig = service.build_provider().get(config).confi... | null | main.py | main.py | py | 2,164 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "blacksheep.Application",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "app.router",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "app.docs.bind_app",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "app.docs",
"l... |
652343550 | import cv2
from imagepy.core.engine import Simple
from imagepy.core.engine import Filter
class GrayScale(Simple):
title = 'Gray-Scale'
note = ['rgb','8-bit','preview']
def run(self, ips, imgs, para=None):
rst=[]
for img in imgs:
rst.append(cv2.cvtColor(img,cv2.COLOR_BGR2GRAY))
... | null | imagepy/menus/Opencv/Filters/graybin_plgs.py | graybin_plgs.py | py | 603 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "imagepy.core.engine.Simple",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "cv2.cvtColor",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "imagep... |
565992537 | import pickle
import socket
import threading
from typing import Tuple
import rsa
from Crypto.Cipher import AES
hostIP = socket.gethostname() # My local IP adress
port = 5555
server = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
server.bind((hostIP,port))
server.listen()
clients=[]
nicknames=[]
server_symetr... | null | Server.py | Server.py | py | 2,546 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "socket.gethostname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "socket.socket",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREA... |
195501407 | from keras.applications.vgg16 import VGG16
from keras.utils.vis_utils import plot_model
from keras import models
from keras import layers
from keras import optimizers
import glob
import os
import pandas as pd
from sklearn.model_selection import train_test_split
import numpy as np
import keras
import pickle
... | null | Scripts/CNN_VGG16_field_strength.py | CNN_VGG16_field_strength.py | py | 4,697 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.chdir",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"line_number": 2... |
97892399 | import datetime
import json
from typing import Union, Optional
# in PTB-Raw we don't have pytz, so we make a little workaround here
DTM_UTC = datetime.timezone.utc
try:
import pytz
UTC = pytz.utc
except ImportError:
UTC = DTM_UTC # type: ignore[assignment]
def _datetime_to_float_timestamp(dt_obj: date... | null | wallabag/datetime_helpers.py | datetime_helpers.py | py | 6,028 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.timezone",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pytz.utc",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "datetime.t... |
105264725 | import xml.etree.ElementTree as ET
import re
def search_sexp_NPs(parse_txt):
pettern_NP = re.compile(r'\(NP.+')
if pettern_NP.search(parse_txt):
flag_pare = 0
for num_char, char in enumerate(pettern_NP.search(parse_txt).group()):
if char == '(':
flag_pare += 1
... | null | Shi-ma/chapter06/knock59.py | knock59.py | py | 1,462 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "re.compile",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 31,
"usage_type": "name"
}
] |
313563664 | import serial
import tkinter # The python tcl/tk ui construction api
top = tkinter.Tk() # The tcl/tk object
canvas = tkinter.Canvas(top,bg="bisque",height=800,width=800)
canvas.pack()
top.update()
ser = serial.Serial()
ser.baudrate = 115200
ser.bytesize = 8
ser.stopbits = 1
ser.parity = 'N'
ser.timeout = 2000
s... | null | MicroBit/Lab3/Graph.py | Graph.py | py | 1,636 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tkinter.Tk",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "tkinter.Canvas",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "serial.Serial",
"line_number": 9,
"usage_type": "call"
}
] |
530263128 | import numpy as np
from scipy import stats
def main(k: int):
# dummy data, replace with data from file(s)
train = np.arange(4 * 4).reshape((4, 4))
train_labels = np.array(['a', 'b', 'c', 'd'])
test = np.arange(2 * 4).reshape((2, 4))
test_labels = np.array(['a', 'b'])
predicted = knn(k=k, test... | null | knn/knn.py | knn.py | py | 2,833 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.arange",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 1... |
618203563 | from flask import Flask
import requests
import json
app = Flask(__name__)
@app.route("/")
def bot():
url = 'https://thecocktaildb.com/api/json/v1/1/random.php'
r = requests.get(url)
if r.status_code == 200:
data = r.json()
recipe = data["drinks"]
name = [item["strDrink"] for item ... | null | bot.py | bot.py | py | 454 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
}
] |
113966788 | import json
from flask import request
from flask_restful import Resource, reqparse
from src.commons.model_resource import get_data, BaseResource
from schema import Schema, Optional, And, Use
from src.models.log_db import LogCase
from src.commons.logger import logger
from src.commons.manager_utils import logger_req
... | null | xxw/support/src/modules/case_info.py | case_info.py | py | 2,719 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "src.commons.model_resource.BaseResource",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "schema.Schema",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "schema.Optional",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": ... |
623082317 | # -*- coding: utf-8 -*-
##############################################################################
# Copyright Kitware Inc.
#
# Licensed under the Apache License, Version 2.0 ( the "License" );
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# h... | null | sources/nd2/large_image_source_nd2/__init__.py | __init__.py | py | 13,511 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pkg_resources.get_distribution",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "pkg_resources.DistributionNotFound",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "warnings.filterwarnings",
"line_number": 47,
"usage_type": "call"
},
... |
502425309 | import theano as t
def loadShared(x, borrow=True, log=None) :
'''Transfer numpy.array to theano.shared variable.
NOTE: Shared variables allow for optimized GPU execution
'''
import numpy as np
if log is not None :
log.debug('Wrap memory into shared variables')
return t.shared(np.asar... | null | trunk/modules/python/dataset/shared.py | shared.py | py | 1,143 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "theano.shared",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "theano.config",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "theano.tensor.cast",
... |
119831005 | """
rdflib_hdt.sparql_opt
=======================
Provides functions to overrides the RDFlib SPARQL evaluator for HDT documents.
"""
import rdflib.plugins.sparql.evaluate as sparql_evaluate
from rdflib import Variable
from rdflib.plugins.sparql.sparql import FrozenBindings, QueryContext
from rdflib_hdt.hdt_store impor... | null | rdflib_hdt/sparql_op.py | sparql_op.py | py | 1,663 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rdflib.plugins.sparql.evaluate.evalBGP",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "rdflib.plugins.sparql.evaluate",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "rdflib.plugins.sparql.sparql.QueryContext",
"line_number": 25,
... |
186856585 | from threading import Thread
from celery import Celery
from . import tasks
from .celery import app
__all__ = ('TaskApi', )
def watch_task(task, callback, kwargs=None):
"""
watch task until it ends and then execute callback:
callback(response, **kwargs)
where response is a result of task
:... | null | dbs/task_api.py | task_api.py | py | 4,794 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "threading.Thread",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 95,
"usage_type": "call"
},
{
"api_name": "pprint.pprint",
"line_number": 104,
"usage_type": "call"
},
{
"api_name": "gi.repository.Notify... |
421990655 | import time
import json
import base64
import random
import hashlib
import jsonpath
from loguru import logger
from concurrent.futures.thread import ThreadPoolExecutor
from simplejson import JSONDecodeError
from utils import request, run_func, mongo, soup, request_proxy, request_proxy_8088
from config import RUN_SIGN, ... | null | now/chanmam/spider.py | spider.py | py | 12,244 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.loads",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "config.PROXY.get",
"line_numbe... |
63825441 | import os
import requests
def download(url):
"""
从指定的 URL 中下载文件并存储到当前目录
:param url: 要下载的页面的网站
:return:
"""
# 检查 URL 是否存在
try:
req = requests.get(url)
except requests.exceptions.MissingSchema:
print("You don't have the authority to access this page")
return
#... | null | 模块/requests_download.py | requests_download.py | py | 1,174 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.exceptions",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"l... |
296402347 | import scipy.io as sio
import numpy as np
import keras.backend as K
from keras.layers import Input, GlobalAveragePooling2D, Reshape
from keras.layers.convolutional import Conv2D, ZeroPadding2D, MaxPooling2D, AveragePooling2D
from keras.layers.normalization import BatchNormalization
from keras.layers.core import Lambda,... | null | model.py | model.py | py | 3,233 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "keras.layers.convolutional.ZeroPadding2D",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "keras.layers.convolutional.Conv2D",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "keras.layers.normalization.BatchNormalization",
"line_number": 19,... |
486164374 | ### This script creates gray matter, white matter and CSF masks for each of the
### input aseg dseg images.
###
### Ellyn Butler
### November 12, 2020 - March 16, 2021
import nibabel as nib
import numpy as np
import pandas as pd
import os
from copy import deepcopy
#from scipy import binary_dilation
from scipy import n... | null | masks.py | masks.py | py | 5,794 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.listdir",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number":... |
292531292 | import csv
import lxml.etree as ET
# create element tags from each column
headers = ['IssueUID', 'ArticleUID', 'Status', 'VolumeNo', 'IssueNo', 'IssueNotes',
'SpecialEdition', 'PageNo', 'ColumnNo', 'Date', 'ArticleTitle',
'ArticleAuthor', 'Scope', 'ArticleType', 'ArticleFrequency', 'Realm',
... | null | tech_news/csv_to_xml.py | csv_to_xml.py | py | 1,133 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "lxml.etree.Element",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "csv.reader",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "lxml.etree.SubElement",
... |
583598004 | from typing import Optional
import click
from adbutils import adb
from PySide6.QtGui import QImage, QKeyEvent, QMouseEvent, QPixmap
from PySide6.QtWidgets import QApplication, QMainWindow
from ui_main import Ui_MainWindow
import scrcpy
app = QApplication([])
class MainWindow(QMainWindow):
def __init__(self, ma... | null | scrcpy_ui/main.py | main.py | py | 4,400 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PySide6.QtWidgets.QApplication",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PySide6.QtWidgets.QMainWindow",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "ui_main.Ui_MainWindow",
"line_number": 17,
"usage_type": "call"
},
{
... |
259425405 | import cv2
from imutils.video import WebcamVideoStream
import subprocess
import os
from client import Clientmanger
import time
HOME = os.getcwd()
# p =subprocess.Popen("python3 "+HOME+"/sockets/user/sender.py",shell=True)
cap = WebcamVideoStream(src="http://192.168.50.30:10000/?action=stream")
cap.start()
time.sleep(3... | null | uniclass2200319-2.0cpu/client/example.py | example.py | py | 1,019 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.getcwd",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "imutils.video.WebcamVideoStream",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "client.Clientmang... |
502197758 | # coding: utf-8
import multiprocessing
import time
import typing
from multiprocessing import Event
from sandbox.benchmark.multiprocessing.lib.shared import SharedDataInterface
from sandbox.benchmark.multiprocessing.lib.work import work
from sandbox.lg import lg
class Executor(object):
def __init__(
s... | null | sandbox/benchmark/multiprocessing/lib/executor.py | executor.py | py | 2,990 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.Callable",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "multiprocessing.Event",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "sandbox.lg.lg.in... |
586737008 | import scrapy
from animecrawler.parser.anime_item_parser import AnimeItemParser
from animecrawler.utils.extract_utils import ExtractUtils
class AnimePlanetSpider(scrapy.Spider):
name = 'anime_planet_4'
all_anime_url = '{hostname}{path}'.format(hostname=ExtractUtils.ANIME_PLANET_URL, path='/anime/all')
sta... | null | animecrawler/spiders/anime_planet_spider_4.py | anime_planet_spider_4.py | py | 1,190 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "scrapy.Spider",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "animecrawler.utils.extract_utils.ExtractUtils.ANIME_PLANET_URL",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "animecrawler.utils.extract_utils.ExtractUtils",
"line_nu... |
246011229 | __author__ = 'penny'
import sys
import numpy as np
from scipy import stats
from mayavi import mlab
import pyfits
from vispy import app, scene
fitsfile = pyfits.open('cloud_catalog_july14_2015.fits')
n = len(fitsfile[1].data['x_gal'])
P = np.zeros((n,3), dtype=np.float32)
X, Y, Z = P[:,0],P[:,1],P[:,2]
X[...] = fitsf... | null | vispy_examples/isosurface_scatter.py | isosurface_scatter.py | py | 3,541 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pyfits.open",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "numpy.nan_to_num",
"lin... |
600594658 | import random
import logging
import json
import time
from os import system
from subprocess import call, check_output
from .keyboardinput import KeyGrabber
from .voiceinput import VoiceInput
from .statemachine import StateMachine, Action, State
from .restclient import RestClient
from .audio.speak import speak
from .h... | null | modules/input/src/main_backup.py | main_backup.py | py | 6,788 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "statemachine.State... |
260799740 | # -*- coding: utf-8 -*-
from coreapi.compat import force_bytes, force_text
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from rest_framework import status
from rest_framework.exceptions import APIException
from rest_framework.renderers import JSONRenderer
from rest_framework.s... | null | drf_tweaks/versioning.py | versioning.py | py | 6,381 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.utils.deprecation.MiddlewareMixin",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "rest_framework.exceptions.APIException",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "rest_framework.status.HTTP_400_BAD_REQUEST",
"line_number": 2... |
257704976 | from django.test import TestCase, Client
from django.core.urlresolvers import reverse
import urllib.request
import urllib.parse
import json
from .services import make_request
class UserTestCase(TestCase):
#setUp method is called before each test in this class
def setUp(self):
self.user_data = {'email':... | null | grubbr_exp/exp/tests.py | tests.py | py | 5,219 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.test.TestCase",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.core.urlresolvers.reverse",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "djang... |
96208325 | import cupy as cp
class Dropout:
def __init__(self, dropout_ratio = .5):
self.ratio = dropout_ratio
self.mask = None
def Forward(self, x, flag = True):
if flag:
self.mask = cp.random.rand(*x.shape) > self.ratio
out = x * self.mask
else:
... | null | NeuralNetwork/Evaluations/Common/Layers/Dropout.py | Dropout.py | py | 469 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cupy.random.rand",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cupy.random",
"line_number": 10,
"usage_type": "attribute"
}
] |
79502241 | from django.shortcuts import render, redirect, HttpResponse
from django.views import View
from app01.models import *
# Create your views here.
class Add_Cate(View):
def get(self, request):
return render(request, 'add_cate.html')
def post(self, request):
print(request.POST)
cate_name = r... | null | python/Django/20190620/test01/app01/views.py | views.py | py | 1,505 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.views.View",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "dja... |
624784938 | # Default settings for the app override in your settings.py
from django.conf import settings
import os
APP_PATH = os.path.abspath(os.path.split(__file__)[0])
LOG_FILES_DIR = getattr(
settings,
'LOG_FILES_DIR',
os.path.join(APP_PATH, 'testdata', 'log')
)
LOG_FILES_FORMAT = getattr(
settings,
'LOG_FI... | null | myDjango/log_viewer/settings.py | settings.py | py | 627 | 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.split",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.conf.settings",
"l... |
506375228 | from pyramid.response import Response
from pyramid.view import view_config
from collections import defaultdict
from sqlalchemy.exc import DBAPIError
from sqlalchemy import func
import unicodedata
import datetime
from datetime import date
from project.models import (
DBSession,
)
from project.models.article impo... | null | 4etapa/project/project/views/views.py.LOCAL.6503.py | views.py.LOCAL.6503.py | py | 11,732 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pyramid.view.view_config",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "unicodedata.normalize",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "pyramid.view.... |
301597788 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 21 10:09:17 2017
@author: freyamuir
"""
"""
Correlation investigation between the rock hardness (Schmidt Hammer Rebound values)
and number of coseismic landslides that occurred within that lithology.
"""
import numpy as np
from scipy import stats
... | null | shr.py | shr.py | py | 2,175 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.tick_params",
"line_number": 21,
"usage_type": "call"
},
{
"a... |
496036735 | from utils import keccak
def hash_pair(s1, s2):
if s1 > s2:
s2, s1 = s1, s2
return keccak(s1 + s2)
class NoHash32Error(Exception):
pass
def merkleroot(lst, proof=[], first=True):
"""
lst: list of hashes
proof: empty or with the element for which a proof shall be built, proof will b... | null | raiden/mtree.py | mtree.py | py | 1,773 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "utils.keccak",
"line_number": 7,
"usage_type": "call"
}
] |
474404486 | # Copyright: Martin Matusiak <numerodix@gmail.com>
# Licensed under the GNU Public License, version 3.
### <Init>
print("Python armed. Executing %s" % __file__)
# runtime bootstrap
import clr
import System
# py modules provided by runtime
import sys
# set up path to import pylib
for d in ['.', 'pylib']:
sys.pat... | null | gnametrans.py | gnametrans.py | py | 6,730 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "System.IO.Path.Combine",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "System.IO",
... |
62614265 | # Pavlos Antoniou
# 22/01/2021
# train and apply RF
from hail import Table
import os
import pprint
from pprint import pformat
import argparse
import hail as hl
import pandas as pd
import numpy as np
import pyspark
from pprint import pformat
import json
import sys
import re
from pathlib import Path
import logging
from... | null | variant_qc/3.train_apply_finalise_RF.py | 3.train_apply_finalise_RF.py | py | 22,153 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "sys.executable",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "logging.getLo... |
152908465 | import os
from collections import namedtuple
import six.moves.configparser as configparser
import six
import jmespath
from jmespath.exceptions import ParseError
import logging
from logging.handlers import RotatingFileHandler
from .exceptions import IncompleteAccountInfoError
LOG_CLIENT_METHOD_BLACK_LIST = (r'_.+', r'\... | null | aliyunlogcli/config.py | config.py | py | 10,652 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.expanduser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.expanduser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"lin... |
59074620 | #!/usr/bin/env python3
"""
Author : Emmanuel Gonzalez
References: TERRA-REF & AgPipeline
Date : 2020-05-17
Purpose: Clip plots using a shapefile/GeoJSON
"""
import argparse
from terrautils.spatial import clip_raster, \
geometry_to_geojson, convert_json_geometry, convert_geometry
from terrautils.imagefile import image... | null | plotclip/transformer.py | transformer.py | py | 19,815 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentDefaultsHelpFormatter",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
"line_number": 87,
"usage_type": "call"
},
{
... |
97432267 | import json
import inspect
import traceback
import os
import time
import requests
import schedule
import configparser
import copy
import base64
from pathlib import Path
from datetime import datetime
from datetime import timezone
import mysql.connector as DatabaseConnector
#################
# PATH OVERRIDE #
#######... | null | cronjob/cronChecks.py | cronChecks.py | py | 18,737 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "inspect.getframeinfo",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "inspect.currentframe",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
62785725 | import sys
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import skimage.io
import skimage.color
from skimage import exposure
from skimage.feature import blob_doh
from skimage.filters import sobel
def crop_center_fraction(img, fraction):
y, x = img.shape
off = int((min(img.shape) * fract... | null | main.py | main.py | py | 2,201 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.ogrid",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "numpy.sqrt",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "matplotlib.rc",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "skimage.io.io.imread",
... |
88749882 | from setuptools import setup, find_packages
import os
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = "liquidjango",
version = "0.2.4",
packages = find_packages('src'),
package_dir = {'': 'src'},
url = 'https://bitbucket.org... | null | pypi_install_script/liquidjango-0.2.4.tar/setup.py | setup.py | py | 1,056 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.join",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_n... |
277284695 | #!/usr/bin/env python3
from setuptools import setup, Extension
from Cython.Build import cythonize
from numpy import get_include as get_numpy_include
from os import path
exts = [Extension("nuc_dynamics.nuc_cython", [path.join("nuc_dynamics", "nuc_cython.pyx")],
include_dirs=[get_numpy_include()])]
s... | null | setup.py | setup.py | py | 586 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "setuptools.Extension",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "numpy.get_include",
"line_... |
258829183 |
import json
from job.model_template.utils import ModelTemplateDriver
DEBUG = False
class DeeFMTemplateDriver(ModelTemplateDriver):
def __init__(self, output_file=None, args=None, local=False):
super(DeeFMTemplateDriver, self).__init__("DeepFM model template" + ("(debuging)" if DEBUG else ""... | null | studio/micro-services/cube-studio/job-template/job/model_template/tf/deepfm/driver.py | driver.py | py | 896 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "job.model_template.utils.ModelTemplateDriver",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 23,
"usage_type": "call"
}
] |
496430876 | import cv2
import numpy as np
import imutils
cap = cv2.VideoCapture('white_plate.avi')
while(1):
grabbed, frame = cap.read()
hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
# define range of red color in HSV
#lower_red = np.array([161,155,84], dtype=np.uint8)
#upper_red = np.array([179, 255, 255], ... | null | rect_detect.py | rect_detect.py | py | 1,493 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2HSV",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
... |
598897624 | #!/usr/bin/env python3
""" This module contains the Class Puesto
"""
import models
from models.base_model import BaseModel, Base
from sqlalchemy import Column, String, ForeignKey, SmallInteger, Float
class Puesto(BaseModel, Base):
"""Representation of a Puesto de votación"""
if models.storage_t == "db":
... | null | models/puesto.py | puesto.py | py | 888 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "models.base_model.BaseModel",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "models.base_model.Base",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "models.storage_t",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.