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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
70153811305 | # -*- coding: utf-8 -*-
from django.http import HttpResponse, JsonResponse
from django.views.decorators.csrf import csrf_exempt
from rest_framework.renderers import JSONRenderer
from rest_framework.parsers import JSONParser
from employee.models import Employee
from employee.serializers import employee_serializer
# Cre... | borgessouza/DjangoLabs | employee/views.py | views.py | py | 2,429 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "employee.models",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "employee.models.Employee.objects.all",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "employee.models.Employee.objects",
"line_number": 18,
"usage_type": "attribute"
},... |
27971059344 | from bs4 import BeautifulSoup
from urllib.request import urlopen,Request,urlretrieve,build_opener,install_opener
import os
import random
from main.models import Post,Images
from django.core.files import File
from django.contrib.auth.models import User
from main.categories import user_agent_list
class ScrapeFunction:
... | itfidele/Bhano-Blog | operations/scrape.py | scrape.py | py | 6,352 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "random.choice",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "main.categories.user_agent_list",
"line_number": 12,
"usage_type": "argument"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 20,
"usage_type": "call"
},
{
"api_name... |
30503083715 | #!/usr/bin/env python
# _*_ coding: utf-8 _*_
import os
import shutil
import argparse
"""
for i in `find . -maxdepth 1 | awk -F '/' '{ print $2 }' | grep -v "\ "`; do
echo "-----------------------------------------$i---------------------------------";
python gen_dao.py --dir=$i ; done
可自动生成dao文件,并移动到pu... | feng1o/python_1 | tx_add/gen_dao.py | gen_dao.py | py | 3,263 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.listdir",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number"... |
42242964730 | import numpy as np
import bead_util as bu
import matplotlib.pyplot as plt
import os
import scipy.signal as sig
import scipy
import glob
from scipy.optimize import curve_fit
import cant_util as cu
data_dir1 = "/data/20170831/image_calibration2/align_profs"
data_dir2 = "/data/20170831/image_calibration2/align_profs"... | charlesblakemore/opt_lev_analysis | scripts/camera_analysis/align_image.py | align_image.py | py | 3,689 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "numpy.array",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "bead_util.getdata",
"line_numbe... |
14983002282 | #!/usr/bin/python
# encoding=utf8
from flask import Flask, render_template, request, flash, redirect, session, abort
from tinydb import TinyDB,Query
import os
import json
import cPickle as cp
import sys
reload(sys)
sys.setdefaultencoding('utf8')
app = Flask(__name__)
app.secret_key = os.urandom(12)
usersAnnot={"admin... | ankitvad/AnnotationSite | hello.py | hello.py | py | 2,037 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.urandom",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cPickle.load",
"lin... |
72663792744 | # mypy: ignore-errors
import streamlit as st
from bokeh.models import CustomJS
from bokeh.models.widgets import Button
from streamlit_bokeh_events import streamlit_bokeh_events
REC_GIF = "ai_talks/assets/icons/rec_on.gif"
def get_js_code(lang: str) -> str:
return """
var value = "";
var rand = 0... | dKosarevsky/AI-Talks | ai_talks/src/utils/stt.py | stt.py | py | 3,457 | python | en | code | 243 | github-code | 36 | [
{
"api_name": "bokeh.models.widgets.Button",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "streamlit.session_state",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "bokeh.models.CustomJS",
"line_number": 51,
"usage_type": "call"
},
{
"ap... |
41237480224 | from fastapi import FastAPI, APIRouter, HTTPException, status
from pydantic import BaseModel,json
from api.settings import base_url
import pandas as pd
import requests
import json
from typing import List, Optional
from routers.users import user_login
import datetime
vehicle_router = APIRouter(tags=["Veh... | deryacortuk/FastAPI-Pandas | routers/vehicles.py | vehicles.py | py | 4,489 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "api.settings.base_url",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "routers.users.user_login",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "requ... |
1098849667 | import logging
import traceback
import psycopg2
from django.db import IntegrityError
from apps.fyle_expense.models import Expense, ExpenseGroup
from apps.task_log.exceptions import MissingMappingsError
from apps.task_log.models import TaskLog
from apps.xero_workspace.models import EmployeeMapping, CategoryMapping, Pr... | akshay-codemonk/fyle-xero | apps/task_log/tasks.py | tasks.py | py | 10,343 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "apps.task_log.models.TaskLog.objects.create",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "apps.task_log.models.TaskLog.objects",
"line_number": 27,
"usage_type": "at... |
35366813632 | # Image Credits
# Bullet and Spaceship sprite: https://q.utoronto.ca/courses/288975/files/24417060?module_item_id=4444455
# Dinosaur sprite: https://arks.itch.io/dino-characters
# Block sprite: https://replit.com/talk/ask/Pygame-Sprite-Graphics/38044
# Gem, Box, Half platform: https://opengameart.org/content/platformer... | mashalll/cct211 | main.py | main.py | py | 10,968 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pygame.init",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite... |
16182812319 | import boto3
class S3:
def __init__(self, aws_access_key_id, aws_secret_access_key):
self.s3_client = boto3.client(
's3',
aws_access_key_id=aws_access_key_id,
aws_secret_access_key=aws_secret_access_key)
self.s3 = boto3.resource(
's3',
aw... | satishvis/s3test | s3_demo.py | s3_demo.py | py | 1,544 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "boto3.client",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "boto3.resource",
"line_number": 10,
"usage_type": "call"
}
] |
25717509151 | from typing import Type, TypeVar, MutableMapping, Any, Iterable, Generator
from datapipelines import (
DataSource,
PipelineContext,
Query,
NotFoundError,
validate_query,
)
from .common import KernelSource, APINotFoundError
from ...data import Platform
from ...dto.thirdpartycode import VerificationS... | meraki-analytics/cassiopeia | cassiopeia/datastores/kernel/thirdpartycode.py | thirdpartycode.py | py | 3,374 | python | en | code | 522 | github-code | 36 | [
{
"api_name": "typing.TypeVar",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "typing.MutableMapping",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "datapipelines.Pipelin... |
6911964039 | from os.path import dirname, realpath, join
import time
from datetime import datetime
from rich import box
from rich.table import Table
from rich.console import Console
SCRIPT_PATH = dirname(realpath(__file__))
class Results:
RESULTS_PATH = "results"
def __init__(self, results_name: str):
self.metho... | huridocs/pdf_metadata_extraction | src/performance/Results.py | Results.py | py | 2,170 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.realpath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "rich.table.Table",
"l... |
1963001410 | from django.conf.urls import include, url
from django.urls import reverse
from django.utils.html import format_html
from django.utils.translation import ugettext
from wagtail.admin.rich_text.editors.draftail import features as draftail_features
from wagtail.core import hooks
from . import urls
from .richtext import (... | cividi/wagtail-draftail-snippet | wagtail_draftail_snippet/wagtail_hooks.py | wagtail_hooks.py | py | 2,730 | python | en | code | null | github-code | 36 | [
{
"api_name": "richtext.SnippetLinkHandler",
"line_number": 21,
"usage_type": "argument"
},
{
"api_name": "wagtail.admin.rich_text.editors.draftail.features.EntityFeature",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "wagtail.admin.rich_text.editors.draftail.features... |
1806212132 | from __future__ import annotations
import asyncio
import concurrent.futures
import dataclasses
import functools
import logging
import os
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.utils import formatdate, make_msgid
import jinja2
from .. import scra... | janLo/punkow | punkow/service/mailer.py | mailer.py | py | 4,021 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "email.mime.multipart.MIMEMultipart",
"line_number": 33,
"usage_type": "call"
},
{
"a... |
70173864105 | import os
import re
from typing import Any, Iterable, List
from flask import Flask, request
from werkzeug.exceptions import HTTPException
app = Flask(__name__)
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
DATA_DIR = os.path.join(BASE_DIR, "data")
class CustomBadRequest(HTTPException):
status_code = 40... | IgorVolokho99/LESSON_24_HomeWork | app.py | app.py | py | 1,798 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_n... |
36515561991 | # -*- coding: utf-8 -*-
"""
Created on Mon Nov 11 10:11:41 2019
@author: Mohammed
"""
from sklearn import datasets
from sklearn import metrics
from sklearn import linear_model
from sklearn import svm
from sklearn import model_selection
import matplotlib.pyplot as plt
def main():
digits = datasets.load_digits()
... | mjachowdhury/MachineLearning-4thYear-CIT | Lab6/lab6.py | lab6.py | py | 1,564 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sklearn.datasets.load_digits",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.imshow",
"line_number": 20,
"usage_type": "call"
},
{
"api_name":... |
17991705417 | import pandas as pd
import numpy as np
from prediction2 import create_model, evaluate_model
from sklearn.cross_validation import train_test_split
from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier
from sklearn.grid_search import GridSearchCV
def get_data():
df = pd.read_csv("data/cl... | dbluiett/more_than_gut | project/customer_preds.py | customer_preds.py | py | 3,594 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.get_dummies",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sklearn.ensemble.GradientBoostingClassifier",
"line_number": 22,
"usage_type": "call"
},
{
"ap... |
70606645225 | import os
import sys
# 在linux会识别不了包 所以要加临时搜索目录
curPath = os.path.abspath(os.path.dirname(__file__))
rootPath = os.path.split(curPath)[0]
sys.path.append(rootPath)
import execjs
import time
from datetime import datetime
import pandas as pd
import requests
import json
import akshare as ak
def get_var():
'''
获取js... | cgyPension/pythonstudy_space | 05_quantitative_trading_hive/util/同花顺自选股.py | 同花顺自选股.py | py | 5,988 | python | en | code | 7 | github-code | 36 | [
{
"api_name": "os.path.abspath",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path.split",
"line_n... |
11230963388 | import torch
import torch.nn as nn
import torch.optim as optim
import torchvision.models as models
import torchvision.datasets as datasets
import torchvision.transforms as transforms
# 加载数据集
transform = transforms.Compose([transforms.Resize(256),
transforms.CenterCrop(224),
... | rainy2k/deep-learning | transfer_learning.py | transfer_learning.py | py | 2,427 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torchvision.transforms.Compose",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.Resize",
"line_number": 9,
"usage_type": "call"
},
{
"... |
2410926756 | from django.contrib import admin
from db_file_storage.form_widgets import DBAdminClearableFileInput
from django import forms
from .models import Kid, Photo, PhotoFile
admin.site.site_header = "Administración del sitio"
admin.site.site_title = admin.site.site_header
class PhotoForm(forms.ModelForm):
class Meta:
... | kiddybigmoments/kiddybigmoments-server | webapp/admin.py | admin.py | py | 553 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.contrib.admin.site",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 7,
"usage_type": "attribute"
},
{
"a... |
73349078504 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... | IlyaSergeev/taxi_service | TaxiService/migrations/0001_initial.py | 0001_initial.py | py | 1,872 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.swappable_dependency",
"line_number": 11,
"usage_type": "call... |
3310605398 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Block(nn.Sequential):
def __init__(self, in_planes, out_planes, args):
super(Block, self).__init__()
self.x5_block = nn.Sequential(
nn.Conv2d(in_channels=64, out_channels=64, kernel_size=(3, 3), padding=1, bias=Fa... | uday96/EVA4-TSAI | S15/models/quiz_dense.py | quiz_dense.py | py | 4,240 | python | en | code | 1 | github-code | 36 | [
{
"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.Sequential",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"li... |
7989155548 | import numpy as np
import cv2
import time
import math
from visual import *
import visual as vs # for 3D panel
import wx # for widgets
capture = cv2.VideoCapture(1)
def nothing(x):
pass
####### TRACKBAR #########
#cv2.namedWindow('bar')
#cv2.createTrackbar('R','bar',0,255,nothing)
#cv2.createT... | samuelamico/PingPongOpenCV | ball_detect.py | ball_detect.py | py | 4,564 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "cv2.INTER_AREA",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"li... |
27193939959 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import sys
import gzip
import logging
import argparse
from collections import OrderedDict
LOG = logging.getLogger(__name__)
__version__ = "1.0.1"
__author__ = ("Xingguo Zhang",)
__email__ = "invicoun@foxmail.com"
__all__ = []
def read_tsv(file, sep... | zxgsy520/metavirus | scripts/stat_mpa_tax.py | stat_mpa_tax.py | py | 2,401 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "gzip.open",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "logging.basicConf... |
14919631267 | #!/usr/bin/env python
# This file is part of fdsgeogen.
#
# fdsgeogen is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# fdsgeogen is... | FireDynamics/fdsgeogen | scripts/fgg_run_jureca.py | fgg_run_jureca.py | py | 3,900 | python | en | code | 11 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.path.isfile",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "os.path... |
27863085436 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from time import sleep
import os
driver = webdriver.Chrome()
driver.get("ht... | mmangon/10fastfingers | main.py | main.py | py | 1,196 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "os.system",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.webdriv... |
71054390185 | import data_pipeline as dp
import glob
import numpy as np
import pandas as pd
import os
import shutil
import matplotlib.pyplot as plt
from keras.preprocessing.image import ImageDataGenerator, load_img, img_to_array, array_to_img
## Global Parameters
IMG_WIDTH=300
IMG_HEIGHT=300
IMG_DIM = (IMG_WIDTH, IMG_HEIGHT)
def... | luke-truitt/learn-together-model | data_preprocessing.py | data_preprocessing.py | py | 3,735 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "keras.preprocessing.image.img_to_array",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "keras.preprocessing.image.load_img",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "data_pipeline.build_dataset",
"line_number": 33,
"usage_type": ... |
34788181082 | """First migration
Revision ID: 1e99703f8998
Revises:
Create Date: 2022-03-30 17:34:52.872031
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1e99703f8998'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto ge... | gilde-der-nacht/website | olymp/app/storage/migrations/versions/1e99703f8998_first_migration.py | 1e99703f8998_first_migration.py | py | 1,893 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "alembic.op.create_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Strin... |
28587679911 | # -*- coding: utf-8 -*-
from odoo import models, fields, api
import pika
import json
import time
class rabbitmq(models.Model):
_name = 'res.partner'
_description = 'Processing of Contact Records'
_inherit = "res.partner"
def sequential_contacts(self):
records = self.env['res.partner'].search... | FirstClassComputerConsulting/odoo_insurance_app | rabbitmq/models/models.py | models.py | py | 2,625 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "odoo.models.Model",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_nu... |
73947669542 | '''
Desarrollado por: Ferney Vanegas Hernández
Misión TIC 2022
Versión : 1.0.2
Título: Reto 4
'''
import modules.rows as r
import modules.columns as c
import modules.widhts as w
import modules.longs as l
import modules.walls as wall
def main():
dim = int(input('Ingresa un número para dimensionar e... | ferneyvanegas/WorldCraft-ASCII-Listas | main.py | main.py | py | 1,468 | python | es | code | 1 | github-code | 36 | [
{
"api_name": "modules.rows.get_rows",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "modules.rows",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "modules.columns.get_columns",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "module... |
18913786240 | #! /usr/bin/env python
# -*- coding:utf-8 -*-
"""
@author : MG
@Time : 2018/6/12 20:38
@File : run.py
@contact : mmmaaaggg@163.com
@desc :
"""
import time
import logging
from ibats_bitmex_feeder.backend.orm import init
from ibats_bitmex_feeder.feeder import start_feeder
logger = logging.getLogger()
if __na... | IBATS/IBATS_BitMexFeeder | run.py | run.py | py | 731 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "ibats_bitmex_feeder.backend.orm.init",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "ibats_bitmex_feeder.feeder.start_feeder",
"line_number": 21,
"usage_type": "call"
... |
35386786784 | #!/usr/bin/python3
#import TAlight dove collocare le funzioni scritte una volta per tutte a bagaglio comune dei problemi.
import sys
import yaml
import argparse
from colorama import init
init()
#from termcolor import cprint
parser = argparse.ArgumentParser(description="evaluate one single submission file (the stream ... | romeorizzi/TALight | example_problems/tutorial/tiling_mxn-boards_with_1x2-boards/services/eval_submission.py | eval_submission.py | py | 10,376 | python | en | code | 11 | github-code | 36 | [
{
"api_name": "colorama.init",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_nu... |
12772839204 | import os
import base64
import json
import logging
from aws_kinesis_agg.deaggregator import deaggregate_records
from src.consumers.mysql_consumer import MySQLConsumer
from src.utils import get_secret
logger = logging.getLogger()
logger.setLevel(os.environ.get("LOG_LEVEL", "INFO"))
def handle_event(event, context):
... | troybESM/maxwell-kinesis-consumer | src/handlers/maxwell_kinesis_mysql.py | maxwell_kinesis_mysql.py | py | 1,216 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "aws_kinesis_agg.deagg... |
32752270722 | import tempfile
import unittest
import pytest
from os import environ
from os.path import join, isdir, getmtime
from time import time
from selenium.webdriver.common.timeouts import Timeouts
from selenium.common.exceptions import TimeoutException
from tbselenium import common as cm
from tbselenium.test import TBB_PATH
f... | webfp/tor-browser-selenium | tbselenium/test/test_tbdriver.py | test_tbdriver.py | py | 5,565 | python | en | code | 483 | github-code | 36 | [
{
"api_name": "unittest.TestCase",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "tbselenium.test.fixtures.TBDriverFixture",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tbselenium.test.TBB_PATH",
"line_number": 19,
"usage_type": "argument"
... |
7628041943 | from django.test import TestCase
from api import models
from django.urls import reverse
from django.contrib.auth import get_user_model
from rest_framework import status
from rest_framework.test import APIClient
from exercise.serializers import TagSerializer
TAGS_URL = reverse('exercise:tag-list')
#help funcs
# def c... | Mgalazyn/gym_api-drf | app/tests/test_tag_api.py | test_tag_api.py | py | 2,264 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.urls.reverse",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.reverse",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.test.TestCase",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "rest_fra... |
27756843887 | import socket
import json
def main():
TYPE_OF_NETWORK_ADRESS = socket.AF_INET
THE_PROTOCOL = socket.SOCK_STREAM # TCP
THE_LEVEL = socket.SOL_SOCKET
THE_OPTION = socket.SO_REUSEADDR
THE_VALUE = 1
with socket.socket(TYPE_OF_NETWORK_ADRESS, THE_PROTOCOL) as the_socket:
the_socket.se... | ibrahimhalilbayat/data_engineering_diary | Sockets/tcp_server.py | tcp_server.py | py | 1,496 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "socket.AF_INET",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "socket.SOL_SOCKET",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "socke... |
43906506457 | """
Methods for pyspectrumscale.Api that deal with filesets
"""
from typing import Union
import json
def get_fileset(
self,
filesystem: Union[str, None],
fileset: Union[str, None]=None,
allfields: Union[bool, None]=None
):
"""
@brief List all filesets or return a specific ... | Aethylred/pyspectrumscale | pyspectrumscale/Api/_fileset.py | _fileset.py | py | 7,753 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.Union",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_numbe... |
6347327566 | import numpy as np
import torch
from homan.utils.nmr_renderer import OrthographicRenderer, PerspectiveRenderer
import neural_renderer as nr
def visualize_perspective(image, predictions, K=None):
perspect_renderer = PerspectiveRenderer(image_size=max(image.shape))
new_image = image.copy()
# 2 * factor to ... | hassony2/homan | homan/visualize.py | visualize.py | py | 5,329 | python | en | code | 85 | github-code | 36 | [
{
"api_name": "homan.utils.nmr_renderer.PerspectiveRenderer",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.Tensor",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.Tensor",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": ... |
26771615241 | #!/usr/bin/python3
""" Display the id of a Github user using Github's API """
import requests
import sys
def get_hub():
""" Get the id of the user using their personal access token password """
req = requests.get("https://api.github.com/user",
auth=(sys.argv[1], sys.argv[2]))
print(... | Alouie412/holbertonschool-higher_level_programming | 0x11-python-network_1/10-my_github.py | 10-my_github.py | py | 385 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "attribute"
}
] |
18832494510 | from collections import defaultdict
class Solution:
def isAnagram(self, s: str, t: str) -> bool:
history = defaultdict(int)
for c in s:
history[c] += 1
for c in t:
history[c] -= 1
for v in history.values():
if v != 0:
return Fal... | parkjuida/leetcode | python/valid_anagram.py | valid_anagram.py | py | 434 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.defaultdict",
"line_number": 6,
"usage_type": "call"
}
] |
12982777466 | import h5py
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.ndimage import gaussian_filter1d
from scipy.ndimage.morphology import distance_transform_edt
from scipy.stats import linregress
from skimage.future import graph
from skimage.measure import regionprops
from sklearn.linear_model... | kreshuklab/drosophila_embryo_cells | scripts/predict_fate.py | predict_fate.py | py | 8,815 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "scipy.ndimage.morphology.distance_transform_edt",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "scipy.ndimage.morphology.distance_transform_edt",
"line_number": 25,
"usage_typ... |
35603667971 | import pika
import ssl
import json
class Dev:
def __init__(self):
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
ssl_context.set_ciphers('ECDHE+AESGCM:!ECDSA')
url = f"amqps://ryanl:842684265santos@b-b86d75fd-5111-4c3c-b62c-b999e666760a.mq.us-east-1.amazonaws.com:5671"
paramet... | ryanbsdeveloper/opensource-chat | modules/chat/dev.py | dev.py | py | 993 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "ssl.SSLContext",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "ssl.PROTOCOL_TLSv1_2",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pika.URLParameters",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pika.SSLOpt... |
6298326622 |
import pyttsx3
import speech_recognition as sr
import PyPDF2
from gtts import gTTS
from googletrans import Translator
from playsound import playsound
import os
assistant=pyttsx3.init("sapi5") #creation object for speak
voices=assistant.getProperty('voices') #check voices
assistant.setProperty('voice', vo... | Kabir2099/Desktop-Assistant | Book_Reader.py | Book_Reader.py | py | 2,948 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pyttsx3.init",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "speech_recognition.Recognizer",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "speech_recognition.Microphone",
"line_number": 27,
"usage_type": "call"
},
{
"api_name... |
39151761897 | import io
import json
import logging
from fdk import response
def handler(ctx, data: io.BytesIO = None):
name = "World"
try:
body = json.loads(data.getvalue())
name = body.get("name")
except (Exception, ValueError) as ex:
logging.getLogger().info('error parsing json payload: ' + s... | wlloyduw/SAAF | jupyter_workspace/platforms/oracle/hello_world/func.py | func.py | py | 576 | python | en | code | 25 | github-code | 36 | [
{
"api_name": "io.BytesIO",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"... |
30148735325 | from modules.symboltable import Symbol_table
import socket
import struct
import datetime
try:
import yara
except:
pass
symbol_table = Symbol_table()
class Node:
def __init__(self, value, children:list) -> None:
self.value = value
self.children:list = children
def evaluate(self):
... | matheus-1618/GuardScript | Interpreted/modules/node.py | node.py | py | 9,480 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "modules.symboltable.Symbol_table",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "socket.socket",
"line_number": 119,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 119,
"usage_type": "attribute"
},
{
"api_name": "... |
11467704901 | import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.model_zoo as model_zoo
from torch.nn.functional import pad
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
class ConvBNLayer(nn.Module):
def __init__(self,in_channels... | milely/SRN.Pytorch | backbone/resnet_fpn.py | resnet_fpn.py | py | 6,634 | python | en | code | 27 | github-code | 36 | [
{
"api_name": "torch.device",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Module",
... |
12369223367 | """Add viewed column to batch_job
Revision ID: b23863a37642
Revises: 72a8672de06b
Create Date: 2018-12-31 17:13:54.564192
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b23863a37642'
down_revision = '72a8672de06b'
branch_labels = None
depends_on = None
def ... | golharam/NGS360-FlaskApp | migrations/versions/b23863a37642_add_viewed_column_to_batch_job.py | b23863a37642_add_viewed_column_to_batch_job.py | py | 802 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "alembic.op.batch_alter_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.... |
9411931518 | # Primary game file
import sys, pygame
from pygame.locals import *
display_surf = pygame.display.set_mode((800, 600))
pygame.display.set_caption('Hello Pygame World!')
def run():
"""This allows for the running of the game from outside the package"""
print("Started trying to run")
# main game loop
whil... | mlansari/ShellShockClone | ShellShockClone/game.py | game.py | py | 460 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pygame.display.set_mode",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_caption",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "p... |
3146953868 | from setuptools import setup, find_packages
from os import path
DIR = path.abspath(path.dirname(__file__))
description = """SharePy will handle authentication for your SharePoint Online/O365 site, allowing
you to make straightforward HTTP requests from Python. It extends the commonly used Requests module,
meaning tha... | JonathanHolvey/sharepy | setup.py | setup.py | py | 1,452 | python | en | code | 165 | github-code | 36 | [
{
"api_name": "os.path.abspath",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number"... |
32560269380 | # coding: utf-8
import sys
import os
from Public.Decorator import *
import uiautomator2 as u2
from Public.common import common
from tenacity import *
cm = common()
#获取resourceID
condition = os.path.exists(cm.mapping_gp_path)
mapping_path = (cm.mapping_vid_path,cm.mapping_gp_path)[condition]
res = cm.parse_mapping_fi... | taylortaurus/android-ui-runner | Public/appBase.py | appBase.py | py | 9,249 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "Public.common.common",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "Public.common.common... |
18699363715 | #encoding=utf-8
from __future__ import unicode_literals
import sys
sys.path.append("../")
import Terry_toolkit as tkit
# data=tkit.Json(file_path="/mnt/data/dev/tdata/知识提取/chinese/test.json").auto_load()
# for it in data:
# print(it)
import json
# json.load()函数的使用,将读取json信息
file = open('/mnt/data/dev/tdata/知识提... | napoler/Terry-toolkit | test/ttjson.py | ttjson.py | py | 851 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 17,
"usage_type": "call"
}
] |
27768921922 | import pandas as pd
from bs4 import BeautifulSoup
import requests
import random
import time
url='https://www.tianyancha.com/search?base=bj'
headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36'}
response = requests.get(url,headers=heade... | kshsky/PycharmProjects | case/crawler/TianYanCha.py | TianYanCha.py | py | 3,711 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 104,
"usage_type": "call"
},
{
"api_name": "pymysql.connect",
... |
21414967137 | from colour import Color
import cv2 as cv2
import numpy as np
a= input('enter a color=')
b = Color(a)
c = b.hsl
d = tuple(255*x for x in c)
print(d)
print(list(d))
img = cv2.imread('color.png')
hsl1 = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
green = np.uint8([[list(d)]])
hsv_green = cv2.cvtColor(green,cv2.COLOR_BGR2HSV)
... | DESK-webdev/team_webdev | img_pros/star_4.py | star_4.py | py | 657 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "colour.Color",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2HSV",
"line_num... |
6817402374 | from keras.applications.vgg16 import preprocess_input
from keras.preprocessing.image import ImageDataGenerator
# models
from keras.applications.vgg16 import VGG16
from keras.models import Model
# clustering and dimension reduction
# from sklearn.cluster import KMeans
from sklearn.decomposition import PCA
... | AnmolGarg98/KNN_image-classification | KNN_VGG16_pretrained_features.py | KNN_VGG16_pretrained_features.py | py | 6,453 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "keras.preprocessing.image.ImageDataGenerator",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "keras.applications.vgg16.VGG16",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "keras.models.Model",
"line_number": 46,
"usage_type": "call"
... |
9360337388 | import fire
from flask import Flask, jsonify, request
from flask_cors import CORS
from flask_restful import Resource, Api
from graph_knn import load_entity_knn, load_multi_knn
class Knn(Resource):
def __init__(self, **kwargs):
self.knn = kwargs['knn']
def post(self):
json_data = request.get_... | graph-embeddings/pbg-helper | knn-graph-viewer/back/api.py | api.py | py | 4,457 | python | en | code | 21 | github-code | 36 | [
{
"api_name": "flask_restful.Resource",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "flask.request.get_json",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "flask.json... |
43362574911 | from collections import deque
def bfs_shortest_path(adj_matrix, src, dest):
dist = [float('inf')] * n
dist[src] = 0
q = deque()
q.append(src)
while q:
curr = q.popleft()
if curr == dest:
return dist[dest]
for neighbor in range(n):
if adj_matrix[c... | slayzerg01/yandex-training-3.0 | 36/task36.py | task36.py | py | 635 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.deque",
"line_number": 8,
"usage_type": "call"
}
] |
22356028668 | import pickle
import json
import sys
from sklearn.feature_extraction.text import CountVectorizer
# Loading the saved model
loaded_model = pickle.load(open('C:/Users/abhis/OneDrive/Desktop/UsingSpawn/logreg_model.pkl', 'rb'))
# Loading the CountVectorizer vocabulary
loaded_vec = CountVectorizer(vocabulary=pickle.loa... | abtyagi15/Automatic-Ticket-Classification | classify.py | classify.py | py | 1,499 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pickle.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_extraction.text.CountVectorizer",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name":... |
37012746527 | from collections import deque
from typing import List
class Solution:
@staticmethod
def maxSlidingWindow(nums: List[int], k: int) -> List[int]:
if not nums or len(nums) < k:
raise ValueError()
window = deque()
res = []
for i in range(len(nums)):
while w... | Manu87DS/Solutions-To-Problems | LeetCode/Python Solutions/Sliding Window Maximum/sliding.py | sliding.py | py | 1,559 | python | en | code | null | github-code | 36 | [
{
"api_name": "typing.List",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "collections.deque",
"line_number": 11,
"usage_type": "call"
}
] |
41068970621 | import matplotlib.pyplot as plt
import random
import matplotlib
from matplotlib import font_manager
import numpy as np
# 设置图片大小及像素
plt.figure(figsize=(20, 8), dpi=80)
# 设置中文
my_font = font_manager.FontProperties(
fname='/System/Library/Fonts/Hiragino Sans GB.ttc')
# 生成数据
x = range(0, 120)
random.seed(10) # 生成随机种子... | XiongZhouR/python-of-learning | matplotlib/plot_1.py | plot_1.py | py | 1,047 | python | zh | code | 1 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "matplotlib.font_manager.FontProperties",
"line_number": 10,
"usage_type": "call"
},
{
"a... |
39112326593 | import torch
from torch.utils.data import TensorDataset, DataLoader, RandomSampler
from transformers import AutoTokenizer
from sklearn.model_selection import train_test_split
'''
Read the data from a pre-processed CADEC dataset and process them into a format compatible with BERT
'''
class DataProcessor():
"""
... | allepalma/Text-mining-project | bert_data_creation.py | bert_data_creation.py | py | 10,521 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.device",
... |
19423963567 | # -*- coding: utf-8 -*-
"""
Created on Tue Oct 23 19:44:34 2018
@author: whockei1
"""
import numpy as np, matplotlib.pyplot as plt, random, json, pickle, datetime, copy, socket, math
from scipy.stats import sem
import matplotlib.colors as colors
from scipy.ndimage import gaussian_filter as gauss # for smoothing ratem... | whock3/ratterdam | Beltway_Project/ratterdam_PermutationTests.py | ratterdam_PermutationTests.py | py | 16,496 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.ndarray",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "numpy.nan_to_num",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.ma.masked_inv... |
37099800243 | import pandas as pd
import pickle
from data import DATA_FILENAME, to_days_since_1998, datetime
def parse_date(string_value: str) -> int:
try:
return datetime.datetime.strptime(string_value.strip(), '%d/%m/%Y').date()
except ValueError:
return None
COLUMNS = ['ibovespa']
df = pd.read_csv(DATA... | fernando7jr/py-ibov-regression | ibov.py | ibov.py | py | 1,795 | python | pt | code | 0 | github-code | 36 | [
{
"api_name": "data.datetime.datetime.strptime",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "data.datetime.datetime",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "data.datetime",
"line_number": 8,
"usage_type": "name"
},
{
"api_name":... |
70521717223 | import datetime
import json
import os
import time
import random
import requests
from Crypto.Cipher import AES
from django.db.models import Q
from django.http import JsonResponse,HttpResponseRedirect
from django.views.decorators.cache import cache_page
from activety.models import Usercoupon
from news.view... | zhoujialefanjiayuan/liu-lian | xiaochengxu/shopping/views.py | views.py | py | 27,704 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.post",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 127,
"usage_type": "call"
},
{
"api_name": "django.http.JsonResponse",... |
72835791463 | import sqlite3
import click
from flask import current_app, g
from flask.cli import with_appcontext
def get_db():
if 'db' not in g:
g.db = sqlite3.connect(
current_app.config['DATABASE'],
detect_types=sqlite3.PARSE_DECLTYPES
)
g.db.row_factory = sqlite3.Row
... | yukoga/flask_sample_001 | flaskr/db.py | db.py | py | 794 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.g",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "flask.g.db",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "flask.g",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "sqlite3.connect",
"line_number": 1... |
70562902825 | import configparser
import os
class AWSAnmeldung():
def __init__(self,benutzer,account):
self.benutzer = benutzer
self.account = account
configName = "credentials"
configPfad = os.path.join("/","home",self.benutzer,".aws",configName)
self.config = configparser.ConfigParser(... | charlenebertz/fhb-ws1516-sysint | target/dist/fhb-ws1516-sysint-1.0.dev0/build/lib/config.py | config.py | py | 911 | python | de | code | 0 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "configparser.ConfigParser",
"line_number": 11,
"usage_type": "call"
}
] |
25715720301 | from functools import partial
from typing import Dict, Callable
from squirrel.driver.msgpack import MessagepackDriver
from squirrel.serialization import MessagepackSerializer
from squirrel.store import SquirrelStore
from squirrel.iterstream import IterableSource, Composable
import numpy as np
N_SAMPLES = 2500
MAX_VA... | merantix-momentum/gnn-bvp-solver | gnn_bvp_solver/preprocessing/split_and_normalize.py | split_and_normalize.py | py | 7,373 | python | en | code | 12 | github-code | 36 | [
{
"api_name": "typing.Dict",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "typing.Callable",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "numpy.maximum",
"lin... |
10993947420 | import sys, os, argparse, yaml
from datasets.config.config import data_analysis_parameters
import cv2 as cv
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import matplotlib.cbook as cbook
def analysis_kitti(args):
# Load the data
flow_volume = []
masks = []
height,... | sushlokshah/new_approach | general_file/analysis.py | analysis.py | py | 2,885 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.listdir",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 14... |
11352712717 | import json
import requests
import random
def filmes_assistidos_json():
with open('../DadosJSON/filmesAssistidos.json', 'r') as json_file:
dados = json.load(json_file)
return dados
def preferencias_json():
with open('../DadosJSON/preferencias.json', 'r') as json_file:
dados = json.load(... | CassioFig/Sistema-Recomendacao | backend/recomendacao.py | recomendacao.py | py | 4,167 | python | pt | code | 1 | github-code | 36 | [
{
"api_name": "json.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 29,
"... |
15452563301 | from base import VisBase
from helper import get_heat_map
import os
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
import torch
import torch.nn.functional as F
import math
import numpy as np
import matplotlib as mpl
from mpl_toolkits.axes_grid1 import make_axes_locatable
from mpl_toolkits.axes_... | hackerekcah/ESRelation | vis_proj/vis_proj.py | vis_proj.py | py | 13,438 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.dirname",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "base.VisBase",
"lin... |
41924896443 | import sys
import sqlite3
from orders_management import*
#menu for managing customer
class order_menu():
def __init__(self):
self.running = None
self.active_detail = orders_manage()
def run_menu(self,choice):
if choice == 1:
order_date = input("please enter th... | henrymlongroad/computing-coursework.exe | Implementation/order_menu.py | order_menu.py | py | 3,649 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sqlite3.connect",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 68,
"usage_type": "call"
}
] |
16046372668 | """Pakcage Metadata."""
import pathlib
from setuptools import setup
# The directory containing this file
HERE = pathlib.Path(__file__).parent
# The text of the README file
README = (HERE / "README.md").read_text()
# This call to setup() does all the work
setup(
name="bank-of-england",
version="0.0.1",
de... | ronaldocpontes/bank-of-england | setup.py | setup.py | py | 1,019 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_number": 12,
"usage_type": "call"
}
] |
20940437621 | from collections import OrderedDict
import torch
def anchor_offset_to_midpoint_offset(anchor_offset: torch.Tensor, anchors: torch.Tensor):
b, n, h, w = anchors.shape
num_anchors = int(n/4)
# prediction has 6 * num_anchors in dim=1 (they are concatenated) we reshape
# for easier handling (same for anch... | Simon128/pytorch-ml-models | models/oriented_rcnn/encodings.py | encodings.py | py | 5,317 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.Tensor",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "torch.exp",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.exp",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.stack",
"line_number":... |
19389873266 | import sqlite3
insert()
def insert(cur,name,adress,phone,email):
try:
cur.execute(''' INSERT INTO Contact (name,adress,phone,email)
VALUES (?,?,?,?)
''',(name,adress,phone,email))
print('Sucess: The contact:',(name,adress,phone,email),'has been added to the database')
except:
... | Mysticboi/Contact_Database | test.py | test.py | py | 1,625 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sqlite3.connect",
"line_number": 29,
"usage_type": "call"
}
] |
43041165646 | import logging
import os
import snyk
# Set up logger
logger = logging.getLogger(__name__)
logger.setLevel(os.getenv("LOG_LEVEL", default="INFO"))
def get_org_admins(org):
"""
Returns a list of org admins
:param org: the org object
:return: a list of org admins
"""
logger.debug("Getting list ... | snyk-playground/snyk-org-slackbot | snyk_slackbot/api.py | api.py | py | 4,589 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "snyk.SnykClient",
"line_numbe... |
10256295781 | import ast
import json
import cv2
from deepface import DeepFace
from django.contrib.auth import login, logout
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import UserPassesTestMixin
from django.db import connections
from django.db.utils import ProgrammingError
from django.h... | lekarus/SQLQueries | web_app/app/views.py | views.py | py | 12,185 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.views.View",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "a... |
7870451227 | from datetime import datetime
import requests
from bs4 import BeautifulSoup
from uk_bin_collection.uk_bin_collection.common import *
from uk_bin_collection.uk_bin_collection.get_bin_data import \
AbstractGetBinDataClass
# import the wonderful Beautiful Soup and the URL grabber
class CouncilClass(AbstractGetBinDa... | robbrad/UKBinCollectionData | uk_bin_collection/uk_bin_collection/councils/WiganBoroughCouncil.py | WiganBoroughCouncil.py | py | 3,612 | python | en | code | 51 | github-code | 36 | [
{
"api_name": "uk_bin_collection.uk_bin_collection.get_bin_data.AbstractGetBinDataClass",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "requests.packages.urllib3.disable_warnings",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "requests.packages",
"line... |
24938208176 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# filename: tietuku.py
# modified: 2019-03-30
"""
贴图库 api 类
"""
__all__ = [
"TietukuClient",
]
import os
import time
from io import BytesIO
from .base import BaseClient
from .utils import get_links_cache_json, save_links_cache_json
from ..utils.log import cout... | pkuyouth/pkuyouth-html-coder | htmlcoder/core/client/tietuku.py | tietuku.py | py | 4,184 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "base.BaseClient",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "utils.meta.Singleton",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "utils.get_links_cache_json",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "const... |
73087528423 | # -*- coding: utf-8 -*-
# @Author: ahmedkammorah
# @Date: 2019-04-04 15:54:42
# @Last Modified by: Ahmed kammorah
# @Last Modified time: 2019-04-08 22:58:45
from enum import Enum
import json
from MainService.main.email_provider_connector import RESPONSE_STATE
from MainService.main.ak_ep_services import AKEmailSe... | AhmedKammorah/AKEmailService | MainService/main/ak_main_email_service.py | ak_main_email_service.py | py | 5,942 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.dumps",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "MainService.main.ak_ep_services.AKEmailServices",
"line_number": 66,
"usage_type": "name"
},
{
"api_name": "MainService.main.ak_ep_services.logger.debug",
"line_number": 87,
"usage_type"... |
5877766545 | # -*- coding:utf-8 -*-
"""
说明:
这里实现了单篇文章和专栏的爬取。
article 根据article_id发起网络请求,返回的json文件中包含文章的基本信息和文章主体内容,解析文章的基本信息生成一个msg
字典对象,再将文章主体解析成BeautifulSoup对象,连同msg字典一起交给document模块下的Article解析并保存成markdown文件。
根据专栏id获得专栏下的文章所有文章id后,逐一看成是单一的文章,由article爬取。
"""
from zhihu_spider.util import net, document
from zhihu_spider.... | Arlenelalala/ArxivPaper | zhihu_spider/article/__init__.py | __init__.py | py | 4,672 | python | en | code | 7 | github-code | 36 | [
{
"api_name": "os.path.exists",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "zhihu_spider.util.timer.random... |
19715634890 | import networkx as nx
from networkx.algorithms import isomorphism
import argparse
import pickle
from tqdm import tqdm
"""get nx graphs from remapped_fp_file"""
def get_single_subgraph_nx(frequent_subgraph_lines):
'''
create graph from gSpan data format
'''
graph_id = frequent_subgraph_lines[0].stri... | MikeWangWZHL/Schema_Composition | gSpan_official/gSpan6/filter_mined_graph.py | filter_mined_graph.py | py | 4,396 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "networkx.DiGraph",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "networkx.algorithms.isomorphism.categorical_node_match",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "networkx.algorithms.isomorphism",
"line_number": 49,
"usage_type"... |
16442806200 | # from utils.txt_file_ops import *
from utils.Database_conn import *
from object.base_class import *
from loguru import logger
from tabulate import tabulate
from datetime import datetime
class Subject:
def __init__(self, sub_id='', sub_name=''):
self.__sub_id = sub_id
self.__sub_name = sub_name
... | thanhtugn/python_core_thanhtugn | Lesson_14/object/subject.py | subject.py | py | 5,166 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "tabulate.tabulate",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "loguru.logger.info",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "loguru.logger",
"line_number": 71,
"usage_type": "name"
},
{
"api_name": "loguru.logger.erro... |
25947439528 | import os
import sqlite3
from datetime import datetime, timedelta
import telebot
bot = telebot.TeleBot(os.getenv("BOT_TOKEN"))
memes_chat_id = int(os.getenv("MEMES_CHAT_ID"))
flood_thread_id = int(os.getenv("FLOOD_THREAD_ID", 1))
memes_thread_id = int(os.getenv("MEMES_THREAD_ID", 1))
conn = sqlite3.connect("memes.db... | dzaytsev91/tachanbot | cron_job_memes_count.py | cron_job_memes_count.py | py | 1,239 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "telebot.TeleBot",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 9,
... |
10261032869 | # from multiprocessing import Process, Queue
from queue import Queue
import threading
from crawler.reviewCrawler import ReviewCrawler
from crawler.userCrawler import UserCrawler
import json
from GameListCrawler import getGameList
import time
from utils.redisUtis import RedisUtil
from utils.sqlUtils import dbconnector
... | Alex1997222/dataming-on-steam | SteamCrawler/main.py | main.py | py | 4,442 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "queue.Queue",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "queue.Queue",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "queue.Queue",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 2... |
22365841878 | from django import forms
from .models import UserProfile
class UserProfileForm(forms.ModelForm):
class Meta:
model = UserProfile
exclude = ['user']
def __init__(self, *args, **kwargs):
"""
Add placeholders and classes, remove auto-generated
labels and set autofocus on ... | folarin-ogungbemi/Gosip-Bookstore | profiles/forms.py | forms.py | py | 1,120 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "models.UserProfile",
"line_number": 7,
"usage_type": "name"
}
] |
6061528518 | # -*- coding: utf-8 -*-
"""
Created on Thu Mar 12 16:12:53 2020
@author: Monik
"""
import os, tifffile
import numpy as np
import matplotlib.pyplot as plt
import SOFI2_0_fromMatlab as sofi2
#%% helper functions
def where_max(a):
print(a.shape)
return np.unravel_index(np.argmax(a, axis=None), a.shape)
#%% rea... | pawlowska/SOFI2-Python-Warsaw | SOFI2_demo.py | SOFI2_demo.py | py | 1,760 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.unravel_index",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "tifffile.imread",
"l... |
15136620120 | import time
import warnings
import mmcv
import torch
from mmcv.runner import RUNNERS, IterBasedRunner, IterLoader, get_host_info
@RUNNERS.register_module()
class MultiTaskIterBasedRunner(IterBasedRunner):
def train(self, data_loader, **kwargs):
self.model.train()
self.mode = 'train'
sel... | CVIU-CSU/PSSNet | mmseg/core/runners/multi_task_iterbased_runner.py | multi_task_iterbased_runner.py | py | 3,324 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "mmcv.runner.IterBasedRunner",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "mmcv.is_list_of",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "warnings.warn",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "mmcv.runner... |
25796455279 | import itertools
import numpy as np
import collections
import tensorflow as tf
from PIL import Image
from keras.models import Model, load_model
from keras import backend as K
from integrations.diagnosis_nn.diagnosisNN import DiagnosisNN
from neural_network.models import NeuralNetwork
from neural_network.nn_manager.G... | AkaG/inz_retina | integrations/diagnosis_nn/DiagnosisQuery.py | DiagnosisQuery.py | py | 1,527 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "neural_network.nn_manager.GeneratorNNQueryManager.GeneratorNNQueryManager",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "neural_network.models.NeuralNetwork.objects.all",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "neural_network.models.N... |
34684043114 | #!/usr/bin/env python3
from collections import deque
def search(lines, pattern, history=5):
previous_lines = deque(maxlen=history)
for i in lines:
if pattern in i:
yield i, previous_lines
previous_lines.append(i)
if __name__ == '__main__':
with open(r'somefile.txt') as f:
... | kelify/WorkProgram | CookBook-python3/c01/01.py | 01.py | py | 468 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.deque",
"line_number": 6,
"usage_type": "call"
}
] |
18903357112 | from abc import ABCMeta
from json import dumps
from logging import getLogger
from uchicagoldrtoolsuite import log_aware
from ..materialsuite import MaterialSuite
__author__ = "Brian Balsamo, Tyler Danstrom"
__email__ = "balsamo@uchicago.edu, tdanstrom@uchicago.edu"
__company__ = "The University of Chicago ... | uchicago-library/uchicagoldr-toolsuite | uchicagoldrtoolsuite/bit_level/lib/structures/abc/accessioncontainer.py | accessioncontainer.py | py | 7,200 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "abc.ABCMeta",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "uchicagoldrtoolsuite.log_aware",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "json.dum... |
24801071982 | import numpy as np
from scipy import spatial
import matplotlib.pyplot as plt
def fft_smoothing(coords):
#TODO: More relevant procedure required
signal = coords[:,0] + 1j*coords[:,1]
# FFT and frequencies
fft = np.fft.fft(signal)
freq = np.fft.fftfreq(signal.shape[-1])
# filter
cu... | aron0093/cytopath | cytopath/plotting_functions/plot_alignment.py | plot_alignment.py | py | 5,486 | python | en | code | 10 | github-code | 36 | [
{
"api_name": "numpy.fft.fft",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.fft",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.fft.fftfreq",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.fft",
"line_... |
7677909103 | from controller import Robot, Motor, DistanceSensor
import numpy as np
from collections import deque
# import opencv
import cv2 as cv
MAX_SPEED = 47.6
WHEEL_RADIUS = 21
INF = float('inf')
class ChaseFoodState:
def __init__(self, r):
self.r=r
def check_transition(self):
if self.r.has_bum... | Polifack/Subsummed-Architecture-Webots | controllers/khepera4_controller/khepera4_controller.py | khepera4_controller.py | py | 13,750 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "controller.Robot",
"line_number": 167,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 287,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 287,
"usage_type": "attribute"
},
{
"api_name": "cv2.resize",
"li... |
75097728425 | import h5py
import numpy as np
import os
import matplotlib.pyplot as plt
from imblearn.over_sampling import SMOTE
import random
# A simple example of what SMOTE data generation might look like...
# Grab the data
path=os.path.join(os.getcwd() , 'batch_train_223.h5')
file = h5py.File(path, 'r')
keys = file.keys()
sampl... | emilyjcosta5/datachallenge2 | train/testSMOTE.py | testSMOTE.py | py | 2,466 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "h5py.File",
"line_number": 12... |
11045304899 | from datetime import datetime, timedelta
from functools import reduce
from django import db
from django.conf import settings
from django.db import models
from django.db.models import Sum
from django.contrib.auth import get_user_model
from jalali_date import date2jalali
from dmo.models import DmoDay, Dmo
User = get_us... | mohsen-hassani-org/teamche | todo_list/models.py | models.py | py | 6,959 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.db.models.Manager",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 15,
"usage_type": "name"
},
{
... |
23713128222 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import yaml
from yaml.loader import SafeLoader
import subprocess
import netifaces
import argparse
import os
import time
import fcntl
'''yaml
if_list:
- ipaddr: 10.90.3.37
prefix: 24
mac: 52:54:84:11:00:00
gateway: 10.90.3.1
- ipaddr: 192.168.100.254
... | adamxiao/adamxiao.github.io | openstack/asserts/kylin-vr.py | kylin-vr.py | py | 7,510 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "netifaces.interfaces",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "netifaces.ifaddresses",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "netifaces.AF_LINK",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "yam... |
34274019963 | import time
import multiprocessing as mp
def show_current_time():
while True:
t = time.strftime("%H:%M:%S")
print("Текущее время:", t)
time.sleep(1)
def show_message():
while True:
print("(* ^ ω ^)")
time.sleep(3)
if __name__ == "__main__":
p1 = mp.Process(target=s... | Surikat226/Python-grade | async_run.py | async_run.py | py | 645 | python | ru | code | 0 | github-code | 36 | [
{
"api_name": "time.strftime",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Process",
"line... |
31524102898 | """
Test the lookup_specs_chain
NOTE: this just makes sure the chain executes properly but DOES NOT assess the quality of the agent's analysis. That is done in the ipython notebooks in the evals/ folder
"""
import pytest
import json
from meche_copilot.get_equipment_results import get_spec_lookup_data, get_spec_page_va... | fuzzy-tribble/meche-copilot | tests/unit_tests/chains/get_lookup_specs_chain_test.py | get_lookup_specs_chain_test.py | py | 2,625 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "meche_copilot.chains.helpers.specs_retriever.SpecsRetriever",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "meche_copilot.chains.analyze_specs_chain.AnalyzeSpecsChain",
"line_num... |
6108135387 | from django.db import models
from django.utils.translation import gettext_lazy as _
from solo.models import SingletonModel
class Configuration(SingletonModel):
tenant = models.CharField(max_length=255, help_text="Welkin organization name.")
instance = models.CharField(
max_length=255, help_text="The e... | Lightmatter/django-welkin | django_welkin/models/configuration.py | configuration.py | py | 1,152 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "solo.models.SingletonModel",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.db.models",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "d... |
37862194723 | from scipy.spatial.distance import cosine
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("AI-Growth-Lab/PatentSBERTa")
def get_sim(anchor: str, target: str) -> float:
anchor_embed = model.encode([anchor])
target_embed = model.encode([target])
return float(1 - cosine(an... | vquilon/kaggle-competitions | patent-phrase-to-phrase-matching/models/patent_sbert_a.py | patent_sbert_a.py | py | 681 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sentence_transformers.SentenceTransformer",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "scipy.spatial.distance.cosine",
"line_number": 11,
"usage_type": "call"
}
] |
39156539433 | import re
import sys
from collections import namedtuple, Counter, OrderedDict
from operator import itemgetter
from math import log
from Bio import SeqIO
from RecBlast import print, merge_ranges
from RecBlast.Search import id_search
from itertools import chain, islice
import mygene
from pathlib import Path
from RecBlast... | docmanny/RecSearch | RecBlast/Auxilliary.py | Auxilliary.py | py | 40,401 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "Bio.SeqIO.parse",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "Bio.SeqIO",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "Bio.SeqIO.write",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "Bio.SeqIO",
"line_numbe... |
1253707592 | import time
from selenium import webdriver
# browser = webdriver.Firefox()
# browser.get('https://www.jd.com/')
# browser.execute_script('window.scrollTo(0, document.body.scrollHeight)')
# browser.execute_script('alert("123")')
# browser.close()
#
#
#
# print("=================================================")
bro = ... | lyk4411/untitled | pythonWebCrawler/JavaScriptFireFox.py | JavaScriptFireFox.py | py | 711 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "time.sleep",... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.