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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7662960040 | #Alex Black
import cv2
import numpy as np
import io
from PIL import Image
from threading import Thread
import collections
frame = cv2.VideoCapture( 0 )
kern = np.ones( ( 1, 1 ), np.uint8 )
i = 0
while True:
i+=1
print( i )
_,cimg = frame.read()
#cimg = cv2.imread( 'test.png' )
cimgh, cimgw, _ = ... | shihaocao/RC1 | areacompare.py | areacompare.py | py | 2,878 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "cv2.blur",
"line_numb... |
30903061705 | import requests
import bs4
from bs4.dammit import EncodingDetector
from urllib.request import Request, urlopen, urlretrieve
def get_flag(url):
try:
url = url.replace(" ", "%20")
useragent = ["Mozilla/5.0 (compatible; Googlebot/2.1; +http://google.com/bot.html)",
"Mozilla/5.0 (W... | cfowles27293/leetcode | venv/server_get_exploit.py | server_get_exploit.py | py | 1,332 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "urllib.request.Request",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "bs4.dammit.EncodingDetector.find_declared_encoding",
"line_number": 16,
"usage_type": "call... |
35076567124 | """
Factory for HID transport connections.
Currently supports only Cython/HIDAPI
"""
import platform
from logging import getLogger
from ..pyedbglib_errors import PyedbglibNotSupportedError
def hid_transport(library="hidapi"):
"""
Dispatch a transport layer for the OS in question
The transport layer is ... | SpenceKonde/megaTinyCore | megaavr/tools/libs/pyedbglib/hidtransport/hidtransportfactory.py | hidtransportfactory.py | py | 2,186 | python | en | code | 471 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "platform.system",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "cyhidapi.CyHidApiTransport",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "pyedbgli... |
8828354298 | #!/usr/bin/env python
# coding: utf-8
# In[38]:
# Importar las librerias
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
import sklearn
# In[2]:
get_ipython().run_line_magic('cd', "'/home/jovyan/python/dataset'")
get_ipython().run_line_m... | afnarqui/python | Testing.py | Testing.py | py | 1,221 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.random.randn",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplo... |
32952177369 | from lib2to3.pgen2 import token
import requests
import json
#Variáveis iniciais
def get_logradouro():
inicio = 1
qtregistros = 99
mais_paginas = True
token_entidade = "xxxxxx"
conta_registros = 0
lote = 0
#Parametros da requisição
url = "https://e-gov.betha.com.br/glb/service-laye... | ermescarletto/bth | get_logradouros.py | get_logradouros.py | py | 1,862 | python | pt | code | 0 | github-code | 1 | [
{
"api_name": "requests.request",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "requests.request",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_n... |
146002694 | import os
import sys
import argparse
from spinalcordtoolbox.utils import Metavar, SmartFormatter, init_sct, extract_fname, printv
def get_parser():
# Initialize the parser
parser = argparse.ArgumentParser(
description='Transpose bvecs file (if necessary) to get nx3 structure.',
formatter_clas... | jem0101/BigSwag-SQA2022-AUBURN | TestOrchestrator4ML-main/resources/Data/supervised/GITHUB_REPOS/neuropoly@spinalcordtoolbox/scripts/sct_dmri_transpose_bvecs.py | sct_dmri_transpose_bvecs.py | py | 2,558 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "spinalcordtoolbox.utils.SmartFormatter",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "os.path.basename",
"line_number": 14,
"usage_type": "call"
},
{
"a... |
41766349642 | from py2neo import Graph, Node, Relationship
from flask import jsonify
import json
import re
import chardet
from demjson import decode
import numpy as np
from neo4j import GraphDatabase, basic_auth, kerberos_auth, custom_auth, TRUST_ALL_CERTIFICATES
def build_nodes(node_record):
data = {'id': str(node_record['id(... | ownia/KGRM | kg_web/test.py | test.py | py | 5,914 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "py2neo.Graph",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "py2neo.Graph",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": ... |
2545116778 | import os
from typing import Dict, List, Optional
class CopySpec:
"""Copy specification of a single file or directory."""
def __init__(self, source_path: str, target_path: Optional[str] = None):
self.source_path = source_path
self.target_path = target_path
def get_target(self) -> str:
... | eclipse-velocitas/devenv-devcontainer-setup | grpc-interface-support/src/util/templates.py | templates.py | py | 1,938 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "typing.Optional",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_numbe... |
1438555767 | #!/usr/bin/env python3
import uuid
from typing import List
import click
import backoff
from bravado.exception import HTTPConflict, HTTPError
from neptune.new.internal.backends.hosted_neptune_backend import HostedNeptuneBackend
from neptune.new.internal.credentials import Credentials
class Invitation:
def __ini... | neptune-ai/neptune-admin-utils | manage_users.py | manage_users.py | py | 2,931 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "uuid.UUID",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "bravado.exception.HTTPConflict",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "click.echo",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "backoff.on_e... |
11595543761 | import torch
from gtts import gTTS
import os
import keyboard
from tqdm import tqdm
import random
import speech_recognition as sr
def recognize_speech_from_mic(recognizer, microphone):
"""Transcribe speech from recorded from `microphone`.
Returns a dictionary with three keys:
"success": a boolean indica... | jahkelr/machine-learning | Unsupervised/ToxBot/src/generator.py | generator.py | py | 4,254 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "speech_recognition.Recognizer",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "speech_recognition.Microphone",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "speech_recognition.RequestError",
"line_number": 47,
"usage_type": ... |
26681362352 | import json
import plotly
import pandas as pd
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import word_tokenize
from textblob import TextBlob
import numpy as np
from flask import Flask
from flask import render_template, request, jsonify
from plotly.graph_objs import Bar, Histogram
from sklearn.externals ... | qiaochen/TextClsApp | app/run.py | run.py | py | 3,895 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "nltk.tokenize.word_tokenize",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "nltk.stem.WordNetLemmatizer",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "s... |
23206544173 | import robin_stocks.robinhood as r
import json
import pandas as pd
# Reads data about the previous trades from a JSON file and prints it
def read_trade_history(file_name):
print("read_trade_history()")
with open(file_name) as json_file:
data = json.load(json_file)
for sell_date, event in data.item... | messi618/TradingAlgorithm | vivekTradingBot/tradingStatistics.py | tradingStatistics.py | py | 2,230 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.Timestamp",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 2... |
17514167841 | from datetime import datetime
import pytz as pytz
import boto3
boto3.setup_default_session(profile_name='s3-viewer')
s3 = boto3.client('s3')
response = s3.list_buckets()
bucket_names = [bucket['Name'] for bucket in response['Buckets']]
print('Select the bucket:')
for name in bucket_names:
print(name)
selected_buc... | Aleh-Zamzhytski/cloudx | get_object_by_date.py | get_object_by_date.py | py | 1,407 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "boto3.setup_default_session",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "dat... |
6123825523 | from PIL import Image
import numpy as np
import matplotlib.cm as cm
import math
ASPECT_RATIO = 1.0 / 1.0
FRAME_HEIGHT = 8.0
FRAME_WIDTH = FRAME_HEIGHT * ASPECT_RATIO
XRES = 1000
YRES = 1000
x_min = -FRAME_WIDTH/2
x_max = FRAME_WIDTH/2
y_min = -FRAME_HEIGHT/2
y_max = FRAME_HEIGHT/2
x_values = np.linspace(x_min, x_ma... | vivek3141/videos | create_img.py | create_img.py | py | 1,195 | python | en | code | 132 | github-code | 1 | [
{
"api_name": "numpy.linspace",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "math.atan",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number":... |
35466272972 | """Models and all supporting code"""
import cv2
import numpy as np
import utils
class OtsuThresholding(object):
"""Represents model for predicting i-contours given images and o-countours using Otsu's method"""
def __init__(self, kernel_size=None):
"""Configures loader
:param kernel_size: si... | vshmyhlo/dicom-data-loader | models.py | models.py | py | 2,051 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.bool",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "numpy.uint8",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "cv2.threshold",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "cv2.THRESH_BINARY",
... |
25507365738 | from django.shortcuts import render
from django.http import JsonResponse
import json
from django.shortcuts import get_object_or_404
from django.http import Http404
from django.views.decorators.csrf import csrf_exempt
from . import models
def index(request):
ctx = {}
return render(request, 'main/index.html', ctx)
de... | jfsanchez91/CaseReportOpenData | main/views.py | views.py | py | 4,026 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.shortcuts.render",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 137,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 174,
"usage_type": "call"
},
{
"api_name": "django.s... |
15534508158 | import gym
from stable_baselines3.common.vec_env.dummy_vec_env import DummyVecEnv
from stable_baselines3 import PPO, SAC
from stable_baselines3.common.callbacks import EvalCallback
from stable_baselines3.common.utils import get_schedule_fn
from stable_baselines3.common.monitor import Monitor
from stable_baselines3.com... | FaisalAhmed0/SLUSD | src/diayn.py | diayn.py | py | 22,206 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "seaborn.set_theme",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "seaborn.set",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "src.config.conf.font_scale",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "src.con... |
41433954503 | import os
import mock
import json
import pika
import Queue
import logging
import greenlet
import unittest
import threading
from rackattack.tcp import publish
from rackattack.tcp import subscribe
from rackattack.tests import mock_pika
from rackattack.tests import one_threaded_publish
handler = logging.StreamHandler()
... | Stratoscale/rackattack-api | py/rackattack/tests/test_publish.py | test_publish.py | py | 8,433 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.StreamHandler",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.get... |
21898163142 | import os
import csv
from utilities.utilities import *
from utilities.katuyou import Katuyou
from collections import defaultdict
class EmotionClass:
def __init__(self, feeling_folder_path, line_file_path):
self.feeling_foloder_path = feeling_folder_path
self.line_file_path = line_file_path
... | blackpopo/Maya_Bot_v01 | EmotionalSummary.py | EmotionalSummary.py | py | 5,462 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.listdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "utilities.... |
30724803476 | import pygame
from player import Player
class GameScreen(object):
def __init__(self, w, h, tilesize):
pygame.init()
#initialize all screen variables
self.width = w
self.height = h
self.scene = pygame.display.set_mode( (w,h) )
self.caption = pygam... | LSCCyberHawks/GenCyber2023 | Python/gamescreen.py | gamescreen.py | py | 5,715 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pygame.init",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pygame.display... |
16058498554 | from selenium.webdriver.chrome.service import Service
"""
@package base
WebDriver Factory class implementation
It creates a webdriver instance based on browser configurations
"""
from selenium import webdriver
class WebDriverFactory():
def __init__(self, browser):
"""
Inits WebDriverFactory cla... | ManuBoca92/hudl-tech-test | base/WebDriverFactory.py | WebDriverFactory.py | py | 1,156 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "selenium.webdriver.chrome.service.Service",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 33,
"usage_type": "name"
},
{... |
43495804534 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri May 12 01:26:44 2023
@author: mingjunsun
"""
import pandas as pd
import numpy as np
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
import random
import matplotlib.pyplot as plt
#from livelossplot import PlotLosses
from skl... | Sho-Shoo/36490-F23-Group1 | example_code/random_forest.py | random_forest.py | py | 4,038 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.chdir",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "sklearn.ensemble.RandomForestRegressor",
"line_number": 113,
"usage_type": "call"
},
{
"api_name": "skle... |
30980103485 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^scrape_movies/$', views.scrape_movies, name='scrape_movies'),
url(r'^view_movies/$', views.view_movies, name='view_movies'),
url(r'^filter_movies/$', views.filter_movies, name='filter_movi... | manujosephv/MovieScraper | movielistview/urls.py | urls.py | py | 1,055 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.conf.urls.url",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.co... |
17794645978 | # Lifted heavily from Mustard Mine, and may have some unnecessary guff
import base64
import collections
import datetime
import functools
import json
import os
import sys
import threading
import time
import pytz
from pprint import pprint, pformat
# Hack: Get gevent to do its monkeypatching as early as possible.
# I have... | Rosuav/sub-tracker | subtracker.py | subtracker.py | py | 8,962 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "gevent.monkey.patch_all",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "gevent.monkey",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "os.environ",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
... |
28775868892 | from typing import Optional
from pydantic import Field, HttpUrl, validator
from app.model.response import Success
from app.model.base import DataModel, InCreateModel, InUpdateModel
from app.database.table.location_cabinet import CabinetStatus
from app.util.type.guid import GUID
from app.util.regex_pattern imp... | batu1579/instrument-management-service | app/model/location_cabinet.py | location_cabinet.py | py | 6,629 | python | zh | code | 0 | github-code | 1 | [
{
"api_name": "app.model.base.DataModel",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "app.util.type.guid.GUID",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pydantic.Field",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pydan... |
24246196895 | #
# matplot graph class definition
#
# backend independent implementation
#
# Kazutomo Yoshii <ky@anl.gov>
#
import os, sys
import matplotlib.pyplot as plt
import matplotlib.animation as manimation
#import matplotlib.collections as collections
import matplotlib.cm as cm
from matplotlib.offsetbox import OffsetImage, A... | UO-OACISS/tau2 | tools/src/pycoolr/src/pycoolrgui/pycoolr-plot/clr_matplot_graphs.py | clr_matplot_graphs.py | py | 11,842 | python | en | code | 34 | github-code | 1 | [
{
"api_name": "os.path.abspath",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_num... |
73034041633 | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Nicole Thomas <nicole@saltstack.com>`
'''
# Import Python Libs
import os
import random
import string
# Import Salt Testing Libs
from salttesting import skipIf
from salttesting.helpers import ensure_in_syspath, expensiveTest
ensure_in_syspath('../../../')
# Import... | shineforever/ops | salt/tests/integration/cloud/providers/rackspace.py | rackspace.py | py | 3,678 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "salttesting.helpers.ensure_in_syspath",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "string.ascii_uppercase",
"line_number": 34,
"usage_type": "attribute"
},
{
"a... |
13734241619 | import re
from django import forms
from django.conf import settings
from django.contrib.auth.models import User
from django.utils.translation import ugettext as _
from base.models import Lexicon, EXCLUDED_LEXICA
class ProfileEditForm(forms.Form):
lexiconChoices = Lexicon.objects.exclude(lexiconName__in=EXCLUDED... | domino14/Webolith | djAerolith/accounts/forms.py | forms.py | py | 1,589 | python | en | code | 32 | github-code | 1 | [
{
"api_name": "django.forms.Form",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "base.models.Lexicon.objects.exclude",
"line_number": 12,
"usage_type": "call"
},
{
"api_name"... |
21678788184 | # https://leetcode.com/problems/merge-two-sorted-lists/
# Definition for singly-linked list.
from typing import Optional
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class Solution:
def mergeTwoLists(self, list1: Optional[ListNode], list2: Optional[Li... | webdastur/ProgrammingProblems | LeetCode/merge_two_sorted_lists.py | merge_two_sorted_lists.py | py | 946 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.Optional",
"line_number": 13,
"usage_type": "name"
}
] |
17670564445 | from django.utils import timezone
from rest_framework import filters
from rest_framework.response import Response
from rest_framework import status, viewsets, permissions
from url_filter.integrations.drf import DjangoFilterBackend
from .models import (
User, Card, Transaction,
)
from .serializers import (
User... | legacy72/its-animals-backend | bank/views.py | views.py | py | 3,079 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "rest_framework.viewsets.ModelViewSet",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.viewsets",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "rest_framework.permissions.AllowAny",
"line_number": 19,
"usage_type": ... |
11861469094 | # import the necessary packages
from Stitcher import Stitcher
from MotionDetector import MotionDetector
from imutils.video import VideoStream
from datetime import datetime
import numpy as np
import imutils
import time
import cv2
# initialize the video streams and allow them to warmup
print("[INFO] starting cameras...... | sohamroy19/TryangleCam | Python/TryangleCam.py | TryangleCam.py | py | 4,030 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "imutils.video.VideoStream",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "imutils.video.VideoStream",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "Stitch... |
3651344308 | import pycookiecheat
import requests
import re
from bs4 import BeautifulSoup as beaty
import smtplib
from email.message import EmailMessage
class CloudCancellation:
def __init__(self, cancelling, reason=None, success=None):
self.cancelling = cancelling
self.reason = reason
self.success = s... | galinvelikov/cloud_cancellation | cloud_cancellation.py | cloud_cancellation.py | py | 2,438 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "re.findall",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pycookiecheat.chrome_cookies",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSo... |
11810014858 | import logging
import logging.handlers
import os
import time
class CustomFormatter(logging.Formatter):
grey = "\x1b[38;20m"
white = "\x1b[37;20m"
yellow = "\x1b[33;20m"
red = "\x1b[31;20m"
bold_red = "\x1b[31;1m"
reset = "\x1b[0m"
format = "%(asctime)s - %(name)s - %(levelname)s - %(messag... | doppler-motion/code-pub | Python/python_modules/logging_demo/logging_demo.py | logging_demo.py | py | 3,121 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.Formatter",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "logging.DEBUG",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "logging.INFO",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "logging.WA... |
12837454897 | """pim URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vie... | hackcasa/zappa_final | web/urls.py | urls.py | py | 5,762 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "django.urls.re_path",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "django.urls.re_... |
36529140223 | import argparse
import pandas as pd
import numpy as np
from sklearn.neighbors import KNeighborsClassifier
from sklearn.datasets import load_digits
from sklearn.model_selection import train_test_split
def main():
print("*" * 20)
print("Started HW1_ID1_ID2_old.py")
# Parsing script arguments
parser = ar... | omervered0708/hw1MLq2 | test_sklearn.py | test_sklearn.py | py | 1,818 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sklearn.neighbors.KNeighborsClassifier",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 25,
"usage_type": "call"
},
{
"ap... |
5927958459 | import logging
import math
from typing import List, Optional
import torch
import torch.nn as nn
from ocpmodels.common.registry import registry
from ocpmodels.common.utils import conditional_grad
from ocpmodels.models.base import BaseModel
from ocpmodels.models.scn.smearing import GaussianSmearing
try:
pass
excep... | Open-Catalyst-Project/ocp | ocpmodels/models/equiformer_v2/equiformer_v2_oc20.py | equiformer_v2_oc20.py | py | 25,033 | python | en | code | 518 | github-code | 1 | [
{
"api_name": "ocpmodels.models.base.BaseModel",
"line_number": 52,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 129,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 130,
"usage_type": "name"
},
{
"api_name": "typing.Opti... |
12828451545 | # pygame python第三方游戏库 .pyd 动态模块(可以导入,但是看不到源码) .py 静态模块
import pygame # 官方推荐这样导入
from pygame.locals import *
import sys
# 定义常量记录数据 (常量特点: 字母全大写 一旦定义,不要修改记录的值)
WINDOW_H = 768
WINDOW_W = 512
def main(): # 一般将程序的入口定义为main函数
"""主函数"""
# 1. 创建窗口
window = pygame.display.set_mode((WINDOW_W, WINDOW_... | OreoCookiesYeah/base2 | hm_03_飞机移动.py | hm_03_飞机移动.py | py | 1,705 | python | zh | code | 0 | github-code | 1 | [
{
"api_name": "pygame.display.set_mode",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygame.... |
12733332965 | import pygame
import random
class Monster(pygame.sprite.Sprite):
def __init__(self, game):
super().__init__()
self.game= game
self.health = 100
self.max_health=100
self.attack = 0.1
self.velocity= random.randint(1,2)
self.image= pygame.image.load("assets/koo... | taha-khiari/zombie-game | monter.py | monter.py | py | 1,192 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygame.sprite",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "random.randint",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.image.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pygame.image",
... |
35335374713 | from typing import List
from .Entry import Entry
class EntryFilter:
def __init__(self):
pass
def _filter_by_words_count(
self,
filter_fn: callable,
entries: List[Entry],
) -> List[Entry] :
return filter(
lambda entry: filter_fn(len(entry.title.split())),
... | miguel-martinr/stackcrawler | stackcrawler/EntryFilter.py | EntryFilter.py | py | 1,486 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "Entry.Entry",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "Entry.Entry",
"line_number": ... |
5724769308 | """
Примеры:
1)Ввод: 5 15
Вывод: 1+2+3+4+5=15
2)Ввод: 4 46
Вывод: 12+34=46
Введите максимльное число N последовательности: 10
Введите число M, которое необходимо получить в качестве ответа: 46
"""
from typing import List
import numpy as np
import itertools
""" если посмотреть пристально на задачку, то можно заметит... | MasheraAnna/Test_tasks | test1_2try.py | test1_2try.py | py | 2,440 | python | ru | code | 0 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "itertools.product",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_n... |
6006514705 | import cv2
import os
import time
from TutorialMurtaza.Util import BaseFunction
import HandTrackingModule as htm
#############
wCam, hCam = 640, 480
#############
cap = cv2.VideoCapture(0)
cap.set(3, wCam)
cap.set(4, hCam)
folderPath = BaseFunction.getBaseUrl() + '/TutorialMurtaza/Resources/hand_counting'
myList = os... | palindungan/2021_skripsi | OpencvTutorial/TutorialMurtaza/Src/Mediapipe/FingerCountingProject.py | FingerCountingProject.py | py | 2,053 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "TutorialMurtaza.Util.BaseFunction.getBaseUrl",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "TutorialMurtaza.Util.BaseFunction",
"line_number": 15,
"usage_type": "name"... |
23613766958 | # -*- coding: utf-8 -*-
import math
import torch
import torch.nn.functional as F
from torch import nn
from ..utils.nn import get_activation_fn
class FF(nn.Module):
"""A smart feedforward layer with activation support.
Arguments:
in_features(int): Input dimensionality.
out_features(int): Out... | lium-lst/nmtpytorch | nmtpytorch/layers/ff.py | ff.py | py | 2,163 | python | en | code | 391 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.nn.Parameter",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line... |
19936644653 | from functools import wraps
from flask import Flask, request, jsonify, url_for, redirect
from wallet import Wallet
from error import Error
from jose import jwt
from urllib.request import urlopen
import sys
import os
import json
app = Flask(__name__)
env = os.environ
app.debug = env.get('ENVIRONMENT', 'development')... | SumanaMalkapuram/auth0 | api/server.py | server.py | py | 5,856 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "flask.request.headers.get",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "flask.request.h... |
29629691028 | import pandas as pd
import numpy as np
from sklearn.cluster import KMeans
from sklearn import preprocessing
class K_Means:
def __init__(self, k, input):
self.k = k
self.df = input
self.C = None
def centroids(self):
import random
C = {i:[data for data in self.df.values[i... | gospel306/Movie_recommend | data/kmeans.py | kmeans.py | py | 2,008 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "random.sample",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.norm",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"lin... |
31637485511 | # coding=utf-8
import os
import unittest
import shutil
import zipfile
from mock import patch
from testfixtures import TempDirectory
from provider import cleaner
import activity.activity_OutputAcceptedSubmission as activity_module
from activity.activity_OutputAcceptedSubmission import (
activity_OutputAcceptedSubmi... | elifesciences/elife-bot | tests/activity/test_activity_output_accepted_submission.py | test_activity_output_accepted_submission.py | py | 8,902 | python | en | code | 19 | github-code | 1 | [
{
"api_name": "tests.test_data.ingest_accepted_submission_data",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "tests.test_data",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "unittest.TestCase",
"line_number": 25,
"usage_type": "attribute"
}... |
34264370130 | # -*- coding: utf-8 -*-
from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.listview import ListView
class basitListeUyg(App):
def build(self):
duzen=BoxLayout()
programlama_dilleri=["Perl", "PHP", "Pure", "Python", "Rebol",
... | mustafa-altinisik/kivy-tr | docs/programlar/listeEylem/programlar/1/listeGorunumu.py | listeGorunumu.py | py | 593 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "kivy.app.App",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "kivy.uix.boxlayout.BoxLayout",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "kivy.uix.listview.ListView",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "k... |
15103892958 | import imp
from django.shortcuts import render
from mywatchlist.models import Watchlist
from django.http import HttpResponse
from django.core import serializers
# Create your views here.
def show_watchlist(request):
data_watchlist = Watchlist.objects.all()
counter_watched = 0
for show in data_watchlist :
... | eruzetaien/PBPtugas2 | mywatchlist/views.py | views.py | py | 1,071 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "mywatchlist.models.Watchlist.objects.all",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "mywatchlist.models.Watchlist.objects",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "mywatchlist.models.Watchlist",
"line_number": 9,
"usage_... |
36682252501 | import cv2
import mediapipe as mp
import time
wcam, hcam = 680, 480
cap = cv2.VideoCapture(0)
cap.set(3, wcam)
cap.set(4, hcam)
ptime = 0
mpDraw = mp.solutions.drawing_utils
mpFaceMesh = mp.solutions.face_mesh
faceMesh = mpFaceMesh.FaceMesh(max_num_faces=2)
drawspecs= mpDraw.DrawingSpec(thickness = 1, circle_radius =... | kanojia-gaurav/Advance_opencv | FaceMesh/facemesh.py | facemesh.py | py | 880 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "mediapipe.solutions",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "mediapipe.solutions",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "cv2... |
25869305063 | # -*- coding: utf-8 -*-
from dateutil import tz
import datetime
from django.contrib.auth.models import User, Group
from django.db import models
from django.db.models import Min
from django.utils.timezone import utc
from academy.models import Profile
class Attendance(models.Model):
profile = models.ForeignKey(Prof... | enoch2110/dodream | attendance/models.py | models.py | py | 4,670 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.db.models.Model",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.db.models.ForeignKey",
"line_number": 12,
"usage_type": "call"
},
{
"api_name... |
44094509671 | from utils.timestamp_converter import TimestampConverter
class MarketSituation:
def __init__(self, csv_row=None, kafka_row=None):
self.amount = None
self.merchant_id = None
self.offer_id = None
self.price = None
self.prime = None
self.product_id = None
self.... | marcelja/dynamicpricing | merchant/models/market_situation.py | market_situation.py | py | 1,799 | python | en | code | 10 | github-code | 1 | [
{
"api_name": "utils.timestamp_converter.TimestampConverter.from_string",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "utils.timestamp_converter.TimestampConverter",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "utils.timestamp_converter.TimestampConverte... |
73424587235 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import cv2
import numpy as np
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from function_collection import custom_deal, my_utility
import function_collection.ImageProcessing.scaling as scaling
import function_collection.Ima... | freedomDR/pyqt5_project | src/qt.py | qt.py | py | 8,875 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "cv2.imread",
"line_number": 117,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_COLOR",
"line_number": 117,
"usage_type": "attribute"
},
{
"api_name": "function_collection.custom_deal.reversal",
"line_number": 119,
"usage_type": "call"
},
{
"api_... |
34989838921 | import matplotlib
import matplotlib.pyplot as plt
import xlrd
file = u'./data.xlsx'
xlrd.open_workbook(file)
data = xlrd.open_workbook(file)
table = data.sheet_by_name(u'data') # 获得表格
x = table.col_values(0)
x.pop(0)
y1=table.col_values(1)
y1.pop(0)
y2=table.col_values(2)
y2.pop(0)
y3=table.col_values(3)
y3.pop(0)
y4... | kismet-laoqiu/undergrad-rep | 2019KDD-邱柯铭-201693043-中国地铁数据分析-ver02 最新补充版/subway_analysis-master/plot.py | plot.py | py | 1,269 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "xlrd.open_workbook",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "xlrd.open_workbook",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "m... |
17979032121 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
from pyramid.config import Configurator
from TechLurker.models import RedditData, PyjobData, SecurityNewsData, TechRepublicData... | han8909227/TechLurker | TechLurker/scripts/my_scraper/my_scraper/pipelines.py | pipelines.py | py | 2,800 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.environ",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pyramid.config.Configurator",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "TechLurker.models.RedditData",
"line_number": 32,
"usage_type": "call"
},
{
"api_name... |
33951359126 | import tkinter as tk
from tkinter import ttk
from PIL import ImageTk, Image
from tkinter import messagebox
from datetime import datetime
import csv
from pizza import *
from sauce import *
italian_pizza = {"Pizza Napoletana": PizzaNapoletana, "Pizza Capricciosa": PizzaCapricciosa,
"Pizza Qu... | MelihGulum/Tkinter-Projects | Pizza Order System/main.py | main.py | py | 18,745 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "tkinter.Tk",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "tkinter.Tk.__init__",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "tkinter.Tk",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "tkinter.Frame",
... |
41334774112 | import torch
import math
import numpy as np
# def dct1d(x, half_shift=None):
# N = x.shape[-1]
# if half_shift == None:
# half_shift = torch.stack([torch.tensor(-1j * math.pi * k / (2 * N)).exp() for k in range(N + 1)]).to(x.device)[None]
# x_ext = torch.cat([x, x.flip(-1)], -1)
# z = torch.ff... | DiffEqML/kairos | src/utils/numerics.py | numerics.py | py | 3,660 | python | en | code | 15 | github-code | 1 | [
{
"api_name": "torch.cat",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "torch.view_as_real",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "torch.fft.fft",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "torch.fft",
"line_numb... |
28335860302 | import abc
import uuid
from typing import TYPE_CHECKING, Any, Generic, Tuple, Type, TypeVar, Union
import pydantic
from typing_extensions import Self
import prefect
from prefect.blocks.core import Block
from prefect.client.utilities import inject_client
from prefect.exceptions import MissingContextError
from prefect.... | PatrickVieira1/dataengineering-zoomcamp | week_2_workflow_orchestration/venv/lib/python3.9/site-packages/prefect/results.py | results.py | py | 15,848 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "prefect.filesystems.WritableFileSystem",
"line_number": 29,
"usage_type": "name"
},
{
"api_name... |
40420432354 | from pathlib import Path
from numpy.lib.twodim_base import diag
from numpy.ma.core import count
import parse
import numpy as np
data_folder = Path(".").resolve()
def parse_data(data):
lines = []
line_parse = parse.compile("{},{} -> {},{}")
for line in data.split("\n"):
lines.append([int(d) for d ... | eirikhoe/advent-of-code | 2021/05/sol.py | sol.py | py | 1,887 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "parse.compile",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number"... |
74540231072 | import os
import glob
import re
import shutil
import sqlalchemy
import traceback
import importlib
from rapidfuzz import fuzz
from traitlets.config import LoggingConfigurable, Config
from traitlets import Bool, List, Dict, Integer, Instance, Type, Any
from traitlets import default, validate
from textwrap import dedent
... | jupyter/nbgrader | nbgrader/converters/base.py | base.py | py | 20,870 | python | en | code | 1,232 | github-code | 1 | [
{
"api_name": "traitlets.config.LoggingConfigurable",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "traitlets.List",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "traitlets.Dict",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "tr... |
27960984590 | from polygon import arc
import turtle
bob = turtle.Turtle()
turtle.speed(speed=100)
turtle.delay(0)
petals = 16
angle = 30
radius = 10000/ angle
def draw_petal(t, radius, angle):
for i in range(2):
arc(t, radius, angle)
t.lt(180-angle)
for i in range(petals):
draw_petal(bob, radi... | MJC-code/thinkpython | Chapter04/Ex4_2.py | Ex4_2.py | py | 382 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "turtle.Turtle",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "turtle.speed",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "turtle.delay",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "polygon.arc",
"line_number":... |
72878881634 | from tornado.web import RequestHandler
from tornado.escape import json_decode
import json
class BaseHandler(RequestHandler):
def prepare(self):
if self.request.body:
try:
self.data = json_decode(self.request.body)
except TypeError or json.JSONDecodeError as e:
... | zshuangyan/search_bookmark | base_handler.py | base_handler.py | py | 761 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tornado.web.RequestHandler",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "tornado.escape.json_decode",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.JSONDecodeError",
"line_number": 10,
"usage_type": "attribute"
}
] |
32474589299 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('booking', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='meetuprequest',
name=... | jkol36/glidewithus | glidewithus/booking/migrations/0002_auto_20141106_0150.py | 0002_auto_20141106_0150.py | py | 398 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterField",
"line_number": 14,
"usage_type": "call"
},
{... |
6360755344 | from scoringengine.scoringengine import ScoringEngine, ServiceReport
import requests
import requests.exceptions
import os
SERVICE_NAME = 'http'
ScoringEngine.register_service(SERVICE_NAME)
with open(os.path.join(os.path.dirname(__file__), ('http.sample'))) as f:
sample_response = f.read()
@ScoringEngine.schedul... | bburky/scoringengine | services/http.py | http.py | py | 1,124 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "scoringengine.scoringengine.ScoringEngine.register_service",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "scoringengine.scoringengine.ScoringEngine",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 9,
"usag... |
28049663211 | """
This script summarized DE results using mash model.
"""
import pandas as pd
import session_info
from pyhere import here
from gtfparse import read_gtf
from functools import lru_cache
@lru_cache()
def get_annotation(feature):
config = {
"genes": here("input/text_files_counts/_m/caudate/gene_annotation.ts... | LieberInstitute/aanri_phase1 | differential_analysis/permutation_environmental/tissue_comparison/summary_table/_h/summarize_results.py | summarize_results.py | py | 6,514 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pyhere.here",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pyhere.here",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pyhere.here",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pyhere.here",
"line_number": ... |
35075300303 | from aiogram import Bot, Dispatcher, executor, types
bot = Bot('')
dp = Dispatcher(bot)
@dp.message_handler(commands=['start'])
async def start(message: types.Message):
# await bot.send_message(message.chat.id, 'Hello')
await message.answer('Hello, how are you?')
@dp.message_handler(content_types=['photo'... | AntoshkaNaumov/bot_project | aiogram_bot.py | aiogram_bot.py | py | 1,631 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "aiogram.Bot",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "aiogram.Dispatcher",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "aiogram.types.Message",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "aiogram.types"... |
10501114655 | from packets.Messages import Message
from utils.reader import Reader
from utils.writer import Writer
import json
class LeaderboardMessage(Message):
def __init__(self, dataPlayers):
super().__init__()
self.id = 24403
self.dataPlayers = dataPlayers
def decode(self, buffer):
Reader.__init__(self, b... | rostokdev/retrobrawl-py-old | cheese/packets/Messages/Server/LeaderboardMessage.py | LeaderboardMessage.py | py | 628 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "packets.Messages.Message",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "utils.reader.Reader.__init__",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "utils.reader.Reader",
"line_number": 13,
"usage_type": "name"
}
] |
22942055132 | import logging
from typing import Callable, Union
import numpy as np
import torch
from monai.apps.deepgrow.transforms import AddRandomGuidanced, FindDiscrepancyRegionsd
from monai.handlers import MeanDice, from_engine
from monai.handlers.ignite_metric import IgniteMetric
from monai.inferers import SimpleInferer
from m... | Project-MONAI/MONAILabel | sample-apps/endoscopy/lib/trainers/deepedit.py | deepedit.py | py | 5,716 | python | en | code | 472 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "monailabel.tasks.train.basic_train.BasicTrainTask",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "monailabel.tasks.train.basic_train.Context",
"line_number": 58,
"usag... |
33893292705 | from rest_framework import serializers
from rest_framework.reverse import reverse
from api.serializers import UserPublicSerializer
from .models import Product
from .validators import validate_title
class ProductInlineSerializer(serializers.Serializer):
url = serializers.HyperlinkedIdentityField(
view_name="pr... | AlizeeBoc/DRF-API | backend/products/serializers.py | serializers.py | py | 1,723 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "rest_framework.serializers.Serializer",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.HyperlinkedIdentityField",
"line_number": 9,
... |
21728937931 | import requests
import json
import datetime
def format_date(date_str):
# 将日期字符串解析为datetime对象
date = datetime.datetime.fromisoformat(date_str)
# 将datetime对象转换为年月日格式字符串
return date.strftime("%Y.%m.%d")
devices = {
"device1": "iPhone",
"device2": "iPad",
"device3": "Mac"
}
for device_key,... | y0123456789/ipsw | ipsw1.py | ipsw1.py | py | 3,288 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "datetime.datetime.fromisoformat",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "req... |
5587030547 | #!/usr/bin/env python3
import argparse
import collections
import pdb
def dump_map(map, field):
print(f"(field: {field})")
for row in map:
print(row)
print("\n%%%%%%\n")
def count_lit(map):
c = collections.Counter()
for row in map:
c += collections.Counter(row)
return c["#"]
... | vmizener/adventofcode | 2021/20/main.py | main.py | py | 2,107 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.Counter",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "pdb.s... |
42646033615 | import pandas as pd
import numpy as np
import ajf_plts
import code
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from BeamModel import Beam
from Simulation import perform_static_sim
from scipy.stats import wasserstein_distance
from numba import njit
from numba impo... | alanjferguson/thesis-figure-code | chapter_3/tab02_gen_data.py | tab02_gen_data.py | py | 3,551 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_feather",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "numpy.random.choice",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "numpy.random",
... |
41571308589 | import pygame
from decoration import Sky
class GameOver:
def __init__(self, surface, coin_data, reset_overworld):
self.display_surface = surface
self.coin_data = coin_data
self.reset_overworld = reset_overworld
self.sky = Sky(8, 'overworld')
self.font = pygame.font.Font('g... | Stellar2004/Stellar2004---audio_testing | code/game_over.py | game_over.py | py | 1,143 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "decoration.Sky",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.font.Font",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.font",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pygame.font.Font",
... |
40585445114 | import sys
sys.path.insert(0, "../..")
import ply.lex as lex
# Reserved words
reserved = (
'RENDERER', 'INTEGRATOR', 'TRANSFORM', 'SAMPLER', 'FILTER', 'FILM', 'CAMERA',
'WORLDBEGIN', 'WORLDEND', 'ATTRIBUTEBEGIN', 'ATTRIBUTEEND', 'TRANSFORMBEGIN', 'TRANSFORMEND',
'MAKENAMEDMATERIAL', 'NAMEDMATERIAL', 'MATE... | lahagemann/pbr_scene_converter | src/core/LuxLex.py | LuxLex.py | py | 2,530 | python | en | code | 18 | github-code | 1 | [
{
"api_name": "sys.path.insert",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "ply.lex.lex",
"line_number": 91,
"usage_type": "call"
},
{
"api_name": "ply.lex",
"line_number": ... |
75271721632 | __author__ = 'eric'
import cherrypy
import threading
import re
import os
from ws4py.server.cherrypyserver import WebSocketPlugin, WebSocketTool
from ws4py.websocket import *
cherrypy.config.update({'log.screen': False})
cherrypy.config.update({'server.socket_host': '0.0.0.0'})
class CommandWebSocket(WebSocket):
... | eburlingame/lightingserver | main/server.py | server.py | py | 2,376 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "cherrypy.config.update",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cherrypy.config",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "cherrypy.config.update",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cher... |
4848604123 | #!/usr/bin/env python3
"""
Launches a registered algorithm on the given set of media
"""
import argparse
import logging
import time
import tator
logging.basicConfig(
filename='launch_algorithm.log',
filemode='w',
format='%(asctime)s %(levelname)s:%(message)s',
datefmt='%m/%d/%Y %I:%M:%S %p',
leve... | cvisionai/tator-py | examples/launch_algorithm.py | launch_algorithm.py | py | 2,972 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "argparse.Argu... |
19163726958 | import pygame
import random
pasta = "..\\assets\\"
class parede():
distancia = 200
speed =4
canos = [pygame.sprite.Sprite(),pygame.sprite.Sprite()]
points = 0
reinitX = 3000
def __init__(self):
self.canos[1-1].image = pygame.image.load(pasta+"canos_a.png")
self.canos[1... | Pseudo-nimo/Jorge | código/parede.py | parede.py | py | 2,276 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygame.sprite.Sprite",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pygame.image"... |
30522792727 | """
Title: Find closest number
Problem:
Given an array of sorted integers. We need to find the closest value to
the given number. Array may contain duplicate values and negative numbers.
Execution: python find_closest_number.py
"""
import unittest
from typing import List, Optional
def find_closest_num(arr: ... | samgh/6-Weeks-to-Interview-Ready | quickstart_guides/sorting_searching/python/find_closest_number.py | find_closest_number.py | py | 1,927 | python | en | code | 104 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "unittest.TestCase",
"line_number": 60,
"usage_type": "attribute"
},
{
"api_name": "unittest.main",
... |
22716966869 | # importing modules from flask library
from flask import Flask , render_template
# creating instance of class Flask, by providing __name__ keyword as argument
app = Flask(__name__)
# write the routes using decorator functions
# default route or 'URL'
@app.route("/me")
def home():
name = "TANIA SHAIKH"... | 92009/family-info-web-pge | family tree/app.py | app.py | py | 1,232 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "flask.render_t... |
13043600258 | """Sensor Graph main object."""
from collections import deque
import logging
import struct
from pkg_resources import iter_entry_points
from toposort import toposort_flatten
from iotile.core.exceptions import ArgumentError
from iotile.core.hw.reports import IOTileReading
from iotile.core.utilities.hash_algorithms impor... | iotile/coretools | iotilesensorgraph/iotile/sg/graph.py | graph.py | py | 31,087 | python | en | code | 14 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "iotile.core.exceptions.ArgumentError",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "exceptions.ResourceUsageError",
"line_number": 87,
"usage_type": "call"
},
{
... |
5573233633 | import os
import sys
import logging
from flask import Flask
# pylint: disable=no-member
# Get configuration from environment
DATABASE_URI = os.getenv('DATABASE_URI', 'postgres://soqerjpq:YZCacYhoNGHPtbX0zixiq7Lu81MrRJ1U@salt.db.elephantsql.com:5432/soqerjpq')
SECRET_KEY = os.getenv('SECRET_KEY', ' f869ba13-9684-40ce-... | nyudevops-recommendation/recommendations | service/__init__.py | __init__.py | py | 928 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.getenv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "service.service.initialize_logging",
... |
35390527776 | from fastapi import FastAPI, Request
from src.api.architectures import RecommenderNet
from src.api.preprocessing import load_data, get_place_encodings
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
import os
import joblib
import numpy as np
import pandas as pd
app = FastAPI()... | Tamirgading/Pacmann-Recommendation-System | src/api/collaborative.py | collaborative.py | py | 4,243 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "src.api.architectures.RecommenderNet",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "tensorflow.constant",
"line_number": 25,
"usage_type": "call"
},
{
"api_name... |
32013676632 | from __future__ import print_function, division
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from torch.utils.data import Dataset, DataLoader
import numpy as np
import torchvision
from torchvision import transforms, datasets, models
import os
import cv2
from model.r... | liudaizong/Residual-Attention-Network | train.py | train.py | py | 3,426 | python | en | code | 37 | github-code | 1 | [
{
"api_name": "torchvision.transforms.Compose",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.Scale",
"line_number": 16,
"usage_type": "call"
},
{
... |
33350375465 | import torch
import torch.nn as nn
def weights_init(m):
classname = m.__class__.__name__
if classname.find('Linear') != -1:
m.weight.data.normal_(0.0, 0.02)
m.bias.data.fill_(0)
elif classname.find('BatchNorm') != -1:
m.weight.data.normal_(1.0, 0.02)
m.bias.data.fill_(0)
... | htt210/GAN-GenAndMetric | Generators.py | Generators.py | py | 2,673 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"lin... |
32552634273 | # requests 모듈
import requests
from bs4 import BeautifulSoup
'''
url = "http://www.python.org"
response = requests.get(url)
print(response)
print(response.status_code)
html = response.text
#print(html)
url2 = "http://www.python.org/3"
response = requests.get(url2)
print(response)
print(response.status_code)
urls = ["h... | kiyongee2/green_pyworks | pylearning/웹 스크래핑.py | 웹 스크래핑.py | py | 5,186 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 89,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 175,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
... |
33685054332 | from typing import List
from time import sleep
from models.cliente import Cliente
from models.conta import Conta
from utils.helper import verifica_tipo, validar_cpf, validar_nome, validar_email
contas: List[Conta] = []
def main() -> None:
menu()
def menu() -> None:
print('================================... | Wellington8962/Projetos_Python | BancoPy/banco.py | banco.py | py | 6,754 | python | pt | code | 0 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "models.conta.Conta",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "utils.helper.verifica_tipo",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "time.sleep",
... |
30880145691 | import numpy as np
import cv2
import requests
cap = cv2.VideoCapture(0)
ret, frame = cap.read()
cv2.imwrite('pic.png',frame)
url = "http://localhost:8000/meter/piupload/"
fin = open('pic.png', 'rb')
files = {'file': fin}
try:
r = requests.post(url, files=files)
print(r.text)
finally:
fin.close() | SothanaV/smartmeter | pi/capup.py | capup.py | py | 305 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.imwrite",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 13,
"usage_type": "call"
}
] |
31805780073 | import pickle
import time
from dnslib import A, NS, QTYPE, RR
qtype_to_int = {1: (QTYPE.A, A),
2: (QTYPE.NS, NS)}
class Cache:
TIME_CACHE_CLEANED = time.time()
def __init__(self):
self.cache = {}
for record_type in qtype_to_int.keys():
self.cache[record_type] = {}... | Eepakura/task_2-dns_server | cache.py | cache.py | py | 3,777 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "dnslib.QTYPE.A",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "dnslib.QTYPE",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "dnslib.A",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "dnslib.QTYPE.NS",
"line_nu... |
27188793196 | from Quote import Quote
from csv import reader
from pyfiglet import Figlet
from termcolor import colored
from random import randint
end = 1
book_of_quote = []
with open("qoute.csv" , newline='') as plik:
csvv = reader(plik)
csvv.__next__()
for q in csvv:
book_of_quote.append(Quote(q[0],q[1],q[2]))... | Swiatomil/scrap-qoute-game | game.py | game.py | py | 1,490 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "csv.reader",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "Quote.Quote",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pyfiglet.Figlet",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "termcolor.colored",
"line_... |
15219909785 | import os
from pathlib import Path
import coloredlogs, logging
class FileObserver:
"""Searches in the time interval of search_interval for files in the Input folder and saves the filename, filetype
and tablename in a list of list in the object atribute input_files.
For instance: [{filename: 'file1... | kteppris/dwh | scripts/file_observer.py | file_observer.py | py | 3,847 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "coloredlogs.install",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
... |
14905298243 | import pygame
from pygame.sprite import Sprite
class Bullet(Sprite):
"""A class to manage bullets fired from the ship.
Attributes
----------
rect: pygame.Rect
Rectangular coordinates of the bullet
Methods
-------
update()
Move the bullet up the screen
draw_bullet()
... | DeepWalter/python-projects | alien_invasion/bullet.py | bullet.py | py | 1,622 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygame.sprite.Sprite",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "pygame.Rect",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pygame.draw.rect",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "pygame.draw",
"l... |
15973370719 | from dataclasses import dataclass
import glob
import json
from multiprocessing import Pool, cpu_count
import os
from config_manager.config import Config
import commits
import variability
class MetricsConfig(Config):
repos_folder: str
output_json: str
@dataclass
class RepoMetrics:
variability: variabil... | evjeny/code_main_sequence_analysis | calculate_metrics.py | calculate_metrics.py | py | 2,663 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "config_manager.config.Config",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "variability.Dependencies",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 18,
"usage_type": "name"
},
{
"... |
72995391073 | import pandas as pd
import numpy as np
import sys
sys.path.append(
'/groups/umcg-lifelines/tmp01/projects/ov20_0554/umcg-aewijk/covid19-qol-modelling/src/python')
from config import get_config
import matplotlib.pyplot as plt
plt.switch_backend('agg')
import warnings
warnings.filterwarnings('ignore')
def add_we... | molgenis/covid19-qol-modelling | src/python/make_dataframe_for_correlation.py | make_dataframe_for_correlation.py | py | 7,731 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.switch_backend",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotl... |
25452018907 | import pygame, sys
from grid import Grid
from ai import AI
#Get the number of rows and cols from the user.
rows = cols = int(input('Enter the number of rows and cols: '))
screen = pygame.display.set_mode((600,600))
pygame.display.set_caption('Maze Solver')
#Calculating res of each cell
res = screen.get_height()//row... | pratripat/Maze-solving-AI | visualizer.py | visualizer.py | py | 1,057 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pygame.display.set_mode",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_caption",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "p... |
40003845498 | from ortools.linear_solver import pywraplp
from collections import namedtuple
Item = namedtuple("Item", ['index', 'value', 'weight'])
DEBUG = 0
def solve_it(input_data):
# parse the input
lines = input_data.split('\n')
firstLine = lines[0].split()
item_count = int(firstLine[0])
capaci... | thiagoaraujocampos/Knapsack-Problem | solver.py | solver.py | py | 3,161 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.namedtuple",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "ortools.linear_solver.pywraplp.Solver",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "ortools.linear_solver.pywraplp",
"line_number": 54,
"usage_type": "name"
},... |
28567878265 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Task controller.
The controller stores:
- lists of tasks (ProcessorController.model),
- their associated processors and cache (ProcessorController.data).
It can add/delete/update tasks, emitting the corresponding events
"""
from typing import Union, Type, Di... | depixusgenome/trackanalysis | src/taskmodel/processors.py | processors.py | py | 4,081 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line... |
7499822304 | import numpy as np
import sympy
from sympy.abc import alpha
from funx import fun,gfun
from armijo import armijo
def line_search(xk,dk): # 精确线搜索
alphak = None
eq = np.dot(gfun(xk+alpha*dk).T,dk)[0]
alpha0 = sympy.solve(eq,[alpha])
if len(alpha0) > 1:
for a in alpha0:
a = a[0]
... | LMC20020909/HUST-SSE-Curriculum-Design | 数学建模与最优化/最优化方法-源代码/梯度下降法.py | 梯度下降法.py | py | 1,730 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.dot",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "funx.gfun",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sympy.abc.alpha",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "sympy.solve",
"line_number": 10,... |
38425972289 | #!/usr/bin/env python3
# coding: utf-8
# add to crontab
import json, time
import time, datetime
import yaml
import argparse
import os
from influxdb import InfluxDBClient
MEASUREMENT_OUT = 'holtwinters'
MEASUREMENTS= [
{
'measurement_in': 'elasticsearch_jvm',
'value_in': 'mem_heap_used_percent',
... | markuskont/influx-holtwinters | main.py | main.py | py | 4,227 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "yaml.load",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.fromtim... |
15074079513 | # -*- coding: utf-8 -*-
"""
Created on Tue Aug 1 09:00:01 2023
@author: Cathe
"""
import matplotlib.pyplot as plt
import os
import numpy as np
import scipy.io
import re
from matplotlib import rc
from scipy.stats import pearsonr
def is_float(string):
try:
float(string)
return Tr... | qiyaozhu/CyclicPeptide | Clustercenters_15res/Pnear_Modified/Pnear_15res.py | Pnear_15res.py | py | 4,511 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "re.finditer",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "re.finditer",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 104,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 1... |
36926953733 | # coding: utf-8
import json
import re
def sort_dict(dict):
sort_dict = []
#print(len(dict))
all_vote=0
for i in range(len(dict)):
flag=0
max=0
for key,value in dict.items() :
if flag == 0:
max=int(value)
temp=... | herolf/Crawler_herolf | voters_read_sort_611.py | voters_read_sort_611.py | py | 1,666 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "re.sub",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 35,
"usage_type": "call"
}
] |
8692692038 | import datetime
import itertools
from .models import Period
# https://www.womenshealth.gov/a-z-topics/menstruation-and-menstrual-cycle
AVERAGE_MENSTRUAL_CYCLE = datetime.timedelta(days=28)
def avg(lst):
length = 0
total = 0
for item in lst:
total += item
length += 1
return total / le... | rockymeza/ymrj | periods/utils.py | utils.py | py | 1,161 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.timedelta",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "itertools.tee",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "models.Period.objects.filter",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "models.P... |
71509366755 | import sys
import os
import glob
import csv
import logging
from collections import OrderedDict
from util import *
def trade_dates(file):
"""Analyzes a trades csv file and returns a list of the corresponding dates
that are covered in the file.
"""
dates = []
# Open the trades file and get each dat... | gnu-user/finance-research | scripts/align_quotes.py | align_quotes.py | py | 11,709 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "csv.DictReader",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.