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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
27701555522 | import json
from pathlib import Path
import numpy as np
import argparse
from typing import Text, Optional, List, Dict, Any, Set, BinaryIO
class Codebook:
def __init__(self, directoryname: Text):
codebook_filename = Path(directoryname) / "codebook.bin"
print(f"Reading codebook from {codebook_file... | RasaHQ/semantic-map-embedding | scripts/codebook_to_json.py | codebook_to_json.py | py | 4,328 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.Text",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.fromfile",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_numbe... |
75267626593 | from fastapi import APIRouter, Response, HTTPException, status
from models import ProductSchema
from controllers import read_products, read_category, write_product, read_product, purge_product
from datetime import date
router = APIRouter()
@router.get('/', response_model=list[ProductSchema])
async def get_products... | bananichdev/fastApi-money-control | routers/products.py | products.py | py | 1,540 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "controllers.read_products",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "fastapi.HTTP... |
26904333768 | from flask import *
import requests, subprocess, json, re
app = Flask(__name__)
@app.route("/")
async def start():
return """
<form action="/get">
<input name="username" id="username">
<label for="username">Username</label>
</form>
"""
@app.route("/get")
async def getRender():
id ... | TheTechRobo/plays.tv-finder | app.py | app.py | py | 1,527 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 37,
... |
72353339233 | #--------------------------JoyBot - Python Branch-------------------------#
import os,random,discord,pickle,json,io,contextlib,itertools
from discord.ext.tasks import asyncio
from discord.ext import commands
from discord.utils import find
from datetime import datetime
from decimal import Decimal
from shutil import cop... | Joyte/Misc | notsortedatall/old_bot.py | old_bot.py | py | 36,443 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "decimal.Decimal",
"line_number": 106,
"usage_type": "call"
},
{
"api_name": "pickle... |
11424085756 | import json
import logging
from django.http import HttpResponse, JsonResponse
from django.views.decorators.csrf import csrf_exempt
from rest_framework import status
from rest_framework.response import Response
from .tasks import fetch_fastq
logger = logging.getLogger(__name__)
@csrf_exempt
def test(request):
r... | ufuktepe/DataCollectionService | data_collection/views.py | views.py | py | 1,308 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.views.decorators.csrf.csrf_exempt",
"line_number": 14,
"usage_type": "name"
},
{
... |
40454649248 | # -*- coding: utf-8 -*-
import base64
import json
from odoo import fields, models, api
from ..utils.utils import make_signature
class PaymentAcquirer(models.Model):
_inherit = 'payment.acquirer'
provider = fields.Selection(selection_add=[('liqpay', 'Liqpay')])
liqpay_public_key = fields.Char(
... | i-vyshnevska/l10n_ukraine | liqpay_acquirer/models/payment_acquirer.py | payment_acquirer.py | py | 3,744 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "odoo.models.Model",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "odoo.fields.Selection",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "odoo.fields"... |
36549110878 | """Backend supported: tensorflow.compat.v1, tensorflow, pytorch, paddle"""
import os
os.environ["DDEBACKEND"] = "pytorch"
import numpy as np
import deepxde as dde
# For plotting
import matplotlib.pyplot as plt
x_lower = -5
x_upper = 5
t_lower = 0
t_upper = np.pi / 2
nx = 256
nt = 201
# Creation of the 2D domain (fo... | xusuyong/WTU-AI4S | src/PINN/标准非线性薛定谔方程/deepxde-非线性薛定谔-呼吸子.py | deepxde-非线性薛定谔-呼吸子.py | py | 5,053 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.environ",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "numpy.pi",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "numpy.linspace",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"lin... |
3261805310 | import logging
import time
from datetime import timedelta
import numpy as np
from tqdm import tqdm
import src.cfg as cfg
import src.data as data
import src.models as models
import src.processing as processing
import src.filters as fltr
"""
parameters = dict(years_train=list(range(2010, 2014)),
year... | idrigo/arctic_ddmodeling | scripts/predict_area.py | predict_area.py | py | 3,063 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "logging.INFO"... |
70749879395 | from http.server import BaseHTTPRequestHandler
import json
import debugserver
def capitalize(string, lower_rest=False):
return string[:1].upper() + (string[1:].lower() if lower_rest else string[1:])
class handler(BaseHTTPRequestHandler):
def do_GET(self):
path = self.path
print('path is ', path)
... | johnayoung/test-zeit-now | capitalize.py | capitalize.py | py | 621 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "http.server.BaseHTTPRequestHandler",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "debugserver.serve",
"line_number": 24,
"usage_type": "call"
}
] |
10990578984 | from typing import Dict
from tqdm import tqdm
from towhee.utils.log import engine_log
from towhee.runtime import ops, AcceleratorConf
from towhee.operator import NNOperator
from towhee.serve.triton import constant
from towhee.serve.triton.model_to_triton import ModelToTriton
from towhee.serve.triton.pipe_to_triton imp... | towhee-io/towhee | towhee/serve/triton/pipeline_builder.py | pipeline_builder.py | py | 3,691 | python | en | code | 2,843 | github-code | 1 | [
{
"api_name": "typing.Dict",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "towhee.runtime.ops",
"line_number": 33,
"usage_type": "argument"
},
{
"api_name": "towhee.utils.log.engin... |
74839939873 | import os
import glob
import re
from datetime import datetime, timedelta, time
import fitz
from openpyxl import Workbook
from dataclasses import dataclass
# ------ CHANGE ME ---------
folder_path = "C:\\Users\\majona\\GitHub\\iko-tools\\Python\\antwerpTimeConverter\\input"
save_path = f'C:\\Users\\majona\\GitHub\\ik... | jonathanmajh/iko-tools | Python/antwerpTimeConverter/main.py | main.py | py | 3,729 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime.now",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "openpyx... |
25866765879 | import numpy as np
import random
import math
import copy
import matplotlib.pyplot as plt
import matplotlib.animation as animation
class RED_FOXES:
def __init__(self, maxx, minx, wymiar, fitness, alfa):
self.wymiar = wymiar
self.position = np.empty(wymiar)
self.mi = random.uniform(0, 1)
... | JakubPrzychodzki1G/in-ynierka-red-fox-algorytm | main.py | main.py | py | 8,628 | python | pl | code | 0 | github-code | 1 | [
{
"api_name": "numpy.empty",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "random.uniform",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "random.uniform",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "random.uniform",
"line_... |
1160027609 | import numpy as np
import os
import cv2
import trimesh
import pickle
import json
import pycolmap
import collections
import matplotlib.pyplot as plt
from models.pose_estimator import PoseModel
from models.human_detector import DetectorModel
from .aria_human import AriaHuman
from .exo_camera import ExoCamera
from utils... | rawalkhirodkar/egohumans | egohumans/lib/datasets/ego_exo_scene.py | ego_exo_scene.py | py | 87,259 | python | en | code | 16 | github-code | 1 | [
{
"api_name": "numpy.random.seed",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "cv2.getTickCount",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "os.path.join",
... |
37259020703 | from gpaw import *
from ase.io import read, write
from ase.eos import EquationOfState
from ase.optimize import BFGS
import numpy as np
import math as m
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
# User inputs
#################################################################
kpoints = [4, 4... | venkkris/scripts | bo_nmc.py | bo_nmc.py | py | 3,609 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.use",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "ase.io.read",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 59... |
30716496756 | import json
import unittest
from copy import deepcopy
from http import HTTPStatus
from typing import Union
from flask import Response
from team_picker.constants import (TEAMS_URL, TEAM_BY_ID_URL,
RESULT_ONE_ROLE, RESULT_LIST_TEAMS,
RESULT_CREATED_C... | ibuttimer/TeamPicker | test/test_teams.py | test_teams.py | py | 20,098 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "test_data.TeamData",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "base_test.BaseTestCase",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "base_test.BaseTestCase",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "test... |
21615960545 | import os
import json
import datetime
from django.apps import apps
from django.core.management.base import BaseCommand, CommandError
from core.models import User, ActivityPeriod
class Command(BaseCommand):
help = "Insert a .json file containing user details and their activity periods."
def validate_date_fo... | Mangy007/full-throttle-labs-api | core/management/commands/populate_data.py | populate_data.py | py | 2,799 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "attribute"
},
... |
11810692657 | import logging
from django.core.exceptions import ObjectDoesNotExist
from django.test import Client, TestCase
from django.urls import reverse
from cms.contexts.tests import ContextUnitTest
from cms.medias.tests import MediaUnitTest
from cms.pages.models import PageMedia
from cms.pages.tests import PageUnitTest
lo... | UniversitaDellaCalabria/uniCMS | src/cms/api/tests/test_page_media.py | test_page_media.py | py | 5,322 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "django.test.TestCase",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "django.test.... |
7762360924 | """
URL configuration for SANSKARSET project.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.2/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='h... | expertsdrives/sanskarsat | SANSKARSET/urls.py | urls.py | py | 1,469 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "application.views.index",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "application.views",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "djang... |
17989289001 | from anytree import Node, RenderTree
from apted.helpers import Tree
node_id = 0
def parse_goal_ast(content):
"""
Brings the AST into an 'anytree' shape using recursion.
"""
global node_id
node_id = 0
po_id = str(content.get('id', -1))
ast_anytree_root_node = Node(
po_id, op_name="... | Flunzmas/gym-autokey | gym_autokey/envs/datastructures/po_anytree.py | po_anytree.py | py | 3,295 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "anytree.Node",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "anytree.Node",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "anytree.Node",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "anytree.RenderTree",
"line... |
195482476 | """Main init module contains create_app function"""
import logging
import os
from logging.handlers import SMTPHandler, RotatingFileHandler
import telebot_router
from flask import Flask
from flask_bootstrap import Bootstrap
from flask_login import LoginManager, login_manager
from flask_migrate import Migrate
from flask... | Vadim-AM/Customer-service | app/__init__.py | __init__.py | py | 2,857 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask_migrate.Migrate",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask_login.LoginManager",
"line_number": 19,
"usage_type": "call"
},
{
"api_na... |
5563353172 | import zmq
from time import sleep
context = zmq.Context()
socket = context.socket(zmq.PUB)
socket.bind('tcp://127.0.0.1:2000')
messages = [100,200,300]
i = 0
while True:
sleep(1)
socket.send_pyobj({i:messages[i]})
i = 0 if i == 2 else i + 1
| williamlun/SomeCommunicationSocket | ZeroMQ/zmq_pub.py | zmq_pub.py | py | 257 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "zmq.Context",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "zmq.PUB",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "time.sleep",
"line_number": 13,
"usage_type": "call"
}
] |
24000446479 | from datetime import date
from django.views import generic
from .models import Post, Event
from .forms import PostForm, EventForm
from django.contrib import messages
from django.shortcuts import render, redirect, reverse, get_object_or_404
from django.contrib.auth.decorators import login_required
from django.core.excep... | rocrill/velo_city | blog/views.py | views.py | py | 6,688 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "models.Post.objects.filter",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "models.Post.objects",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "models.Post",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "djang... |
41433217351 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
import urllib2
import requests
import codecs
import csv
import pprint as pp
import re
from collections import OrderedDict
url_standard = 'http://nocompulsoryvaccination.com'
url_next_page = '/page/'
#web request function
def make_reque... | rjshanahan/Vaccination-Social-Media | generic_forum_webscraper.py | generic_forum_webscraper.py | py | 3,517 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"li... |
37564289971 | import os
import warnings
import numpy as np
from scipy.signal import find_peaks
from scipy.interpolate import InterpolatedUnivariateSpline
import pandas as pd
from pyqcams import constants
def gaus(vp , vt, s=0.1):
''' Gaussian function used for Gaussian Binning of final vibrational states.
In... | Rkoost/PyQCAMS | pyqcams/util.py | util.py | py | 4,683 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "numpy.exp",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 24,
... |
32061921957 | from datetime import datetime
import pytest
from pytest_mock import MockerFixture
from recipes.models import ProductListItem, ProductListWeek, Recipe, RecipePlan, RecipePlanWeek
from telegram_bot.services import utils, telegram_handlers
from recipes.tests.factories import (
ProductListItemFactory,
ProductList... | djangoner/RecipeBase | telegram_bot/tests/test_telegram.py | test_telegram.py | py | 4,762 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "telegram_bot.services.utils.BOT_TOKEN",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "telegram_bot.services.utils",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "telegram_bot.services.utils.SITE_DOMAIN",
"line_number": 19,
"usag... |
37690690285 | import numpy as np
from .vehicle_pose import VehiclePose
from .waypoint import Waypoint
from typing import List, Union
import sys
import math
import time
from queue import PriorityQueue
from io import StringIO
MAX_FLOAT = sys.float_info.max - 10
DIR_TOP = 0
DIR_TOP_LEFT = 1
DIR_TOP_RIGHT = 2
DIR_LEFT = 3
DIR_RIGHT =... | out0/crawler-poc | planner/astar.py | astar.py | py | 8,784 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.float_info",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "waypoint.Waypoint",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "waypoint.Waypoint",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "waypoint.Wayp... |
15690350442 | from celery.schedules import crontab
import djcelery
djcelery.setup_loader()
BROKER_URL = 'redis://localhost:6379/0'
CELERY_RESULT_BACKEND = 'redis://localhost:6379/0'
CELERYBEAT_SCHEDULER = "djcelery.schedulers.DatabaseScheduler"
CELERY_DISABLE_RATE_LIMITS = False
CELERYBEAT_SCHEDULE = {
'delete-every-day': ... | lafaiDev/mini-blog | tweets/settings/celery_config.py | celery_config.py | py | 449 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "djcelery.setup_loader",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "celery.schedules.crontab",
"line_number": 17,
"usage_type": "call"
}
] |
71660047394 | #스택/큐
#올바른 괄호
from collections import deque
def solution(s):
answer = 0
que = deque(s)
while que:
k = que.popleft()
if answer == -1:
return False
if k == '(':
answer += 1
else:
answer -= 1
if answer == 0:
return Tru... | yabooung/study | 프로그래머스/파이썬/레벨2/올바른 괄호.py | 올바른 괄호.py | py | 369 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.deque",
"line_number": 6,
"usage_type": "call"
}
] |
3179744349 | from django.urls import path
from PrincipalApp import views
from django.contrib.auth.decorators import login_required
app_name = 'Merlin'
urlpatterns = [
path('', views.Index.as_view(), name='Index'),
path('ListCategoria/',views.ListCategoria.as_view(), name='ListCategoria'),
path('RegistrarCategoria/',views... | bsramosl/Merlin | PrincipalApp/urls.py | urls.py | py | 641 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "PrincipalApp.views.Index.as_view",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "PrincipalApp.views.Index",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_... |
41782618855 | import numpy as np
import argparse
import cv2
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required = True, help = "Path to the image")
args = vars(ap.parse_args())
image = cv2.imread(args["image"])
image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
cv2.imshow("Original", image)
lap = cv2.Laplacia... | heitorrapela/daily-studies | computer-vision/book_practical_python_and_opencv/chapter 10/10.1.py | 10.1.py | py | 417 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
... |
70828987235 | import tensorflow.python.eager.context
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Activation
from tensorflow.keras.utils import to_categorical
from tensorflow.keras.datasets import mnist
from sklearn.naive_bayes import MultinomialNB
from sklearn.metrics import confusion_ma... | CJW-MAPU/TIL | Python/First/mnist_deeplearning.py | mnist_deeplearning.py | py | 2,749 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "tensorflow.python.eager.context.device",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tensorflow.python.eager.context",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "tensorflow.keras.datasets.mnist.load_data",
"line_number": 13,
"us... |
71611531233 | #!/usr/bin/env python3
import operator
from functools import reduce
from pathlib import Path
def part1(contents):
visible_trees_counter = 0
grid = [[x for x in row] for row in contents.split("\n")]
n, m = len(grid), len(grid[0])
for i in range(n):
for j in range(m):
if i not in (0,... | delminskii/adventofcode2022 | day8/script.py | script.py | py | 2,664 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "functools.reduce",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "operator.mul",
"line_number": 76,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 83,
"usage_type": "call"
}
] |
21233407475 | import requests
from lxml import etree
if __name__ == '__main__':
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36'
}
url = 'https://anqiu.58.com/ershoufang/'
page_text = requests.get(url = url,headers = hea... | xiaomaozhaocai/python | pachong/05.requests实战之爬取药监局.py | 05.requests实战之爬取药监局.py | py | 411 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
}
] |
27218942710 | import datetime
import json
import os
import shutil
import sys
import time
from threading import Thread
import PyQt5
import selenium
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import Qt, QThread
from PyQt5.QtGui import QFont
# from selenium import webdriver
import web
# Login: glog... | Skayloo/SS | Start.py | Start.py | py | 16,869 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PyQt5.QtCore.QThread",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_numbe... |
10989798884 | import torch
from torch import nn
class CenterPivotConv4d(nn.Module):
"""
CenterPivot 4D conv
Args:
in_channels (`int`):
Number of input channels.
out_channels (`int`):
Number of output channels.
kernel_size (`list or tuple`):
Numbers for kernel... | towhee-io/towhee | towhee/models/layers/conv4d.py | conv4d.py | py | 3,550 | python | en | code | 2,843 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
35650658942 | from collections import namedtuple
import numpy as np
Experience = namedtuple('Experience', 'state action reward new_state game_over')
'''
A more efficient implementation of replay memory
to optimize for space.
This implementation of ReplayMemory was inspired by the following
sources:
- devsisters/DQN-tensorflow: ... | prabhatnagarajan/repro_dqn | dqn/replaybuffer.py | replaybuffer.py | py | 3,689 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "collections.namedtuple",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "numpy.empty",
... |
29316897925 | import jax
import tensorflow as tf
import numpy as np
from transformers import GPT2TokenizerFast
import itertools
class TFRecordLoader:
def __init__(self, index_fname, batch_size, parse_fn, map_fn=None, restore_state=None):
if restore_state is not None:
self.file_idx = restore_state["file_idx"... | Lisennlp/mesh_easy_jax | tfrecord_loader.py | tfrecord_loader.py | py | 8,299 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tensorflow.data.TFRecordDataset",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "tensorflow.data",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.data.experimental.dense_to_ragged_batch",
"line_number": 45,
"usage_type"... |
30689763711 | import argparse
import numpy as np
import torch
from torchtext.data import Iterator as BatchIter
import torch.nn.functional as F
from Beam import Beam
import causalchains.utils.data_utils as du
from causalchains.utils.data_utils import EOS_TOK, SOS_TOK, PAD_TOK
from causalchains.train.masked_cross_entropy import maske... | weberna/causalchains | causalchains/train/lm_generate.py | lm_generate.py | py | 24,410 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "causalchains.utils.data_utils.load_vocab",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "causalchains.utils.data_utils",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "causalchains.utils.data_utils.EOS_TOK",
"line_number": 22,
"usage_... |
15253117933 | r"""Preprocess code.org data into a form that we can handle."""
import os
import pickle
import getpass
import numpy as np
USER = getpass.getuser()
DATA_ROOT = '/mnt/fs5/{}/generative-grading/data/real/education/'.format(USER)
ZIPF_CLASS = {'head': 0, 'body': 1, 'tail': 2}
def load_data(problem_name):
problem_id... | malik-ali/generative-grading | src/rubricsampling/makeRawCodeOrgStudentData.py | makeRawCodeOrgStudentData.py | py | 3,221 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "getpass.getuser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_num... |
73004256993 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.conf.urls import url
from . import views
app_name = 'proyecto'
urlpatterns = [
# URL pattern for the UserListView
url(
regex=r'^$',
view=views.ProyectoListView.as_view(),
name='list'
),
... | danielstp/jaguares | proyecto/urls.py | urls.py | py | 883 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "django.conf.urls.url",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django... |
24125526099 | import os
from pathlib import Path
dir_ = os.path.abspath(os.curdir)
p = Path(f'{dir_}/text2/text3/text4/text5/text6')
p.mkdir(parents=True, exist_ok=True)
def rec():
for i in os.listdir():
if Path(i).is_file():
print('file-',i)
else:
print('dir-',i)
os.c... | RozhkovaDarya/Rozhkova_Darya_dz_7 | 2.py | 2.py | py | 544 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.abspath",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.curdir",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_num... |
71113924193 |
from django.urls import path, include
from my_plant_app.web.views import create_profile, show_index, details_profile, edit_profile, delete_profile, \
show_catalogue, create_plant, details_plant, edit_plant, delete_plant
urlpatterns = (
path('', show_index, name='show index'),
path('profile/', include([
... | GeorgiLukanov87/PythonWeb-Django-Framework | my_plant_app/my_plant_app/web/urls.py | urls.py | py | 883 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "my_plant_app.web.views.show_index",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "... |
28146672506 | #################################################################################
# Capstone Project - Career Study Advisor
# By: Kevin Elliott (ellkev004), Ryan Wong (wngrya001) and Zena Kelz (klzzen001)
# 21/07/2014 - 22/09/2014
# This document is for navigation throught the website
################################... | ryanwongsa/CareerStudyAdvisor | csa/advisor/urls.py | urls.py | py | 2,718 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "advisor.views.search",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name... |
33593223112 | import numpy as np
from scipy.optimize import curve_fit
def logistic_model(t,r,K):
return K/(1+(K/p0-1)*np.exp(-r*t))
N=int(input().strip())
populations=list(map(int,input().strip().split()))
T=int(input().strip())
years_to_predict=[int(input().strip())for _ in range(T)]
p0=populations[0]
t=np.arange(0,N)
initial_g... | MicroPlusone/SDU_mathmodeling_program | 山东大学 数学模型 程序汇总/人口增长的logistic模型.py | 人口增长的logistic模型.py | py | 599 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "numpy.exp",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "scipy.optimize.curve_fit",
"line_number": 12,
"usage_type": "call"
}
] |
11613445795 | import requests
import json
from bs4 import BeautifulSoup
import re
import nltk
nltk.download('stopwords')
from nltk.corpus import stopwords
# Everthing in one file
stop_words = stopwords.words('english')
def scrap_content(url):
page=requests.get(url)
page_content= page.text
content = BeautifulSoup(p... | Abdelrahman-Abuhelal/free-GPT | main.py | main.py | py | 3,284 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "nltk.download",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "reques... |
24012699516 | import aiopg
class DbSession(object):
engine = None
connection = None
cursor = None
status = None
def __init__(self, engine, *, transactional=True):
self.transactional = transactional
self.engine = engine
self.connection = None
self.status = 'new'
@property
... | eteamin/buzzle | buzzle/database/session.py | session.py | py | 3,033 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "aiopg.create_pool",
"line_number": 86,
"usage_type": "call"
}
] |
31109285277 | import argparse
from itertools import islice
import random
def run_martingale_simulation(initial_bankroll, initial_bet):
bankroll = initial_bankroll
bet = initial_bet
results = []
while bankroll > 0:
result = simulate_spin()
if result == 'win':
bankroll += bet
... | kevindowling/FreelancingExamples | RouletteSim/RouletteSimLocal/roulette.py | roulette.py | py | 7,100 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "random.randint",
"line_number": 131,
"usage_type": "call"
},
{
"api_name": "itertools.islice",
"line_number": 142,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 163,
"usage_type": "call"
}
] |
25896635456 | from datetime import datetime
import Player
class Result:
def __init__(self, date: datetime, place: int, player: Player, id: int = None):
self.id = id
self.date = date
self.place = place
self.player = player
| JChoptiany/Poker-Pro-League | Result.py | Result.py | py | 246 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "datetime.datetime",
"line_number": 6,
"usage_type": "name"
}
] |
16569111742 | """
The version of the package can be returned as a single string or a dict.
When a string, it comes from the package __version__.
When a dict, it also has __version__,
as well as versions of other depdency packages.
"""
from typing import Optional
import dls_mainiac_lib.version
import dls_servbase_lib.ve... | DiamondLightSource/soakdb3 | src/soakdb3_lib/version.py | version.py | py | 1,208 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "soakdb3_lib.__version__",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "dls_servbase_lib.version.version.meta",
"line_number": 37,
"usage_type": "call"
},
{
"api... |
21380838489 | import pygame, sys, math, random, time, Object
pygame.init()
width = 1000
height = 1000
size = width, height
fps = 60
bgColor = (83,174,232)
screen = pygame.display.set_mode(size)
icon = pygame.image.load('icon.png')
pygame.display.set_caption("Ball Demo")
pygame.display.set_icon(icon)
clock = pygame.t... | jtcnh/BallDemo | main.py | main.py | py | 1,030 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygame.init",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.l... |
12578144176 | """
Created on Tue Feb 28 11:44:11 2023.
@author: Vishal Philip
This script consists of functions for plotting line charts,
bar charts and pie charts using matplotlib library.
It also reads data from excel files using pandas.
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
... | vishalphilip1/MScDataScience | Assignment1/Visualisation.py | Visualisation.py | py | 3,898 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "mat... |
13853365576 | import requests
import json
import re
url = "http://www.juzimi.com/article/%E6%83%85%E4%B9%A6"
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36",
"Referer": "http://www.juzimi.com/search/node/%E5%82%B2%E6%85%A2%E4%B8%8E%E5... | youguanxinqing/Extract_Data | regex.py | regex.py | py | 1,513 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 32... |
19115387739 | import getChannelInfo
from flask import Flask, request, url_for, redirect, render_template
app = Flask(__name__)
@app.route("/", methods=["POST","GET"])
def home():
if request.method == "POST":
return redirect(url_for("results", youtubeUrl = request.form["url"].split('.com/')[-1]))
else:
retur... | luantorrex/youtube-insights | main.py | main.py | py | 1,293 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "flask.redirect",
... |
8092641902 | # Распознавание лиц с помощью нейронных сетей
# Необходимо установить следующие компоненты:
# pip install git+https://github.com/rcmalli/keras-vggface.git
# pip install mtcnn
# pip install keras-applications
# Заменить строку на from keras.utils.layer_utils import get_source_inputs
# В файле keras_vggface/models.py
fro... | eabuntov/poiist_lab | lab7.py | lab7.py | py | 2,763 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.imread",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "mtcnn.MTCNN",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "PIL.Image.from... |
21012757630 | import os
import lxml
import shutil
import requests as re
import astropy.units as u
from astroquery.vizier import Vizier
from astropy.io import fits
from astropy.coordinates import SkyCoord
from bs4 import BeautifulSoup
# Create the download file directory.
data_dir = os.path.expanduser('~/astro_data/')
... | Astrohackers-TW/IANCUPyData | iancupy_data/download_file.py | download_file.py | py | 3,869 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "os.path.expanduser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
15347359304 | import pickle
import torch
import os
from ood_samplefree.datasets import __DATASETS__, get_transform
from ood_samplefree.architectures import __ARCHITECTURES__, \
__ARCHITECTURES_224__
from ood_samplefree.experiments import OODStreamerWithSummaries
NUM_WORKER = 4
BATCH_SIZE = 256
def run(dataset, architecture, ... | jm-begon/ood_samplefree | experiments/main.py | main.py | py | 4,667 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "os.path.expanduser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.expanduser",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"lin... |
32793763181 | """create table vulnerabilities
Revision ID: 7c34e9a89bc0
Revises: b21ffaeed8e4
Create Date: 2016-06-29 10:11:36.057723
"""
# revision identifiers, used by Alembic.
revision = '7c34e9a89bc0'
down_revision = 'b21ffaeed8e4'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
import d... | asrozar/perception_ui | migrations/versions/7c34e9a89bc0_create_table_vulnerabilities.py | 7c34e9a89bc0_create_table_vulnerabilities.py | py | 1,357 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime.now",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "alembic.op.create_table",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "... |
1666799492 | '''Created on 2021-11-03
@author: Gabriel Bailey
This code will solve Burger's equation for a given equation using the leapfrog method. It will produce 4 graphs of the equation at different times, and also an animated graph over time if desired.
'''
# Started from laplace.py
from numpy import pi,zeros, sin,linspace
... | TheRajeshB/Labwork1 | Lab08/Lab08_Q3.py | Lab08_Q3.py | py | 2,622 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.pi",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "numpy.zeros",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_n... |
1421958380 | #!/usr/bin/env python #
# #
# Autor: Milena Crnogorcevic #
# Date created: 7/22/2019 ... | mcrnogor/LLE-ALPs | sensitivity/scripts/ALP_fit.py | ALP_fit.py | py | 2,626 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "xspec.Xset",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "xspec.Xset",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "numpy.logspace",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.log10",
"lin... |
25632547496 | from functools import reduce
from operator import concat
# ===================================================
# utils
# ===================================================
def select_keys(d: dict, ks: list) -> dict:
return {k: d[k] for k in ks if k in d}
# ===================================================
... | akotek/CDN | ex.py | ex.py | py | 1,271 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "functools.reduce",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "operator.concat",
"line_number": 33,
"usage_type": "argument"
}
] |
43903665021 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu May 16 13:29:10 2019
@author: phoebeharmon
"""
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu May 9 14:10:19 2019
@author: phoebeharmon
"""
import speech_recognition as sr
print(sr.__version__)
#Recognizer instance recongizes spe... | phoebeharmon/chat_server | speechRecPractice.py | speechRecPractice.py | py | 1,529 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "speech_recognition.__version__",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "speech_recognition.Recognizer",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "speech_recognition.AudioFile",
"line_number": 30,
"usage_type": "call"
... |
12171273789 | import rclpy
from rclpy.node import Node
from sensor_msgs.msg import Image
import cv2
from cv_bridge import CvBridge
class CameraSubscriber(Node):
def __init__(self):
super().__init__("camera_subscriber")
self.create_subscription(Image, "/wamv/sensors/cameras/front_left_camera_sensor/optical/image_... | Wavefire5201/boat_ctrl | boat_ctrl/camera.py | camera.py | py | 754 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "rclpy.node.Node",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "sensor_msgs.msg.Image",
"line_number": 10,
"usage_type": "argument"
},
{
"api_name": "sensor_msgs.msg.Image",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "cv_bri... |
43199603252 | from itertools import compress
import numpy as np
from .object_intersect import partition, get_ob_2dbboxes, get_vert_co_2d, get_ob_loc_co_2d, do_selection
from .polygon_tests import point_inside_rectangles, points_inside_rectangle, segments_intersect_rectangle
def get_obs_mask_in_selbox(obs, obs_mask_check, depsgra... | AtixCG/Universal-3D-Shortcuts | Blender/With Addons/scripts/addons/space_view3d_xray_selection_tools/functions/object_intersect_box.py | object_intersect_box.py | py | 3,688 | python | en | code | 38 | github-code | 1 | [
{
"api_name": "itertools.compress",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "object_intersect.get_vert_co_2d",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "polygon_tests.points_inside_rectangle",
"line_number": 17,
"usage_type": "call"
},
... |
4997054465 | #!/usr/bin/env python3
import os
import random
import signal
import socket
import struct
import sys
import threading
import time
from datetime import datetime
from datetime import timedelta
Z = 2
W = 3
X = 3
T = 1
M = 3
# Packet_type
REG_REQ = 0xa0
REG_ACK = 0xa1
REG_NACK = 0xa2
REG_REJ = 0xa3
REG_INFO = 0xa4
INFO_A... | marioferro2002/XARXES-prac1 | server.py | server.py | py | 35,024 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "socket.socket",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 93,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_DGRAM",
"line_number": 93,
"usage_type": "attribute"
},
{
"api_name": "socket.socke... |
8882625049 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('webapp', '0009_auto_20141216_0118'),
]
operations = [
migrations.AlterField(
model_name='openinghours',
... | IvanCaceres/drunken-octo-spice | appointments/webapp/migrations/0010_auto_20141216_0119.py | 0010_auto_20141216_0119.py | py | 702 | 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"
},
{... |
1633435425 | #!/usr/bin/env python3
'''
Perform classification of a corpus using CountVectorizer.
Displays the metrics from the classification.
'''
import codecs as cs
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.naive_bayes import MultinomialNB
from sklearn import cross_validation
from sklearn import m... | dumoulma/fic-prototype | MeasureTF.py | MeasureTF.py | py | 2,326 | python | en | code | 10 | github-code | 1 | [
{
"api_name": "sklearn.datasets.load_files",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_extraction.text.CountVectorizer",
"line_number": 25,
"usage_type": "call"
},
... |
36626195418 | import requests
def get_and_filter_data(api_url, filter_params):
response = requests.get(api_url)
if response.status_code == 200:
data = response.json()
filtered_data = [item for item in data if all(item.get(key) == value for key, value in filter_params.items())]
return filtered_data... | Prosik2205/Python | main.PY | main.PY | py | 645 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 4,
"usage_type": "call"
}
] |
3978233106 | # -*- coding: utf-8 -*-
""" Class to store Units and perform conversion
This script requires that `logging` be installed within the Python
environment you are running this script in.
"""
import logging
import json
from os import path
import logging.config
class Unit:
"""It represents the physical un... | Praveenstein/Intern_Assignment | Q1/Q1_unit_2_dicConfig.py | Q1_unit_2_dicConfig.py | py | 3,305 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.load",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "logging.config.dictConfig",
"line_number": 94,
"usage_type": "call"
},
{
"api_name": "logging.config",
"line_number": 94,
"usage_type": "attribute"
},
{
"api_name": "logging.getLo... |
5410486029 | from copy import deepcopy
import requests
from c2corg_api.legacy.converter import convert_from_legacy_doc, convert_to_legacy_doc
from c2corg_api.schemas import schema_validator
def test_converter(document_id, document_type):
legacy_doc = requests.get(f"https://api.camptocamp.org/{document_type}s/{document_id}", ... | c2corg/c2c_api-poc | migrations/test_converter.py | test_converter.py | py | 1,457 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "c2corg_api.legacy.converter.convert_from_legacy_doc",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 11,
"usage_type": "call"
},
{
"api... |
33627617622 |
from math import fabs
from platform import platform
from tkinter.tix import Tree
import pygame
import os
import random
import time
class Setting:
window_width = 750
window_height = 900
frames = 60
path_file = os.path.dirname(os.path.abspath(__file__))
image_path = os.path.join(path_file, "Images"... | ElRashoMacuin/JumperGame | jump.py | jump.py | py | 22,760 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line... |
31764970088 | def COOKEweights(SQ_array, TQ_array, realization, alpha, background_measure,
overshoot, cal_power):
"""Compute the weights with Cooke formulation
Parameters
----------
SQ_array : numpy array
Array with answers to seed questions
TQ_array : numpy array
Array with answ... | demichie/elicipy | COOKEweights.py | COOKEweights.py | py | 9,208 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.zeros",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": ... |
25159626748 | import os
from unidecode import unidecode
from pathlib import Path
import argparse
import re
parser = argparse.ArgumentParser()
parser.add_argument("--path", type=str, required=True)
parser.add_argument("--remove_accent", type=bool, required=False, default=True)
parser.add_argument("--lower", type=bool, required=False... | eugeniothiago/file-name-padronizer | file_padronizer.py | file_padronizer.py | py | 3,190 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"li... |
73001660513 | import sys
sys.path.insert(1, 'C:\\Users\\upcnet\\Repositoris\\neuroimatge\\nonlinear2')
sys.path.insert(1, '/Users/acasamitjana/Repositories/neuroimatge/nonlinear2')
from Fitters.GAM import GAM, SmootherSet, SplinesSmoother
import numpy as np
import numpy.random as R
# import matplotlib
# matplotlib.use('GTKAgg')
imp... | imatge-upc/VNeAT | scripts/legacy/GAM/testGAM_splinesSmoother.py | testGAM_splinesSmoother.py | py | 2,588 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "sys.path.insert",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "sys.path.insert",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_numbe... |
20330162062 | import scipy.stats
import numpy as np
class UniformDist:
def __init__(self, xmax=1., xmin=None):
self.xmax = xmax
self.xmin = - xmax if xmin is None else xmin
self.prob = 1 / (self.xmax - self.xmin)
def __call__(self, *args, **kwargs):
return self.prob
def __str__(self):
... | uidilr/bayesian_irl | src/utils/prob_dists.py | prob_dists.py | py | 2,191 | python | en | code | 14 | github-code | 1 | [
{
"api_name": "numpy.exp",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "scipy.stats.stats",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "scipy.stats",
"line_nu... |
21918886906 | ''' Define the Layers '''
import torch.nn as nn
import torch.nn.functional as F
from Attention import MultiHeadAttention
class PositionwiseFeedForward(nn.Module):
''' A two-feed-forward-layer module '''
def __init__(self, d_in, d_hid, dropout=0.1):
super().__init__()
self.w_1 = nn.Conv1d(d_in,... | dodohow1011/waveglow_2 | SubLayer.py | SubLayer.py | py | 2,034 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv1d",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
23910040963 | #!/user/bin/env python3
# Note that all the tests in this module require dataset (either network access or cached)
import os
import glob
import shutil
import torchtext.data as data
from torchtext.datasets import AG_NEWS
import torch
from ..common.torchtext_test_case import TorchtextTestCase
def conditional_remove(f):... | MauiDesign/PyTorchText | test/data/test_builtin_datasets.py | test_builtin_datasets.py | py | 14,783 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "glob.glob",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.remove",
"line_number": ... |
34872369398 | from flask import Flask, request
import json
app = Flask(__name__)
@app.route('/motion-data', methods=['POST'])
def motion_data():
data = json.loads(request.data)
# Do something with the motion data (e.g., store it in a database)
return 'Motion data received'
if __name__ == '__main__':
app.run(host='... | strikerPro818/strikerBot | Xavier_NX/mobileSelectTrack/appMotion.py | appMotion.py | py | 348 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.request.data",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line... |
30706837147 | from functools import lru_cache
from ScienceDynamics.config.log_config import logger
class PapersFetcher(object):
def __init__(self, db_client, db_name="journals", papers_collection="papers_features",
papers_join_collection="aminer_mag_papers"):
self._db = db_client[db_name]
self.... | data4goodlab/ScienceDynamics | ScienceDynamics/fetchers/papers_fetcher.py | papers_fetcher.py | py | 1,514 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "functools.lru_cache",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "ScienceDynamics.config.log_config.logger.debug",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "ScienceDynamics.config.log_config.logger",
"line_number": 29,
"usage_t... |
39761293672 | # -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans, DBSCAN
from sklearn import metrics
from sklearn.datasets import make_blobs
from scipy.spatial import Voronoi
# Aquí tenemos definido el sistema X de 1000 elementos de dos estados
# construido a p... | peinadoginesd/clustering | clustering.py | clustering.py | py | 10,811 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "sklearn.datasets.make_blobs",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "... |
28081058204 | from django.shortcuts import render
from django.shortcuts import get_object_or_404
# Create your views here.
from django.http import HttpResponse
from .models import Site, Value
def index(request):
listSites = Site.objects.all()
context = {'listaSites' : listSites}
return render(request, 'index.html', cont... | bunnis/MWSite1 | MW/views.py | views.py | py | 2,106 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "models.Site.objects.all",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "models.Site.objects",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "models.Site",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.shor... |
70324000673 | import argparse
import multiprocessing
import shlex
import fim
import pandas as pd
import export
import outlier
import preprocess
##############################################################################
# DATA LOADING AND PRE-PROCESSING
def load_metrics(file_in, min_var, min_corr, scaling):
# load data ... | bittremieux/qc_analysis | qc_analysis.py | qc_analysis.py | py | 6,497 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "preprocess.load_metrics",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "preprocess.preprocess",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "outlier.d... |
27528723023 | #!/usr/bin/python3
import argparse
import json
import time
import cv2
import numpy as np
# dictionary with ranges
ranges_pcss = {"b": {"min": 100, "max": 256},
"g": {"min": 100, "max": 256},
"r": {"min": 100, "max": 256},
}
def main():
"""
INITIALIZE -----------... | JorgeFernandes-Git/PSR_AULAS_2021 | openCV/video_capture/ar_paint_v1/ar_paint.py | ar_paint.py | py | 9,828 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line... |
291709158 | #!/usr/bin/python3
import argparse
import string
import random
from pwn import *
import subprocess
import requests
import netifaces
import sys
import json
import hashlib
from urllib.parse import urlencode
webserver_port = 9001
proxies = {"http": "http://127.0.0.1:8080"}
class dompdf_rce:
def __init__(self, dompd... | dugisan3rd/exploit | dompdf v1.2.1 RCE (CVE-2022-28368)/dompdf-rce.py | dompdf-rce.py | py | 4,780 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "random.choice",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "string.ascii_lowercase",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "urllib.parse.url... |
12889344897 | import numpy as np
import random
from scipy.stats import norm
from scipy.special import expit as sigmoid
class BBVI(object):
def __init__(self,trainSource,testSource,featureDim,
maxIteration,batchSize,sampleSize,stepScale,startPara,
dataAccessing='RA',interval=100,testSampleNum=200):
self._maxitera... | allenzhangzju/Black_Box_Variational_Inference | bayesian_logistic_regression_for_a9a/class_BBVI.py | class_BBVI.py | py | 7,041 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "numpy.array",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": ... |
29991270161 | # **************************************************************************
# *
# * Authors: Grigory Sharov (gsharov@mrc-lmb.cam.ac.uk)
# *
# * MRC Laboratory of Molecular Biology (MRC-LMB)
# *
# * This program is free software; you can redistribute it and/or modify
# * it under the terms of the GNU General Public... | scipion-em/scipion-em-relion | relion/protocols/protocol_create_mask3d.py | protocol_create_mask3d.py | py | 9,433 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "enum.Enum",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "pwem.objects.VolumeMask",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "pwem.protocols.ProtCreateMask3D",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "pyw... |
6232972354 | import uuid
from datetime import datetime
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from core.models import Reading, Customer, Device
class TestReadingView(APITestCase):
def setUp(self):
self.url = reverse('reading')
def test_send_... | FadyAlfred/envio-challenge | core/tests.py | tests.py | py | 2,020 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "rest_framework.test.APITestCase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.urls.reverse",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "uuid.u... |
12238117511 | from dataclasses import dataclass
import datetime
from typing import List, NamedTuple, Tuple
import json
from copy import deepcopy
from event import Event, Location, Timeframe
from mapsy import timeDistance
@dataclass
class Task:
id: int
begin: datetime.datetime
end: datetime.datetime
dur: datetime.t... | swiftplan-winhacks/swiftplan | planner.py | planner.py | py | 7,527 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "datetime.timedelta",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": ... |
12394194085 | from aiohttp import web
from asyncpg.exceptions import UniqueViolationError
from . import permissions
from .dataaccess import environmentda
from . import auditing
async def get_envs(request):
env_list = await environmentda.get_envs()
envs = {'envs': [{'name': e} for e in env_list]}
return web.json_respo... | dvnrsn/toggle-meister | tmeister/environments.py | environments.py | py | 1,443 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "dataaccess.environmentda.get_envs",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "dataaccess.environmentda",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "aiohttp.web.json_response",
"line_number": 13,
"usage_type": "call"
},
{
... |
2309219912 | import numpy as np
from PIL import Image, ImageDraw, ImageFilter
import streamlit as st
# 何個作るか聞く
num_trials = st.slider('何個試作しますか?',0,10,0)
button = st.button('上記の設定で試作')
# 画像を後で入れる空のリスト
imgs = []
# URLを下になる画像から順に入れる
urls = ['base.png', 'field.jpg', 'yattazeyossya.png', 'Splatoon2logo.png',
'decorators-12... | auto-autumn/streamlit-thumbnails | AutoThumbnailStreamlit.py | AutoThumbnailStreamlit.py | py | 2,311 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "streamlit.slider",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "streamlit.button",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_... |
8249415108 | from twisted.web import server
from .base import BaseResource
class DataResource(BaseResource):
def __init__(self, dataserver):
self.dataserver = dataserver
BaseResource.__init__(self)
def render(self, request):
request.setHeader('Content-type', 'text/javascript; charset=UTF-... | wehriam/awspider | awspider/resources/data.py | data.py | py | 1,226 | python | en | code | 19 | github-code | 1 | [
{
"api_name": "base.BaseResource",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "base.BaseResource.__init__",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "base.BaseResource",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "twisted.w... |
22932495045 | #!/usr/bin/env python3
from decimal import Decimal
import argparse
import json
from robinhood.RobinhoodCachedClient import RobinhoodCachedClient, FORCE_LIVE
from robinhood.util import ORDER_TYPES, ORDER_SIDES
# Set up the client
client = RobinhoodCachedClient()
client.login()
def place_order(order_type, order_side... | mstrum/robinhood-python | order_crypto.py | order_crypto.py | py | 2,376 | python | en | code | 102 | github-code | 1 | [
{
"api_name": "robinhood.RobinhoodCachedClient.RobinhoodCachedClient",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "decimal.Decimal",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "decimal.Decimal",
"line_number": 27,
"usage_type": "call"
},
{
... |
6148137744 | """
Module to train the decision tree model.
"""
import logging
import typing
import pickle
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeClassifier
logger = logging.getLogger(__name__)
def train_test_split_data(data:pd.DataFrame, target_col:str, test... | jiahaolo/Hotel_Booking_Prediction_Web_App | src/train.py | train.py | py | 6,610 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "sklearn... |
9898261445 | # Django imports.
from django.db import models
__author__ = 'Jason Parent'
class Task(models.Model):
PENDING = 'PENDING'
SUCCESS = 'SUCCESS'
FAILURE = 'FAILURE'
STATUS_CHOICES = (
(PENDING, PENDING),
(SUCCESS, SUCCESS),
(FAILURE, FAILURE),
)
objects = models.Manager... | JasonParentEAB/channeler | channeler/tasks/models.py | models.py | py | 557 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "django.db.models.Model",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.models.Manager",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "d... |
22813435642 | import numpy as np
import cv2
import os
from cv2 import dnn
def ColorizeImage(sourceImg, save):
if(os.path.exists(sourceImg) == False):
return
proto_file = 'Model\colorization_deploy_v2.prototxt'
model_file = 'Model\colorization_release_v2.caffemodel'
hull_pts = 'Model\pts_in_hull.npy'
# R... | OguzkanK/Image-Colorizer | ColorizeImage.py | ColorizeImage.py | py | 2,370 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.exists",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.dnn.readNetFromCaffe",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.dnn",
"lin... |
13043906918 | import pytest
from iotile.core.exceptions import ArgumentError
from iotile.sg.model import DeviceModel
from iotile.sg.sensor_log import SensorLog
from iotile.sg.exceptions import StorageFullError, UnresolvedIdentifierError
from iotile.sg.engine import InMemoryStorageEngine
from iotile.sg import DataStreamSelector, Dat... | iotile/coretools | iotilesensorgraph/test/test_sensorlog.py | test_sensorlog.py | py | 12,526 | python | en | code | 14 | github-code | 1 | [
{
"api_name": "iotile.sg.model.DeviceModel",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "iotile.sg.sensor_log.SensorLog",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "iotile.sg.DataStreamSelector.FromString",
"line_number": 18,
"usage_type": "ca... |
62125632 | import numpy as np
import matplotlib.pyplot as plt
def pie_charts(sizes,title):
#adjust the size of figure
plt.figure(figsize=(6,9))
#define label
labels = ['0-17 years','18-64 years','65+ years']
colors = ['yellow','lightskyblue','yellowgreen']
#The larger the value is, the larger the ga... | ShikaZzz/disease-outbreak | scripts/h1n1_piecharts.py | h1n1_piecharts.py | py | 1,303 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.pie",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplo... |
412533190 | import os
import pytest
from pandas.api.types import is_string_dtype # type: ignore
from dae.variants.attributes import Role
from dae.pedigrees.families_data import FamiliesData
from dae.pedigrees.loader import FamiliesLoader
@pytest.mark.parametrize(
"pedigree",
[
("pedigree_A.ped"),
("ped... | iossifovlab/gpf | dae/dae/pedigrees/tests/test_families_loader.py | test_families_loader.py | py | 4,050 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "os.path.exists",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "dae.pedigrees.loader.FamiliesLoader",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pytes... |
8617676101 | import torch
from transformers import BertTokenizer, BertModel
import pandas as pd
import logging
dataset = pd.read_csv('tokenized_data_without_punctuation_stopwords_lemma.csv')
dataset = dataset[:1000]
dataset = dataset['text'].astype(str).tolist()
# Set log level to ERROR to suppress warning messages
logging.getLog... | nazlicaneroglu/NLP-Project | bertembedding.py | bertembedding.py | py | 1,073 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.ERROR",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "transformers.Bert... |
74537810272 | import os
import shlex
import shutil
import sys
from pathlib import Path
from subprocess import check_call
from typing import Callable, Dict, List, Union
from pytest import fixture, skip
FILES_PATH = Path(__file__).parent / "files"
def call(cmd: Union[str, List[str]], cwd: Union[str, Path, None] = None) -> int:
... | jupyterlab/jupyterlab-git | jupyterlab_git/tests/conftest.py | conftest.py | py | 2,898 | python | en | code | 1,327 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number... |
71460302755 | import os
import json
def get_fields_names(fdf_file):
with open(fdf_file, "r") as f:
content = f.read()
field_names = []
start = 0
offset = len("/T (")
while not content.find("/T", start) == -1:
field_start = content.find("/T", start)
field_end = content.find(")", fie... | kai-pinckard/pdf-tools | field_value_mapping.py | field_value_mapping.py | py | 6,863 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.system",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "os.remove",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 81,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.