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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
21025162572 | #!/usr/bin/env python3
"""
Implementation of R3PTAR
"""
import logging
import signal
import sys
from ev3dev2.motor import OUTPUT_A, OUTPUT_B, OUTPUT_C, OUTPUT_D, MediumMotor, LargeMotor
from ev3dev2.sensor.lego import InfraredSensor
from ev3dev2.sound import Sound
from threading import Thread, Event
from time import ... | ev3dev/ev3dev-lang-python-demo | robots/R3PTAR/r3ptar.py | r3ptar.py | py | 4,270 | python | en | code | 59 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "threading.Thread.__init__",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "threadin... |
5995812394 | #!/usr/bin/env python
import numpy as np
import healpy as hp
import pylab
import matplotlib.pyplot as plt
import time
import mocklc
import matplotlib
import sepmat
import gpkernel
import scipy
import emcee
import sys
import time
Ns=2000
np.random.seed(17)
#set geometry
inc=45.0/180.0*np.pi
Thetaeq=np.pi
zeta=60... | HajimeKawahara/sot | src/sot/dymap/static_sampling.py | static_sampling.py | py | 2,866 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "numpy.random.seed",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "numpy.pi",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "numpy.pi",
"lin... |
21397302549 | #!/usr/bin/env python3
import argparse
import os
import re
import dataclasses
from dataclasses import dataclass
from pathlib import Path
from typing import Optional, List
"""
Supports following cases:
1. Master version x.y.z needs to be bumped to x.y.z when preparing for official release:
git checkout clus... | TheRacetrack/racetrack | utils/version_bumper.py | version_bumper.py | py | 4,748 | python | en | code | 27 | github-code | 6 | [
{
"api_name": "dataclasses.replace",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 68,
"usage_type": "name"
},
{
"api_name": "re.compile",
... |
17246495292 | #!/usr/bin/env python2
import argparse
import ast
import json
import logging
import os
from collections import namedtuple
import tqdm
import sys
sys.path.append('.')
print(sys.path)
from srcseq.astunparser import Unparser, WriterBase
def file_tqdm(fobj):
return tqdm(fobj, total=get_number_of_lines(fobj))
SrcA... | ReversalS/coop-code-learning | views/PythonExtractor/source/srcseq/generate_data.py | generate_data.py | py | 2,978 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "collections.namedtuple",
... |
6315981642 | from flask import Blueprint, render_template, flash, request, redirect, url_for, jsonify, abort
from app.extensions import cache, pages
from app.tasks import long_task
import flam3, io, base64, struct
from PIL import Image
main = Blueprint('main', __name__)
@main.route('/')
@cache.cached(timeout=1000)
def home():
... | akotlerman/flask-website | app/controllers/main.py | main.py | py | 3,537 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Blueprint",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "app.extensions.cache.cached",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "app.... |
72536213308 | # 爬取buff平台的商品信息
import asyncio
import aiohttp
from lxml.html import etree
import re
import json
import traceback
import os
from util import fetch_url, get_current_time_str
from models import PriceInfo
import urllib
async def get_goods_info(url, session) -> PriceInfo:
# 获取商品信息
print(url)
# 最多重试3次
for i... | ZangYUzhang/aeyl-steam | buff_spider/__init__.py | __init__.py | py | 4,898 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "util.fetch_url",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "traceback.print_exc",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "models.PriceInfo",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "os.path.join",
... |
22293771882 | #!/usr/bin/python3
"""This module contains decorator functions for the views. These includes:
- token_required
"""
import jwt
from functools import wraps
from flask import request, make_response
from os import environ
from flask import jsonify
SECRET_KEY = environ.get('SECRET_KEY')
def token_required(f):
"""Chec... | Sonlowami/CaseShare | src/api/v1/views/decorators.py | decorators.py | py | 1,141 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "flask.request.headers.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask.request.hea... |
33207147676 | from fastapi import HTTPException, status
from db.models import DbLeague
from routers.schemas import LeagueBase
from routers.slug import name_to_slug
from sqlalchemy.orm import Session
def add_team(db: Session, request: LeagueBase):
league = DbLeague(
name=request.name,
country=request.country,
... | rbujny/League-Team-Players | db/db_league.py | db_league.py | py | 816 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "routers.schemas.LeagueBase",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "db.models.DbLeague",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "rou... |
8891107927 | import cv2
import numpy as np
classify_body = cv2.CascadeClassifier('haarcascade_fullbody.xml')
vid_capture = cv2.VideoCapture('people_walking.mp4')
while vid_capture.isOpened():
ret,frame = vid_capture.read()
frame = cv2.resize(frame, None,fx=0.5,fy=0.5, interpolation = cv2.INTER_LINEAR)
... | RudraCS18/Object-Detection-using-openCV-python | pedestrian detection.py | pedestrian detection.py | py | 707 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.INTER_LINEAR",
... |
4956366915 | from django.db import models
from django.contrib.auth.models import User
from django.core.validators import MaxValueValidator, MinValueValidator
# Create your models here.
class Pricebaba(models.Model):
first_name = models.CharField(max_length=100, null=False);
last_name = models.CharField(max_length=100, null=False... | nidhisha-shetty/Human-Resource-CRM-System | pricebabaapp/models.py | models.py | py | 768 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "django.db.models.Model",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "... |
44083675715 | from typing import Iterable
from scapy.all import *
from scapy.layers.inet import IP
def ip_from_packets(packets: Iterable) -> str:
"""
Get the IP of the machine where the packets are recorded
It is the IP which is present in all packets
:param packets:list of packets
:return: ip address
"""
IPs = {}
for pac... | llmhyy/malware-traffic | Experiments/exp16_visualisation/ip_from_pcap.py | ip_from_pcap.py | py | 925 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "typing.Iterable",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "scapy.layers.inet.IP",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "scapy.layers.inet.IP",
"line_number": 17,
"usage_type": "name"
}
] |
27388540421 | from discord.ext import commands
import biscuitfunctions as bf
async def fixprivs(context):
return bf.getprivs(context) in ['quaid', 'quaidling', 'tesseract']
class admin(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(
name='getid',
pass_context = T... | delta1713/ButteryBiscuitBot | admin.py | admin.py | py | 2,262 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "biscuitfunctions.getprivs",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands.Cog",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 5,
"usage_type": "name"
},
{
"api_nam... |
79843457 | import numpy as np
from scipy.linalg import lstsq
from optimal_control.basis import Basis
from optimal_control.examples.discrete import StoppingExample
from optimal_control.solvers.discrete import DiscreteValueFunction
class ModifiedForStopping(DiscreteValueFunction):
def __init__(self, example: StoppingExample... | hagerpa/reinforced_optimal_control | optimal_control/solvers/discrete/value_function/modified_for_stopping.py | modified_for_stopping.py | py | 4,639 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "optimal_control.solvers.discrete.DiscreteValueFunction",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "optimal_control.examples.discrete.StoppingExample",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "optimal_control.basis.Basis",
"line_n... |
30195630744 | import unittest
from ops.testing import Harness
from charm import CandidCharm
class TestCharm(unittest.TestCase):
def setUp(self):
self.harness = Harness(CandidCharm)
self.addCleanup(self.harness.cleanup)
self.harness.begin()
def test_website_relation_joined(self):
id = self... | canonical/candid | charms/candid/tests/unit/test_charm.py | test_charm.py | py | 577 | python | en | code | 41 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "ops.testing.Harness",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "charm.CandidCharm",
"line_number": 10,
"usage_type": "argument"
}
] |
15565374410 | from pathlib import Path
WHERE_CLAUSE = "where"
# DATABASE Connection constants
DB_USERNAME = "project1user"
DB_PASSWORD = "project1pass"
DEFAULT_DB = "project1db"
VERBOSITY_DEFAULT = 2
MACHINE = "lab-machine"
# Benchmark constants
EPINIONS = "epinions"
INDEXJUNGLE = "indexjungle"
TIMESERIES = "timeseries"
BENCH... | karthik-ramanathan-3006/15-799-Special-Topics-in-Database-Systems | constants.py | constants.py | py | 800 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 27,
"usage_type": "call"
}
] |
73348441787 | from datetime import datetime
import math
from abc import abstractmethod
from typing import List, Tuple
from anteater.core.anomaly import Anomaly, RootCause
from anteater.core.kpi import KPI, Feature, JobConfig
from anteater.core.ts import TimeSeries
from anteater.model.algorithms.spectral_residual import SpectralResi... | openeuler-mirror/gala-anteater | anteater/model/detector/base.py | base.py | py | 5,619 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "anteater.source.metric_loader.MetricLoader",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "anteater.core.kpi.KPI",
"line_number": 26,
"usage_type": "name"
},
{
"api_... |
34197097202 | import numpy as np
import threading
import time
from datetime import datetime
import jderobot
import math
import cv2
from math import pi as pi
time_cycle = 80
class MyAlgorithm(threading.Thread):
def __init__(self, pose3d, laser1, laser2, laser3, motors):
self.pose3d = pose3d
self.laser1 = laser... | RoboticsLabURJC/2016-tfg-irene-lope | AutoPark_Practice/MyAlgorithm.py | MyAlgorithm.py | py | 6,482 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "threading.Thread",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "threading.Event",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "threading.Event",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "threading.Lock"... |
41474623270 | from __future__ import division # Why is this not standard.
import datetime
import re
class Tribunal(object):
"""System for keeping players in check"""
def __init__(self, config, callback_message_func):
super(Tribunal, self).__init__()
# We need someway of keeping track if someone is being ... | psykzz/ircmod_gradiusbot | mod_tribunal.py | mod_tribunal.py | py | 5,908 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "re.compile",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 119,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 119,
"usage_type": "attribute"
}
] |
18722283162 | import numpy as np
import matplotlib.pyplot as plt
X = np.array([[2.5, 3.0, 3.0, 3.5, 5.5, 6.0, 6.0, 6.5],
[3.5, 3.0, 4.0, 3.5, 5.5, 6.0, 5.0, 5.5]])
num_rows, N = X.shape
c = 2
# c = 3
# c = 4
V = np.zeros((num_rows, c))
U = np.zeros((c, N))
row_iteration = 0
for i in range(N):
U[row_iteration, i] ... | vvsct/c-means | hcm.py | hcm.py | py | 1,215 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.random.permutation",
"li... |
23361556734 | import datetime
from polls.models import LogModel
class LogMiddleware:
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
response = self.get_response(request)
if request.path.find('admin') != -1:
return response
path =... | konstantinkonstantinovich/home_task_6 | polls/middleware.py | middleware.py | py | 549 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "polls.models.LogModel.objects.create",
"line_number": 18,
"usage_type": "call"
},
{
... |
13284456276 | from django.conf.urls import patterns, include, url
from django.conf import settings
from django.views.generic import TemplateView
from frontend import views
from frontend import facebook
urlpatterns = patterns('',
url(r'^$', views.index, name='index'),
url(r'^settings/', views.settings, name='settings'),
... | jjchen/cos333 | frontend/urls.py | urls.py | py | 2,723 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "frontend.views.index",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": ... |
31954675537 | """
The color scheme.
"""
from __future__ import unicode_literals
from prompt_toolkit.styles import PygmentsStyle, Style, Attrs
from pygments.token import Token
__all__ = (
'PymuxStyle',
)
ui_style = {
Token.Line: '#888888',
Token.Line.Focussed: '#448844',
Toke... | jonathanslenders/pymux-test | pymux/style.py | style.py | py | 3,589 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "pygments.token.Token.Line",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pygments.token.Token",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pygments.token.Token.Line",
"line_number": 15,
"usage_type": "attribute"
},
{
... |
30301215925 | ########## Use:
########## Last Modified:
########## Author: Yamaga
##### dependencies
from __future__ import print_function, division
import os, sys
from astropy.io import fits
import numpy as np
import astropy.io.fits
from astropy.nddata import Cutout2D
from astropy import units as u
import shutil
import optparse
imp... | Sound-110316/Personal_repository | pix_awase.py | pix_awase.py | py | 4,121 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "astropy.io.fits.open",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "astropy.io",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "astropy.io.fits.open",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "astropy.io"... |
27741430831 | import os
import fileinput
import logging
import argparse
import shutil
import re
from sys import platform
import socket
# import reggie source code
# use reggie2.0 functions by adding the path
import settings
settings.init() # Call only once
import sys
sys.path.append(settings.absolute_reggie_path)
reggie_exe_path = ... | piclas-framework/reggie2.0 | repas/repas.py | repas.py | py | 9,185 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "settings.init",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "settings.absolute_reggie_... |
7970861568 | import os
from charms.reactive import is_state, when_all, when, when_not, set_flag, when_none, when_any, hook, clear_flag
from charmhelpers.core import templating, host, unitdata
from charmhelpers.core.hookenv import ( open_port,
status_set,
... | erik78se/layer-nextcloud | src/reactive/nextcloud.py | nextcloud.py | py | 6,879 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "charmhelpers.core.hookenv.log",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "charms.reactive.relations.endpoint_from_flag",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "charms.reactive.relations.endpoint_from_flag",
"line_number": 27,
... |
8353691653 | # flake8: noqa
from __future__ import absolute_import, unicode_literals
import json
import os
import pytest
from c8.collection import StandardCollection
from c8.exceptions import (
CollectionCreateError,
CollectionDeleteError,
CollectionFindError,
CollectionImportFromFileError,
CollectionListErro... | Macrometacorp/pyC8 | tests/test_collection.py | test_collection.py | py | 8,364 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "tests.helpers.assert_raises",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "c8.exceptions.CollectionFindError",
"line_number": 29,
"usage_type": "argument"
},
{
"api_name": "pytest.mark",
"line_number": 21,
"usage_type": "attribute"
},
{
... |
23158641917 | import requests
import json
def get_weather(api_key, city):
url = f"http://api.weatherapi.com/v1/current.json?key={api_key}&q={city}"
response = requests.get(url)
data = json.loads(response.text)
if "error" in data:
print("Failed to fetch weather data.")
else:
temperature = data["c... | Mutukukioko/WeatherApp | main.py | main.py | py | 703 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 7,
"usage_type": "call"
}
] |
1584228601 | from django.conf import settings
from cms.models import Title
from minitrue.base import replacer
from minitrue.contrib.django_cms.utils import plugin_get_url
def title_get_url(obj):
return obj.page.get_absolute_url()
replacer.register(Title, fields=['title', 'page_title', 'menu_title', 'redirect', 'meta_descrip... | beniwohli/django-minitrue | minitrue/contrib/django_cms/searchreplace.py | searchreplace.py | py | 2,169 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "minitrue.base.replacer.register",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cms.models.Title",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "minitrue.base.replacer",
"line_number": 11,
"usage_type": "name"
},
{
"api_n... |
36939207944 | import json
import paho.mqtt.client as pmqtt
class mqtt():
"""HIAS iotJumpWay MQTT Module
This module connects devices, applications, robots and software to
the HIAS iotJumpWay MQTT Broker.
"""
def __init__(self,
helpers,
client_type,
configs):
... | leukaemiamedtech/hiasbch-mqtt-blockchain-agent | modules/mqtt.py | mqtt.py | py | 6,273 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "paho.mqtt.client.Client",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "paho.mqtt.client",
"line_number": 73,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"line_number": 168,
"usage_type": "call"
}
] |
43391129954 | # 搜索网易云上评论超过几万来着
from selenium import webdriver
class Spider:
page = webdriver.Chrome()
list_ge = []
count = 0
list_url = []
# first_url = "https://music.163.com/#/song?id=31654747"
# list_url.append(first_url)
# print(list_url)
# 获取歌的地址
def get_url(self, url= "https://music.163.co... | frebudd/python | wangyiyu_pinglun.py | wangyiyu_pinglun.py | py | 1,676 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 6,
"usage_type": "name"
}
] |
10442912320 | import requests
from bs4 import BeautifulSoup
import html5lib
"""THE BELOW REQUEST CAN BE MODIFIED TO GET MORE DATA BY CHANGING THE /page/1 to any page no"""
r=requests.get('https://cutoffs.aglasem.com/page/1')
s=BeautifulSoup(r.content,'html5lib')
jc=s.find(class_="jeg_posts jeg_load_more_flag")
for i in range(0,len... | fredysomy/web-scrape-data | college-cuttofs-updates.py | college-cuttofs-updates.py | py | 522 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 6,
"usage_type": "call"
}
] |
39542654444 | import requests
import json
import csv
headers = {
'Authorization': '',
'API-Key': '',
'Accept': 'application/json',
}
p = {
'severities': ''
}
response = requests.get('https://apptwo.contrastsecurity.com/Contrast/api/ng/ORGID/traces/APPID/filter', params=p,headers=headers)
app = requests.get('https:... | abridgel-zz/scripts | lab3.py | lab3.py | py | 976 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": ... |
28806078956 | from typing import Dict
from typing import Iterator
from typing import List
from jira.resources import Board
from ..exceptions import QueryError
from ..plugin import BaseSource
from ..types import SchemaRow
class Source(BaseSource):
SCHEMA: List[SchemaRow] = [
SchemaRow.parse_obj({"id": "id", "type": "i... | coddingtonbear/jira-select | jira_select/sources/boards.py | boards.py | py | 2,300 | python | en | code | 22 | github-code | 6 | [
{
"api_name": "plugin.BaseSource",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "types.SchemaRow",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "types.SchemaRow.parse_o... |
12095699545 | from argparse import ArgumentParser
import json
from tqdm import tqdm
import os, sys
import logging
import re
import gc
import torch
from torch.utils.data import DataLoader
from torch.optim import Adam
from bert_diora.models import BertDiora
from bert_diora.utils import TokenizedLengthSampler
def main(args):
# S... | jinulee-v/bert_diora | train.py | train.py | py | 10,660 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.manual_seed",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.device",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
... |
70893752508 | import sys
import pandas as pd
from sklearn.feature_selection import SelectKBest, mutual_info_regression
from sklearn.preprocessing import LabelEncoder
import matplotlib.pyplot as plt
# Load the dataset
#filename = sys.argv[1]
data = pd.read_csv('uploads/BigBasket.csv')
# Encode categorical variables using label enco... | FireQueen-3010/MainProject | script.py | script.py | py | 2,244 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_selection.SelectKBest",
"line_number": 21,
"usage_type": "call"
},
... |
35060216092 | from flask import Flask, render_template, request, jsonify
import atexit
import cf_deployment_tracker
import os
import json
import requests
# Emit Bluemix deployment event
cf_deployment_tracker.track()
app = Flask(__name__)
db_name = 'mydb'
client = None
db = None
'''
if 'VCAP_SERVICES' in os.environ:
vcap = js... | vishalsatam/DeploymentOfMLAlgoOnCloud | Flask Application/webApp.py | webApp.py | py | 9,720 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "cf_deployment_tracker.track",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "json.load",
"lin... |
39961449850 | #!/usr/bin/env python
# -- coding: utf-8 --
import numpy
from tf import transformations, TransformListener
import rospy
import geometry_msgs
import math
class TransformerTool:
def __init__(self, target_frame=None, source_frame=None):
self.target_frame = target_frame
self.source_frame = source_fra... | 6VV/vr-robot-back | robot/robot_control/TransformerTool.py | TransformerTool.py | py | 5,042 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "math.acos",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "math.sin",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 35,
"... |
73928148349 | import random
import string
import factory
from django.contrib.auth import get_user_model
from reviews.models import Doctor, Review, Specialty
User = get_user_model()
def random_string(length=10):
return u"".join(random.choice(string.ascii_letters) for x in range(length))
class DoctorFactory(factory.django.D... | idesu/review_moderation_lite | reviews/tests/factories.py | factories.py | py | 1,158 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "string.ascii_letters",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_nam... |
35245234184 | from flask import render_template, url_for, flash, redirect, request, make_response, send_from_directory
from os import path
from csaptitude import app, db, bcrypt
from csaptitude.forms import TestResultsForm, TestRegistrationForm, TestLoginForm
from csaptitude.models import User, TestResult, QuestionResponse
from flas... | DoctorHayes/AptitudeTest-CS | csaptitude/routes.py | routes.py | py | 6,245 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.render_template",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "csaptitude.app.route",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "csaptitude.app",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "flask.rende... |
8067752722 | from django.shortcuts import render_to_response
from curriculum.models import TipoProyecto
from django.conf import settings
# Create your views here.
def home(request):
menuInicio = 'selected'
return render_to_response('default/index.html', {'menuInicio': menuInicio,
'settings': settings, })
def estudio... | sebasgoldberg/jsg | default/views.py | views.py | py | 1,106 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "django.shortcuts.render_to_response",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.settings",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render_to_response",
"line_number": 13,
"usage_type": "call"
},... |
32731754668 | from collections import deque
n, m, v = map(int, input().split())
lst = [[] for _ in range(n+1)]
visit_d = [0] * (n+1)
bfs_q = []
for i in range(m):
a, b = map(int, input().split())
lst[a].append(b)
lst[b].append(a)
# 각 요소들 정렬
for i in range(1, n+1):
lst[i].sort()
def dfs(start):
visit_d... | woo222/baekjoon | python/그래프/s2_1260_DFS와 BFS.py | s2_1260_DFS와 BFS.py | py | 773 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 26,
"usage_type": "call"
}
] |
17591799943 | import requests
headers = {
'Host': 'bagel.htb:8000',
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
'Accept-Language': 'en-US,en;q=0.5',
'Connection': 'close',
'Upgrad... | 0xRoqeeb/scripts | ProcScanner/proscanner.py | proscanner.py | py | 984 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 24,
"usage_type": "call"
}
] |
10282905855 | import os
from flask import Flask
from flask_modals import Modal
from flask_login import LoginManager
from flask_sqlalchemy import SQLAlchemy, Pagination
from importlib import import_module
from apps.utils.stocks_properties import read_properties_file
db = SQLAlchemy()
login_manager = LoginManager()
print('El path d... | qa8990/reports | apps/__init__.py | __init__.py | py | 1,875 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask_login.LoginManager",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "apps.utils.stocks_properties.read_properties_file",
"line_number": 14,
"usage_type":... |
74766917948 | #-------------------------------------------------------------------------------
# Recipes tests
#-------------------------------------------------------------------------------
import io
import os
import pytest
from pathlib import Path
from cookbook.db import get_db
# Data generators for testing.
#----------------... | cmvanb/cookbook | tests/test_recipes.py | test_recipes.py | py | 8,458 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "io.BytesIO",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "io.BytesIO",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line... |
71584682748 | from bs4 import BeautifulSoup
import requests
class DHMenuScraper:
menuLink = "https://nutrition.sa.ucsc.edu/menuSamp.asp?"
dHallCodes = {
"nineten" : "locationNum=40&locationName=Colleges+Nine+%26+Ten+Dining+Hall",
"cowellstevenson" : "locationNum=05&locationName=Cowell+Stevenson+Dining+Hall"... | kschniedergers/DHBot | DHMenuScraper.py | DHMenuScraper.py | py | 1,281 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 20,
"usage_type": "call"
}
] |
29564758485 | #!/usr/bin/python
# -*- encoding: utf-8 -*-
import random
from model.leverage_bracket import leverage_bracket
from model.symbol import symbol as s
from operation.contract.client.leverage_bracket.query_leverage_bracket_list import query_leverage_bracket_list
from test_cases.contract.client.conftest import *
from common... | shiqilouyang/thanos_test | test_cases/contract/client/leverage_bracket/test_query_everage_bracket_list.py | test_query_everage_bracket_list.py | py | 3,595 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "common.logger.logger.info",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "common.logger.logger",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "operation.contract.client.leverage_bracket.query_leverage_bracket_list.query_leverage_bracket_list... |
32171234106 | import json
from django.views.generic import ListView
from django.conf import settings
from django.shortcuts import render
from django.urls import reverse_lazy
from django.contrib.sites.models import Site
import requests
from cart.cart import Cart
from django.views.generic import CreateView
from django.views import Vie... | Alisjj/Shop-From-Home | orders/views.py | views.py | py | 2,802 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.auth.mixins.LoginRequiredMixin",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "django.views.generic.CreateView",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "orders.models.Order",
"line_number": 17,
"usage_type": "nam... |
8670813064 | import pathlib
def get_desanitizer(celltypes_dir):
cell_type_list = read_all_manifests(celltypes_dir)
return desanitizer_from_meta_manifest(cell_type_list)
def desanitizer_from_meta_manifest(cell_type_list):
"""
cell_type_list is the result of reading list_of_manifests
"""
desanitizer = dic... | AllenInstitute/neuroglancer_formatting_scripts | src/neuroglancer_interface/utils/celltypes_utils.py | celltypes_utils.py | py | 6,758 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 145,
"usage_type": "call"
}
] |
17609317181 | # encoding: utf-8
import os
import binascii
from collections import OrderedDict
import cachemodel
from basic_models.models import CreatedUpdatedAt
from django.urls import reverse
from django.db import models, transaction
from django.db.models import Q
from entity.models import BaseVersionedEntity
from issuer.models ... | reedu-reengineering-education/badgr-server | apps/backpack/models.py | models.py | py | 8,542 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "issuer.models.BaseAuditedModelDeletedWithUser",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "entity.models.BaseVersionedEntity",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 24,
"usage_ty... |
23182257426 | import pytest
import json
import ipaddress
from tests.common.utilities import wait_until
from tests.common import config_reload
import ptf.testutils as testutils
import ptf.mask as mask
import ptf.packet as packet
import time
pytestmark = [
pytest.mark.topology('t0'),
pytest.mark.device_type('vs')
]
def add_i... | SijiJ/sonic-mgmt | tests/route/test_static_route.py | test_static_route.py | py | 6,020 | python | en | code | null | github-code | 6 | [
{
"api_name": "pytest.mark.topology",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pytest.mark.device_type",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pytest.... |
23811859933 | from typing import List, Tuple
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import lr_scheduler
from torchvision import datasets, models, transforms
import time
import copy
from PIL import Image
from grid import SQUARES
class GeoModel:
"""Encapsulates the creation, training, ... | yawnston/geo-guessing | model.py | model.py | py | 8,132 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torchvision.transforms.Compose",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.RandomResizedCrop",
"line_number": 27,
"usage_type": "call"
... |
74743639546 | import logging
logger = logging.getLogger('camelot.view.controls.formview')
from PyQt4 import QtGui
from PyQt4 import QtCore
from PyQt4.QtCore import Qt
import sip
from camelot.view.art import Icon
from camelot.view.model_thread import post
from camelot.view.model_thread import model_function
from camelot.view.contr... | kurtraschke/camelot | camelot/view/controls/formview.py | formview.py | py | 16,671 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "PyQt4.QtGui.QAction",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "PyQt4.QtGui",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "camelot.view.ar... |
70075741628 | # -*- encoding:utf-8 -*-
'''
@time: 2019/12/21 8:28 下午
@author: huguimin
@email: 718400742@qq.com
一个doc表示一个样本
'''
import math
import torch
import torch.nn as nn
import numpy as np
import torch.nn.functional as F
from layers.dynamic_rnn import DynamicLSTM
from layers.attention import Attention
class GraphConvolution(n... | LeMei/FSS-GCN | models/word2vec/ecgcn.py | ecgcn.py | py | 9,816 | python | en | code | 14 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "torch.nn.Parameter",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line... |
9054587294 | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 28 16:52:49 2021
@author: shabalin
Utils to work with fable and hexrd functions.
"""
import sys, os
import numpy as np
import yaml, subprocess
#import cbftiffmxrdfix
def run_peaksearch(par_file=None):
""" Wrapper for the ImageD11 peaksearch.py script""" ... | agshabalin/py3DXRD | .ipynb_checkpoints/fable_hexrd_utils-checkpoint.py | fable_hexrd_utils-checkpoint.py | py | 7,948 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "yaml.safe_load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_num... |
74126214589 | # -*- coding: utf-8 -*-
# this file is released under public domain and you can use without limitations
import datetime
#########################################################################
## This is a sample controller
## - index is the default action of any application
## - user is required for authentication a... | tylrbvn/longboxes | controllers/collection.py | collection.py | py | 5,360 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 22,
"usage_type": "attribute"
}
] |
7122911694 | from django.conf.urls import url
from one import views
from one.views import CreateStudent
urlpatterns = [
url(r'^index/', views.index),
url(r'^print/',views.PrintTable,name='print'),
url(r'^studentname/(\d+)/',views.stuname,name='studentname'),
url(r'^detail/',views.detail,name='detail'),
url(r'^C... | lao1a0/Django-1 | one/urls.py | urls.py | py | 385 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "one.views.index",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "one.views",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.conf.urls.url... |
5212403801 | # -*- coding: utf-8 -*-
import scrapy
from junyang_spider.items import YouzySchoolBadgeItem
class SchoolBadgeSpider(scrapy.Spider):
name = "school_badge"
allowed_domains = ["youzy.cn"]
start_urls = [
"https://www.youzy.cn/college/search?page=1",
]
custom_settings = {
'ITEM_PIPELINE... | endForYou/spider | junyang_spider/spiders/school_badge_spider.py | school_badge_spider.py | py | 914 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scrapy.Spider",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "junyang_spider.items.YouzySchoolBadgeItem",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "scrapy.Request",
"line_number": 25,
"usage_type": "call"
}
] |
6018015716 | import os
import re
from pathlib import Path
summary = ""
def get_sql(name, docs, cat, markdown, docs_url):
return f"INSERT INTO `ae-expression` ( `name`, `docs`, `cat`, `markdown`, `docs_url`) VALUES ( {name}, {docs}, {cat}, {markdown}, {docs_url});"
def get_content(file_path, docs, cat):
with open(file_p... | Yuelioi/Program-Learning | Python/Projects/提取文件API的sql.py | 提取文件API的sql.py | py | 1,733 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "re.findall",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "re.M",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.scandir",
"line_number": 35,... |
26408420089 | import json
from socket import *
import base64
def client_json(ip, port, obj):
# 创建TCP Socket并连接
sockobj = socket(AF_INET, SOCK_STREAM)
sockobj.connect((ip, port))
if 'exec_cmd' in obj.keys():
send_obj = obj
elif 'upload_file' in obj.keys():
with open('{0}'.format(obj['upload_file... | Prin-Meng/NetDevOps | network_protocal/task_day13/socket_client.py | socket_client.py | py | 2,627 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "base64.b64encode",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "base64.b64decode",
"line_n... |
34778096922 | import os
import yaml
def book_ids_from_frontmatter(frontmatter):
'''Return a list of book id hashes from frontmatter of list file.'''
sections = yaml.load(frontmatter)['sections']
books = []
for section in sections:
for source in section['listings']:
if source['type'] == 'book':... | Backlist/backlist-workflows | backlist.py | backlist.py | py | 1,832 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "yaml.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "yaml.load",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 36,
... |
17970705274 |
#setuptools.setup is looking at one argv parameter; to "build" and "install":
#python3 setup.py install
#libtorrent from pypi has bindings and library now, before was:
# python-libtorrent-bin is at extra require now, but, if was at install requires:
# ok, package python-libtorrent-bin is old. install with pip instal... | colin-i/tora | setup.py | setup.py | py | 1,548 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_number": 21,
"usage_type": "call"
}
] |
36262108045 | from collections import deque
def solution(stats):
queue = deque(stats)
answer = []
while queue:
x = queue.popleft()
length = len(answer)
if length < 1:
answer.append([x])
else:
max_index = -1
for i in range(length):
if an... | hon99oo/PythonAlgorithmStudy | 코테/스테이지파이브/solution2/solution.py | solution.py | py | 636 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 5,
"usage_type": "call"
}
] |
6518783432 | #!/usr/bin/env python
import datetime
from elasticsearch import Elasticsearch
from jobs.lib import Configuration
from jobs.lib import Send_Alert
local_config = {
"minutes": 5,
"index": "servers-*",
"max_results": 1000,
"severity": "low"
}
# Query goes here
search_query = {
"query": {
"b... | 0xbcf/elasticsearch_siem | jobs/LockedADAccount.py | LockedADAccount.py | py | 1,430 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.utcnow",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "datetime.timedelta",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "da... |
2128326759 | from cumulusci.tasks.apex.anon import AnonymousApexTask
from cumulusci.core.exceptions import TaskOptionsError
import time
class SetBDIMappingMode(AnonymousApexTask):
"""Change the mapping mode for NPSP BGE/BDI."""
task_docs = """
Use the 'mode' argument to specify either 'Help Text' or 'Data Import Field... | SalesforceFoundation/NPSP | tasks/set_BDI_mapping_mode.py | set_BDI_mapping_mode.py | py | 2,760 | python | en | code | 609 | github-code | 6 | [
{
"api_name": "cumulusci.tasks.apex.anon.AnonymousApexTask",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "cumulusci.core.exceptions.TaskOptionsError",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 63,
"usage_type": "call... |
33051867473 | import numpy as np
import cv2
import pickle
import glob
import matplotlib.pyplot as plt
import os
import Lane_find_functions as Lff
import function_parameters as FP
import time
# video_name = 'test_video_4lanes_1.13.mp4'
# image_folder = './Test_images/dashcam_driving/'
# video_name = 'challenge_video_4lanes_1.8.mp4'... | Domagoj-Spoljar/-Python-Algoritam-Prepozunavanje-vozne-trake | frames_to_video_dynamic.py | frames_to_video_dynamic.py | py | 3,245 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "function_parameters.video_name",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "function_parameters.dashcam_image_path",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 32,
"usage_type": "call"
},... |
15211959630 | """
CNN Classification of SDSS galaxy images
----------------------------------------
Figure 9.20
The accuracy of a multi-layer Convolutional Neural Network
applied to a set of morphologically classified galaxy images taken
from the SDSS. The configuration of the network is described in
Section 9.8.4. The left panel s... | astroML/astroML_figures | book_figures/chapter9/fig_morph_nn.py | fig_morph_nn.py | py | 10,396 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "astroML.plotting.setup_text_plots",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 55,
"usage_type": "name"
},
{
... |
38779549924 | import asyncio
import datetime
import time
import random
import discord
from discord import Member, Guild, User, message
from discord.ext import commands
from datetime import datetime
client = discord.Client()
client = discord.Client(intents=discord.Intents.all())
bot = commands.Bot(command_prefix='!')
... | Bolgorov/Agoki | agoki code (without token).py | agoki code (without token).py | py | 10,312 | python | de | code | 0 | github-code | 6 | [
{
"api_name": "discord.Client",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "discord.Client",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "discord.Intents.all",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "discord.Intents",
... |
18817086763 | from gameObject import GameObject
import pygame, time
FALL_VELOCITY = (0, 3.9)
NULL_VELOCITY = (0, 0)
FLAPPING_VELOCITY = (0, -4.5)
FLAPPING_MAX_TIME = 0.15
BIRD_RADIUS = 15
WINDOW_WIDTH = 480
COLOR_RED = (255, 0, 0)
class Bird(GameObject):
def __init__(self, x, y, color, brain):
GameObject.__init__(sel... | JSMarrocco/JSMarrocco_PersonalRepository | NEAT_fluppy_bird/bird.py | bird.py | py | 1,951 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "gameObject.GameObject",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "gameObject.GameObject.__init__",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "gameObject.GameObject",
"line_number": 16,
"usage_type": "name"
},
{
"api_na... |
6661767688 | import random
import cv2
import numpy as np
import sys
sys.path.insert(1, 'build/lib')
from va_rs import augment
original_cube = np.zeros((32, 32, 32), dtype=np.float32)
original_cube[12:20, 12:20, 12:20] = 1.0
original_cube = original_cube[None, ...]
linear_cube = original_cube.copy()
nearest_cube = original_cube... | PUTvision/volume-augmentations | examples/augment.py | augment.py | py | 913 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.path.insert",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_num... |
19272008799 |
import MDAnalysis
import sys
import itertools
import tool
from argparse import ArgumentParser
"""
a = sys.argv
a.pop(0)
kai1 = [i for i in a if ".trr" in i]
kai2 = [i for i in a if ".pdb" in i]
kai3 = [i for i in a if "prob" in i]
kai4 = [i for i in a if ".trr" not in i and ".pdb" not in i
and ".t... | satoshi-python/Desktop | pca1_kai.py | pca1_kai.py | py | 5,325 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "MDAnalysis.Universe",
"line_number": 120,
"usage_type": "call"
},
{
"api_name": "itertools.product",
"line_number": 156,
"usage_type": "call"
},
{
"api_name": "tool.... |
36689627100 | import sys
import subprocess
from PyQt5 import uic, QtCore
from PyQt5.QtWidgets import QApplication, QMainWindow
form_class = uic.loadUiType("./testBtn.ui")[0]
class WindowClass(QMainWindow, form_class):
def __init__(self):
super().__init__()
self.setupUi(self)
self.testBtn.cl... | quswjdgns399/air_command | main_ui.py | main_ui.py | py | 2,953 | python | ko | code | 0 | github-code | 6 | [
{
"api_name": "PyQt5.uic.loadUiType",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "PyQt5.uic",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "subprocess.Po... |
14033064402 | import matplotlib.pyplot as plt
import xgboost as xgb
import os
from constants import *
from time import gmtime, strftime
from src.models.model_learner import ModelLearner
from src.models.csv_handler import save_feature_importance_res
class XgboostTrainObj(ModelLearner):
def __init__(self,org_name):
self... | EyalHadad/miRNA_transfer | src/models/training/xgboos_trainer.py | xgboos_trainer.py | py | 2,852 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "src.models.model_learner.ModelLearner",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "src.models.model_learner.ModelLearner.__init__",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "src.models.model_learner.ModelLearner",
"line_number": 1... |
19412698559 | import json
def create_row_w_validated_params(cls, validated_params, rqst_errors):
found_rows_w_rqst_name = cls.check_for_rows_with_rqst_name(
validated_params['name'],
rqst_errors
)
new_row = None
if not found_rows_w_rqst_name and not rqst_errors:
new_row = cls()
new_... | bbcawodu/careadvisors-backend | picmodels/models/care_advisors/healthcare_service_expertise_models/services/create_update_delete.py | create_update_delete.py | py | 2,368 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.dumps",
"line_number": 65,
"usage_type": "call"
}
] |
7194454936 | # THINGS TO DO
# Isolates + Member + Star < Bridge < Organizer
import networkx as nx
from community import community_louvain
import pandas as pd
import operator
# ORGANIZER/LIAISON/BROKER
G = nx.read_weighted_edgelist('Only_50_Employees1.csv', delimiter=',', create_using = nx.DiGraph(), nodetype=str)
page_score = di... | AnnaMudano/Msc-Students | Unofficial_Roles_Script.py | Unofficial_Roles_Script.py | py | 3,132 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "networkx.read_weighted_edgelist",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "networkx.DiGraph",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "networkx.pagerank",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "ne... |
28102982969 | from django.urls import path
from .views import *
from django.contrib.auth.views import LogoutView
urlpatterns = [
path('aboutMe/', aboutMe, name="aboutMe"),
path('routePages/',routePages,name="routePages"),
path("routePages/<id>", routePagesId, name="routePagesId"),
path('crearHistoria/',crearHistor... | ldcomba/ProyectoFinalComba_HistoriaMascotas | AppPages/urls.py | urls.py | py | 1,924 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
34453314320 | import sys, os
import requests
from bs4 import BeautifulSoup # scraper library
import pandas as pd # tables
from collections import OrderedDict
# Config
base_page_url = 'https://www.teamrankings.com/ncaa-basketball/stat/'
date_range = pd.date_range(pd.datetime(2018, 1, 1), periods=59).tolist()
# dictionary: output_n... | bwu987/March-Madness-Crusher | scraper/scraper.py | scraper.py | py | 3,218 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.date_range",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.datetime",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
... |
35724557326 | from django.shortcuts import render
from social.apps.django_app.middleware import SocialAuthExceptionMiddleware
from social import exceptions as social_exceptions
class SocialAuthExceptionMiddleware(SocialAuthExceptionMiddleware):
def process_exception(self, request, exception):
if hasattr(social_exceptio... | jasonwaters/fitcompetition | fitcompetition/middleware.py | middleware.py | py | 592 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "social.exceptions",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "django.shortcuts.render",
"line_number": 9,
"usage_type": "call"
}
] |
644356051 | from rest_framework import status
from rest_framework.response import Response
from rest_framework.views import APIView
from .serializers import UserRegistrationSerializer
class UserRegistrationView(APIView):
"""
API endpoint for user registration.
"""
def post(self, request):
"""
Han... | soovuh/military-collections-api | custom_auth/views.py | views.py | py | 951 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "serializers.UserRegistrationSerializer",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "rest_framework.response.Response",
"line_number": 27,
"usage_type": "c... |
34632164463 | import cv2
import numpy as py
#检测拐角
#与边缘检测不同,拐角的检测的过程稍稍有些复杂
# 。但原理相同,所不同的是先用十字形的结构元素膨胀像素,
# 这种情况下只会在边缘处“扩张”,角点不发生变化。
# 接着用菱形的结构元素腐蚀原图像,
# 导致只有在拐角处才会“收缩”,而直线边缘都未发生变化。
image = cv2.imread('img\\building.jpg', 0)
origin = cv2.imread('img\\building')
#构造5 * 5的结构元素,分别为十字形/菱形/方形/X形
cross = cv2.getStructuringElement(cv2.MO... | liuyuhua-ha/opencvStudy | opencvStudy/checkFaceTest.py | checkFaceTest.py | py | 1,754 | python | zh | code | 0 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.getStructuringElement",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.MORPH_CROSS",
... |
10383049173 | from typing import Dict
import executorch.backends.qualcomm.python.PyQnnWrapperAdaptor as PyQnnWrapper
import torch
from .node_visitor import NodeVisitor, register_node_visitor
from .qnn_constants import OpDequantize, QNN_OP_PACKAGE_NAME_QTI_AISW
class DequantizeOpBase(NodeVisitor):
def __init__(self, *args) -... | pytorch/executorch | backends/qualcomm/builders/op_dequantize.py | op_dequantize.py | py | 2,130 | python | en | code | 479 | github-code | 6 | [
{
"api_name": "node_visitor.NodeVisitor",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.fx",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "typing.Dict",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "torch.fx",
"li... |
17961314435 | from pymavlink import mavutil
from contextlib import nullcontext
CONNECTION_STRING = "udpin:0.0.0.0:14550"
DRONE_IDS = [3, 4]
def wait_heartbeats_multi(connection):
heartbeats = {id: False for id in DRONE_IDS}
while not all(heartbeats.values()):
msg = connection.recv_match(type="HEARTBEAT")
i... | jath03/mavlink-testing | utils.py | utils.py | py | 1,543 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pymavlink.mavutil.mavlink_connection",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pymavlink.mavutil",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "contextlib.nullcontext",
"line_number": 41,
"usage_type": "call"
},
{
"api... |
20288234307 | # -*- coding: utf-8 -*-
import re
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
REQUIRES = [
'docopt',
'argparse==1.2.1',
'requests==2.8.1',
'trello==0.9.1',
'wsgiref==0.1.2',
]
class PyTest(TestCommand):
def finalize_options(self):
T... | cirinoalejandro/trello-to-text | setup.py | setup.py | py | 2,304 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "setuptools.command.test.test",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "setuptools.command.test.test.finalize_options",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "setuptools.command.test.test",
"line_number": 19,
"usage_type"... |
31935770331 | import pandas as pd
import numpy as np
import time
import sys
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
np.set_printoptions(threshold=sys.maxsize)
df = pd.read_csv('contourQ3data.csv')
Z = df.pivot_table(index='p1', columns='p3', values='vari').T.values
X_unique = np.sort(df.p1.... | isabelnic/Modelling-and-Visualisation | checkpoint 2/plot_contour_vari.py | plot_contour_vari.py | py | 694 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.maxsize",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.sort",
... |
44070613144 | import numpy as np
import math
import matplotlib.pyplot as plt
class LotkaVolterra:
"""This class defines the Lotka--Voltera prey-predator
system. There are 4 parameters in this class which
define the evoluion of the system.
Attributes:
k_a reproduction rate of the antelopes
... | sidsriv/Simulation-and-modelling-of-natural-processes | lotkaVolterra.py | lotkaVolterra.py | py | 5,583 | python | en | code | 21 | github-code | 6 | [
{
"api_name": "numpy.zeros",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number"... |
17110435205 | import tkinter
from tkinter import *
from PIL import ImageTk, Image
# configure window
root = Tk()
windowColor = "#F2F2F2"
root.geometry("827x1500")
root.configure(bg = windowColor)
root.title("Train Build")
# create a container for canvas so window is scrollable
# window is a frame inside canvas that is a contain... | masonknight22/CE596-RailroadAnalysisMockup | analysis p1.py | analysis p1.py | py | 12,035 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PIL.Image.open",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "PIL.ImageTk.PhotoImage",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "PIL.ImageTk",
"li... |
20105435432 | import ConfigParser, logging, datetime, os, json
from flask import Flask, render_template, request
import mediacloud
CONFIG_FILE = 'settings.config'
basedir = os.path.dirname(os.path.realpath(__file__))
# load the settings file
config = ConfigParser.ConfigParser()
config.read(os.path.join(basedir, 'settings.config'... | freeeal/MAS.500 | hw3/mcserver.py | mcserver.py | py | 2,145 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "ConfigParser.ConfigParser"... |
26825006942 |
from __future__ import annotations
import pickle # nosec
import struct
from typing import Final, Optional
from ..packet import Packet
from ..sign import Signatures
__all__ = ['UdpPack']
_prefix = struct.Struct('!BBI')
class UdpPack:
"""Packs and unpacks SWIM protocol :class:`~swimprotocol.packet.Packet`
... | icgood/swim-protocol | swimprotocol/udp/pack.py | pack.py | py | 4,184 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "struct.Struct",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sign.Signatures",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "pickle.HIGHEST_PROTOCOL",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "typing.Fin... |
71861354429 | from collections import Counter
from datetime import datetime
# 示例数据
# 10折 1200 (0/1) 自己
# 10折 1200 VDMzZFF1T0hKdTRjaEJRMkV0N2xiZz09 (0/3) 舞***影(15***33)
def extract_discount(share_str: str) -> int:
return int(share_str.split(" ")[0][:-1])
def extract_price(share_str: str) -> int:
return int(share_str.spli... | fzls/djc_helper | process_my_home.py | process_my_home.py | py | 2,004 | python | en | code | 319 | github-code | 6 | [
{
"api_name": "collections.Counter",
"line_number": 58,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 67,
"usage_type": "name"
}
] |
42432440743 | # MenuTitle: SVG Pen
from fontTools.pens.basePen import BasePen
# (C) 2016 by Jens Kutilek
# https://raw.githubusercontent.com/jenskutilek/TypoLabs2016/master/penCollection/svgPen.py
# See also:
# http://www.w3.org/TR/SVG/paths.html#PathDataBNF
# https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths
# SVG... | jenskutilek/TypoLabs2016 | penCollection/svgPen.py | svgPen.py | py | 11,820 | python | en | code | 15 | github-code | 6 | [
{
"api_name": "fontTools.pens.basePen.BasePen",
"line_number": 161,
"usage_type": "name"
},
{
"api_name": "fontTools.pens.basePen.BasePen.__init__",
"line_number": 194,
"usage_type": "call"
},
{
"api_name": "fontTools.pens.basePen.BasePen",
"line_number": 194,
"usage_type... |
37368152653 | from typing import List, Dict, Tuple, Any
import numpy as np
import pandas as pd
import spacy
import en_core_web_sm
from spacy.matcher import Matcher
from concept_processing.asp.asp_generator import ASPGenerator
from concept_processing.asp.asp_solver import clingo_solve
from concept_processing.asp.clingo_out_parsers... | CharlizeY/AI-thesis | concept_processing/extraction.py | extraction.py | py | 9,204 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "concept_processing.enums.ProblemType.ATOMISATION",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "concept_processing.enums.ProblemType",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "concept_processing.enums.ProblemType.GENERALISATION",
... |
36546618587 | import sys, getopt
import collections
def main(argv):
inputFile = ''
try:
opts, args = getopt.getopt(argv, 'hi:')
except getopt.GetoptError:
print('test.py -i <inputfile>')
sys.exit(2)
for opt, arg in opts:
if opt == '-h':
print('test.py -i <inputfile>')
... | Cranzai/AdventofCode | 2021/day08/python/day8.py | day8.py | py | 3,788 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "getopt.getopt",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "getopt.GetoptError",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_num... |
22504436543 | import scrapy
from scrapy import Request
class TrilhasTDC(scrapy.Spider):
name = "trilhas_tdc"
start_urls = [
"http://www.thedevelopersconference.com.br/tdc/2018/saopaulo/trilhas"
]
def parse(self, response):
colunas = response.xpath('//div[contains(@class, "col-sp")]')
for c... | anacls/scrapy-study | tdc_examples/scrapy_study/spiders/trilhas_tdc.py | trilhas_tdc.py | py | 1,172 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scrapy.Spider",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 18,
"usage_type": "call"
}
] |
29827009348 | import string
from os.path import exists
import pandas as pd
from datetime import datetime
from random import shuffle
import numpy as np
if exists('D:\GRE\my word list\words.csv'):
df = pd.read_csv('D:\GRE\my word list\words.csv')
wordcount = df.shape[0]
else:
df = pd.DataFrame(columns = ['word'... | Geeks-Sid/GRE-word-game | play.py | play.py | py | 5,044 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"l... |
27132320608 | """
Main launching point of the Top Patch Server
"""
import base64
import uuid
import os
import logging
import logging.config
import tornado.httpserver
import tornado.ioloop
import tornado.web
import tornado.options
from redis import StrictRedis
from rq import Connection, Queue
from server.handlers import RootHandle... | SteelHouseLabs/vFense | tp/src/vFense_listener.py | vFense_listener.py | py | 5,617 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "tornado.options.define",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "tornado.options.define",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "tornado.httpserver.web",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_nam... |
72789776189 | import gc
import itertools as it
import os.path as osp
from typing import List
import warnings
from collections import deque, namedtuple
import numpy as np
import torch
from examples.speech_recognition.data.replabels import unpack_replabels
from fairseq import tasks
from fairseq.utils import apply_to_sample
from omega... | lovemefan/Wav2vec2-webserver | fairseq_lib/examples/speech_recognition/w2l_decoder.py | w2l_decoder.py | py | 2,977 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "itertools.groupby",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "torch.LongTensor",
"line_number": 81,
"usage_type": "call"
}
] |
37858257254 | #using a shallow net(2 layers)
#not tested
import numpy as np
import matplotlib.pyplot as plt
import sklearn
import sklearn.datasets
import sklearn.linear_model
from utils import load_dataset
#loading the dataset using utils
x,y = load_dataset()
shape_x = x.shape
shape_y = y.shape
m = shape_x[1]
#first trying to fit ... | thepavankoushik/Project-Reboot | shallow networks/planardata_classify.py | planardata_classify.py | py | 2,445 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "utils.load_dataset",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LogisticRegressionCV",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model",
"line_number": 17,
"usage_type": "attribute"
},
{... |
38930719861 | #!/usr/bin/python3
"""
Python script that takes GitHub credentials
(username and password) and uses the GitHub API to display id
"""
import requests
import sys
if __name__ == '__main__':
if len(sys.argv) != 3:
print("Usage: ./10-my_github.py <username> <token>")
sys.exit(1)
username, t... | Bellamalwa/alx-higher_level_programming | 0x11-python-network_1/10-my_github.py | 10-my_github.py | py | 851 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number"... |
72683633467 | from matplotlib import pyplot as plt
if __name__ == '__main__':
slope = 0.0008588
y_intercept = -0.1702
rainfall_values = [50 * x for x in range(0, 18)]
y = [max(slope * x + y_intercept, 0) for x in rainfall_values]
plt.title('Bifurcation diagram of Scanlon model')
plt.xlabel('Rainfall (... | tee-lab/patchy-ecosterics | thesis_code/scanlon_transitions/phase_transition.py | phase_transition.py | py | 498 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.title",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.xlabel",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "ma... |
11120983307 | import abc
import typing as tp
from librarius.domain.messages import (
TAbstractMessage,
TAbstractCommand,
TAbstractQuery,
TAbstractEvent,
)
if tp.TYPE_CHECKING:
from librarius.domain.messages import AbstractCommand, AbstractQuery, AbstractEvent
from librarius.domain.models import Entity
fr... | adriangabura/vega | librarius/service/handlers/abstract.py | abstract.py | py | 1,538 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "typing.TypeVar",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "typing.Generic",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "librariu... |
37219263893 | from typing import List, Dict
import csv
def get_unique_industries(path: str) -> List[str]:
with open(path, mode="r") as file:
data_file = csv.DictReader(file)
list_data_file = []
for data in data_file:
list_data_file.append(data)
industries = set([industry['industry']
... | Gilson-SR/job-insights | src/insights/industries.py | industries.py | py | 684 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "csv.DictReader",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.