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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
14665193133 | from importers import CSVImportCommand
import requests
import click
class BroadbandImportCommand(CSVImportCommand):
def clean_column(self, column):
clean = column.replace('<', '').replace('N/A', '')
if clean == '':
return '0'
else:
return clean
def process_ro... | alphagov/land-availability-import | import_broadbands.py | import_broadbands.py | py | 1,730 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "importers.CSVImportCommand",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "requests.post",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "click.command",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "click.argument"... |
13638178027 | """project-specific settings"""
import yaml
import os.path
from mod import log, util, config
#-------------------------------------------------------------------------------
def load(proj_dir) :
"""load the .fips-settings.yml file from project directory
:param proj_dir: absolute project directory
:re... | XoDeR/RE | Src/Third/fips/mod/settings.py | settings.py | py | 3,399 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "os.path.path.isfile",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "yaml.load",
"line_n... |
32685815226 | import cv2
import random
import math
from imgTools import *
#trouve la meilleurs harmonisation et effectue la modification de l'image
def findBestHarmonieCompl(histoHSV, imgHSV, verbose = True):
#le mode correspond a un p
#mode = couleur, occurance
mode = (0,0)
ite = 0
for key, value in histoHSV.... | Kyrial/Projet-M2-Image-Harmonisation-des-couleurs | Sources/complementaire.py | complementaire.py | py | 2,557 | python | fr | code | 1 | github-code | 7 | [
{
"api_name": "cv2.imread",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2HSV",
"line_number": 63,
"usage_type": "attribute"
},
{
"api_name": "cv2.cvtColor",
"li... |
33545525866 | from libmodel import simple_autoPrelu
from torchvision import transforms,datasets
from torch.optim import Optimizer
import numpy as np
import torch
from pytorch_msssim import *
import os
from libcustomDataset import ImageFolderWithPaths
class CyclicLR(object):
"""
optimizer (Optimizer): Wrapped op... | eric-tc/testCython | python/libtrain.py | libtrain.py | py | 9,192 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.optim.Optimizer",
"line_number": 69,
"usage_type": "argument"
},
{
"api_name": "numpy.floor",
"line_number": 156,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 157,
"usage_type": "call"
},
{
"api_name": "numpy.maximum",
... |
42431069158 | import bpy
from bpy.props import BoolProperty
bl_info = {
"name": "protected_delete_addon",
"author": "1C0D",
"version": (0, 0, 1),
"blender": (2, 80, 0),
"location": "View3D",
"description": "protect from deleting with a pp in properties panel >object>visibility",
"category": "Ob... | 1C0D/protected_delete_Addon-Blender | protected_delete_addon.py | protected_delete_addon.py | py | 3,104 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "bpy.types",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "bpy.props.BoolProperty",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bpy.types",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "bpy.context.copy... |
22784549398 | # -*- coding: utf-8 -*-
import cchardet as chardet
class Encoding(object):
def detectecEncoding(self, text):
unicod = text
detected = cchardet.detect(text)
@staticmethod
def clean(text):
encoding = detectecEncoding(text)
if (encoding != 'utf-8'):
text = text.e... | ndious/imppy | Encoding.py | Encoding.py | py | 354 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "cchardet.detect",
"line_number": 9,
"usage_type": "call"
}
] |
26684242393 | from flask import Flask, render_template, request, redirect, url_for
app = Flask(__name__)
# Store form data
form_data = []
@app.route('/', methods=['GET', 'POST'])
def onboarding_form():
global form_data
if request.method == 'POST':
form_data.append(request.form.to_dict())
retu... | ChrisChu2229/sellerOnboardForm | app.py | app.py | py | 636 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "flask.request.form... |
30638690256 | from django.shortcuts import render
def homepage_view(request):
return render(request, 'homepage.html', {
'title': 'Django Ecommerce',
'services': [{
'name': 'Happy clients',
'value': '1000+',
}, {
'name': 'Available products',
'value': '2000... | mihaitzzza/nt-06-python | web-ecommerce-app/ecommerce/views.py | views.py | py | 414 | python | ta | code | 3 | github-code | 7 | [
{
"api_name": "django.shortcuts.render",
"line_number": 5,
"usage_type": "call"
}
] |
2878788806 | import os
import sqlite3
from random import choice
from string import ascii_letters, digits
from datetime import datetime
from dotenv import load_dotenv
load_dotenv()
database_file = os.getenv('database')
def current_time():
return datetime.now().strftime('%d/%m/%Y %H:%M:%S')
def random_id():
return ''.joi... | meesvw/shin | database.py | database.py | py | 4,356 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
... |
14196207915 | # from pudb import set_trace; set_trace()
from typing import List, Set, Tuple
from itertools import product, chain
from collections import Counter, combinations
class Solution1:
def subsetsWithDup(self, nums: List[int]) -> List[List[int]]:
"""LeetCode 90
This is a cheating method. We basically us... | FanchenBao/leetcode | 2021_08_challenge/08_03_2021.py | 08_03_2021.py | py | 3,261 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "collections.combinations",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "typing.Set",
"lin... |
35915959245 | from pages.comparisonPage.comparison_page import ComparisonPage
from utilities.status import Status
import unittest
import pytest
from ddt import ddt, data, unpack
from utilities.read_data import getCSVData
@pytest.mark.usefixtures("oneTimeSetUp", "setUp")
class ComparisonTests(unittest.TestCase):
@pytest.fixture... | joselitan/selenium-python-framework | tests/comparisonTest/comparison_test.py | comparison_test.py | py | 2,120 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pages.comparisonPage.comparison_page.ComparisonPage",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "utilities.status.Status",
"line_number": 14,
"usage_type": "cal... |
18082235622 |
from .models import *
from .forms import *
from django.shortcuts import render, get_object_or_404, redirect
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
@login_required
def account_redirect(request):
return redirect('account-landing', pk=request.user.pk, name=requ... | Mkane1977/redditclone | RedditClone/reddit/views.py | views.py | py | 2,921 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.shortcuts.redirect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.decorators.login_required",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render",
"line_number": 15,
"usage_type": "call"
... |
73787840863 | # -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import logging
import datetime as dt
from src.utils.utils import Rsummary
from unidecode import unidecode
from pathlib import Path
# global variable
regions = ["national", "auvergne_rhone_alpes", "bourgogne_franche_comte", "bretagne", "centre_val... | NathanDoumeche/Mobility_data_assimilation | 1-Data_generation/src/process_rte_raw_datas.py | process_rte_raw_datas.py | py | 7,138 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "unidecode.unidecode",... |
36621809715 | from typing import List, Tuple
def weighted_interval_scheduling(jobs: List[Tuple[int, int, int]]) -> int:
# sort jobs by finish time
jobs.sort(key=lambda x: x[1])
n = len(jobs)
dp = [0] * n
dp[0] = jobs[0][2]
for i in range(1, n):
# find the latest job that doesn't conflict with the c... | ShaoyiLu/CS577 | DynamicProgramming/P04.py | P04.py | py | 889 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 3,
"usage_type": "name"
}
] |
74854023901 | import os
from flask import Flask, Blueprint, jsonify, request, render_template, redirect, url_for, flash, jsonify
from flask.ext.sqlalchemy import SQLAlchemy
root = os.path.abspath(os.path.dirname(__file__))
abt = Blueprint('abt', __name__,
template_folder=os.path.join(root, 'templates'),
static_folder=os.pat... | arjunpur/ABTester | flask_abtester/views.py | views.py | py | 2,023 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.abspath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.Blueprint",
"line... |
10537958466 | from datetime import datetime
from datetime import timedelta
from celery.schedules import crontab
from IGitt.Interfaces.Actions import MergeRequestActions
from IGitt.Interfaces.MergeRequest import MergeRequest, MergeRequestStates
from IGitt.Interfaces.Repository import Repository
from gitmate.utils import lock_igitt_o... | GitMateIO/gitmate-2 | plugins/gitmate_pr_stale_reminder/responders.py | responders.py | py | 2,009 | python | en | code | 6 | github-code | 7 | [
{
"api_name": "IGitt.Interfaces.Repository.Repository",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 23,
"usage_type": "name"
},
{
"ap... |
14199465505 | # from pudb import set_trace; set_trace()
from typing import List
import math
class Solution:
def findMaxFish(self, grid: List[List[int]]) -> int:
"""This is equivalent to find all the cliques and compute the
total sum of the nodes. Then find the largest sum among the cliques.
O(MN), 262 ... | FanchenBao/leetcode | LeetCode_2658.py | LeetCode_2658.py | py | 1,196 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 7,
"usage_type": "name"
}
] |
20348641326 | # -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
from termcolor import colored
def make_the_soup(filename):
"""Read an xml document and return its content as a bs4 object
:param filename: filename
:return: content of the document or False
:rtype: bs4.BeautifulSoup or boolean
"""
# Parsin... | TimeUs-ANR/LSE-OD2M | structure_extraction/io/io.py | io.py | py | 1,992 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "termcolor.colored",
"line_number": 23,
"usage_type": "call"
}
] |
25585987940 | import logging
import os
from datetime import timedelta
from hashlib import md5
from mimetypes import guess_extension
from urllib.parse import quote, unquote_plus
from django.conf import settings
from django.utils import timezone
from .browser import RequestBrowser
from .html_asset import HTMLAsset
from .url import ... | biolds/sosse | se/html_cache.py | html_cache.py | py | 6,949 | python | en | code | 13 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.statvfs",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.SOSSE_HTML_SNAPSHOT_DIR",
"line_number": 26,
"usage_type": "attribute"
},
{
"ap... |
28072613265 | import psycopg2
import time
import sys
import stomp
import threading
import datetime
from commons import RandomUtils
from db_tools.postgresql import PG_Client
def readNewMessageFile():
tag_info = PG_Client.query('select i_id from tag_info ORDER BY RANDOM() LIMIT 1 ', None);
print(' rows : ', tag_i... | zhuangjiesen/python_tools | dragsun_test_tools/main_test/egms/egms_tkl.py | egms_tkl.py | py | 3,932 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "db_tools.postgresql.PG_Client.query",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "db_tools.postgresql.PG_Client",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "db_tools.postgresql.PG_Client.query",
"line_number": 28,
"usage_type": ... |
4393438887 | from django.test import TestCase, RequestFactory
from django.urls import reverse
from continuing_education.api.serializers.address import AddressSerializer, AddressPostSerializer
from continuing_education.tests.factories.address import AddressFactory
from reference.tests.factories.country import CountryFactory
class... | uclouvain/osis-continuing-education | tests/api/serializers/test_address.py | test_address.py | py | 1,821 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "django.test.TestCase",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "reference.tests.factories.country.CountryFactory",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "continuing_education.tests.factories.address.AddressFactory",
"line_numb... |
27334719220 | import argparse
import os
import csv
from glob import glob
import codecs
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Create normlized text files for each audio file in mailabs datasets.",
formatter_class=argparse.ArgumentDefaultsHelpFormatter
)
parser.add_argument("--datasets_r... | AntonieV/voice_cloning | mailab_normalize_text.py | mailab_normalize_text.py | py | 3,595 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentDefaultsHelpFormatter",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 24,
"usage_type": "call"
},
{
"a... |
6132171651 | from random import choice, random, randrange
from functools import reduce
import svgwrite as svg
import time
import numpy as np
from itertools import product
from copy import copy
from random import random
from math import acos, sqrt, pi, cos, sin
import shapely.geometry as geom
import shapely.affinity as aff
import b... | charlieb/flowers | petals.py | petals.py | py | 12,858 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "random.random",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_n... |
74027669662 | import array
import random
import math
import pyglet
from .resources import get_image, TILE_WIDTH, HALF_FONT_INFO
from .util import pushed_matrix, UP, DOWN, LEFT, RIGHT
from .caterpillar import Caterpillar
from .coccoon import Cocoon
from .level import load_level_to_grid
from . import tiles
SPEED = 2
class Grid:
... | encukou/caterpillar-game | caterpillar_game/grid.py | grid.py | py | 10,880 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "pyglet.graphics.Batch",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pyglet.graphics",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "pyglet.graphics.Batch",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pygl... |
16379228907 | from rest_framework import serializers
from ...leeway.models import LeewaySimulation
class LeewaySimulationSerializer(serializers.ModelSerializer):
"""
Serializer for the Leeway Simulations. Inherits from
`serializers.ModelSerializer`.
"""
#: Show username instead of id
username = serializer... | digitalfabrik/opendrift-leeway-webgui | opendrift_leeway_webgui/api/v1/serializers.py | serializers.py | py | 945 | python | en | code | 8 | github-code | 7 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.ReadOnlyField",
"line_number": 13,
"u... |
70153653342 | from discord.ext.commands import Bot, Cog, Context, command
from games.roles import simple
class GameRoleCog(Cog):
@command(aliases=["sr"])
async def show_role(self, ctx: Context, player_count: int) -> None:
"""役職一覧を表示(引数:プレイ人数)"""
send_message: str = f"{player_count}人プレイ役職:\n"
... | eda3/werewolf | src/cogs/game_role_cog.py | game_role_cog.py | py | 561 | python | en | code | 4 | github-code | 7 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "discord.ext.commands.Context",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "games.roles.simple",
"line_number": 11,
"usage_type": "name"
},
{
"api_name":... |
39126681232 | from elasticsearch import Elasticsearch
import requests
import tarfile
# On Windows/Ubuntu try to download the elasticsearch application and run it as a service
# elastic search instance has to be running on the machine. Default port is 9200.
# Call the Elastic Search instance
# Download the client library using pip f... | kpburgula/nlp_code_snippets | search_engine/run_this.py | run_this.py | py | 2,914 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "elasticsearch.Elasticsearch",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "tarfile.open",
"line_number": 32,
"usage_type": "call"
}
] |
14009594549 |
import glob
import torch
from PIL import Image
class ImageDataset(torch.utils.data.Dataset):
def __init__(self, root_dir, transform=None, mode='trainA'):
self.transform = transform
self.image_paths = glob.glob(root_dir + f'{mode}/*')
def __len__(self):
return len(self.image_paths)
... | shjo-april/PyTorch_Tutorials | 8. Image Generation/8.4. CycleGAN/core/dataset.py | dataset.py | py | 924 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.utils",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "glob.glob",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number... |
33212635674 | import numpy as np
import scipy.sparse as sp
from discretize.tests import check_derivative
from .maps import IdentityMap
from .props import BaseSimPEG
from .utils import timeIt, Zero, Identity
__all__ = ["BaseObjectiveFunction", "ComboObjectiveFunction", "L2ObjectiveFunction"]
class BaseObjectiveFunction(BaseSimPE... | simpeg/simpeg | SimPEG/objective_function.py | objective_function.py | py | 17,611 | python | en | code | 438 | github-code | 7 | [
{
"api_name": "props.BaseSimPEG",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "maps.IdentityMap",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "utils.timeIt",
"line_number": 95,
"usage_type": "name"
},
{
"api_name": "utils.timeIt",
"li... |
15137393097 | """Unit tests for the viewdata module."""
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
import os
import sys
import time
import tempfile
import numpy as np
from klustaviewa.views.viewdata impor... | klusta-team/klustaviewa | klustaviewa/views/tests/test_viewdata.py | test_viewdata.py | py | 4,615 | python | en | code | 29 | github-code | 7 | [
{
"api_name": "tempfile.mkdtemp",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.random.randn",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.ra... |
23566599643 | import json
import random
import time
from datetime import datetime
from flask import Flask, Response, render_template, stream_with_context
# ------------------- #
# Flask Configuration #
# ------------------- #
application = Flask(__name__)
random.seed() # Initialize the random number generator
# --------------... | eljamm/IOT-Weather-Monitor | app.py | app.py | py | 3,798 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "random.seed",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "random.randrange",
... |
31029165215 | from typing import List
## 假设这个最后的结果为ans,ai ^ aj = x,x ^ ai = aj
## 确定x的每一位是否可以为1,可以用一个集合记录所有数前k位,看看有没有合适的x的前k位异或上这个集合中的数还在这个集合中
class Solution:
def findMaximumXOR(self, nums: List[int]) -> int:
ans = 0
for i in range(30,-1,-1):
st = set()
for num in nums:
st.... | lock19960613/SCL | Daily/PY/Leetcode421-数组中两个数的最大异或值.py | Leetcode421-数组中两个数的最大异或值.py | py | 763 | python | zh | code | 0 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
1706658822 | import json
from difflib import get_close_matches
data = json.load(open("files/data.json"))
def search(word):
word = word.lower()
if word in data:
return data[word]
elif len(get_close_matches(word, data.keys())) > 0:
choice = input("Did you mean %s? enter y for yes n for no: " %
... | farazmalick/python-learning | InteractiveDictionary/wordSearch.py | wordSearch.py | py | 823 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "json.load",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "difflib.get_close_matches",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "difflib.get_close_matches",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "difflib.... |
34498921050 | import os
import sys
from matplotlib.backends.backend_pdf import PdfPages
import matplotlib.pyplot as plt
plt.style.use('seaborn-white')
import numpy as np
import copy
import math
from PeakDetection import *
from Constants import *
D2R = math.pi/180.0
class sysEvaluation:
''' compare the perform... | sulkytejas/ans-testing | post_processing/automaticProcessing.py | automaticProcessing.py | py | 54,307 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 6,
"usage_type": "name"
},
{
"api_name"... |
28461780858 | from models import session
from models.UserPokemon import UserPokemon
from random import randint
from web import PokerocketAdapters as adapters
from bl.PokemonService import PokemonService
from bl import SystemConstants as sysConst
class UserPokemonService():
def __init__(self):
self.pokemonService = Poke... | ChadCarey/PokeRocket | pokerocket_endpoints/bl/UserPokemonService.py | UserPokemonService.py | py | 2,748 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "bl.PokemonService.PokemonService",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "models.UserPokemon.UserPokemon",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "bl.SystemConstants.MAX_HUNGER",
"line_number": 30,
"usage_type": "attribu... |
17721759581 | #!/usr/bin/env python3
"""
A test program for working with PostgreSQL database via Python interface. Let's execute
a series of queries while doing most work automatically
"""
import psycopg2
# pseudo constants
MY_WEEKS = range(1,11)
def get_cohort_users_count(db_cursor: psycopg2.extensions.cursor) -> [int]:
count... | gdg-work/SkillFactory__SDA5__Project_1 | Python_Tests/test2.py | test2.py | py | 2,179 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "psycopg2.extensions",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "psycopg2.extensions",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "psycopg2.extensions",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_na... |
27975415499 | import re
import time
from urllib2 import URLError
import os.path
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
RE_CHARSET = re.compile('.*;charset=(.*)')
UPLOAD_FILE_TEMPFOLDER = '/tmp'
class AmbiguityError(ValueError)... | zopefoundation/z3c.webdriver | src/z3c/webdriver/browser.py | browser.py | py | 14,958 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "re.compile",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.common.exceptions.NoSuchElementException",
"line_number": 75,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.support.ui.Select",
"line_number": 177,
"usage_type": "ca... |
25245815856 | from io import open
from Message import *
from Participant import *
import constant
class WhatsappChat ():
def __init__(self, filepath, encoding="utf8"):
self.__filepath = filepath
self.__encoding = encoding
self.__messages = []
self.__participants = []
self.__process_file(... | xcesaralejandro/WhatsappChatAnalyze | WhatsappChat.py | WhatsappChat.py | py | 2,015 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "io.open",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "constant.USER_MESSAGE",
"line_number": 52,
"usage_type": "attribute"
},
{
"api_name": "constant.LINE_PREVIOUS_MESSAGE",
"line_number": 55,
"usage_type": "attribute"
}
] |
38534001657 | from bs4 import BeautifulSoup
from replit import db #replit database. Just replace on yours for file/db
from requests_html import HTMLSession
import bs4 as bs
import requests
import time
postPattern = {
"title": "",
"description": None,
"link": ""
}
def check(name, newHead): #is it new post
if ... | AllexKzk/python-telegram-rss-parser-bot | siteParser.py | siteParser.py | py | 1,052 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "replit.db.keys",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "replit.db",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_n... |
6004802686 | import pygame
import random
class Apple():
def __init__(self, display):
self.x = random.randint(0, width)
self.y = random.randint(0, height)
self.r = 10
self.dsply = display
self.color=(255,0,0)
def show(self):
pygame.draw.circle(self.dsply, self.color... | BJahanyar/Advanced_Python | MachineLearning/Mini_Project_Snake_AI/Snake.py | Snake.py | py | 3,888 | python | en | code | 6 | github-code | 7 | [
{
"api_name": "random.randint",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.draw.circle",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pygame.draw",
"lin... |
31699674622 | from sys import stdin
import itertools
def main():
input = stdin.readline
n, k = map(int, input().split())
t = [list(map(int, input().split())) for _ in range(n)]
S = list(itertools.permutations(range(2,n+1)))
ans = 0
for s in S:
s = list(s)
total = 0
pre = 1
for... | nsmr-sor/atcoder | abc183/c.py | c.py | py | 514 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.stdin.readline",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "itertools.permutations",
"line_number": 8,
"usage_type": "call"
}
] |
21414239098 | DOF = 7
import numpy as np
import pandas as pd
from scipy.spatial.transform import Rotation
from omni.isaac.core.utils.stage import add_reference_to_stage
from omni.isaac.core import World
from omni.isaac.core.utils.types import ArticulationAction
# from omni.isaac.franka.franka import Franka
from omni.isaac.manipulat... | JunHeonYoon/Isaac_Sim | panda_controller/armcontroller/controller.py | controller.py | py | 18,701 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "omni.isaac.core.World",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "numpy.zeros",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.zeros"... |
5054156750 | from django.core.management.base import BaseCommand
from django.db import models, transaction
from typing import Any, Optional
from api.apps.users.models import User
from api.apps.users.factory import (AdminUser,
AdminProfile,
ActiveUser,
... | Jeffallan/timekeeper | backend/api/apps/users/management/commands/gen_users.py | gen_users.py | py | 1,385 | python | en | code | 4 | github-code | 7 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "django.db.models",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "api.apps.users.factory.AdminUser",
"line_number": 22,
"usage_type": "name"
},
... |
31735954702 | # %%
import urllib
import os
import pyspark as ps
import pandas as pd
from pyspark.sql.functions import *
# Access our environment variables
ACCESS_KEY = os.environ.get('ACCESS_KEY')
SECRET_KEY = os.environ.get('SECRET_KEY')
#Encode the secret key so its not transmitted in plain text
ENCODED_SECRET_KEY = ... | jeffreywlinn/data_engineering | Project_2_Silver_To_Gold.py | Project_2_Silver_To_Gold.py | py | 4,935 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.environ.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_nu... |
40474204452 | # -*- coding: utf-8 -*-
"""
"""
import numpy as np
import cv2 as cv
from sklearn.cluster import KMeans
# --------------------------------------------------------------------------- #
# K-Means Implementation Function - OpenCV
# --------------------------------------------------------------------------- #
d... | jtzanetatos/MSc_Dissertation | src/python/objdect/image_processing/_image_processing.py | _image_processing.py | py | 6,542 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "cv2.TERM_CRITERIA_EPS",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "cv2.TERM_CRITERIA_MAX_ITER",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "numpy.float32",
"line_number": 38,
"usage_type": "call"
},
{
"api_name... |
27020949604 | import numpy as np
import matplotlib.pyplot as plt
f = lambda x: x**2 - 4*x + 6
x = np.linspace(-1, 6, 100)
# print(x)
y = f(x)
# 그래프 그리기
plt.plot(x, y, 'k-') # k- 선
plt.plot(2, 2, 'sk') # sk 점
plt.grid() # 모눈
plt.xlabel('x')
plt.ylabel('y')
plt.show()
| chahayeong/Homework | keras2/keras66_gradient1.py | keras66_gradient1.py | py | 295 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.linspace",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyp... |
9548942396 | import os
import shutil
from moviepy.editor import VideoFileClip
from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
from utils import check_input_file_valid
class Splitter:
def __init__(self, input_file, output_folder, split_interval):
self.input_file = input_file
self.output_direc... | jmadni/ingage | splitter.py | splitter.py | py | 1,438 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "utils.check_input_file_valid",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "shutil.rmtre... |
37727001601 | from __future__ import division
import numpy as np
from scipy.special import expit
from sklearn.base import BaseEstimator, ClassifierMixin, RegressorMixin
from sklearn.utils import check_X_y, indexable, column_or_1d
from sklearn.utils.validation import check_is_fitted
from sklearn.isotonic import IsotonicRegression
f... | betacal/post-aistats2017 | experiments/calib/models/calibration.py | calibration.py | py | 12,259 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "sklearn.base.BaseEstimator",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "sklearn.base.ClassifierMixin",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "numpy.newaxis",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_na... |
2971628687 | import pytest
from flask import g, session
from app.db import get_db
@pytest.mark.parametrize('path', (
'create',
'edit/1',
'delete/1',
))
def test_login_required(client, path):
response = client.post(path)
assert response.headers['Location'] == 'http://localhost/login'
def test_author_required(ap... | Neo-Hao/mean-review-collector | tests/test_review.py | test_review.py | py | 1,873 | python | en | code | 13 | github-code | 7 | [
{
"api_name": "pytest.mark.parametrize",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "app.db.app_context",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "app.db",
... |
24924726846 | from scipy.optimize import minimize
from sklearn.gaussian_process import GaussianProcessRegressor
from pyDOE import *
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
fun = lambda x: x*x+5*np.sin(3*x)
# fun = lambda x: np.sin(3*x)
def errorSigma(x):
y_pred, sigma = gp.predict(x[0], retur... | simonesilvetti/pyCheck | smothed/tassellation.py | tassellation.py | py | 5,200 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "scipy.optimize.minimize",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sklearn.gaussian_process.GaussianProcessRegressor",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 95,
"usage_type": "ca... |
11130823710 | from collections import defaultdict
ANY_USER = 'ANY_USER'
ADMIN_GROUP = 'admin_users'
GROUP_PREFIX = '@'
class Authorizer:
def __init__(self, app_allowed_users, admin_users, groups_provider):
if ANY_USER in app_allowed_users:
self._app_auth_check = AnyUserAuthorizationCheck()
else:
... | BioPortainer/BioPortainer | Modules/bioportainer-pipeline-runner/.tools/GUI/src/auth/authorization.py | authorization.py | py | 3,771 | python | en | code | 8 | github-code | 7 | [
{
"api_name": "collections.defaultdict",
"line_number": 99,
"usage_type": "call"
}
] |
23629373340 | import sqlite3
import re
from datetime import datetime
class Bdd:
def __init__(self, filename, template_config, regex_id, regex_ip, regex_port, regex_name, regex_comment):
self.filename = filename
self.connection = None
self.cursor = None
self.template_config = template_config
... | lyon-esport/Supervision | Server/functions/Bdd.py | Bdd.py | py | 11,445 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "sqlite3.connect",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sqlite3.Row",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "re.match",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number... |
15171841233 | import struct
from src.utils.config_output import config as config_output
import json
import logging
from src.outputs.outputController import OutputController
from src.utils.updDataConversion import UDPDataConversion
logging.basicConfig(format='%(asctime)s %(levelname)s %(name)s: %(message)s', level=logging.DEBUG)
l... | garagonc/ofw-mqtt | src/outputs/RTDS_UDPlistener_4Nodes_IST.py | RTDS_UDPlistener_4Nodes_IST.py | py | 1,921 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.basicConfig",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "src.utils.co... |
28008193001 | ### Start of importing dependecies
import cv2 as cv
import numpy as np
import mediapipe as mp
import time
from HandyFunction import LmFinder
from HandyFunction import overlayPNG
from HandyFunction import rotateImage
from HandyFunction import calculate_rotation
from Resizer import Resize
### ending of importi... | erfanzar/AR-ML-FOR-REPLACEING | RUko.py | RUko.py | py | 8,536 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_UNCHANGED",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
... |
4879384752 | from asyncpg.pool import *
from websocket.variables import *
logger = logging.getLogger('websockets')
logger.setLevel(logging.INFO)
logger.addHandler(logging.StreamHandler())
fields_ = [
'DateTime',
'Last',
'Bid',
'Ask',
]
fields = [fields_lookup[f] for f in fields_]
MESSAGES = {
'HEARTBEAT_MESS... | acanacar/ExecutionAlgo | websocket/trash/connection_api2.py | connection_api2.py | py | 4,560 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "websocket.variables.send",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "websocket.variables",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "websocket.variables.send",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": ... |
9127801380 | from django import forms
from django.core.validators import FileExtensionValidator
class UploadFileForm(forms.Form):
file = forms.FileField(required=True)
def clean(self):
cleaned_data = super(UploadFileForm, self).clean()
file_name = self.cleaned_data.get('file')
if file_name:
... | sanjeevnataraj/Geocoding | geoapp/forms.py | forms.py | py | 534 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.forms.Form",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.forms.FileField",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.forms"... |
8854836173 | from django.urls import path,re_path
from fltdatas import views
urlpatterns = [
#本模块上级目录fltdata
#path('list/', views.Task_listview.as_view(), name="task_list"),
#path('task_feedback/', views.task_feedback, name="task_feedback"),
#注意updateview的使用需要调用re_path进行带正则表达式的匹配
#re_path(r'^edit/(?P<pk>\w+)/$'... | sicksnail/web_smim1 | fltdatas/urls.py | urls.py | py | 1,525 | python | zh | code | 0 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "fltdatas.views.airplanlist",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "fltdatas.views",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "djang... |
27739357091 | import os
from tkinter import StringVar, LEFT, filedialog, messagebox
from tkinter.ttk import Button, Label, Entry, LabelFrame
from PIL import Image, ImageTk
from queue import SimpleQueue
from time import time
from os import path
from threading import Thread
class ExpControls:
def __init__(self, widget_frame, q_o... | redscientific/RS_Logger | RSLogger/user_interface/Logger/controls.py | controls.py | py | 5,560 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "queue.SimpleQueue",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "tkinter.ttk.LabelFrame",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tkinter.LEFT",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "tkinter.StringV... |
30679379193 | from __future__ import annotations
import os
import signal
from abc import abstractmethod
from typing import Optional
from subprocess import Popen
from .ContextBase import ContextBase
from autoinsight.common.CustomTyping import AutomationInstance
from autoinsight.decorator.Log import log
from ..IdentObjectBase import... | shangerxin/autoinsight | src/autoinsight/ident/context/ProcessBase.py | ProcessBase.py | py | 4,118 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "ContextBase.ContextBase",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "typing.Option... |
37915759047 | # -*- coding: utf-8 -*-
"""
Conversion extensions for basic LOD models
"""
from datetime import datetime
class ConvertBase:
"""
Common convert extension for basic LOD models
"""
__index_sort_import__ = None
__index_sort_export__ = None
__load_from_file__ = True
__load_to_file__ = True
... | torrua/loglan_converter | config/postgres/model_convert.py | model_convert.py | py | 2,788 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "datetime.datetime.now",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 26,
"usage_type": "name"
}
] |
17690187051 | #!/usr/bin/env python
# coding: utf-8
# ## **Section 1: Library and Data Imports (Q1)**
#
# - Import your libraries and read the data into a dataframe. Print the head of the dataframe.
# In[1]:
import numpy as np
import pandas as pd
import seaborn as sns
sns.set_theme(color_codes = True)
sns.set_palette('Pastel1'... | Garylikai/Kaggle-Challenge-Rossmann-Stores-Sales | cse519_hw3_Li_Kai_113358694.py | cse519_hw3_Li_Kai_113358694.py | py | 38,894 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "seaborn.set_theme",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "seaborn.set_palette",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv... |
71586251745 | # pylint: disable=no-member, wrong-import-position
"""
Thermal-fluid specific material classes
"""
import xml.etree.ElementTree as ET
from jax.config import config
config.update("jax_enable_x64", True)
import jax.numpy as jnp
from srlife import materials
class ThermalFluidMaterial:
"""Thermal fluid materia... | Argonne-National-Laboratory/srlife | srlife/thermohydraulics/thermalfluid.py | thermalfluid.py | py | 7,157 | python | en | code | 6 | github-code | 7 | [
{
"api_name": "jax.config.config.update",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "jax.config.config",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "jax.numpy.maximum",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "jax.numpy"... |
24558980997 | import json
import logging
from pathlib import Path
from typing import Iterator, Union
from langchain_core.chat_sessions import ChatSession
from langchain_core.messages import HumanMessage
from langchain_community.chat_loaders.base import BaseChatLoader
logger = logging.getLogger(__file__)
class SingleFileFacebook... | langchain-ai/langchain | libs/community/langchain_community/chat_loaders/facebook_messenger.py | facebook_messenger.py | py | 2,462 | python | en | code | 68,990 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "langchain_community.chat_loaders.base.BaseChatLoader",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 25,
"usage_type": "name"
},
{
... |
4353207401 | from django.urls import path, include
from . import views
urlpatterns = [
path('', views.projects, name = 'projects'),
path('homepage', views.homepage, name = 'homepage'),
path('studentlist', views.liststudents, name='liststudent'),
path('delete/<int:id>', views.delete, name='delete'),
path... | bassem267/Web-dev-project | website/urls.py | urls.py | py | 1,325 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
20301243523 | import numpy as np
import matplotlib.pylab as plt
from sys import argv
s = [10,20,30,40,50,60,70]
data45 = np.genfromtxt("ode_45.txt", delimiter = ",")
x45 = data45[:,0]
y45 = data45[:,1]
f = plt.figure()
plt.plot(x45,y45)
plt.xlabel("x")
plt.ylabel("y")
plt.title("45 degrees")
f.savefig("45.png")
plt... | SergioCorreal/CorrealSergio_hw4 | ode_graf.py | ode_graf.py | py | 599 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.genfromtxt",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pylab.figure",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pylab",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyl... |
11080402434 |
import logging
from miro import app
from miro import transcode
class MiroLibraryManager:
'''MiroLibraryManager
Manages objects to transcode from miro's library
'''
def __init__(self, request_path_func):
self.request_path_func = request_path_func
self.transcodes = dict()
def get... | jordanbs/AirTorrent | server/miro_library_manager.py | miro_library_manager.py | py | 1,723 | python | en | code | 7 | github-code | 7 | [
{
"api_name": "miro.app.item_info_cache.get_info",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "miro.app.item_info_cache",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "miro.app",
"line_number": 18,
"usage_type": "name"
},
{
"api_name... |
5456330578 | import smtplib
import time
from datetime import datetime
import board
import busio
import adafruit_vl6180x
time.sleep(2)
i2c = busio.I2C(board.SCL, board.SDA)
sensor = adafruit_vl6180x.VL6180X(i2c)
door = False
count = 0
def sendMsg(msg):
conn = smtplib.SMTP('smtp.gmail.com',587)
conn.ehlo()
... | RKEC/DAS | doorAlertSystem(GitHub).py | doorAlertSystem(GitHub).py | py | 923 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "time.sleep",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "busio.I2C",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "board.SCL",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "board.SDA",
"line_number": 9,
... |
2222251176 | from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from ..models import Customer, ProductType, Product, ProductOrder, PaymentType, Order
... | blathering-barnacles/Bangazon-2 | ecomm/views/editSettings.py | editSettings.py | py | 4,540 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "models.ProductType.objects.raw",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "models.ProductType.objects",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "models.ProductType",
"line_number": 23,
"usage_type": "name"
},
{
... |
5315799686 | import asyncio
import os
from datetime import datetime as dt
import aioredis
from aiogram import Bot, Dispatcher
from aiogram.contrib.fsm_storage.memory import MemoryStorage
from aiogram.dispatcher.filters.state import State, StatesGroup
from aiogram.dispatcher.middlewares import LifetimeControllerMiddleware
from aiog... | TaleStorm/compliment | bot_config/bot_messages.py | bot_messages.py | py | 13,907 | python | ru | code | 0 | github-code | 7 | [
{
"api_name": "loguru.logger.add",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "loguru.logger",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "dotenv.load_dotenv",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "aiogram.dispatcher... |
70530150303 | from bpy.props import *
from .utils import *
maprange_rna = bpy.types.ShaderNodeMapRange.bl_rna
interpolation_type_items = enum_from_rna( maprange_rna, 'interpolation_type' )
class MaltNodeMapRange( EssentialsNode ):
bl_idname = 'MaltNodeMapRange'
bl_label = 'Map Range'
menu_category = 'CONVERTOR... | Kolupsy/MaltShadingEssentials | nodes/map_range.py | map_range.py | py | 2,031 | python | en | code | 18 | github-code | 7 | [
{
"api_name": "bpy.props.types",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "bpy.props",
"line_number": 4,
"usage_type": "name"
}
] |
28097974498 | from lxml import etree as et
from pathlib import Path
import sys
class BookmarkHandler:
def __init__(self, qgis_path, profile_manager):
self.profile_manager = profile_manager
self.qgis_path = qgis_path
self.bookmark_list = []
self.source_bookmark_file = ""
self.target_book... | WhereGroup/profile-manager | datasources/Bookmarks/bookmark_handler.py | bookmark_handler.py | py | 3,081 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "lxml.etree.XMLParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "lxml.etree.parse",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"li... |
21009087440 | import subprocess
import argparse
import time
import shlex
import signal
def test_foreground(args):
launch_command = 'nnictl create --config {} --foreground'.format(args.config)
print('nnictl foreground launch command: ', launch_command, flush=True)
proc = subprocess.Popen(shlex.split(launch_command))
... | microsoft/nni | test/training_service/nnitest/foreground.py | foreground.py | py | 628 | python | en | code | 13,409 | github-code | 7 | [
{
"api_name": "subprocess.Popen",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "shlex.split",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "signal.SIGINT",
"line_num... |
29428262828 | #!/usr/bin/env python
# coding: utf-8
"""
Object Detection (On Image) From TF2 Saved Model
=====================================
"""
import time
from object_detection.utils import label_map_util
from object_detection.utils import visualization_utils as viz_utils
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # S... | janickq/tensorflow-test | TF-image-object-counting.py | TF-image-object-counting.py | py | 9,793 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.get_logger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tensorf... |
19892586886 | ## Modules for citation file conversion
import os, sys
import bibtexparser
from datetime import datetime
class Citation():
def __init__(self, bibtex_filepath=None):
self.info_dict = {}
self.bibtex_provided = False
self.repo_provided = False
self.bibtex_filepath = bibtex_filepath
... | vdplasthijs/py_bibtex_to_cff_converter | citation_conversion_utilities.py | citation_conversion_utilities.py | py | 10,117 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "bibtexparser.load",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 126,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 126,
"usage_type": "name"
}
] |
14872342018 | # This cog overwrites the original Discord !help command
# Customised with expanded explanations of commands and formatting
import discord
from discord.ext import commands
from botmain import config
class Help(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
a... | Audi-Un-Autre/TheTranslators | COGS/help.py | help.py | py | 943 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "discord.ext.commands.Cog.listener",
"line_number": 14,
"usage_type": "call"
},
{
... |
23402708612 | import json
from abc import abstractmethod
from datetime import datetime
import scrapy
from kingfisher_scrapy.base_spiders import SimpleSpider
from kingfisher_scrapy.exceptions import AccessTokenError, MissingEnvVarError
from kingfisher_scrapy.util import (
components,
date_range_by_interval,
handle_http_... | open-contracting/kingfisher-collect | kingfisher_scrapy/spiders/paraguay_dncp_base.py | paraguay_dncp_base.py | py | 5,387 | python | en | code | 11 | github-code | 7 | [
{
"api_name": "kingfisher_scrapy.base_spiders.SimpleSpider",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "kingfisher_scrapy.exceptions.MissingEnvVarError",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "kingfisher_scrapy.util.parameters",
"line_number"... |
28271366609 | import random
from matplotlib import pyplot as plt
random.seed(0)
from lib.conceptors import *
from experiments.exp2_below_phoneme_clustering.kmeans.point import Point
from experiments.exp2_below_phoneme_clustering.kmeans.method import Method
class KMeans:
"""
This class contains the clustering functional... | jorisptrs/Bachelor-Thesis | Code/experiments/exp2_below_phoneme_clustering/kmeans/kmeans.py | kmeans.py | py | 12,231 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "random.seed",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "experiments.exp2_below_phoneme_clustering.kmeans.point.Point.init_points",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "experiments.exp2_below_phoneme_clustering.kmeans.point.Point"... |
19511801157 | """
USAGE: fodt_clean.py path/to/file.fodt
"""
import sys
import lxml.etree as et
from pathlib import Path
if len(sys.argv) != 2:
raise SystemExit(__doc__)
filename = Path(sys.argv[1])
tree = et.fromstring(filename.read_bytes())
for binary_data in tree.xpath("//office:binary-data", namespaces=tree.nsmap):
... | mbbrgn/umweltecke | fodt_clean.py | fodt_clean.py | py | 586 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "lxml.etree.fromstring",
"... |
71935657183 | import ctypes
import fcntl
import logging
import mmap
import os
import select
from cros.factory.device import device_utils
from cros.factory.device import sensor_utils
from cros.factory.test.i18n import _
from cros.factory.test.i18n import arg_utils as i18n_arg_utils
from cros.factory.test import test_case
from cros.f... | arccode/factory | py/test/pytests/proximity_sensor.py | proximity_sensor.py | py | 7,946 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "cros.factory.utils.type_utils.Enum",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cros.factory.utils.type_utils",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "cros.factory.test.test_case.TestCase",
"line_number": 25,
"usage_type": ... |
44618230293 | # ---
# jupyter:
# jupytext:
# cell_metadata_json: true
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.10.2
# kernelspec:
# display_name: Python 3
# language: python
# name: pyth... | econ-ark/BayerLuetticke | notebooks/DCT-Copula-Illustration.py | DCT-Copula-Illustration.py | py | 45,563 | python | en | code | 10 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.ion",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 74,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
... |
30627524062 | from pathlib import Path
from itaxotools.common.utility import AttrDict
from ..types import Type, SequenceReader, ColumnFilter, FileFormat
from .common import Object, Property, Item
from .input_file import InputFileModel
class SequenceModel(Object):
path = Property(Path)
reader = Property(SequenceReader)
... | iTaxoTools/DecontaminatorGui | src/itaxotools/decontaminator_gui/model/sequence.py | sequence.py | py | 2,531 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "common.Object",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "common.Property",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "common.Property",
... |
7413321718 | #!/usr/bin/env python
import collections
import json
import os
import socket
import subprocess
import sys
import time
try:
# Python 3
from urllib.request import urlopen, URLError, HTTPError
except ImportError:
# Python 2
from urllib2 import urlopen, URLError, HTTPError
SanityCheckResult = collection... | open-craft/ansible-playbooks | playbooks/roles/sanity-checker/files/sanity_check.py | sanity_check.py | py | 7,288 | python | en | code | 11 | github-code | 7 | [
{
"api_name": "collections.namedtuple",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "socket.socket",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "socket.AF... |
36293995560 | from typing import Optional, List
from sqlalchemy.orm import Session
from app.schemas.measurementsSchema import MeasurementsBase
from app.schemas.measuresTypes import MeasurementsTypeBase, MeasureTypeInDB
from app.models.measurementsModel import Measurements, MeasuresType
from app.exceptions.measureExceptions import M... | gustavoeraldo/water-heating-system-api | app/controllers/measurementsController.py | measurementsController.py | py | 2,177 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "base.ControllerBase",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "app.models.measurementsModel.Measurements",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 11,
"usage_type": "name"
},
{
... |
40659034410 | import unittest
import pymongo
import sys
sys.path.append('../../')
sys.path.append('../')
from app.models.urlshortener import urlShortener
class TestUrlShortener(unittest.TestCase):
""" test the model of url handler """
def setUp(self):
connection = pymongo.MongoClient('mongodb://localhost:27017/')
... | PradheepShrinivasan/picourl | app/models/test_urlShortener.py | test_urlShortener.py | py | 4,246 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_numbe... |
1822796881 | from django.core.mail import EmailMultiAlternatives
from django.dispatch import receiver
from django.template.loader import render_to_string
from django.urls import reverse
def email_txn(email,template):
print('*********************** email send template sratrted ***********************' )
"""
Handles pa... | snaik7/altcoin | altcoin/altcoin/webhook/email.py | email.py | py | 1,175 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.template.loader.render_to_string",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "django.core.mail.EmailMultiAlternatives",
"line_number": 32,
"usage_type": "call"
}
] |
5080440675 | from datasets import load_dataset
import os
import json
import click
from itertools import chain
from copy import deepcopy
from typing import List, Any, Dict, Optional
from tqdm.auto import tqdm
import jsonlines
import re
import openai
class DataSource:
def __getitem__(self, index):
"""
return... | HeegyuKim/open-korean-instructions | src/translate.py | translate.py | py | 6,116 | python | en | code | 168 | github-code | 7 | [
{
"api_name": "typing.Dict",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "datasets.load_dataset",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"line... |
21771896120 | # -*- coding: utf-8 -*-
"""
Created on Wed May 29 08:41:34 2019
@author: Jean-Baptiste
"""
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
dataset_train = pd.read_csv('train.csv')
X_train = dataset_train.iloc[:,1:]/255.0
Y_train = dataset_train.iloc[:, 0].values... | yannickkiki/datascience | digit_recognizer/Jean-Baptiste/digit_recong-CNN.py | digit_recong-CNN.py | py | 1,736 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.OneHotEncoder",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "keras.models.Sequential",
"line_number": 40,
"usage_type": "call"
},
{
"api_n... |
70918959584 | '''
Data Frames and Series
Data frames are a data structure used to store data
df.shape => returns a tuple (n_rows,n_columns)
df.columns => series of column names
Each column is a series
* Using the bracket operator to select a column of the data
x = df['column_name']
'''
'''
Code 1: Basic subsetting and displaying... | Cyranka/python_files | beginner_python/eda_with_python.py | eda_with_python.py | py | 13,528 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "scipy.stats.norm",
"line_number": 225,
"usage_type": "call"
},
{
"api_name": "scipy.stats.linregress",
"line_number": 422,
"usage_type": "call"
},
{
"api_name": "scipy.stats.linregress",
"line_number": 446,
"usage_type": "call"
},
{
"api_name": "sta... |
17605519293 | # -*- coding: utf-8 -*-
"""
Created on Tue Dec 25 09:57:53 2018
@author: lj
"""
import os #导入os模块
import numpy as np #导入numpy模块
import tensorflow as tf #导入tensorflow模块
import matplotlib.pyplot as plt #plt是绘图工具,在训练过程中用于输出可视化结果
import matplotlib.gridspec as gridspec #gridspec是图片排列工具,在训练过程中用于输出可视化结果
## ... | shiluqiang/Simple_GAN_tensorflow | simple_GAN.py | simple_GAN.py | py | 8,152 | python | zh | code | 1 | github-code | 7 | [
{
"api_name": "numpy.zeros",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": ... |
12642227195 | import os
from transformers import (AutoModelForSeq2SeqLM,
AutoTokenizer,
DataCollatorForSeq2Seq,
TrainingArguments,
Trainer)
from datasets import load_from_disk
import torch
from textSummarizer.entity import Mode... | mon28/Text-Summarizer | src/textSummarizer/components/model_trainer.py | model_trainer.py | py | 2,388 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "textSummarizer.entity.ModelTrainerConfig",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 17,
"usage_type": "attribute"
},
{
"... |
31930898953 | import enum
class ClassificationType(enum.IntEnum):
"""
Type of the classification problem.
Attributes:
CLASSIFICATION_TYPE_UNSPECIFIED (int): An un-set value of this enum.
MULTICLASS (int): At most one label is allowed per example.
MULTILABEL (int): Multiple labels are allowed for one ... | srinidhi005/rmi_api | flask_env/lib/python3.5/site-packages/google/cloud/automl_v1/gapic/enums.py | enums.py | py | 3,485 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "enum.IntEnum",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "enum.IntEnum",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "enum.IntEnum",
"line_number": 61,
"usage_type": "attribute"
},
{
"api_name": "enum.IntEnum",
... |
13830679869 | import cv2
from io import BytesIO
#import pytesseract
from dateutil.parser import parse
from datetime import date
from pathlib import Path
import threading
from uploader.models import Receipt, ProcessedState
from django.core.files.base import ContentFile
# pytesseract.pytesseract.tesseract_cmd = "D:\\py-tesseract\\tess... | jeremyqzt/receipts-backend | receipt/uploader/readerMain.py | readerMain.py | py | 6,437 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "io.BytesIO",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "django.core.files.base.ContentFile",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "PIL.Image.op... |
43527628974 | #!/usr/bin/env python
import os
activate_this = os.path.expanduser("~/PycharmProjects/DefensicsAutomation/venv/bin/activate_this.py")
execfile(activate_this, dict(__file__=activate_this))
from datetime import datetime
import CheckAndSendResults
import GlobalVariables
import subprocess
import os
def send_daily_result... | drozenbx/DefensicsAutomation | SendDailyResults.py | SendDailyResults.py | py | 3,302 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.expanduser",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "CheckAndSendResults.send_results",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "subpro... |
40614539206 | from flask import Flask
from multiprocessing import Pool
from flask.globals import request
from healthcheck import HealthCheck
from utils.decorators import AppDecorator
import gunicorn_conf
import json
from utils import constants
from utils import endpoints
import time
import concurrent.futures
from utils import merge_... | arunkrk/Flask_Repo | flask-app/app.py | app.py | py | 3,909 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "healthcheck.HealthCheck",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "utils.constants.hc_success",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "u... |
26725410068 | ###############################################################################
# Module: greenplum_applier
# Purpose: Applies CDCs polled from stream to a Greenplum DB
#
# Notes: Greenplum is essentially a Postgres DB, hence why it inherits from
# PostgresCdcApplier. The only differentiator is the ... | albertteoh/data_pipeline | data_pipeline/applier/greenplum_cdc_applier.py | greenplum_cdc_applier.py | py | 888 | python | en | code | null | github-code | 7 | [
{
"api_name": "postgres_cdc_applier.PostgresCdcApplier",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
}
] |
35786726171 | from pin import Pin, PinType
class PinRandom(Pin):
def __init__(self, channel: int, type: PinType):
self.__range = [x * 0.1 for x in range(0, 10)]
self.__i = 0
super().__init__(channel = channel, type = type)
def get_value(self):
assert self.type != PinType.PT_INVALID
... | 3eR01ive/pydash | pinRandom.py | pinRandom.py | py | 450 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pin.Pin",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "pin.PinType",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "pin.PinType.PT_INVALID",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pin.PinType",
"line... |
38633572100 | from collections import deque
data = [line.strip().split("-") for line in open("input.txt", "r")]
graph = {}
for [u, v] in data:
if u not in graph.keys():
graph[u] = []
if v not in graph.keys():
graph[v] = []
graph[u] += [v]
graph[v] += [u]
def caves_path_calculator(caves_queue, part,... | goncalobarias/Advent-of-Code | 2021/12/solution.py | solution.py | py | 1,057 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.deque",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 40,
"usage_type": "call"
}
] |
19428898140 | import tkinter as tk
from tkinter import ttk
from tkinter import messagebox
import random
from PIL import ImageTk
word_query = {
0: "我喜欢你!",
1: "我养你!",
2: "我养你呀!",
3: "我爱你!",
4: "可以做我的女朋友吗!",
5: "不想错过你!",
6: "我陪你!",
}
class Love:
def __init__(self):
self.roo... | pzq7025/Script | love.py | love.py | py | 1,645 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "tkinter.Tk",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "tkinter.ttk.Button",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tkinter.ttk",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "tkinter.ttk.Label",
"li... |
43019245787 | # -*- coding: utf-8 -*-
"""
Created on August 2021
@author: zhiqiang cai
"""
import sys
import os
import json,ast
from pandas import DataFrame
import itertools
import math
import numpy as np
import random
# This program is created to simulate users' changes to luc for a given map
# R should run the following 3 py pro... | krirk-n/iplan-pipeline | archive/py/luc_change_simulation.py | luc_change_simulation.py | py | 6,429 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "json.dump",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame.from_dict",
"lin... |
33346678285 | from django.urls import path
from . import views
urlpatterns = [
path('login/', views.login_user, name="login"),
path('index/', views.index, name="index"),
path('abpract/<slug:hell>', views.FormCheck.as_view()),
path('add_product/', views.add_product, name="add_product"),
path('edit_product/', views.edit_product, name=... | syed-abdullah786/django-pract | abpractice/urls.py | urls.py | py | 590 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.