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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
147575716 | from django.conf.urls import url
from attendance import views
from attendance import more_views
urlpatterns = [
url(r'^submit/$', views.AttendancePersonal.as_view(), name='attendance-submit'),
url(r'^rolls/$', views.RollsView.as_view(), name='class-rolls'),
url(r'^rolls/class/$', views.ClassRollsView.as_view(),... | null | ap/attendance/urls.py | urls.py | py | 2,646 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "attendance.views.AttendancePersonal.as_view",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "attendance.views.AttendancePersonal",
"line_number": 7,
"usage_type": "att... |
10215360 | # pylint:disable=unused-variable
# pylint:disable=unused-argument
# pylint:disable=redefined-outer-name
import logging
import subprocess
import time
from pathlib import Path
from pprint import pprint
from typing import Dict
import docker
import pytest
import tenacity
from .helpers.utils_docker import ... | null | packages/pytest-simcore/src/pytest_simcore/docker_swarm.py | docker_swarm.py | py | 4,307 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "docker.from_env",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "docker.client",
... |
362728127 | # -*- coding: utf-8 -*-
"""
@author: zicheng
"""
from elasticsearch import Elasticsearch, helpers
from elasticsearch_dsl import Search, Q
import json
es = Elasticsearch()
index_name = 'subtitle_py'
if es.indices.exists(index=index_name):
print("{} already exists; let's get rid of it...".format(ind... | null | ir_part.py | ir_part.py | py | 4,281 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "elasticsearch.Elasticsearch",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "elasticsearch.helpers.bulk",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "ela... |
71890698 | import logging
import weakref
import simuvex
import claripy
l = logging.getLogger("angr.path_history")
class PathHistory(object):
"""
This class keeps track of historically-relevant information for paths.
"""
__slots__ = ('_parent', 'merged_from', 'merge_conditions', 'length', 'extra_length', '_addrs... | null | angr/path_history.py | path_history.py | py | 9,610 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "simuvex.o",
"line_number": 94,
"usage_type": "attribute"
},
{
"api_name": "simuvex.o",
"line_number": 97,
"usage_type": "attribute"
},
{
"api_name": "simuvex.SimActionConst... |
561793309 | from django.http import HttpResponse
from django.shortcuts import render, redirect
from home.models import Product, UserProfile,OrderForm, Order
from datetime import datetime, date
from django.core.mail import send_mail
def index(request):
products = Product.objects.order_by("id")
if request.method == 'POST': #cfm i... | null | meals/views.py | views.py | py | 2,171 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "home.models.Product.objects.order_by",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "home.models.Product.objects",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "home.models.Product",
"line_number": 8,
"usage_type": "name"
},
{... |
534628688 | import psycopg2
from settings import *
import pprint
import json
# Set DB cursur
connDB = psycopg2.connect(("dbname='"+dbName+"' user='"+dbUsername+"' host='"+dbHost+"' password='"+dbPassword+"'"))
cur = connDB.cursor()
#Define road types of interest
roadTypes = ['primary', 'tertiary']
def create_err... | null | findTagError.py | findTagError.py | py | 5,345 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "psycopg2.connect",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 125,
"usage_type": "call"
},
{
"api_name": "pprint.pprint",
"line_number": 126,
"usage_type": "call"
}
] |
33425869 | #!/usr/bin/python3
print("Content-Type: text/html")
print()
print('Hello web')
import cgi, os, view_16, html_sanitizer
'''
files = os.listdir('./16_security_sanitizing/data')
listStr = ''
for item in files:
listStr = listStr + '<li><a href="16_security_sanitizing.py?id={name}">{name}</a></li>'.format(name=item)
'''
... | null | 16_security_sanitizing.py | 16_security_sanitizing.py | py | 1,527 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "html_sanitizer.Sanitizer",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cgi.FieldStorage",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "view_16.getList",
"line_number": 59,
"usage_type": "call"
}
] |
312707200 | from . import views
from django.urls import path, include
app_name='bookapp'
urlpatterns = [
path('', views.index, name='index'),
path('book/<int:book_id>/',views.detail,name='detail'),
path('add/',views.add_book,name='add_book'),
path('update/<int:id>/',views.update,name='update'),
path('delete/<i... | null | bookstore/bookapp/urls.py | urls.py | py | 360 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
267607724 | import shutil
import os
from pathlib import Path
def main():
txtBaseFilePath = [] # Stores base folder text files adrress
txtFile = [] # Stores base folder text file names
txtDestFilePath = [] # Stores dest folder text files adrress
Source_path = "D:\sai"
source = Path('D:\sai')
... | null | File_task.py | File_task.py | py | 1,572 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pathlib.Path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 3... |
227884229 | from functools import wraps
import re
from flask import request, g, Response
from flask_restful import Resource
from app import config as config_module, domain
# from app.domain import Account, User
config = config_module.get_config()
def login_required(f):
@wraps(f)
def decorated_function(*args, **kwargs):... | null | app/resources.py | resources.py | py | 14,711 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "app.config.get_config",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "app.config",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "flask.g",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "flask.Response",
"li... |
505139079 | import js2py
import requests
from scrapy import Selector
import os
import time
"""
https://phishstats.info/------5秒内
先重定向
get https://phishstats.info/, 503
post https://phishstats.info/xxxxxxxx, 200
关闭防火墙等
"""
import re
sess = requests.session()
sess.headers = {"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win... | null | cloudflare/phishstats.py | phishstats.py | py | 3,679 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.session",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 42,
... |
25225781 | import os
import numpy as np
import cv2
import skimage.io
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
from mpl_toolkits.mplot3d import proj3d
from matplotlib import patches
from matplotlib.patches import FancyArrowPatch
from matplotlib.patches import Polygon
from skimage.measure import find_contour... | null | utils/visualization.py | visualization.py | py | 20,807 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.FONT_HERSHEY_SIMPLEX",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "utils.utils.random_colors",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "utils.utils.random_colors_cv2",
"line_number": 18,
"usage_type": "call"
},
{
... |
108243342 | # Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | null | tests/unit/customizations/codedeploy/test_utils.py | test_utils.py | py | 2,111 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "awscli.testutils.unittest.TestCase",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "awscli.testutils.unittest",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "mock.MagicMock",
"line_number": 30,
"usage_type": "call"
},
{
"... |
628808911 |
"""
Usage::
import patch_vs2008
patch_vs2008.apply_patch()
"""
import os
import shutil
import sys
import zipfile
from subprocess import check_call
try:
from urllib.request import urlopen
except ImportError:
from urllib2 import urlopen
PATCH_URL = \
"https://github.com/menpo/condaci/raw/master... | null | appveyor/patch_vs2008.py | patch_vs2008.py | py | 1,538 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.basename",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout.flush",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line... |
507547277 | #!/usr/bin/env python3
# Copyright (C) 2019 National Institute of Informatics
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this fil... | null | python/plugins/broker/mqtt/tests/test_tls.py | test_tls.py | py | 4,902 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "logging.CRITICAL",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "pytest.ma... |
5605521 | from django import forms
class ProjectForm(forms.Form):
name = forms.CharField(
max_length=50,
required=True,
widget=forms.TextInput(
attrs={
'placeholder': 'Project Name'
}
)
)
deadline = forms.DateField(
widget=forms.DateIn... | null | dashboard/forms.py | forms.py | py | 417 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.forms.Form",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "django.forms.CharField",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.forms"... |
9060130 | import torch
from model.sttn.model.sttn import InpaintGenerator
import numpy as np
device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
# cap = torch.cuda.memory_allocated(device)
print(torch.cuda.get_device_properties(device))
print(torch.cuda.get_device_properties(device).total_memory)
#
# net = I... | null | test/test_gpu.py | test_gpu.py | py | 713 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.device",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.cuda.get_devi... |
217118919 | import math
from tkinter import *
from tkinter import messagebox
from tkinter import filedialog
import PIL.Image, PIL.ImageTk
import cv2
import time
from tkinter import ttk
import os
#######################################################################################################
#★★★★먼저 tkinter를 설치해주시기 바랍니다.★★... | null | videoPlayer.py | videoPlayer.py | py | 23,314 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.strftime",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "time.gmtime",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "tkinter.ttk.Entry",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "tkinter.ttk",
"line_n... |
175381566 | import json
import logging
import optparse
import os
import sys
log = logging.getLogger('cratools')
log.addHandler(logging.StreamHandler(sys.stderr))
log.setLevel(logging.WARN)
repo_root = os.path.dirname(os.path.dirname(__file__))
class MissingDataFile(Exception): pass
class Config(object):
def __init__(self,... | null | cratools/command.py | command.py | py | 1,416 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.StreamHandler",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "logging.WARN",
... |
596789732 | import requests
from bs4 import BeautifulSoup
from flask import Flask, jsonify, render_template
import re
from flask_bootstrap import Bootstrap
app = Flask(__name__)
Bootstrap(app)
release_notes_urls = {'gke-stable': 'https://cloud.google.com/kubernetes-engine/docs/release-notes-stable',
'gke-ra... | null | app.py | app.py | py | 4,981 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask_bootstrap.Bootstrap",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
... |
614018523 | import boto3
import json
import xlrd
from openpyxl import workbook, Workbook
from openpyxl import load_workbook
import openpyxl
class ReadReviews:
loc = ("E://NLP//Reviews.xlsx")
comprehend = boto3.client(service_name='comprehend', region_name='us-east-1')
def __init__(self):
self.wb... | null | review_analysis.py | review_analysis.py | py | 1,937 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "boto3.client",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "xlrd.open_workbook",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "openpyxl.load_workbook",
... |
381590651 | import pygame
pygame.init()
screen_width = 800
screen_height = 600
screen = pygame.display.set_mode((screen_width, screen_height))
# Text Renderer
def text_format(message, textFont, textSize, textColor):
newFont = pygame.font.Font(textFont, textSize)
newText = newFont.render(message, 0, textColor)
re... | null | menu.py | menu.py | py | 2,894 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.init",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pygame.font.Font... |
3272711 | from __future__ import unicode_literals
import unittest
from mock import Mock, patch
from clld.tests.util import TESTS_DIR
class Tests(unittest.TestCase):
def get_result(self):
return TESTS_DIR.joinpath('fmpxmlresult.xml').open(encoding='utf8').read()
def test_Result(self):
from clld.lib.fm... | null | clld/tests/test_lib_fmpxml.py | test_lib_fmpxml.py | py | 1,438 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "clld.tests.util.TESTS_DIR.joinpath",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "clld.tests.util.TESTS_DIR",
"line_number": 11,
"usage_type": "name"
},
{
... |
623115303 | import scrapy
#to run from command line, use
#>>scrapy crawl spammers
#and to run and export use this
#scrapy crawl spammers -o spammers.json
#if you run it twice, it appends and will break the json file
class SpammerSpider(scrapy.Spider):
name = "spammers"#this is the name that appears above when running
#... | null | damselfly/damselfly/spiders/spammers_spider.py | spammers_spider.py | py | 1,518 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scrapy.Spider",
"line_number": 11,
"usage_type": "attribute"
}
] |
581131504 | from transformers import BartTokenizerFast
import sys
import os
MSG_LEN = 4
LEARNING_RATE = 2e-5
HEAD_LEARNING_RATE = 2e-3
GUMBEL_TAU = 0.5
BIT_MULTIPLIER = 1
WEIGHT_DECAY = 0.01
LOSS_WEIGHTS = {'sbart': 50, 'bit_acc': 1, 'reconstruction': 0.2, 'discriminator': 1}
tokenizer = BartTokenizerFast.from_pretrained(os.path... | null | BART_Watermarker/hparams.py | hparams.py | py | 495 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "transformers.BartTokenizerFast.from_pretrained",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "transformers.BartTokenizerFast",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},... |
132019196 | import json
from administrator.models import Student
with open('students-gr1.json') as f:
students_json = json.load(f)
for student in students_json:
student = Student(first_name=student['first_name'].upper(), middle_name=student['middle_name'].upper(), last_name=student['last_name'].upper(), lrn=student['lrn'... | null | importjson.py | importjson.py | py | 580 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.load",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "administrator.models.Student",
"line_number": 8,
"usage_type": "call"
}
] |
375702362 | import click
from moodle_manager import MoodleManager
import translators as ts
moodle = None
def _check_moodle_object():
global moodle
if moodle is None:
moodle = MoodleManager()
@click.group()
def cli():
"""CLI tool for managing Moodle Events Notifier"""
pass
@cli.command('show_events')
... | null | moodle_events_notifier/cli.py | cli.py | py | 2,114 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "moodle_manager.MoodleManager",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "click.group",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "click.echo",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "click.progressbar... |
562961436 | from django.urls import path, include
from . import views
from rest_framework.routers import DefaultRouter
"""django_test URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an im... | null | products/urls.py | urls.py | py | 2,279 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "django.urls.include",
"line_number": 29,
"usage_type": "call"
},
{
"api_nam... |
506959772 | import yaml
import ipaddress
import sys
ROUTER_NETWORK = ipaddress.ip_network("100.64.0.0/20")
PODS_PATH = ["./host_vars/pod1.yml", "./host_vars/pod2.yml"]
def modify_group_all_ver(count, path="./group_vars/all.yml"):
obj = {}
with open(path, "r") as f:
obj = yaml.load(f, Loader=yaml.SafeLoader)
... | null | ansible_setup/generate_pods_vars.py | generate_pods_vars.py | py | 1,492 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "ipaddress.ip_network",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "yaml.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "yaml.SafeLoader",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "yaml.dump",
"l... |
279971806 | import xml.dom.minidom
import shutil
import os
moduleName = "MultiAccountChat"
moduleDmName = "Relena_" + moduleName + ".dm"
moduleSwfName = moduleName + ".swf"
moduleXmlName = "xml"
srcPath = "."
dstPath = os.environ['PROGRAMFILES(X86)'] + "\\Dofus2BetaModule\\app\\ui\\" + moduleName;
dom = xml.dom.minidom.parse(sr... | null | install_win.py | install_win.py | py | 950 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "xml.dom.minidom.dom.minidom.parse",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "xml.dom.minidom.dom",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_na... |
448907952 | # -*- coding: utf-8 -*-
"""
Created on Thu Jul 4 21:11:20 2019
@author: coding.
@price: 50
@introduction:
爬取猫眼即将上瘾电影并进行分析。
"""
import urllib.request
from lxml import etree
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import cm
import json
def get_response(url, headers):
"... | null | maoyan/maoyan.py | maoyan.py | py | 4,122 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "urllib.request.request.Request",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 30,
"usage_type": "name"
},
{
"api_nam... |
426421618 | import cv2
import numpy as np
import imutils
import base64
cap = cv2.VideoCapture(0)
cap.set(cv2.CAP_PROP_FRAME_WIDTH,320);
cap.set(cv2.CAP_PROP_FRAME_HEIGHT,240);
def get_approx(c, value, peri):
return cv2.approxPolyDP(c, value * peri, True)
def is_shape(approx, area, hullArea):
(x, y, w, h) = cv2.bounding... | null | misc_code/angle.py | angle.py | py | 1,949 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FRAME_WIDTH",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "cv2.CAP_PROP_FRAME_HEIGHT",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_na... |
494858906 | '''VoidFinder - Hoyle & Vogeley (2002)'''
################################################################################
#
# IMPORT MODULES
#
################################################################################
from voidfinder import filter_galaxies, find_voids
import numpy as np
from astropy.io impo... | null | python/scripts/DESI_void_mock_7_voidfinder.py | DESI_void_mock_7_voidfinder.py | py | 4,217 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "astropy.io.fits.open",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "astropy.io.fits",
"line_number": 84,
"usage_type": "name"
},
{
"api_name": "astropy.table.Table",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "numpy.load",... |
464225420 | import numpy as np
import cv2
import pyrealsense2 as rs
import matplotlib.pyplot as plt
#config = rs.config()
#config.enable_record_to_file('test.bag')
pipe = rs.pipeline()
profile = pipe.start()
#profile = pipe.start(config)
try:
while True:
frames = pipe.wait_for_frames()
... | null | Next_Gen/Circles/live_video.py | live_video.py | py | 1,492 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pyrealsense2.pipeline",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.asanyarray",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_RGB2BGR"... |
178732518 | import _pickle as cPickle
import numpy as np
import math
from torch.utils.data import Dataset, DataLoader
from .constants import TEST_LIST_20, TEST_LIST_30
class RawDataLoader(object):
def __init__(self, data_path, data_name):
self.path = data_path
self.dataset = self._load_file(data_name)
... | null | rnn_classification/data_manager.py | data_manager.py | py | 4,140 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "_pickle.Unpickler",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "constants.TEST_LIST_30",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "constants.TEST_LIST_20",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "math.... |
479336002 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import os,sys,datetime,time,subprocess,threading
tomcat_dict = {}
tomcat_name = sys.argv[1].split(',')
current_date = datetime.date.fromtimestamp(time.time()) #当天日期
def run_cmd(cmd):
'''
运行命令,获取结果
:param cmd:
:return: 命令的结果
'''
global result
... | null | sundry/tomcat_xsbs.py | tomcat_xsbs.py | py | 2,621 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "datetime.date.fromtimestamp",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "time.time",... |
231961440 | import subprocess
from datetime import datetime
from time import sleep
from quokka.controller.utils import get_response_time
from quokka.models.apis import get_all_hosts, set_host, record_host_status
class HostMonitorTask:
def __init__(self):
self.terminate = False
def set_terminate(self):
... | null | quokka/controller/HostMonitorTask.py | HostMonitorTask.py | py | 1,507 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "quokka.models.apis.get_all_hosts",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "subprocess.check_output",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "quokka.controller.utils.get_response_time",
"line_number": 35,
"usage_type": "ca... |
596753022 | import json
import os
import pytest
from mock import MagicMock, patch
from requests import HTTPError, Timeout
from tests.common import HERE
from datadog_checks.unifi_console.api import UnifiAPI
from datadog_checks.unifi_console.config import UnifiConfig
from datadog_checks.unifi_console.errors import Unauthorized
fro... | null | unifi_console/tests/test_api.py | test_api.py | py | 4,233 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datadog_checks.unifi_console.config.UnifiConfig",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "mock.MagicMock",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datadog_checks.unifi_console.api.UnifiAPI",
"line_number": 17,
"usage_type... |
73460168 | from __future__ import absolute_import
import inflection
import os
import json
from django.http.request import QueryDict
from urlparse import urlparse, urlunparse
from uuid import UUID
from django import template
from django.utils.safestring import mark_safe
from django.utils import six
from dynamic_rest.conf import s... | null | dynamic_rest/templatetags/dynamic_rest.py | dynamic_rest.py | py | 3,003 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.template.Library",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "django.utils.six.string_types",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_na... |
320666776 | from flask import Flask,render_template,request
import numpy as np
import pandas as pd
import cv2
import matplotlib.pyplot as plt
import time
import os
import face_recognition
import kairos_face as kf
kf.settings.app_id = '20a555a4'
kf.settings.app_key = '19f94e54b3b8becaf7465a3e698428f6'
app = Flask(__name__)
print... | null | checking.py | checking.py | py | 2,008 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "kairos_face.settings",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "kairos_face.settings",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "flask.Flask",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.V... |
127078459 | #!/usr/bin/env python
import json
import re
json_config = open("config.json").read()
# Remove comments.
json_config = re.sub("//.*", "", json_config, re.MULTILINE)
config = json.loads(json_config)
# Create the hosts file lines.
lines = ["%s %s\n" % (config["haproxy_bind_ip"], proxy["dest_addr"]) for proxy in config... | null | writehosts.py | writehosts.py | py | 442 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.sub",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "re.MULTILINE",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 10,
"usage_type": "call"
}
] |
250601079 | #!
import os, PyPDF2, re, shutil, send2trash #imports
from pathlib import Path
def walk(wP, boole, pword):
paths = []
#print(str(boole) + ' : ' + wP)
for folderName, subfolders, filenames in os.walk(wP):
for subfolder in subfolders:
lazy = 'lazy'
for filename in filenames:
... | null | python/test/Ch15/pdfParanoia.py | pdfParanoia.py | py | 2,865 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.walk",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PyPDF2.PdfFileReader",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "PyPDF2.PdfFileWriter",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_n... |
63822236 | from collections import Sequence
from django.test import TestCase
from story.seed_data import CHARACTERS, GROUPS, LOCATIONS, TITLES
DATA_LISTS = [CHARACTERS, GROUPS, LOCATIONS, TITLES]
class SeedDataTests(TestCase):
def test_data_structure(self):
"""Confirm consistency and format of seed data lists"""
for data... | null | story/tests/test_seed_data.py | test_seed_data.py | py | 696 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "story.seed_data.CHARACTERS",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "story.seed_data.GROUPS",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "story.seed_data.LOCATIONS",
"line_number": 6,
"usage_type": "name"
},
{
"api_name... |
20071137 | from krun import LOGFILE_FILENAME_TIME_FORMAT
from krun.config import Config
from krun.env import EnvChangeAppend
import os
import pytest
import time
from distutils.spawn import find_executable
JAVA = find_executable("java")
from krun.tests import TEST_DIR
def touch(fname):
with open(fname, 'a'):
os.uti... | null | krun/tests/test_config.py | test_config.py | py | 8,450 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "distutils.spawn.find_executable",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.utime",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "krun.tests.TEST... |
81711587 | import delta_initial_actions
import os
import sys
from PyQt5 import QtWidgets
from create_database import CreateDatabase
from query_controller import ViewDatabase
from database_builder import Ui_DatabaseBuilder
from open_file_dialog import open_fd
def open_driver():
os.startfile('C:\Windows\SysWOW64\odbcad32.ex... | null | app.pyw | app.pyw | pyw | 7,198 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.startfile",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QMessageBox",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidg... |
410759112 | import copy
import os
import pytest
import numpy as np
import pandas as pd
import flopy
from ..gis import shp2df
@pytest.fixture(scope='function')
def period_data(shellmound_sfrdata):
#shellmound_sfrdata = copy.deepcopy(shellmound_sfrdata)
perdata = shellmound_sfrdata.period_data
rd = shellmound_sfrdata.r... | null | sfrmaker/test/test_sfr_data.py | test_sfr_data.py | py | 7,168 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pytest.fixture",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "numpy.array_equal... |
224735949 | """Functions and variables shared accross the notebooks."""
from glob import glob
import os
import pandas as pd
from PIL import Image
import seaborn as sn
from sklearn.metrics import confusion_matrix
from sklearn.model_selection import train_test_split
import syft as sy
import torch
import torchvision.transforms as ... | null | examples/Serving and Querying models on Grid/skin_cancer_model_utils.py | skin_cancer_model_utils.py | py | 7,007 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "glob.glob",
"line_number": 26,
"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.path.splitext",
"line_numb... |
196402066 | import numpy as np
import gpflow as gp
from scipy.stats import norm
import matplotlib.pyplot as plt
from gpflow.utilities import print_summary
import sys
# sys.path.append('./examples')
# from branin import branin
from mpl_toolkits.mplot3d import Axes3D
import h5py
from plots import *
def EI(sigma_x, u_x , f_best):
... | null | EI.py | EI.py | py | 3,580 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scipy.stats.norm.cdf",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "scipy.stats.norm",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "scipy.stats.norm.pdf",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "scipy.stat... |
258243020 | import os
import json
# json_string = '''
# {
# "00_Pipeline" : "",
# "Project_root" : ""
# }
# '''
#
# print json_string
#
# json_object = json.loads(json_string)
#
# print 'json_object', json_object
#
# json_object["00_Pipeline"] = "P:/hello/"
#
# new_string = json.dumps(json_object, indent=2)
#
# print 'new_str... | null | scratch.py | scratch.py | py | 659 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.load",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 32,
"usage_type": "call"
}
] |
455336915 | __author__ = "Petr Kohout <xkohou14@stud.fit.vutbr.cz>"
__date__ = "$29.8.2020 10:43:10$"
from debug.iniLoader import IniLoader
from utils.vector import Vector
from objects.ball import Ball
from generator.generator import Generator
import random
class BallGenerator(Generator):
def __init__(self, INI_FILE):
... | null | src/generator/ball_generator.py | ball_generator.py | py | 2,418 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "generator.generator.Generator",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "debug.iniLoader.IniLoader.load",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "debug.iniLoader.IniLoader",
"line_number": 20,
"usage_type": "name"
},
{... |
517397176 | # coding: utf-8
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
"",
url(r"^siteadmin/", include(admin.site.urls)),
url(r"^airport/", include("apps.... | null | src/air/urls.py | urls.py | py | 961 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.conf.urls.patterns",
"line_number": 13,
"usage_type": "call"
},
{
"... |
424093725 | import gym
import dqn.Network as Network
import cv2
import torch
import torch.optim as optim
import numpy as np
import torch.nn as nn
from torch.utils.tensorboard import SummaryWriter
from collections import deque
import random
import time
import os
import copy
import torch.nn.functional as F
from dqn.alg import AgentD... | null | proportional_prioritization/double_dqn_pp.py | double_dqn_pp.py | py | 7,556 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "dqn.alg.AgentDQN",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "copy.deepcopy",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "collections.deque",
... |
465652876 | #!/usr/bin/env python
from sklearn.ensemble import RandomForestRegressor as _RandomForestRegressor
from codec import codecs_manager
from base import *
from util.param_util import convert_params
class RandomForestRegressor(EstimatorMixin):
def __init__(self, options):
self.handle_options(options)
... | null | apps/Splunk_ML_Toolkit/bin/algos/RandomForestRegressor.py | RandomForestRegressor.py | py | 1,749 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "util.param_util.convert_params",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sklearn.ensemble.RandomForestRegressor",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "codec.codecs_manager.add_codec",
"line_number": 41,
"usage_type": "... |
102765550 | from nav_msgs.msg import Odometry
import numpy as np
import rospy
from math import cos, sin
from std_msgs.msg import Float32MultiArray
from tf.transformations import euler_from_quaternion
rospy.init_node('abs_motion')
def odom_callback(msg):
global phi
position = msg.pose.pose.position
(_, _, phi) = eul... | null | motion_mpo_500/src/absolute_motion.py | absolute_motion.py | py | 1,529 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rospy.init_node",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tf.transformations.euler_from_quaternion",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "rospy.Subscriber",
"line_number": 17,
"usage_type": "call"
},
{
"api_name... |
535105322 | import os
from collections import namedtuple
import pandas as pd
import csv
import numpy as np
import scipy.stats as stats
POUNDS_TO_KG = 2.20462262185
INCHES_TO_CM = 2.54
CDCDataEntry = namedtuple('CDCDataEntry', ['Sex', 'factor', 'L', 'M', 'S'])
def build_cdc_stats_table(path):
with open(path) as csv_file:
... | null | height_age_weight_percentiles.py | height_age_weight_percentiles.py | py | 4,008 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.namedtuple",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.floor",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.floor",
"line... |
160160040 | #!/usr/bin/python3
"""
@author: Gregory Kramida
@licence: Apache v2
Copyright 2016 Gregory Kramida
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
U... | null | multistereo.py | multistereo.py | py | 10,298 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "enum.Enum",
"line_number": 81,
"usage_type": "name"
},
{
"api_name": "common.args.string_arr",
"line_number": 95,
"usage_type": "argument"
},
{
"api_name": "common.args.required_length",
"line_number": 95,
"usage_type": "call"
},
{
"api_name": "comm... |
73447504 | import logging
from typing import List, Tuple, Dict, Any # noqa
from asphalt.core import (
ContainerComponent, Context, merge_config, PluginContainer,
context_teardown)
from async_generator import yield_
from typeguard import check_argument_types
from asphalt.web.servers.base import BaseWebServer
logger = l... | null | asphalt/web/component.py | component.py | py | 2,435 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "asphalt.core.PluginContainer",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "asphalt.web.servers.base.BaseWebServer",
"line_number": 13,
"usage_type": "argument"
},
... |
437113314 | #
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
from abc import ABC
from typing import Any, Iterable, List, Mapping, MutableMapping, Optional, Tuple
import pendulum
import requests
from airbyte_cdk.sources import AbstractSource
from airbyte_cdk.sources.streams import Stream
from airbyte_cdk.sources.stre... | null | dts/airbyte/airbyte-integrations/connectors/source-wrike/source_wrike/source.py | source.py | py | 5,051 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "airbyte_cdk.sources.streams.http.HttpStream",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "abc.ABC",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "requests.Response",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_na... |
496038413 | import xml.dom.minidom as dom, json, copy
from com.pajk.plazass.utils import DictUtil,RocketMQWriter,ScheduleDao,AllHttpClientWriter,LogUtil,DateTimeUtil,ValidateUtil,CommonUtils
# import_script 武汉大学人民医院/Abstract.py
## 武汉大学人民医院 获取号源
class GetResource(Abstract):
def __init__(self):
self.__visitNoon = {"0": ... | null | whrm/GetResource.py | GetResource.py | py | 5,816 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "com.pajk.plazass.utils.DictUtil.getDictValue",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "com.pajk.plazass.utils.DictUtil",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 20,
"usage_type": "call"
},
... |
45239628 | from django.shortcuts import render, redirect
from .models import Orders, DrinkChoice, Keyword
from .forms import CardForm
from django.contrib import messages
import datetime
from django.core.mail import EmailMessage
def index(request):
order_list = Orders.objects.order_by('drink')
keyword_list = Keyw... | null | CoffeeApp/liquidbeans/coffee/views.py | views.py | py | 1,806 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "models.Orders.objects.order_by",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "models.Orders.objects",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "models.Orders",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "... |
215480751 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import time
from random import random, randint, seed
from flask import Flask, jsonify
from flask import abort
from flask import make_response
from flask import request
from flask import url_for
from flask_httpauth import HTTPBasicAuth
import json
import subprocess
import r... | null | Projeto_2/app.py | app.py | py | 7,447 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask_httpauth.HTTPBasicAuth",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "flask.make_res... |
94794877 | # *- coding:utf8 *-
import sys
import os
sys.path.append(os.path.dirname(os.getcwd()))
from flask_restful import Resource
from config.Logs import PRINT_API_NAME
class AUsers(Resource):
def post(self, users):
print(PRINT_API_NAME.format(users))
apis = {
"register":"control_user.register... | null | LoveBreakfast/apis/AUsers.py | AUsers.py | py | 662 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
253376463 | #!/usr/bin/env python3
import os
import sys
import json
import subprocess
settings = json.load(open('src/_settings.json'))
appTitle = settings['appTitle']
appFoot = settings['appFoot']
baseHtml = '''
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
... | null | Make.py | Make.py | py | 4,310 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 150,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 153,
... |
374489935 | from application import db
from application.core.models import Order, User, Location, Dish
from application.utils import geocode, date
from . import userservice
from datetime import datetime, timedelta
import settings
from math import floor
from typing import List
def get_current_order_by_user(user_id: int) -> Order:... | null | application/core/orderservice.py | orderservice.py | py | 5,730 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "application.core.models.Order.confirmed",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "application.core.models.Order",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "application.core.models.Order",
"line_number": 11,
"usage_type... |
425888604 | import networkx as nx
import matplotlib.pyplot as plt
###### Ego Networks - Size, Density, Structural Holes, Brokerage, Homophily ######
'''
Ego networks simply refer to a network which consists of a central node and its surrounding alters (one path length away). The
size and density of an ego network are quite strai... | null | Chapter5ActorLevelEgo.py | Chapter5ActorLevelEgo.py | py | 6,432 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "networkx.Graph",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "networkx.ego_graph",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "networkx.degree",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "networkx.density",
... |
264966236 | ##############################---------Forecasting ---------#####################################
###################---Github---#####################
# --------Importing Important Libraries and API's--------
import pandas as pd
import numpy as np
import github3
imp... | null | Github_Analytics.py | Github_Analytics.py | py | 3,830 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "urllib.error",
"line... |
652029774 | """
Content
-----------------------------------------------------------------------------
This module contains a single class, mzMLmeta, which is used to parse and
serialize an mzML file into a Python dictionnary. This class was slightly
modified from the pymzml implementation[1]_.
Following features are implemented... | null | mzml2isa/mzml.py | mzml.py | py | 25,427 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.dirname",
"line_number": 106,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 106,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 106,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"... |
77499229 | import itchat
itchat.login()
friends = itchat.get_friends(update=True)[0:]
def get_var(var):
variable = []
for i in friends:
value = i[var]
variable.append(value)
return variable
NickName = get_var("NickName")
Sex = get_var('Sex')
Province = get_var('Province')
City = get_var('City')
Signatu... | null | wechat/see2chat.py | see2chat.py | py | 2,009 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "itchat.login",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "itchat.get_friends",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line... |
155667769 | __author__ = 'codegrafix'
#call mvvOnlinePlanner
import os, sys
from datetime import date
import time
import webbrowser
def main(mvvurl):
cdate=date.today()
ctime=time.localtime()
#current time
itdTime='itdTime='
for i in range(3,5):
if len(str(ctime[i])) < 2:
itdTime = itdTi... | null | main.py | main.py | py | 1,043 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.date.today",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "time.localtime",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "webbrowser.open",
... |
452919660 | from extracting_data import extract_data
from feature_encoding import onehot_encoding
from train_model import train_model
import nltk
from nltk.stem.lancaster import LancasterStemmer
stemmer = LancasterStemmer()
import numpy as np
import pickle
import json
import random
from keras.models import load_model... | null | chatbot_model/Talk.py | Talk.py | py | 2,921 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "nltk.stem.lancaster.LancasterStemmer",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "nltk.word_t... |
322806805 | # Copyright 2014 Cloudera Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | null | ibis/tests/test_comms.py | test_comms.py | py | 11,505 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.remove",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.error",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "pytest.mark.skipif",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_nu... |
310975170 | import cv2
import sys
import numpy as np
from imutils import contours
import imutils
def _abrir_archivo(dir):
imagen = cv2.imread(dir)
if imagen == None:
print("No se puede abrir imagen")
sys.exit(1)
return imagen
def order_points(pts):
# initialzie a list of coordinates that will be ord... | null | PYT_DOC/algoritmo_2.py | algoritmo_2.py | py | 4,855 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.imread",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.argmin",
"line_number": 25,
... |
39737737 | import math
import time
import matplotlib.pyplot as plt
import serial
# init serial - source for the data
SERIAL_PORT = '/dev/tty.usbmodem14201' # path to serial output on Mac
SERIAL_RATE = 9600
ser = serial.Serial(SERIAL_PORT, SERIAL_RATE)
# containers for data to be displayed on plot
last_x, last_y, last_z = None... | null | plotter/plotter_serial_scatter.py | plotter_serial_scatter.py | py | 2,127 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "serial.Serial",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "serial.Seria... |
496426570 | from plotly.basedatatypes import BaseLayoutHierarchyType
import copy
class Line(BaseLayoutHierarchyType):
# width
# -----
@property
def width(self):
"""
Sets the line width. Has an effect only when `type` is set to
"line".
The 'width' property is a number and may ... | null | plotly/graph_objs/layout/mapbox/layer/_line.py | _line.py | py | 2,714 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "plotly.basedatatypes.BaseLayoutHierarchyType",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "copy.copy",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "plotly.validators.layout.mapbox.layer.line.WidthValidator",
"line_number": 90,
"usa... |
87098934 | import asyncio
import discord
import json
import requests
import re
import time
import threading
from random import choice
from pyfp import Pipe, Match
from pymongo import MongoClient
from doughbot.bot_helpers import command_prefix, restrict_to, get_role, log
MUTE_REGEX = re.compile(r"^mute <@!\d+> \d+[s,m,h,d,w]")
c... | null | doughbot/bot.py | bot.py | py | 4,520 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.compile",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "discord.Client",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"l... |
337180248 | #!/usr/bin/env python3
import elasticsearch, getopt, logging, sys, urllib3
logging.basicConfig(level = logging.ERROR)
def usage():
print('Usage: {} [OPTIONS]'.format(sys.argv[0]))
print('Options:')
print(' -d enable debug')
print(' -p port the port of the ES server (default "9200... | null | elk/es2report.py | es2report.py | py | 2,324 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "logging.ERROR",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "getopt.getopt",
... |
510087073 | import os,sys,pprint
import numpy as np
import pandas as pd
from scipy.signal import savgol_filter
from copy import deepcopy
import time
printer = pprint.PrettyPrinter(indent=3)
home_dir = os.path.expanduser('~')
extracted_path = os.path.join(home_dir, 'data_pool/waterfall_data')
process_keys = ['B_band','G_band','R... | null | SG_filter/sg_ref_test.py | sg_ref_test.py | py | 6,724 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pprint.PrettyPrinter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.expanduser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
... |
42405448 |
from collections import defaultdict
import networkx
from grandalf.utils.geometry import getangle
from grandalf.graphs import Graph, Edge, Vertex
from grandalf.layouts import VertexViewer, SugiyamaLayout
from grandalf.routing import EdgeViewer
from atom.api import List, Typed, ForwardTyped, observe
from enaml.widgets... | null | angrmanagement/ui/graph/flowgraph.py | flowgraph.py | py | 6,475 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "graph.QtGraph",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "atom.api.ForwardTyped",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "grandalf.utils.geometry.getangle",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "... |
397327882 | # -*- encoding: utf-8 -*-
import sqlite3
import datetime
conn = sqlite3.connect('test.sql3', detect_types=sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES)
#conn = sqlite3.connect(dbFilePath, detect_types=sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES)
cs = conn.cursor()
cs.execute('''CREATE TABLE IF NOT EXISTS Histo... | null | database/SQLite3/type/datetime/datetime.py | datetime.py | py | 894 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlite3.connect",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sqlite3.PARSE_DECLTYPES",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sqlite3.PARSE_COLNAMES",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": ... |
277743362 | #!/usr/bin/env python3
import hmac
import json
import sys
PREFIX = "ugra_soviet_technologies_are_eternal_"
TOKEN_SECRET = b"fluctuation-constellation-accumulation-architecture-refrigerator"
TOKEN_SALT_SIZE = 16
FLAG_SECRET = b"comfortable-intermediate-battlefield-firefighter-contradiction"
FLAG_SALT_SIZE = 12
def g... | null | tasks/soviet/generate.py | generate.py | py | 1,162 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "hmac.new",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "hmac.new",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "hmac.new",
"line_number": 24,
... |
296336604 | # 环境变量配置,用于控制是否使用GPU
# 说明文档:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html#gpu
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
from paddlex.det import transforms as t
import paddlex as pdx
import paddle
# # 下载和解压昆虫检测数据集
# insect_dataset = 'https://bj.bcebos.com/paddlex/datasets/insect_det.ta... | null | old/gear/pdx.py | pdx.py | py | 3,107 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.environ",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "paddlex.det.transforms.Compose",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "paddlex.det.transforms",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "... |
239987332 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# IMPORT STANDARD LIBRARIES
import os
import unittest
# IMPORT LOCAL LIBRARIES
from pysix import six
from pythonx import helper
import common
class helper(object):
'''dummy class.'''
def __init__(self):
'''.'''
super(helper, ... | null | tests/test_helper.py | test_helper.py | py | 6,149 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.linesep",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "pysix.six.string_types",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "pysix.six",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "common.BaseDocs... |
581532315 | import numpy
from scipy import stats
from hctsa.Operations import CO_AutoCorr
def SY_LocalGlobal(y, subsetHow='l', n=''):
"""
"""
if subsetHow == 'p' and n == '':
n = .1
elif n == '':
n = 100
N = len(y)
if subsetHow == 'l':
r = range(0, min(n, N))
elif subse... | null | hctsa/Operations/SY_LocalGlobal.py | SY_LocalGlobal.py | py | 1,180 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.round",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.random.randint",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"lin... |
123183536 | import cv2 as cv
import mediapipe as mp
import time
class HandDetector:
def __init__(self,
static_image_mode=False,
max_num_hands=2,
model_complexity=1,
min_detection_confidence=0.5,
min_tracking_confidence=0.5):
self.mp... | null | Projects/FingerCounter/HandTrackingModule.py | HandTrackingModule.py | py | 2,388 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "mediapipe.solutions",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "mediapipe.solutions",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "cv2.cvtColor",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "cv2.CO... |
382026288 | import matplotlib.pyplot as plt
import numpy as np
import os
import sys
sys.path.append("..")
import config
from utils import sfs_utils, diversity_utils, HGT_utils
from parsers import parse_midas_data
def process_one_species(species_name):
if os.path.exists(os.path.join(config.analysis_directory, 'allele_freq', s... | null | HGT_scripts/plot_sfs_and_count_peaks.py | plot_sfs_and_count_peaks.py | py | 2,372 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
609394950 | import ast
import collections
files = [
# 'output/n-gram-predicted-needs-1.vec.txt',
# 'output/prediction-lstm-1.vec.txt',
# 'output/seq-2-seq-needs.vec.txt',
# 'output/weather-need.vec.txt',
# 'output/testing-seq-2-seq-r01.vec.txt',
]
need_size = 50
half_day = False
for file in files:
my_da... | null | results/tvector-half-day.py | tvector-half-day.py | py | 1,927 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "ast.literal_eval",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 51,
"usage_type": "call"
}
] |
445145283 | from statistics import mean
import operator
import pprint
import pandas
from sklearn.cross_validation import KFold, cross_val_score
from sklearn.neighbors import KNeighborsClassifier
from sklearn.preprocessing import scale
from Common.common_io import save_to_file
pp = pprint.PrettyPrinter(depth=6)
def get_best_k_s... | null | MLMainProject/Week2/Assignment1_KNN/main.py | main.py | py | 1,166 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pprint.PrettyPrinter",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sklearn.cross_validation.KFold",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sklearn.neighbors.KNeighborsClassifier",
"line_number": 18,
"usage_type": "call"
},... |
156414445 | # -*- coding: utf-8
# author by Mr.Bidosto
import os
try:
import requests
except ImportError:
print("\n [!] module requests belum terinstall")
os.system("pip install requests")
try:
import bs4
except ImportError:
print("\n [!] module bs4 belum terinstall")
os.system("pip install bs4")
try:
impo... | null | simplebf.py | simplebf.py | py | 26,555 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.system",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number... |
206343613 | import torch
import torch.nn as nn
import math
from collections import OrderedDict
class Layer(nn.Sequential):
'''block中的每个卷积层包含三层卷积,先升维,再卷积,再降维'''
def __init__(self, num_input_features, num_output_features=32, bn_size=4):
'''维度默认×4'''
super(Layer, self).__init__()
#先把维度升上去
self.... | null | 对照实验/固定的随机连接网络共同代码/Fixed_Random_Connect.py | Fixed_Random_Connect.py | py | 6,875 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Sequential",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_... |
541462240 | # Copyright (c) 2014-2017 by Ron Frederick <ronf@timeheart.net>.
# All rights reserved.
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License v1.0 which accompanies this
# distribution and is available at:
#
# http://www.eclipse.org/legal/epl-v10.html
#
#... | null | base/lib/python/asyncssh/crypto/pyca/dsa.py | dsa.py | py | 3,087 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "misc.PyCAKey",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "cryptography.hazmat.primitives.asymmetric.dsa.DSAParameterNumbers",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "cryptography.hazmat.primitives.asymmetric.dsa",
"line_number":... |
264980218 | import numpy as np
import re
import json
from markdown2 import Markdown
from Bio import Entrez
from Bio import SeqIO
from collections import defaultdict, OrderedDict
from scipy import stats
from utils import getBindingCore, importBindData,\
importData, reference_retreive, div0, getBindingCore, getRandomColor
def s... | null | uniqueSeqsPTM.py | uniqueSeqsPTM.py | py | 7,517 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.defaultdict",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "scipy.stats.fisher_exact",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "scipy.stats",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "collecti... |
119417435 | from loguru import logger
from util import util
from db import dao
from telegram import ParseMode
from models.bakchod import Bakchod
import shortuuid
import datetime
import traceback
def handle(update, context):
try:
util.log_chat("daan", update)
# Extract query...
query = update.messag... | null | src/handlers/daan.py | daan.py | py | 4,007 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "util.util.log_chat",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "util.util",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "telegram.ParseMode.MARKDOWN",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "telegra... |
282774090 | import discord
import asyncio
import evaluate
import json
client = discord.Client()
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name)
print(client.user.id)
print('------')
client.change_status("with a Python")
@client.event
async def on_message(message):
disable... | null | discord_pyevaluate/discord_pyevaluate.py | discord_pyevaluate.py | py | 1,847 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "discord.Client",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "evaluate.check_if_safe",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "evaluate.get_evaluation",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "json.loa... |
622013994 | #-*- coding: utf-8 -*-
from django.conf import settings
from django.http import HttpResponseRedirect
from django.http import HttpResponse
from models.User import User
from google.appengine.api import users
def create_database_dict(database_dict = {}):
def get_db_object(db_class, main_key = None):
if main_... | null | apps/common/middlewares/authappuser.py | authappuser.py | py | 2,907 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.settings.IS_AUTH",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "models.User.User.install",
"line_number": 29,
"usage_type": "call"
},
{
"a... |
528726798 | import re
import asyncio
from httptools import HttpParserError, HttpRequestParser
from request import Request
class RouterError(Exception): pass
class HttpProtocol(asyncio.Protocol):
__slots__ = ("_route", "_loop", "_transport", "_parser", "_request")
def __init__(self, event_loop=None, route=None, re_rout... | null | server.py | server.py | py | 3,136 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "asyncio.Protocol",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "httptools.HttpRequestParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "request.Request",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "http... |
500570010 | from __future__ import annotations
from typing import List
from FindLocationsOfAKnownKmer import find_kmer_locations
# MARKDOWN
def find_kmer_clusters(sequence: str, kmer: str, min_occurrence_in_cluster: int, cluster_window_size: int) -> List[int]:
cluster_locs = []
locs = find_kmer_locations(sequence, kmer... | null | docs/data/learn/Bioinformatics/input/ch1_code/src/FindClumpsOfAKnownKmer.py | FindClumpsOfAKnownKmer.py | py | 1,458 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "FindLocationsOfAKnownKmer.find_kmer_locations",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 8,
"usage_type": "name"
}
] |
325736270 | # -*- coding: utf-8 -*-
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | null | packages/google-cloud-websecurityscanner/google/cloud/websecurityscanner_v1/types/scan_run.py | scan_run.py | py | 6,353 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "proto.module",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "proto.Message",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "proto.Enum",
"line_number": 91,
"usage_type": "attribute"
},
{
"api_name": "proto.Enum",
"lin... |
651127136 | import traceback
from datetime import datetime
from vkBot.controllers.user import *
def process_message(user_id, message, source):
user, is_new = create_new_user(user_id, source)
try:
if is_new:
new_user_action(user, message)
else:
print('registered')
exist... | null | vkBot/controllers/message_process.py | message_process.py | py | 1,720 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "traceback.format_exc",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 47,
"usage_type": "name"
}
] |
106903762 | import base64
import subprocess
import re
def sendFichier(codeErreur=0,phrase="",infos=[]):
rep=""
try:
m=re.search("[A-Za-z]*.\.[A-Za-z]*",phrase)
fileName=m.group(0)
res,inf=searchFile(codeErreur,fileName,infos)
if inf[1]==0:#un seul fichier
rep=convertFileToSend(r... | null | client3/FileManager.py | FileManager.py | py | 1,764 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.search",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "subprocess.check_output",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "base64.b64encode",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "base64.b64decode",
... |
189268949 | import collections
from math import log
import operator
import re
from pylab import *
from sklearn.datasets import load_iris
import pickle
from decision_tree.sun.plotter import C45_Tree
def calcShannonEnt(dataSet):
# 计算出数据集的总数
numEntries = len(dataSet)
# 用来统计标签
labelCounts = collections.defaultdict... | null | decision_tree/sun/decision_tree_c45_continuous.py | decision_tree_c45_continuous.py | py | 14,375 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.defaultdict",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "math.log",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "operator.itemgetter",
"line_number": 113,
"usage_type": "call"
},
{
"api_name": "math.log",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.