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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
72173664361 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
# if not calling for snakemake rule
try:
sys.stderr = open(snakemake.log[0], "w")
except NameError:
pass
import json
import jsonschema
import pandas as pd
VALIDATOR_VERSION = jsonschema.Draft202012Validator
def validate_record(record, validator... | NRW-GEUBT/geuebt-validate | workflow/scripts/validate_assemblies.py | validate_assemblies.py | py | 3,229 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "sys.stderr",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "jsonschema.Draft202012Validator",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "json.l... |
35461974449 | from gzip import READ
from turtle import st
from django.shortcuts import get_object_or_404, render
from django.urls import is_valid_path
from movies_app.models import *
from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.request import Request
from rest_framework.respons... | druckhead/Django | W5_movies_restAPI/movies_app/views.py | views.py | py | 8,045 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "rest_framework.request.Request",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "rest_framework.response.Response",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "rest_framework.status.HTTP_204_NO_CONTENT",
"line_number": 33,
"usage_typ... |
42778295720 |
from django.shortcuts import render
from qsapp.models import Answers, Questions
from haystack.query import SearchQuerySet, AutoQuery
from django.db.models import Q
"""
#View / Controller of the project
#Index View
Renderes the homepage with GET
Request with **qsapp/home.html**
"""
def index(request):
return r... | shantanubedajna009/django_question_answering_system | qsapp/views.py | views.py | py | 2,600 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "django.shortcuts.render",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "haystack.query.SearchQuerySet",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "django.db.models.Q",
"line_number": 69,
"usage_type": "call"
},
{
"api_name... |
17095499029 | #!/usr/bin/env python
"""
Send message to Slack from command line
"""
import argparse
import os
import sys
import warnings
from urllib.parse import quote
import requests
from slacker import Slacker
from slacker.utilities import get_item_id_by_name
warnings.filterwarnings("ignore", message=".*InsecurePlatformWar... | juanpabloaj/slacker-cli | slacker_cli/__init__.py | __init__.py | py | 5,121 | python | en | code | 184 | github-code | 18 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "slacker.Slacker",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "urllib.parse.quote",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "requests.p... |
33102836475 | """
Main, POMDP prediction. eICU.
"""
# import
import time
import pickle
import logging
import numpy as np
import pandas as pd
import scipy.stats as st
from PBVI import PBVI_OS
from POMDP import POMDP_OS
from copy import deepcopy as dcopy
from sklearn.metrics import confusion_matrix
def discretize_data(stream_data,... | ILABUTK/MLePOMDP_Early_Sepsis_Detection | scripts/3_second_stage/main.py | main.py | py | 21,357 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "numpy.random.choice",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "pandas.Series"... |
72988306920 | import requests
import neopixel
import board
import time
import random
total_pixels = 550
lower_bank_start = 250
inactivity_timeout = []
last_known_state = [[] for x in range(total_pixels)]
all_pixels = neopixel.NeoPixel(
board.D18,
total_pixels,
brightness=1,
auto_write=False,
pixel_order=neopixe... | rydercalmdown/xmas_lights | firmware/app.py | app.py | py | 10,646 | python | en | code | 5 | github-code | 18 | [
{
"api_name": "neopixel.NeoPixel",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "board.D18",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "neopixel.RGB",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "time.sleep",
"... |
15799209625 | import pytest
import requests
"来个注释演示一下改动"
@pytest.fixture(scope='session')
# 获取access_token
def access_token_3():
_baseurl = 'https://qyapi.weixin.qq.com/cgi-bin'
_corpsecret = 'xvmyVvTMnJaR0q2eitVBAOdyetWp8FvG6WscIEmorRw'
_corpid = 'ww3c6b51ae743ae4ec'
# 先获取到access_token
r = requests.get(_baseu... | echo9527git/haige_requests | requests_demo0730/conftest.py | conftest.py | py | 1,013 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.session",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"lin... |
4363715750 | # This example was taken from https://www.springboard.com/blog/data-mining-python-tutorial/
#
# With this problem we want to create natural groupings for a set of data objects that might not
# be explicitly stated in the data itself
import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as p... | rrosatti/python | data mining/clustering_model.py | clustering_model.py | py | 1,529 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "matplotli... |
23974256909 | from __future__ import print_function
import os
import logging
import numpy as np
import torch
from torch import nn, optim
from torch.autograd import Variable
from torchvision import datasets, transforms
from args import args, device
from model import Generator, DiscriminatorAndQ
from dataloader import mnist
from tens... | jxcodetw/NCTU_HW | Deep_Learning/lab4/infoGAN/train.py | train.py | py | 3,362 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "args.args.summary_path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "args.args",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"lin... |
39023642145 | import argparse
import sys
import rospy
from std_msgs.msg import String
from hr_msgs.msg import TTS
class ConvAIConnector:
prosody_rate_tag_XSLOW = "<prosody rate=\"x-slow\">";
prosody_rate_tag_SLOW = "<prosody rate=\"slow\">";
prosody_rate_tag_MEDIUM = "<prosody rate=\"medium\">";
prosody_rate... | HKUST-NISL/Grace_Connector | conv_ai_connector.py | conv_ai_connector.py | py | 1,880 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "rospy.init_node",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "rospy.Subscriber",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "std_msgs.msg.String",
"line_number": 23,
"usage_type": "argument"
},
{
"api_name": "rospy.Publis... |
13723132110 | # !/usr/bin/python
# -*- coding: utf-8 -*-
"""
Created on Aug 26 11:29:27 2020
@author: kevincassou
"""
# few functions for gas flow and conductances in vacuum system
import numpy as np
import scipy.constants as sc
# conversion
mbar2Pa = 1e2 # conversion mbar to Pa
m2cm = 1e2
# gas viscosity
def viscosity(mo... | kevinCassou/LPAbrew | gas.py | gas.py | py | 4,361 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "scipy.constants.k",
"line_number": 60,
"usage_type": "attribute"
},
{
"api_name": "scipy.constants",
"line_number": 60,
"usage_type": "name"
},
{
"api_name": "numpy.pi",
"line_number": 60,
"usage_type": "attribute"
},
{
"api_name": "numpy.pi",
"... |
24360893301 | import os
import openai
from flask import Flask, request, Response
from dotenv import load_dotenv
from flask_cors import CORS, cross_origin
app = Flask(__name__)
cors = CORS(app)
app.config['CORS_HEADERS'] = 'Content-Type'
load_dotenv()
openai.api_key = os.getenv("OPENAI_API_KEY")
openai.organization = os.getenv("ORG... | issilva5/tuneforge-back | tuneforge.py | tuneforge.py | py | 5,604 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "dotenv.load_dotenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "openai.api_key",
"li... |
26205891500 | from PyQt5.QtWidgets import QWidget, QListWidgetItem
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import Qt
from view.ui_person_widget import Ui_PersonWidget
import model.database_manager as DB
class FAPersonWidget(QWidget, Ui_PersonWidget):
def __init__(self, mainController):
super().__init__()
... | seconddream/face_album | Source/view/person_widget.py | person_widget.py | py | 2,034 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "view.ui_person_widget.Ui_PersonWidget",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.Qt.UserRole",
"line_number": 24,
"usage_type": "attribute"
},
... |
27883555730 | import os
import argparse
from datetime import timedelta
from media.tools.common import (
load_movies, random_sample_list
)
class Status():
'''
Status object for a given movie.
It contains the movie object, an array of faults,
and a simple flag determining whether or not the
film ... | cjcodeproj/medialibrary | src/media/tools/movies/validate.py | validate.py | py | 5,172 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "datetime.timedelta",
"line_number": 87,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 90,
"usage_type": "call"
},
{
"api_name": "argparse.Arg... |
26168732011 | from django import forms
from django.forms import ModelForm
from .models import OutstationPrice,Routes,Cab
def get_source():
data = Routes.objects.all()
return data
def get_destination():
data = Routes.objects.values('destination')
return data
def get_cabs():
data = Cab.objects.values('model_n... | asim09/bozo | prices/forms.py | forms.py | py | 916 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "models.Routes.objects.all",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "models.Routes.objects",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "models.Routes",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "model... |
72945240360 | import pandas as pd
import os
import numpy as np
from report.directories import output_data_raw, output_plots_approx_solution, output_tables_approx_solution
import matplotlib.pyplot as plt
from report.config import outp_file_format
from report.utils import get_nonexistant_path, savefig_metadata, splitpath
from montecar... | babiscodelab/OxfordThesisCode | report/data_processing/plotting/fast_calibration.py | fast_calibration.py | py | 4,560 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "os.listdir",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_hdf",
"line_numb... |
17961471906 | from __future__ import absolute_import, unicode_literals
import logging
import os
import shelve
import pykka
from itertools import cycle
from cachetools import cachedmethod
from mopidy.audio.scan import Scanner
from mopidy.audio.tags import convert_tags_to_track
from mopidy.exceptions import ScannerError
from six imp... | vonZeppelin/mopidy-ydisk | mopidy_ydisk/tagger.py | tagger.py | py | 2,997 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pykka.ThreadingActor",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "mopidy.audio.scan.Scanner",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": ... |
9858333793 | # Please make sure as to have the tabulate module installed in order
# to execute this program.
from tabulate import tabulate
import copy
# Creates a class Shoe for stroing the data of each shoe in stock
class Shoe:
def __init__(self, country, code, product, cost, quantity):
self.country = country
... | EpicurianCoder/projects-python-java-sql | python-3/inventory.py | inventory.py | py | 7,994 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "tabulate.tabulate",
"line_number": 116,
"usage_type": "call"
}
] |
25703555694 | import numpy as np
from ase import Atoms
from ase.formula import Formula
assert Atoms('MoS2').get_chemical_formula() == 'MoS2'
assert Atoms('SnO2').get_chemical_formula(mode='metal') == 'SnO2'
for sym in ['', 'Pu', 'Pu2', 'U2Pu2', 'U2((Pu2)2H)']:
for mode in ['all', 'reduce', 'hill', 'metal']:
for empir... | martin-stoehr/ase-devel | ase/test/formula.py | formula.py | py | 1,200 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "ase.Atoms",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "ase.Atoms",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "ase.Atoms",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "ase.Atoms",
"line_number": 18,
"u... |
9663209341 | from bs4 import BeautifulSoup
import requests
from scrape_smash import scrape_me_your_moves
import pandas as pd
# requests the sitemap for ultimateframedata.com
r = requests.get('https://ultimateframedata.com/sitemap.xml')
xml = r.text
soup = BeautifulSoup(xml, 'lxml')
sitemapTags = soup.find_all('loc')
sitemap = []... | jlee31798/smash_ultimate_webscraping | looping_sitemap.py | looping_sitemap.py | py | 799 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "scrape_smash.scrape_me... |
1420756127 | import json
from math import sqrt
def prepare_data():
with open("lab02.json") as json_file:
dogs = json.load(json_file)
return dogs
def find_dog(dogs, name):
for dog in dogs:
if dog["name"] == name:
dog1 = dog
return dog1
def correlation_coefficient(dog1, dog2):
... | en0t-poloskun/SII | lab04/lab04.py | lab04.py | py | 4,736 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "json.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 55,
"usage_type": "call"
}
] |
14387427613 | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="medhsi",
version="1.0.0",
author="foxelas",
author_email="foxelas@outlook.com",
description="Tools for Macropathology Hyper-Spectral Image Processing",
long_descripti... | foxelas/medHSI | medHSIpy/package/setup.py | setup.py | py | 1,118 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "setuptools.setup",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 15,
"usage_type": "call"
}
] |
30988321619 | from etl.extract_data import extract_data
from etl.clean_fans import clean_fans
from etl.clean_blogger import clean_blogger
from etl.clean_live_stats import clean_live_stats
from etl.clean_live_info import clean_live_info
from etl.clean_live_goods import clean_live_goods
from etl.clean_live_fans import clean_live_fans
... | Kira1108/dou_plus_api | pipeline.py | pipeline.py | py | 1,990 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "dbconfig.get_mysql_conn",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "etl.extract_data.extract_data",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "etl.clean_fans.clean_fans",
"line_number": 17,
"usage_type": "call"
},
{
"a... |
14186885493 | import os
from functools import partial
from typing import List, Tuple, Optional, Callable, Dict, Any, Union
import albumentations as A
import cv2
import numpy as np
import pandas as pd
import torch
from pytorch_toolbelt.datasets import INPUT_IMAGE_KEY, INPUT_INDEX_KEY
from pytorch_toolbelt.utils.torch_utils import im... | BloodAxe/xView3-The-First-Place-Solution | xview3/centernet/multilabel_dataset.py | multilabel_dataset.py | py | 29,134 | python | en | code | 56 | github-code | 18 | [
{
"api_name": "torch.utils.data.dataloader.default_collate",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "pytorch_toolbelt.datasets.INPUT_IMAGE_KEY",
"line_number": 79,
"usage_type": "name"
},
{
"api_name": "torch.channels_last",
"line_number": 79,
"usage_typ... |
70817671721 | import pika
import uuid
class Sender:
def __init__(self):
"""
initialize connection, channel and declare a nameless queue and assign it to self.queue
and at last basic consume on that queue bu auto acknowledgement and self.on_response method as callback
"""
self.connection ... | cybera3s/my_rabbitmq | RPC/client.py | client.py | py | 2,324 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pika.BlockingConnection",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pika.ConnectionParameters",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "pika.Bas... |
75349731879 | """
Image postprocessing module.
"""
import os
from typing import Union, Tuple
from time import time
import numpy as np
import cv2
from ds_utils import load, pack_rgb, unpack_rgb
from scipy.cluster.vq import kmeans, vq
from PIL import Image
from wbdlogger import WBDLogger
logger = WBDLogger()
def postprocessing(ou... | kotborealis/wbd | wbd/postprocessing.py | postprocessing.py | py | 11,705 | python | ru | code | 0 | github-code | 18 | [
{
"api_name": "wbdlogger.WBDLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numbe... |
29700739501 | import logging
from flask.views import MethodView
from mongoengine.errors import NotUniqueError, ValidationError
from .users_blp import users_blp
from ...models.user import User
from ...schemas.communs_schemas import PagingError
from ...schemas.users_schemas import (
GetUsersListSchema,
InputCreateUserSchema... | VictorCyprien/MFE-Python-Flask | api/views/users/root_users_view.py | root_users_view.py | py | 1,408 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask.views.MethodView",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "models.user.User.objects",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "mod... |
39674549341 | from flask import Flask, request, render_template, redirect, url_for, send_from_directory, abort, copy_current_request_context
from waitress import serve
from flask.templating import render_template
from flask_mail import Mail, Message
from cryptography.fernet import Fernet
import os
import configparser
import request... | rab-Dos/xv_bar | static/app.py | app.py | py | 6,152 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"lin... |
8865153588 | # -*- coding: utf-8 -*-
import scrapy
from shiyanlougithub.items import ShiyanlougithubItem
class GithubSpider(scrapy.Spider):
name = 'github'
allowed_domains = ['https://github.com/shiyanlou?tab=repositories']
start_urls = ['http://https://github.com/shiyanlou?tab=repositories/']
@property
def st... | adaonline/pythonCourse | demo/Scrapy_demo6_projectForGithub_commits_branchs_releases/shiyanlougithub/spiders/github.py | github.py | py | 1,922 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "scrapy.Spider",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "shiyanlougithub.items.ShiyanlougithubItem",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "scrapy.Request",
"line_number": 23,
"usage_type": "call"
}
] |
24003066808 | import torchvision
def get_backbone(name, pretrained=False):
backbones = {
"resnet18": torchvision.models.resnet18(pretrained=pretrained),
"resnet50": torchvision.models.resnet50(pretrained=pretrained),
"wide_resnet50_2": torchvision.models.wide_resnet50_2(pretrained=pretrained)
}
i... | guolz-ml/SimCLR-Pytorch | models/simclr_backbone.py | simclr_backbone.py | py | 601 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "torchvision.models.resnet18",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "torchvision.models",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torchvision.models.resnet50",
"line_number": 6,
"usage_type": "call"
},
{
"api_... |
71426534440 | # This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load in
import numpy as np # linear algebra
import pandas as pd # data processing, CSV fil... | aorursy/new-nb-3 | ezzzio_retinascan.py | ezzzio_retinascan.py | py | 5,043 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.listdir",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pandas.get_dummies",
"... |
41270491540 | """This module does blah blah."""
import json
SEED = 12
NUM_THREADS = 8
WRITE_IMG_SUMMARY_EVERY = 100
with open('config.json', 'r') as f:
CONFIG_JSON = json.load(f)
CONFIG = CONFIG_JSON[CONFIG_JSON['active_config']]
BASE_PATH = CONFIG['base_path']
DATA_PATH = CONFIG['data_path']
CHKPTS_PATH = CONFIG['chkpts_pat... | benru89/histology_dcgan | constants.py | constants.py | py | 1,012 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "json.load",
"line_number": 9,
"usage_type": "call"
}
] |
3021456688 | import depthai as dai
import numpy as np
import cv2
try:
import toolkit.methodspaths as methodspaths
except:
import methodspaths
class PoseEdgeWorker:
def __init__(self, method, detector):
self._method = method
self._detector = detector
self._det_pool = ['yolox']
self._chea... | JoaoPMonteiro/epoche | toolkit/handledepthai.py | handledepthai.py | py | 7,257 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "methodspaths.methodsDict",
"line_number": 74,
"usage_type": "attribute"
},
{
"api_name": "methodspaths.methodsDict",
"line_number": 76,
"usage_type": "attribute"
},
{
"api_name": "methodspaths.methodsDict",
"line_number": 78,
"usage_type": "attribute"
},
... |
32337601321 | import io
import re
def __export_remote_functions():
def substitute_vars(string, vars: dict):
# Define a regular expression for placeholders
placeholder_pattern = re.compile(r"\$\{?(\w+)(?:-(\w+))?\}?")
# Define a function to replace the placeholders with keyword arguments
def repl... | chenggroup/ai2-kit | ai2_kit/domain/util.py | util.py | py | 6,882 | python | en | code | 31 | github-code | 18 | [
{
"api_name": "re.compile",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "re.IGNORECASE",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "io.StringIO",
"line_numbe... |
28445596262 | from .gui import *
import logging
import warnings
logging.basicConfig(level=logging.DEBUG, filename="mylog.txt")
class Box:
def __init__(self, orientation, *args):
self.mapped = False
self.orientation = orientation
def __repr__(self):
return 'Py{}Box'.format(self.orientation)
def is... | mcdougallab/neurongui2 | neurongui2/gui_callback.py | gui_callback.py | py | 2,920 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.basicConfig",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "logging.debug",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "logging.debug",
... |
9554662384 | #!/usr/local/bin/python3
# *** NOTE: THIS SCRIPT MUST BE RUN AS ROOT ***
# python module imports
import os
import shutil
import nmap
import sys
import subprocess
from datetime import datetime
# variable containing the filepath of the nmap scan results file
mac_list = os.environ['HOME'] + "/maclist.log"
# variable c... | AdamFSU/Scripts | nmap_scan.py | nmap_scan.py | py | 5,274 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "os.environ",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
... |
28308403644 | import requests
import time
import json
from constants import *
# initialize the scryfall API link and pull the data from the website
scryfallAPILink = (f"https://api.scryfall.com/cards/search?q=set:{setCode}"
f"+or+set:{bonusSheetCode}")
scryfallDataPath = 'scryfall.json'
downloadData = input("Do ... | winry-fruitiwi/py-util | 17L/getJSONData.py | getJSONData.py | py | 2,852 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 42... |
26952858849 | from typing import Optional
import numpy as np
__all__ = ["Results"]
def _convert_arrays_to_lists(data: dict) -> dict:
"""If the input dictionary contains numpy arrays, this function will
cast them to lists and return the same dictionary with the lists instead
of the numpy arrays.
Parameters
--... | aramis-lab/clinica | clinica/pipelines/statistics_surface/surfstat/models/results/_base.py | _base.py | py | 1,962 | python | en | code | 196 | github-code | 18 | [
{
"api_name": "numpy.ndarray",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "inspect.getmembers",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "inspect.ismethod",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "typing.Optiona... |
30543659144 | # convert group table in to splitted table with 80+ columns
import pandas as pd
import json
from pprint import pprint
with open('results-20181108-202123.json') as f:
data = json.load(f)
ages = ["age_0","age_20","age_30","age_40","age_50","age_60","age_70","age_80","age_99"]
sexes = ["F_SEX","M_SEX"]
final_df = No... | Khallil/BCG-Data-science-competition | convert_table.py | convert_table.py | py | 1,733 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "json.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 32,
"usage_type": "call"
}
] |
75023800999 | import csv
import os
from contextlib import suppress
from PySide2 import QtCore, QtGui
from PySide2.QtGui import QStandardItemModel, QStandardItem
from PySide2.QtWidgets import *
from modbus_client.gui.style.custom_elements import CenterDelegate
from modbus_client.resources.codes import ErrorCodes
class HistorianWi... | bronemos/modbus-client | modbus_client/gui/widgets/historian_widget.py | historian_widget.py | py | 7,701 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "PySide2.QtCore.Qt",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "PySide2.QtCore",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "PySide2.QtGui.QStandardItemModel",
"line_number": 27,
"usage_type": "call"
},
{
"api_name":... |
13723799236 | from bson import ObjectId
from pymongo import ASCENDING,MongoClient
from flask import g
class SettingModel():
def __init__(self, settingId=None):
self._id = ObjectId(settingId)
self.collection = getattr(g,'database',MongoClient('localhost', 27017)).db_meta.settings
self.collection_config = ... | LucasYJiang/learninggames | gameServer/syssetting/models.py | models.py | py | 807 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "bson.ObjectId",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.g",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.g",
"line_number... |
11684262830 | import os
import csv
import unicodedata
import datetime
import eel
### 引数textの全角文字数カウント
def get_zen_count(text):
count=0
for c in text:
if unicodedata.east_asian_width(c) in "FWA":
count +=1
return count
### 商品クラス
class Item:
def __init__(self,code,name,price,cnt):
self.item_code=code
self.item_name=na... | ht25367/T05-pos-system02 | fruits_menu.py | fruits_menu.py | py | 5,119 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "unicodedata.east_asian_width",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "eel.order_list_add_write_js",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "eel.order_list_add_write_js",
"line_number": 56,
"usage_type": "call"
},
{
... |
71960255719 | from gurobipy import *
import math
from data import Players, Boosters, Roles, Games, WP, Rating, Price
## SETS ##
# P - Set of Players
# T - Sets of Teams, (Subsets of players)
# R - Roles a player can take
# B - Boosters that can be given to a player
# G - Set of games that are played
## DATA ##
# R6_p - Player Rati... | b3v21/hltvfantasysolver | main.py | main.py | py | 6,002 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "data.Players",
"line_number": 52,
"usage_type": "argument"
},
{
"api_name": "data.Boosters",
"line_number": 53,
"usage_type": "name"
},
{
"api_name": "data.Games",
"line_number": 54,
"usage_type": "argument"
},
{
"api_name": "data.Roles",
"line_... |
11073226635 | import json
from typing import List
from requests import Response
from crawl_utils.crawl_request import ConfigurableCrawlRequest
from crawl_utils.db_utils import getLocalDate
from 浦发银行_完成.pfyh_config import PC_REQUEST_URL, PC_REQUEST_METHOD, PC_REQUEST_HEADERS, PC_REQUEST_DATA, \
PC_FIELD_VALUE_MAPPING, PC_FIELD_NA... | wuyiping2019/crawl_finance_product | 浦发银行_完成/pfyh_pc.py | pfyh_pc.py | py | 2,049 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "crawl_utils.crawl_request.ConfigurableCrawlRequest",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "浦发银行_完成.pfyh_config.MASK",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "浦发银行_完成.pfyh_config.PC_REQUEST_URL",
"line_number": 18,
"usag... |
5806290124 | import json
import os
import sys
from tools.data_splitter import split_data
from tools import change_seperator
import shutil
import pandas as pd
def make_config_file(dataset):
'''
Initialize a config file (save at directory: dataset/json_files/config.json) which consists the the "dataset":dataset und "file_nam... | AlessioAnalytics/recommender_system | configure.py | configure.py | py | 30,300 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "json.dump",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 792,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 792,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": ... |
13174329148 | from tweepy import OAuthHandler
from tweepy import API
from tweepy import Cursor
from datetime import datetime, date, time, timedelta
from collections import Counter
import csv
import sys
import re
consumer_key = '86knabsXSE98VuXWFF3hBdza9'
consumer_secret = 'BnS4zWYwhwbUSB4Td4tPJkrLjTUxdKPNrACc23yfxgKiSGwi8... | manloeng/web-projects | John-McAfee-Conspiracy/Scraper 3.py | Scraper 3.py | py | 2,130 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "tweepy.OAuthHandler",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tweepy.API",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tweepy.Cursor",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_numbe... |
74708316841 | import keras
from keras import models
from keras import layers
import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
import math
import pandas as pd
def generateSin():
x = np.linspace(-10, 10, 10000)
y = np.sin(6*x)
# + np.random.randn(*x.shape) * 0.3
ar... | Chilibonitsu/ML-mlflow-AND-OR-XOR-plus-Sine-Wave-prediction | timeSeries mlflow/timeSeriesSinXY Hassan's new fatures from x.py | timeSeriesSinXY Hassan's new fatures from x.py | py | 5,895 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.linspace",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "keras.models.Sequential",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "keras.models",
"... |
16668068791 | from django.urls import path
from .views import TournamentUpdateApiView, TournamentsAPIList, TournamentAPIView, TournamentCreateView, BracketAPIView, BracketCreateView, AllBracketAPIView, TournamentDeleteAPIView, BracketUpdateAPIView
urlpatterns = [
path('api/v1/tournament/<str:slug>/', TournamentAPIView.as_view(... | inilay/ats_api | tournaments/urls.py | urls.py | py | 941 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "views.TournamentAPIView.as_view",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "views.TournamentAPIView",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": ... |
39445331922 | from django.conf import settings
from champsquarebackend.core.utils import run_bash_script
from champsquarebackend.core.loading import get_model
VideoRecord = get_model('monitoring', 'VideoRecord')
def janus_post_process_file(input_file, output_file):
"""
python function wrapper of janus post process scr... | ChampSquare/ChampionSquareBackend | champsquarebackend/apps/dashboard/records/utils.py | utils.py | py | 2,794 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "champsquarebackend.core.loading.get_model",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.SETTINGS_JANUS_POST_PROCESS_SCRIPT",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 1... |
7304388685 | from PyQt5.QtWidgets import *
from matplotlib.figure import Figure
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
import networkx as nx
from copy import deepcopy
from AppLogic.errorMessage import ErrorMessage
class Graph():
def __init__(self, scene: QGraphicsScene, toolBar: Q... | ShazaAllam2001/Signal-flow-graph | GUI/AppLogic/drawGraph.py | drawGraph.py | py | 2,484 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "networkx.DiGraph",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.figure.Figure",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "networkx.planar_layout",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "netw... |
28298983191 | import string
import sys
import json
import glob
import cv2
import numpy as np
from PIL import Image
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
def getRandomContours(num_angles, start_frame):
vid_frames = glob.glob('./python/frames/frame*')
angles_out = []
curr_frame = 0
angles = []... | luke-favret/RandWind_Main | RandWind_local/python/driver.py | driver.py | py | 6,561 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "glob.glob",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_numb... |
74840979880 | # Import bokeh packages
from bokeh.layouts import column
from bokeh.models import CategoricalColorMapper, ColumnDataSource, CustomJS, Legend, Range, Range1d, Slider
from bokeh.palettes import Category20
from bokeh.plotting import figure, output_file, save, show
# Import python packages
from IPython.display import Imag... | dskarbrevik/Visualize-Machine-Learning | k-nearest-neighbors/KNN_accuracy.py | KNN_accuracy.py | py | 4,133 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.chdir",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.random",
... |
28653958454 | import pygame
from moviepy.editor import VideoFileClip
import threading
import os
import sys
if getattr(sys, 'frozen', False):
# If the application is run as a bundle (i.e. pyinstaller)
base_dir = sys._MEIPASS
else:
base_dir = os.path.dirname(__file__)
os.environ['IMAGEIO_FFMPEG_EXE'] = os.path.join(base... | jo2000we/chatbook | videoplayer.py | videoplayer.py | py | 2,752 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys._MEIPASS",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line... |
70814753959 | # loading libraries
import numpy as np
from sklearn.model_selection import train_test_split
import pandas as pd
from sklearn.datasets import load_iris
from sklearn.metrics import mean_squared_error
from NBClassifier import *
data = load_iris()
X = data['data']
y = data['target']
# split into train and tes... | sharkann789/EasyNBClassifiers | test.py | test.py | py | 878 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.mean_squared_error",
"line_number": 38,
"usage_type":... |
9976497498 | import pytest
import aplazame_sdk
from .base import PrivateTestCase
from .decorators import instance_required
class OrdersTestCase(PrivateTestCase):
def setUp(self):
super(OrdersTestCase, self).setUp()
response = self.client.orders({'ordering': '-cancelled,confirmed'})
qs = response.js... | aplazame/aplazame-sdk | tests/test_orders.py | test_orders.py | py | 4,082 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "base.PrivateTestCase",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "decorators.instance_required",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "decorators.instance_required",
"line_number": 38,
"usage_type": "name"
},
{
"api... |
42129045394 | import os
import glob
import logging
from typing import Any, Dict, Generator, Iterator, Union
import rhsm.config
from rhsm import ourjson
from rhsmlib.facts.collector import FactsCollector
log = logging.getLogger(__name__)
class CustomFacts:
def __init__(self, data: Dict[str, Any] = None):
self.data: D... | candlepin/subscription-manager | src/rhsmlib/facts/custom.py | custom.py | py | 3,669 | python | en | code | 61 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_numb... |
34713992968 | import contextlib
import cProfile
import io
import pstats
@contextlib.contextmanager
def profiled(print_callers: bool = False):
"""
Profile the execution of a function, copied from
https://docs.sqlalchemy.org/en/14/faq/performance.html
Args:
print_callers (bool, optional): IF true, print who'... | elehcimd/mltraq | src/mltraq/extras/profiling.py | profiling.py | py | 627 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "cProfile.Profile",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "io.StringIO",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pstats.Stats",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "contextlib.contextmanager",... |
11347240802 | import logging
from aiogram import Dispatcher
from data.config import ADMINS
from utils.db_api.main import GET_ID
async def on_startup_notify(dp: Dispatcher):
for admin in ADMINS:
try:
await dp.bot.send_message(admin, "Бот Запущен\n/start")
except Exception as err:
loggi... | SMF321/keys3_bot | utils/notify_admins.py | notify_admins.py | py | 532 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "aiogram.Dispatcher",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "data.config.ADMINS",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "logging.exception",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "utils.db_api.m... |
32415619481 | #!/usr/bin/python
import wx
import os.path as join
class mainApp(wx.App):
def __init__(self, redirect=False, filename=None):
self.xPos = 50
wx.App.__init__(self, redirect, filename)
self.mainFrame = wx.Frame(None, wx.ID_ANY, title = 'Test Window', pos =(0, 0), size = (800, 600))
... | foss-np/e-barnamala | eBarnamala-old/tests/test.py | test.py | py | 1,618 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "wx.App",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "wx.App.__init__",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "wx.App",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "wx.Frame",
"line_number": 10... |
40709747590 | from db import get_running_data, get_other_data
from django.http import HttpRequest
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from ip2geotools.databases.noncommercial import DbIpCity
from config import IMAGES_FOLDER_PATH, BOT_API_TOKEN, CHAT_ROOM_ID
import telebot
def generat... | NguyenQuangMinh0504/my_website | django_my_website/django_my_website/utils.py | utils.py | py | 5,702 | python | vi | code | 1 | github-code | 18 | [
{
"api_name": "matplotlib.use",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.bar",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyp... |
14717332073 | import itertools
import os
import jsonschema
from jsonschema import ValidationError
from red_val.exceptions import RedSpecificationError, RedValidationError, CWLSpecificationError, format_validation_error
from red_val.schemas.red import red_schema
from red_val.red_types import InputType, OutputType
from red_val.red_va... | curious-containers/curious-containers | red-val/red_val/red_validation.py | red_validation.py | py | 15,033 | python | en | code | 6 | github-code | 18 | [
{
"api_name": "jsonschema.validate",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "red_val.schemas.red.red_schema",
"line_number": 38,
"usage_type": "argument"
},
{
"api_name": "jsonschema.ValidationError",
"line_number": 39,
"usage_type": "name"
},
{
... |
20406456115 | # crawler_naver news_fun
import urllib.request
import bs4
url = "https://news.naver.com"
html = urllib.request.urlopen(url)
bs_obj = bs4.BeautifulSoup(html,"html.parser")
ul = bs_obj.find("ul",{"id":"text_today_main_news_801001"})
lis = ul.findAll("li")
a_tag = [li.find("strong").text for li in lis]
# for li i... | 951237/python_crawling | 크롤링_네이버뉴스_201807/crawler_naver news_fun_180728.py | crawler_naver news_fun_180728.py | py | 439 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "urllib.request.request.urlopen",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 6,
"usage_type": "name"
},
{
"api_name":... |
3318548362 | from flask import Flask
from flask_bcrypt import Bcrypt
from flask_cors import CORS
from flask_marshmallow import Marshmallow
from flask_sqlalchemy import SQLAlchemy, sqlalchemy
from flask_migrate import Migrate
import os
import logging
# load dotenv
from dotenv import load_dotenv
# init()
load_dotenv()
db_user = os... | wambuidenis/fuprox_desktop_depts | fuprox/__init__.py | __init__.py | py | 2,234 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number":... |
11310853172 | from setuptools import setup
import versioneer
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md')) as f:
long_description = f.read()
setup(name="phylonetwork",
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
... | bielcardona/PhyloNetwork | setup.py | setup.py | py | 875 | python | en | code | 8 | github-code | 18 | [
{
"api_name": "os.path.abspath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number"... |
12588006079 | from ipaddress import IPv4Address, IPv6Address
from django.db import models
CHECK_INTERVALS = 5
class AddressInfo:
ipv4_address: IPv4Address | None = None
ipv6_address: IPv6Address | None = None
ipv6_prefix_length: int | None = None
@property
def ipv4_address_str(self) -> str | None:
if... | rexzhang/ddns-clienter | ddns_clienter_core/constants.py | constants.py | py | 1,604 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "ipaddress.IPv4Address",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "ipaddress.IPv6Address",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "ipaddress.IPv4Address",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "ipad... |
28515859232 | import pandas as pd
import numpy as np
import re
import os
import sys
import sqlite3
import nltk
#nltk.download('punkt')
#nltk.download('stopwords')
from sklearn.model_selection import train_test_split
import logging
import multiprocessing
import gensim
from gensim.models import Word2Vec
from sklearn.feat... | GBocharov/text-sentiment-analysis | source.py | source.py | py | 16,569 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pymorphy2.MorphAnalyzer",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords",
"line_number": 31,
"usage_type": "name"
},
{
"api_nam... |
23073133643 | #!/usr/bin/env python3
# Version 1.0
# Author Alexis Blanchet-Cohen
# Date: 09/06/2014
import argparse
import glob
import os
import subprocess
import util
# Read the command line arguments.
parser = argparse.ArgumentParser(description="Converts BAM files to bedgraph files.")
parser.add_argument("-s", "--scriptsDirec... | blancha/abcngspipelines | utils/bamtobedgraph_stranded.py | bamtobedgraph_stranded.py | py | 3,632 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "util.cdMainScriptsDirectory",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "o... |
20077735332 | import json
import requests
from bs4 import BeautifulSoup
import time
import re
import os
import datetime
import pickle
def get_starting_values(file_path):
"""
Looks if file exists if yes load the file of not returns empty dictionary
:param file_path:
:return:
"""
data = {}
if os.path.exi... | OKangur/scraper | scraper.py | scraper.py | py | 17,844 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.exists",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number... |
72720873960 | import rclpy
import cv2
import numpy as np
from rclpy.node import Node
from std_msgs.msg import String
from sensor_msgs.msg import Joy, Image
from cv_bridge import CvBridge
from rclpy import qos
class Camera(Node):
def __init__(self):
super().__init__("cam_node")
self.sub = self.create_subscriptio... | Entity014/IEEE | src/rabbit_package/rabbit_package/camera.py | camera.py | py | 1,496 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "rclpy.node.Node",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "sensor_msgs.msg.Image",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "rclpy.qos.qos_profile_sensor_data",
"line_number": 18,
"usage_type": "attribute"
},
{
"... |
6423104434 | import math
import string
from rich import print
from utils import load_input
"""
Lowercase item types a through z have priorities 1 through 26.
Uppercase item types A through Z have priorities 27 through 52.
"""
verbose = False
input_data = load_input()
def find_common_item(row):
compartment_1 = row[... | Remi-Gau/advent_of_code | 2022/day_03/part_1.py | part_1.py | py | 1,355 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "utils.load_input",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "math.floor",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "rich.print",
"line_number":... |
28699021330 | import pymongo
conn=pymongo.MongoClient('localhost',27017)
db=conn.test
myset=db.zzh
'''
insert()
insert_many()
insert_one()
save() 如果有则修改,没有则插入
'''
# myset.insert({"name" : "Frank", "age" : 26, "sex" : "m" })
# myset.insert([{"name" : "Frank", "age" : 26, "sex" : "m" },{"name" : "Frank", "age" : 26, "sex" : "m" }])
... | Air-Zhuang/Test35 | database/mongo/mongo.py | mongo.py | py | 1,976 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 3,
"usage_type": "call"
}
] |
20785579160 | from greenlet import greenlet
def test1():
gr2.switch(1)
print('test1 finished')
def test2(x):
print('test2 first', x)
z = gr1.switch()
print('test2 back', z)
def main(a=50):
for i in range(a):
print(i)
gr1 = greenlet(test1)
gr2 = greenlet(test2)
gr1.switch()
print('gr1 is dead?:... | NuovoVita/pressure_test_comparison | coroutine/greenlet_coroutine_2.py | greenlet_coroutine_2.py | py | 468 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "greenlet.greenlet",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "greenlet.greenlet",
"line_number": 21,
"usage_type": "call"
}
] |
40953754631 | import osmium
import numpy as np
import pandas as pd
import re
import sys
import urllib
import time
from rdflib import Graph, Namespace, URIRef, BNode, Literal
from rdflib.namespace import RDF, FOAF, XSD
start = time.time()
class osm2rdf_handler(osmium.SimpleHandler):
def __init__(self):
osmium.SimpleHandl... | alishiba14/WorldKG-Knowledge-Graph | CreateTriples.py | CreateTriples.py | py | 6,590 | python | en | code | 20 | github-code | 18 | [
{
"api_name": "time.time",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "osmium.SimpleHandler",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "osmium.SimpleHandler.__init__",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "osm... |
17840559259 | from django.shortcuts import render
from django.contrib.auth import authenticate
from products.models import Prediction
from pycaret.regression import *
import pandas as pd
import asyncio
import threading
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import warnings
import yagmai... | 11Jou/Egy-State | Form/views.py | views.py | py | 19,546 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "asyncio.set_event_loop",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "products.models.Prediction",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "as... |
26426390970 | import rpyc
import time
try:
conn = rpyc.connect(None, 12345)
except ConnectionRefusedError:
print('Buffer Offline')
exit()
while True:
try:
id = conn.root.consume()
print('Consumed {}'.format(id))
time.sleep(3)
except EOFError:
print('Buffer Disconne... | Sistemas-Distribuidos-2022-1/Arthur-Cavalcante-de-Andrade | Produtor-Consumidor com buffer limitado/consumer.py | consumer.py | py | 342 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "rpyc.connect",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 14,
"usage_type": "call"
}
] |
75338186919 | from collections.abc import Iterable
from copy import deepcopy
import numpy as np
from bidict import bidict
class PreparedData:
def __init__(self):
self.matching_x_bidict = bidict()
self.matching_y_bidict = bidict()
self.pseudo_columns = []
self.epsilon = 1e-6
self.min_x =... | Quwarm/NN-Data-Classification | mlp/prepared_data.py | prepared_data.py | py | 7,613 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "bidict.bidict",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "bidict.bidict",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "bidict.bidict",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "bidict.bidict",
"line_n... |
19827183444 | import ADS1256
import time
import numpy as np
import RPi.GPIO as GPIO
import config
import board
import adafruit_mcp4728
from multiprocessing import Process, Queue
GPIO.setwarnings(False)
# MCP4728 initialization
i2c = board.I2C() # uses board.SCL and board.SDA
dac = adafruit_mcp4728.MCP4728(i2c)
# ADS1256 pins
RS... | adamswiniarskixc/Transfer_interferometer_for_laser_frequency_stabilization | converters_in_python/converters_multithreading.py | converters_multithreading.py | py | 2,420 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "RPi.GPIO.setwarnings",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "board.I2C",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "adafruit_mcp4728.MCP4728",
... |
74240427881 | #!/usr/bin/env python3
from time import time
from tests import TESTS
import argparse
import subprocess
import sys
def cmd(cmd):
subprocess.check_call(cmd, shell = True)
def cleanup():
cmd("""
cd ../
rm -rf test/output/*
""")
def run_test(test):
cmd(f"cd ../ && ./facetool.py {test['command']} ... | hay/facetool | test/test-all.py | test-all.py | py | 1,343 | python | en | code | 47 | github-code | 18 | [
{
"api_name": "subprocess.check_call",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tests.TESTS",
"line_number": 29,
"usage_type": "argument"
},
{
"api_name": "sys.exit... |
31005532245 | # coding: utf-8
import pyvista
from PIL import Image
def load_stl(path):
return pyvista.PolyData(path)
def project2D(mesh, elev, azim, **kwargs):
mesh = mesh.copy()
mesh.rotate_z(-90-azim)
mesh.rotate_x(-90+elev)
plotter = pyvista.Plotter(off_screen=True)
plotter.set_background('black')
plotter.add_mesh(mesh,... | tkc-morita/ct_multiview | modules/pyvista_renderer.py | pyvista_renderer.py | py | 425 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pyvista.PolyData",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pyvista.Plotter",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PIL.Image.fromarray",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"... |
37689738394 | import logging
from typing import Any, Iterable, List, Optional, Union, Callable, Dict, Tuple
from fedora.client import AuthError, FedoraServiceError
from fedora.client.fas2 import AccountSystem
from ogr.abstract import CommitStatus, GitProject
from packit.config.job_config import JobConfig
from packit.exceptions imp... | RaiLokesh/packit-service | packit_service/worker/allowlist.py | allowlist.py | py | 11,584 | python | en | code | null | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "packit_service.service.events.PushPagureEvent",
"line_number": 39,
"usage_type": "name"
},
{
"api_... |
71969089639 | import os
from typing import List, Optional
import dataclasses
from official.core import config_definitions as cfg
from official.core import exp_factory
from official.modeling import hyperparams
from official.modeling import optimization
from official.vision.beta.configs import backbones
from official.vision.beta.confi... | nicknochnack/RealTimeSignLanguageDetectionwithTFJS | Tensorflow/models/official/vision/beta/configs/image_classification.py | image_classification.py | py | 10,178 | python | en | code | 91 | github-code | 18 | [
{
"api_name": "official.core.config_definitions.DataConfig",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "official.core.config_definitions",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 12,
"usage_type"... |
42583424053 | import numpy as np
import time
import scipy
from scipy.linalg import solve
def jacobi(A, b, x, n, Iteration= False):
counter = 0
D = np.diag(A)
R = A - np.diagflat(D)
x0 = x
x = (b - np.dot(R, x0)) / D
if Iteration==True:
print("Iteration " + str(counter) + ": " + str(x))
counter +=... | pouyaaghahoseini/nla-project | Problem 1/Jacobi.py | Jacobi.py | py | 905 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.diag",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.diagflat",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.norm",
"line_numbe... |
11069097582 | import pygame
from src.constants import HEIGHT, SPACE_SHIP_YELLOW, LASER_YELLOW
from src.ships.Ship import Ship
class Player(Ship):
def __init__(self, x, y, health=100):
super().__init__(x, y, health=health)
self.ship_img = SPACE_SHIP_YELLOW
self.laser_img = LASER_YELLOW
self.mask... | Sandeep-Mani/Space-Invaders | src/ships/Player.py | Player.py | py | 1,350 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "src.ships.Ship.Ship",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "src.constants.SPACE_SHIP_YELLOW",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "src.constants.LASER_YELLOW",
"line_number": 11,
"usage_type": "name"
},
{
"api... |
75192244521 | import os
import glob
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection
import csv
from F1TenthRacingDRL.DataTools.MapData import MapData
def find_folders(path="ResultsJetson23"):
# root_path = "/home/benjy/sim_ws/src/f1tenth_racing/Data/"
root_path = "/hom... | BDEvan5/F1TenthRacingDRL | F1TenthRacingDRL/DataTools/SimToReal/VisualiseTestData.py | VisualiseTestData.py | py | 4,749 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "glob.glob",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": 2... |
9684221020 | import sys
import os
# add the external folder to path:
sys.path.append(os.path.join(os.path.dirname(__file__), "..", ".."))
from paddle import inference
import numpy as np
from scipy.special import softmax
from infoxlm_paddle import InfoXLMTokenizer
from paddlenlp.data import Pad
LABEL_MAPPING = {0: "contradiction",... | jiamingkong/infoxlm_paddle | TIPC/inference_paddle/infer.py | infer.py | py | 6,490 | python | en | code | 4 | github-code | 18 | [
{
"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.join",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
30145574044 | import copy
import random
from typing import Dict,List
# Consider using the modules imported above.
# I added what's in the third line
class Hat:
def __init__(self, **kwargs) -> None:
self.contents = [ball for ball, count in kwargs.items() for x in range(count)]
def draw(self, count: int) -> List[st... | SaraSSC/probability-calc | prob-calc.py | prob-calc.py | py | 1,085 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "random.randrange",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "copy.deepcopy",
"line_nu... |
2761255754 | import telebot
from urllib.request import urlopen
from xml.etree import ElementTree as ET
import os
from dotenv import load_dotenv
dotenv_path = os.path.join(os.path.dirname(__file__), '.env')
if os.path.exists(dotenv_path):
load_dotenv(dotenv_path)
API_TOKEN = os.getenv('API_TOKEN')
bot = telebot.TeleBot(API_TOK... | TsirulikIvan/CurrencyBot | server.py | server.py | py | 2,623 | python | ru | code | 1 | github-code | 18 | [
{
"api_name": "os.path.join",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_num... |
33591402339 | from functools import partial
def build_algorithm(cfg, callback=None, verbose=False):
algorithm_name = cfg.algorithm_name
framework_name = cfg.framework
if algorithm_name == 'kmeans':
if framework_name == 'numpy':
from algorithms.kmeans_np import KMeansNumpy
clustering_cla... | creinders/ClusteringAlgorithmsFromScratch | algorithms/builder.py | builder.py | py | 2,736 | python | en | code | 9 | github-code | 18 | [
{
"api_name": "algorithms.kmeans_np.KMeansNumpy",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "functools.partial",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "algorithms.kmeans_pt.KMeansPytorch",
"line_number": 14,
"usage_type": "argument"
},
... |
39608873161 | from pathlib import Path
import torch
from irra.model.clip_model import CLIP, build_CLIP_from_openai_pretrained
WEIGHT_FILE = Path.home() / "models" / "clip_finetuned" / "clip_finetune.pth"
STRIDE_SIZE = 16
IMAGE_SIZE = (384, 128)
def load_clip(weight_file: Path = WEIGHT_FILE) -> CLIP:
# Filter "base_mode." in f... | AwePhD/td_baseline | src/tdbaseline/clip.py | clip.py | py | 630 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pathlib.Path.home",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.load",
"line_numb... |
15317371448 | import sys
from collections import deque
# sys.setrecursionlimit(1000000)
di = [0, 0, 1, -1]
dj = [1, -1, 0, 0]
n, m= map(int, sys.stdin.readline().split())
tomato = [list(map(int, sys.stdin.readline().split())) for _ in range(m)]
arr = [[-1]* n for _ in range(m)]
queue = deque()
for i in range(m):
for j in ran... | cldud400/python-coding-test | 문제풀이/7576.py | 7576.py | py | 1,015 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.stdin.readline",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin.readline",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"li... |
70922141801 | import singer
import singer.utils
import singer.metrics
import dateutil.parser
import pytz
from singer.transform import Transformer, VALID_DATETIME_FORMATS, \
NO_INTEGER_DATETIME_PARSING, UNIX_SECONDS_INTEGER_DATETIME_PARSING, \
unix_seconds_to_datetime, unix_milliseconds_to_datetime
from singer.utils import s... | dbt-labs/tap-campaign-monitor | tap_campaign_monitor/streams/base.py | base.py | py | 7,637 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "singer.get_logger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "dateutil.parser.parser.parse",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "dateutil.parser.parser",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_na... |
10104191802 | from allauth.account import forms
from allauth.account.models import EmailAddress
from allauth.account.utils import perform_login
from django.contrib import messages
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse, reverse_lazy
from django.contrib.sites.models import Site
from ... | mek32390/mchp-dev | mchp/allauth/socialaccount/views.py | views.py | py | 5,530 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "account.views.RedirectAuthenticatedUserMixin",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "account.views.CloseableSignupMixin",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "django.views.generic.edit.FormView",
"line_number": 26,
"... |
32843065863 | import geojson
import pandas as pd
import pickle
import re
import sys
from bs4 import BeautifulSoup
from copy import deepcopy
from constants.Settings import ADJACENCY_MATRIX, BASEMAP_FILE, TRAVEL_TIME_MATRIX, GRIDS_MEDOID, GRIDS_NODES_COUNT, \
HQ_ID, USE_REAL_TRAVEL_TIME
from entity.Dataset import *
from entity.P... | waldyjoe/MADPRP | preprocess/PreProcessRawData.py | PreProcessRawData.py | py | 6,742 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "constants.Settings.BASEMAP_FILE",
"line_number": 37,
"usage_type": "argument"
},
{
"api_name": "geojs... |
26785438719 | from tkinter import *
import customtkinter as ctk
from PIL import ImageTk, Image
from employee import employeeClass
from product import productClass
from category import categoryClass
from billing import BillClass
from summary import allSummary
# from locations import locationClass
class pharmacy:
def __init__(se... | Usman-Amjad/Pharmacy-Management-System | main.py | main.py | py | 3,908 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "customtkinter.set_appearance_mode",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "customtkinter.set_default_color_theme",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 24,
"usage_type": "call"
},
{... |
1061791695 | """`MonopileInstallation` class and related processes."""
__author__ = "Jake Nunemaker"
__copyright__ = "Copyright 2020, National Renewable Energy Laboratory"
__maintainer__ = "Jake Nunemaker"
__email__ = "jake.nunemaker@nrel.gov"
import numpy as np
import simpy
from marmot import process
from wisdem.orbit.core imp... | WISDEM/WISDEM | wisdem/orbit/phases/install/monopile_install/standard.py | standard.py | py | 13,423 | python | en | code | 125 | github-code | 18 | [
{
"api_name": "wisdem.orbit.phases.install.InstallPhase",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "common.Monopile",
"line_number": 104,
"usage_type": "call"
},
{
"api_name": "common.TransitionPiece",
"line_number": 105,
"usage_type": "call"
},
{
... |
17463265242 | from flask import Blueprint, session, redirect, render_template, jsonify, request
import MySQLdb
import time
import pandas as pd
from sklearn.linear_model import LinearRegression
import numpy as np
collection_bp = Blueprint('collection_bp', __name__)
@collection_bp.route("/")
@collection_bp.route("/collection")
def ... | soundloverx/collectible-cards | api/collection.py | collection.py | py | 6,349 | python | en | code | null | github-code | 18 | [
{
"api_name": "flask.Blueprint",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.session.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "flask.redirect",
"... |
31436020919 | from setuptools import setup, find_packages
import os
version='0.0.11'
if os.environ.get('CI_COMMIT_TAG'):
version = os.environ['CI_COMMIT_TAG']
#if os.environ.get('CI_JOB_ID'):
# version = os.environ['CI_JOB_ID']
with open("README.md","r") as fh:
long_description= fh.read()
setup(
name='Pyth... | fanoos/Python_CI_CD_Test | setup.py | setup.py | py | 1,561 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.environ.get",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "setuptools.setup",
"l... |
1634065153 |
#
# # class Ms(object):
# # def __init__(self):
# # self.connect = pymysql.connect(
# # host="192.168.10.36",
# # port=3306,
# # user="root",
# # password="123456",
# # charset="utf8",
# # )
# # self.cursor = self.connect.cursor()... | liuyanfang-git/test_1 | python jiaoben/python_xx/ss.py | ss.py | py | 10,659 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 186,
"usage_type": "call"
},
{
"api_name": "concurrent.futures.ThreadPoolExecutor",
"line_number": 300,
"usage_type": "call"
},
{
"api_name": "threading.current_thread",
"line_number": 303,
"usage_type": "call"
},
{
"ap... |
25638618921 | # #### API Using Generic Class-Based Views ####
# from .models import Experiment
# from .serializers import ExperimentSerializer
# from rest_framework import generics
#
# class ExperimentList(generics.ListCreateAPIView):
# queryset = Experiment.objects.all()
# serializer_class = ExperimentSerializer
#
... | Cool-Whiskers/wifiSensors | views.py | views.py | py | 8,043 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "models.Experiment.objects.all",
"line_number": 136,
"usage_type": "call"
},
{
"api_name": "models.Experiment.objects",
"line_number": 136,
"usage_type": "attribute"
},
{
"api_name": "models.Experiment",
"line_number": 136,
"usage_type": "name"
},
{
... |
30272496478 | # Usage: python homogenize_WRF_QVAPOR_clearair.py filename
# The name homogenize_WRF_QVAPOR_clearair says it all I hope
# clearair is defined by ds.QCLOUD[0,ilev,:,:] <1e-7
# WRF seems to have actual QCLOUD zeros, but 1e-7 kg/kg is safe
# On Pegasus, these modules need to be loaded in first
# module load py-pip
# p... | brianmapes/VaporLakes | homogenize_WRF_QVAPOR_clearair.py | homogenize_WRF_QVAPOR_clearair.py | py | 1,251 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.argv",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "xarray.open_dataset",
"line_number": 24,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.