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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
12910773710 | #-*- coding:utf-8 -*-
import re
import sys
import os
import codecs
import xlwt
import collections
import time
import configparser
objReadConfig = configparser.ConfigParser(allow_no_value = True)
objReadConfig.read('Conf.ini')
oddHAAPErrorDict = collections.OrderedDict()
for i in objReadConfig.items('TraceRegular'):... | userhei/HAAPHealthyCheck | Code/module/moduleTraceAnalyse.py | moduleTraceAnalyse.py | py | 2,500 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "xlwt.Workbook",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "re.co... |
37356837270 | import yaml
from appium import webdriver
from appium.webdriver.webdriver import WebDriver
def get_driver(config_path) -> WebDriver:
caps = dict()
caps['platformName'] = 'Android'
caps['appPackage'] = 'com.xueqiu.android'
caps['appActivity'] = '.view.WelcomeActivityAlias'
caps['autoGrantPermissions... | whitexie/workwechatuitest | appium_project/baseframe/remotedriver.py | remotedriver.py | py | 579 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "yaml.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "appium.webdriver.Remote",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "appium.webdriver",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "appium.webdriver.w... |
23747590 | from sklearn.datasets import load_iris
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeClassifier
from sklearn import tree
from matplotlib import pyplot as plt
def get_data():
data = load_iris()
x = data.data
y = data.tar... | ElOpio/MachineLearningDemostracion | DecisionTree/DecisionTree.py | DecisionTree.py | py | 1,879 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 22,
"usage_type": "call"
},
{
"ap... |
22131547640 | import unittest
from botocore.exceptions import ClientError
from unittest.mock import patch, MagicMock
from ec2_manager import Ec2Manager
class Ec2ManagerTestCase(unittest.TestCase):
def create_patch(self, name):
patcher = patch(name)
thing = patcher.start()
self.addCleanup(patcher.stop)
... | codenamev/twilio-aws-minecraft | tests/test_ec2_manager.py | test_ec2_manager.py | py | 5,916 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "unittest.TestCase",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "unittest.mock.patch",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "unittest.mock.patch.dict",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "uni... |
39554771790 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import pymongo
from scrapy.conf import settings
import datetime
import time
import importlib,sys
importlib.reload(sys)
#sys.set... | yexing596/tutorial | tutorial/pipelines.py | pipelines.py | py | 5,335 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "importlib.reload",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "scrapy.exceptions.DropItem",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "datet... |
37304129414 | from collections import deque
class Solution:
def orangesRotting(self, grid: List[List[int]]) -> int:
m = len(grid)
n = len(grid[0])
queue = deque()
ctr = 0
maxt = 0
seen = set()
for i in range(m):
for j in range(n):
if grid[i][j] ... | theabbie/leetcode | rotting-oranges.py | rotting-oranges.py | py | 921 | python | en | code | 11 | github-code | 18 | [
{
"api_name": "collections.deque",
"line_number": 7,
"usage_type": "call"
}
] |
26952250909 | from enum import Enum
from typing import IO
from attrs import define, fields
from cattr.gen import make_dict_unstructure_fn, override
from cattr.preconf.json import make_converter
BIDS_VERSION = "1.7.0"
@define
class BIDSDatasetDescription:
"""Model representing a BIDS dataset description.
See https://bids... | aramis-lab/clinica | clinica/iotools/bids_dataset_description.py | bids_dataset_description.py | py | 1,405 | python | en | code | 196 | github-code | 18 | [
{
"api_name": "enum.Enum",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "typing.IO",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "json.dump",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "attrs.define",
"line_number": 11,
... |
25637419350 | from functools import lru_cache
from typing import Optional
from fastapi import Depends
from core.config import get_settings
from services.search_engine import SearchEngineService
from services.cache import CacheService
from db.elastic import get_elastic_storage
from db.redis import get_redis_storage
from db.cache im... | lizatish/Async_API_sprint_2 | fastapi-solution/src/services/genres.py | genres.py | py | 3,787 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "core.config.get_settings",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "db.cache.AsyncCacheStorage",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "db.search_engine.AsyncSearchEngine",
"line_number": 21,
"usage_type": "name"
},
{... |
28964952041 | import numpy as np
import imageio
import os
import matplotlib.pyplot as plt
import glob
alpha = 0.01
data_path = '../data/aic19-track3-test-data/'
for vid_id in range(1,101):
fname = os.path.join(data_path, '%d.mp4' %vid_id)
reader = imageio.get_reader(fname, 'ffmpeg')
meta_data = reader.get_meta_data()
... | tuanbi97/AICityChallenge | Tools/average_image_extracting.py | average_image_extracting.py | py | 885 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "imageio.get_reader",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "imageio.imwrite",
"l... |
21813280287 |
from prettytable import PrettyTable
# PrettyTable documentation: https://code.google.com/archive/p/prettytable/wikis/Tutorial.wiki
# Create a PrettyTable object and save it to a variable called table
table = PrettyTable()
print(table)
# how to add columns to the table
# methods are functions that are associated ... | ahudspeth199/100_days_of_code | src/day_16_object_oriented_programming/python_packages.py | python_packages.py | py | 976 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "prettytable.PrettyTable",
"line_number": 10,
"usage_type": "call"
}
] |
33167200005 | from zipfile import ZipFile
import pandas as pd
import requests
def get_max_date(df: pd.DataFrame) -> str:
return df["Date"].max().strftime('%Y-%m-%d')
class DataMiner:
"""
The DataMiner class is responsible for getting the data from the API, using the API export endpoint
it downloads the data and ... | tariksir/DataEngineerAssignment | resources/data.py | data.py | py | 2,681 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.DataFrame",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "zipfile.ZipFile",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pandas.read_json",
... |
35359552696 | import re
from itertools import permutations, pairwise
finditer = re.compile(BR'''(?x)
(?P<location_L>[A-Za-z]+)
\040\164\157\040
(?P<location_R>[A-Za-z]+)
\040\075\040
(?P<distance>[0-9]+)
''').finditer
def main(raw_puzzle_input: bytes):
puzzle_input = (
(
match['location_L'],
match['location_R'],
i... | jacquet-pl/advent-of-code-public | solvers/All_in_a_Single_Night.py | All_in_a_Single_Night.py | py | 873 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "re.compile",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "itertools.pairwise",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "itertools.permutations",
"line_number": 36,
"usage_type": "call"
}
] |
73041675879 | #!/usr/bin/python
import rospy
import time
from sensor_msgs.msg import Image
from threading import Lock
import cv2
from cv_bridge import CvBridge, CvBridgeError
import numpy as np
GUI_UPDATE_PERIOD = 0.10 # Seconds
class VisionDisplay:
def __init__(self):
self.subVideo = rospy.Subscriber('/camera... | JoachimVeulemans/PXL-DIGITAL | PXL_DIGITAL_JAAR_2/AI & Robotics/Week 4/code/python2/vision_controller.py | vision_controller.py | py | 2,529 | python | en | code | 41 | github-code | 18 | [
{
"api_name": "rospy.Subscriber",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sensor_msgs.msg.Image",
"line_number": 20,
"usage_type": "argument"
},
{
"api_name": "cv_bridge.CvBridge",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "threadi... |
3436106815 | import model.hand as hand
import mediapipe as mp
import cv2
import time
import numpy as np
width = 1280
height = 720
camera = cv2.VideoCapture(1)
camera.set(cv2.CAP_PROP_FRAME_WIDTH, width)
camera.set(cv2.CAP_PROP_FRAME_HEIGHT, height)
detection = hand.HandDetection()
while True:
fingersCount = 0
success , i... | anounman/Virtual-Finger-Counter | FingerCounter.py | FingerCounter.py | py | 1,729 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FRAME_WIDTH",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "cv2.CAP_PROP_FRAME_HEIGHT",
"line_number": 13,
"usage_type": "attribute"
},
{
"api... |
6217332787 | import datetime
import time
from django.utils import translation
from django.utils.translation import ugettext as _
from dataflow.flow.exceptions import NodeValidError
from dataflow.flow.handlers.node_utils import NodeUtils
from dataflow.flow.models import FlowNodeRelation
from dataflow.flow.node_types import NodeTyp... | Tencent/bk-base | src/api/dataflow/flow/handlers/monitor.py | monitor.py | py | 31,743 | python | en | code | 85 | github-code | 18 | [
{
"api_name": "django.utils.translation.ugettext",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "dataflow.flow.node_types.NodeTypes.STREAM_SOURCE",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "dataflow.flow.node_types.NodeTypes",
"line_number": 5... |
71427437479 | import numpy as np
slope = 0.269
yinter = 1.35
n = 100
error = np.random.normal(scale=0.8, size=n)
x_val = np.arange(n)
y_val = x_val * slope + yinter
y_val_error = y_val + error
arr = np.stack((x_val, y_val_error))
import matplotlib.pyplot as plt
plt.scatter(x_val, y_val_error)
plt.show()
np.save(open("challe... | WizzyGeek/AI01_LinReg | challenger.py | challenger.py | py | 347 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.random.normal",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.arange",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.stack",
"l... |
23366201238 | import os
import json
import time
import base64
import random
import requests
from msgraph.core import GraphClient
from .config import *
from .constants import *
# from .client import MSGraphClient
class MSGraphMessage:
def __init__(
self,
client: GraphClient,
mailbox: str,
to_re... | coperyan/python-modules | modules/microsoft_graph/email.py | email.py | py | 7,387 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "msgraph.core.GraphClient",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "os.path.basename",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 70,
"usage_type": "attribute"
},
{
"api_name": "base64.b64enco... |
38270388169 | # Author: bbrighttaer
# Project: jova
# Date: 7/22/19
# Time: 10:47 AM
# File: train_joint.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import copy
import json
import logging
import random
impor... | bbrighttaer/jova | proj/dti/train_joint_gan_attn.py | train_joint_gan_attn.py | py | 58,422 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.basicConfig",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "logging.ERROR",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "datetime... |
72972133159 | import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
# mass, initial position and velocity
m = 1
position0 = [0, 5000000, 0]
velocity0 = [3200, 0, 0]
# mars attributes
mars_mass = 6.42e23
mars_radius = 3386000.0
G = 6.673e-11
M = mars_mass
# simulation time, timestep and time
t_max = ... | fpervaiz/cam-ia-mars-lander | 3d_dynamics.py | 3d_dynamics.py | py | 2,784 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.arange",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 3... |
23674370160 | #!/usr/bin/python3
import re
import os
import MySQLdb as mariadb
import ingestAnalysisSpool
import auscopeReportDownloader
import ingestCorrSkd
import sys
import csv
dirname = os.path.dirname(__file__)
def main(master_schedule, db_name):
# CREATE DATABASE IF REQUIRED
master_schedule = str(master_schedule)... | tiegemccarthy/auscope_database | auscopeDB_daily.py | auscopeDB_daily.py | py | 3,807 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "MySQLdb.connect",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"li... |
19197758315 | from time import sleep
import robot
import time
import random
### DEFINEREDE PARAMETRE ###
arlo = robot.Robot()
rightWheelFactor = 1.0
leftWheelFactor = 1.06225
standardSpeed = 50.0
### PARAMETERUDREGNING ###
def degreeToSeconds(degrees):
'''
Funktionen omregner grader, der skal drejes, til sekunder, der sk... | Woergaard/RobotEksperimentarium | Ex2/_utils.py | _utils.py | py | 8,170 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "robot.Robot",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "time.perf_counter",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "time.perf_counter",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line... |
70168555241 | import sqlite3
# Using connect method for establishing a connection
DATABASE_NAME = 'SQLite_ArnoldCat_Images.db'
class DB:
def __init__(self) -> None:
self.sqliteConnection = sqlite3.connect(DATABASE_NAME)
self.cursor = self.sqliteConnection.cursor()
print("Connected to SQLite")
... | xtnctx/Sqlite_Images | MyDbSqlite.py | MyDbSqlite.py | py | 2,638 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "sqlite3.connect",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sqlite3.Error",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "sqlite3.Error",
"line_number": 65,
"usage_type": "attribute"
}
] |
18905651143 | import xlrd
from py2neo import Graph
from datetime import datetime
activity_list=[]
actor_list=[]
def floatHourToTime(fh):
h, r = divmod(fh, 1)
m, r = divmod(r*60, 1)
return (
int(h),
int(m),
int(r*60),
)
# Give the location of the file
loc = ("C:/Users/user/Desktop/Courses/... | merianakb/Intent-based-NLI | DataArray.py | DataArray.py | py | 1,522 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "xlrd.open_workbook",
"line_number": 23,
"usage_type": "call"
}
] |
3623831254 | incompatible = 'incompatible'
min_post = 1
import json
from typing import List, Dict
# #### --> needed field
class Message(object):
def __init__(self, user=None, **kw):
if user is not None:
self.load_json(user)
self.load_json(kw)
def load_json(self, user):
if isinst... | thomasreolon/UNITN-bachelor-thesis | project/src/mycommons/data_structure.py | data_structure.py | py | 13,351 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "json.loads",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 58,
... |
29718931975 | from actor.actor import Actor
from constants import *
from data import IMAGE_ID
from actor.skills.base_skill import BaseSkill
from actor.states_effect.poison_status import PoisonStatus
from ranged import Ranged
from util import dice
class PoisonDart(BaseSkill):
def __init__(self, x=0, y=0, name="poison_dart"):
... | tamamiyasita/Roguelike-Tutorial-2020 | actor/skills/poison_dart.py | poison_dart.py | py | 1,868 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "actor.skills.base_skill.BaseSkill",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "data.IMAGE_ID",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "data.IMAGE_ID",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "data.IM... |
18790306633 | from .utils.info import BinningProgressUpdater
from .utils.root_binning_ids import main_binning_fun
from . import models
from rnames_api import serializers
import traceback
import json
from django.db import connection
from types import SimpleNamespace
from celery import states as celery_states
import pandas as pd
de... | karilint/rnames | app/rnames_app/binning.py | binning.py | py | 5,676 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "rest_framework.serializers.BaseSerializer",
"line_number": 26,
"usage_type": "argument"
},
{
"api_name": "pandas.DataFrame",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "rnames_api.serializers.RelationInlineSerializer",
"line_number": 42,
"usag... |
7714616376 | from django.db import models
from django.utils.translation import gettext_lazy as _
class BaseItem(models.Model):
"""Abstract base class for all models."""
title = models.CharField(_("title"), max_length=100)
created_at = models.DateTimeField(_("created at"), auto_now_add=True)
updated_at = models.Da... | louis-agyapong/orm_playground | apps/model_inheritance/models.py | models.py | py | 834 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.db.models.Model",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "... |
11312625877 | # %%
import pandas as pd
import plotly.offline as offline
import plotly.graph_objs as go
from typing import Dict, Tuple
from pandas import DataFrame
# %%
def dfs_from_year(year: int) -> Tuple[DataFrame, DataFrame]:
parties = pd.read_csv(
f"~/data/parties_{year}.csv",
low_memory=False,
... | Eugleo/elections | visualization/elections/Visualisation.py | Visualisation.py | py | 2,220 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "typing.Tuple",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
"... |
3793096813 | import os
import re
from collections import defaultdict
from multiprocessing import Process, Manager
from subprocess import check_output
from threading import Thread
from typing import Optional, Tuple, Dict
import numpy as np
class Res:
""" Auxiliary class to mimic pymoo format """
def __init__(self, X: n... | WangRui8217/iMap | ai_infra/common/algo_utils.py | algo_utils.py | py | 5,119 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.ndarray",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "typing.Optional",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
... |
14303001961 | from Grid import Grid
from enum import Enum, auto
import random
class HunterState(Enum):
SEARCHING_PREY = auto()
HUNTING_PREY = auto()
class Hunter():
def __init__(self, initialX: int, initialY: int):
self.x = initialX
self.y = initialY
self.element = 'W'
self.state = ... | TheBestShadow/HunterPrey_AI | HunterAndPrey/Hunter.py | Hunter.py | py | 4,547 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "enum.Enum",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "enum.auto",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "enum.auto",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "Grid.Grid",
"line_number": 18,
"us... |
139371863 | # -*- coding: utf-8 -*-
import scrapy
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
from joke.items import JokeItem
class ZolSpider(CrawlSpider):
name = 'zol'
allowed_domains = ['xiaohua.zol.com.cn']
start_urls = ['http://xiaohua.zol.com.cn/lengxiaohua/']
... | lakeo/tools-script | scrapy/joke/joke/spiders/Zol.py | Zol.py | py | 1,125 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "scrapy.spiders.CrawlSpider",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "scrapy.spiders.Rule",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "scrapy.linkextractors.LinkExtractor",
"line_number": 15,
"usage_type": "call"
},
{
... |
32695610729 | import tweepy # lib do twitter
from chatterbot.trainers import ListTrainer
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
import re
import time
import datetime
from random import randint
def data_hora():
''' RETURNS DATE AND TIME FORMATED '''
data_hora = "%d/%d/%d - %d:%d" %... | vini-ak/Fundamentals-of-Software-Engineering | Mofio/twitter_bot.py | twitter_bot.py | py | 3,925 | python | pt | code | 0 | github-code | 18 | [
{
"api_name": "datetime.datetime.now",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "random.randint",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tweepy.OA... |
4923660599 | import argparse
import json
from redis import Redis
from .utils import load_cluster_details, load_job_details
def create_job_details(cluster_name: str, job_name: str):
# Load details
cluster_details = load_cluster_details(cluster_name=cluster_name)
job_details = load_job_details(cluster_name=cluster_nam... | MicrosoftHam/maro | maro/cli/grass/lib/scripts/create_job_details.py | create_job_details.py | py | 1,027 | python | en | code | null | github-code | 18 | [
{
"api_name": "utils.load_cluster_details",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "utils.load_job_details",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "redis.Redis",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "redis.h... |
86270512625 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2021/9/7 15:16
# @Author :
# @File : evaluation.py
# @Function: 评估指标
import json
import os
project_dir = '/data/0shared/*/*/*/attentionRegularization'
def read_results(results):
claim_dict = dict()
for index, row in results.iterrows():
... | WOW5678/attentionGuiding | evaluations/IR_evaluation.py | IR_evaluation.py | py | 4,248 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "json.load",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 33... |
23173193743 | import csv
import time
import gurobipy as gp
import matplotlib.pyplot as plt
import networkx as nx
import pandas as pd
import numpy as np
from gurobipy import GRB
from matplotlib.lines import Line2D
from matplotlib.patches import Patch
import constants
from itertools import chain
# -----------------------------------... | fvandijken/msc-thesis | ilp_models/MDVSPTW_TSN_model.py | MDVSPTW_TSN_model.py | py | 35,195 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "constants.shipment_file_time_windows",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "constants.time_diff_matrix_file",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "constants.depots_file",
"line_number": 20,
"usage_type": "... |
26169388371 | from django.contrib import messages
from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import login_required
from django.db.models import Q
from django.shortcuts import render, redirect, get_object_or_404
from feed.models import Post
from .forms import UserRegisterForm, ProfileUpdateFor... | asimunit/django-SocialNetwork | contin/account/views.py | views.py | py | 7,021 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "forms.UserRegisterForm",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.contrib.messages.success",
"line_number": 21,
"usage_type": "call"
},
... |
39167984677 | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from authen.forms import *
from authen.models import *
admin.site.register(Sektor)
admin.site.register(Region)
admin.site.register(District)
admin.site.register(Mahalla)
class NewMyUser(UserAdmin):
add_form = CreasteUser
form = C... | Ibrokhim1006/Mahalla | authen/admin.py | admin.py | py | 698 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.contrib.admin.site.register",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
... |
883216044 | import torch
import utility
from decimal import Decimal
from tqdm import tqdm
class Trainer():
def __init__(self, opt, loader, my_model, my_loss, ckp):
self.opt = opt
self.scale = opt.scale
self.ckp = ckp
self.loader_train = loader.loader_train
self.loader_test = loader.loa... | guoyongcs/DRN | trainer.py | trainer.py | py | 5,754 | python | en | code | 426 | github-code | 18 | [
{
"api_name": "utility.make_optimizer",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "utility.make_scheduler",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "utility.make_dual_optimizer",
"line_number": 19,
"usage_type": "call"
},
{
"api_nam... |
4013727824 | from collections.abc import Sequence
import os
from typing import Optional, Union
from absl import app
from absl import flags
from absl import logging
from google.protobuf import message
from tensorflow.python.lib.io import file_io
from tensorflow.tools.proto_splitter import chunk_pb2
from tensorflow.tools.proto_spli... | tensorflow/tensorflow | tensorflow/tools/proto_splitter/testdata/split_gen.py | split_gen.py | py | 5,445 | python | en | code | 178,918 | github-code | 18 | [
{
"api_name": "absl.flags.DEFINE_string",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "absl.flags",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "tensorflow.tools.proto_splitter.testdata.test_message_pb2.StringNode",
"line_number": 20,
"usage_type... |
16623751211 | # coding: utf-8
# Standard libraries
from typing import Union
# https://github.com/usnistgov/DataModelDict
from DataModelDict import DataModelDict as DM
# Local imports
from . import PotentialLAMMPSBuilder
from ...tools import aslist
class EamBuilder(PotentialLAMMPSBuilder):
"""
PotentialLAMMPS builder clas... | usnistgov/potentials | potentials/buildrecord/potential_LAMMPS/EamBuilder.py | EamBuilder.py | py | 5,985 | python | en | code | 9 | github-code | 18 | [
{
"api_name": "typing.Union",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 112,
"usage_type": "name"
},
{
"api_name": "tools.aslist",
"line_number": 114,
"usage_type": "call"
},
{
"api_name": "DataModelDict.DataModelDict"... |
72482579560 | import os
import shutil
import xml.etree.ElementTree as ET
import cv2
import imutils
import numpy as np
def img_AUG(path, img_dir, label_dir):
images_path = os.path.join(path, "jishui")
labels_path = os.path.join(path, "jishui_label")
images_name = os.listdir(images_path)
labels_name = os.... | TanateT/dataset_createProcess | xml_gray.py | xml_gray.py | py | 3,949 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 1... |
35523543093 | import numpy as np
import pyautogui
import time
import random
class wordle:
def __init__(self):
self.keyboard = {'Q':(737,866),
'W':(788,866),
'E':(837,866),
'R':(885,866),
'T':(935,866),
'Y':(983,866),
... | ABat16/PersonalAI | wordle/wordle.py | wordle.py | py | 5,919 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "time.sleep",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "pyautogui.click",
"line_number": 123,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 124,
"usage_type": "call"
},
{
"api_name": "pyautogui.click",
"line_n... |
41301848774 | from urllib import request
from fastapi.testclient import TestClient
# Import our app from main.py.
from main import app
# Instantiate the testing client with our app.
client = TestClient(app)
# Write tests using the same syntax as with the requests module.
def test_api_welcome():
r = client.get("/")
assert ... | Sudonuma/Deploy-Ml-Model-Heroku-FastAPI | api_check.py | api_check.py | py | 1,531 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "fastapi.testclient.TestClient",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "main.app",
"line_number": 8,
"usage_type": "argument"
}
] |
28296516536 | import webbrowser
from requests import RequestException
from jet_bridge_base import settings
from jet_bridge_base.utils.backend import is_resource_token_activated
from jet_bridge_base.logger import logger
def check_token_command(api_url):
try:
if not is_resource_token_activated(settings.PROJECT, setting... | jet-admin/jet-bridge | packages/jet_bridge_base/jet_bridge_base/commands/check_token.py | check_token.py | py | 1,289 | python | en | code | 1,486 | github-code | 18 | [
{
"api_name": "jet_bridge_base.utils.backend.is_resource_token_activated",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "jet_bridge_base.settings.PROJECT",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "jet_bridge_base.settings",
"line_number": 12,... |
38324330819 | import discord
class LoadoutCreateModalPage3(discord.ui.Modal, title="Create Loadout Page (3/3)"):
underbarrel_type = discord.ui.TextInput(
label="Underbarrel",
required=False,
placeholder="Enter UnderBarrel Type"
)
muzzle_type = discord.ui.TextInput(
style=discord.TextSty... | DwayneJ730/Loadout-Discord-Bot | Bot/LoadoutCreateModalPage3.py | LoadoutCreateModalPage3.py | py | 654 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "discord.ui",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "discord.ui.TextInput",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "discord.ui",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "discord.ui.TextInpu... |
34013761766 | from collections import defaultdict
def topological_sort(deps):
"""
deps = [dep1, dep2, dep3, ...]
each dep is a tuple (prerequisite, dependence) meaning that the dep[0] is the parent node of dep[1]
This implementation assumes acyclic graph, for cycle aware topological_sort, refer to topological_sort2... | ustcscgyer/collections_ext | topological_sort.py | topological_sort.py | py | 679 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.defaultdict",
"line_number": 17,
"usage_type": "call"
}
] |
14579534040 | import argparse
from pathlib import Path
from logging import getLogger
from typing import List
from typing import NamedTuple
import chainer
import matplotlib
from nltk.translate import bleu_score
from progressbar import ProgressBar
from cnmt.misc.constants import unk
from cnmt.models.encdec import EncoderDecoder
from... | nakario/cnmt | cnmt/eval/eval.py | eval.py | py | 4,321 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.use",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "typing.NamedTuple",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
... |
20883893453 | from bson.objectid import ObjectId
from pymongo import MongoClient
uri = 'mongodb://localhost:27017/apprentice'
def get_data(id):
client = MongoClient(uri)
db = client.apprentice
data = db.data.find_one({'_id': ObjectId(id)}, {"X": 1, "y": 1})
X = data['X']
y = data['y']
return X, y
| JustinAWei/apprentice | api/get_data.py | get_data.py | py | 313 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bson.objectid.ObjectId",
"line_number": 11,
"usage_type": "call"
}
] |
24288739261 | """
File : identify_face.py
Author : kaiboon
Date : 27/5/2020
Brief : Identify the face of peoples in the images.
If the face is in database, it will return the name of that person, else, it return unknown face.
We use PIL instead of opencv in this file.
"""
import... | kaiboon0216/Face-recognition-python | identify_face.py | identify_face.py | py | 2,248 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "face_recognition.load_image_file",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "face_recognition.face_encodings",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "face_recognition.load_image_file",
"line_number": 18,
"usage_type": "cal... |
18210275381 | import numpy as np
import sys
sys.path.append(r'C:\Users\timmy\Desktop\Senior Design\Carla 0.9.10\WindowsNoEditor\PythonAPI\carla\dist\carla-0.9.10-py3.7-win-amd64.egg')
import carla
def process_img(image, grayscale = False):
i = np.array(image.raw_data)
i2 = i.reshape((480,640,4)) # 4 because of (r,g,b... | Tear-Ao/UCONNSDP33_20212022 | helper_functions.py | helper_functions.py | py | 4,539 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.path.append",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number":... |
36912648501 | # coding=utf-8
"""SIP EC config database event queue class."""
import ast
from typing import Callable, List, Union
from . import _keys
from .event import Event
from .. import ConfigDb
from .._logging import LOG
DB = ConfigDb()
class EventQueue:
"""Event queue class.
Used to poll for subscribed events and q... | rtobar/integration-prototype | sip/execution_control/configuration_db/sip_config_db/_events/event_queue.py | event_queue.py | py | 5,334 | python | en | code | null | github-code | 18 | [
{
"api_name": "typing.Callable",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "ast.literal_eval",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "event.Event.from_config",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "event.Event"... |
28960389708 |
# sudo CUDA_VISIBLE_DEVICES=1,3 python3 train.py --backbone resnet50 --imagelist_path /home/sggpls/Documents/siim-pneumothorax/data_for_train/ --image_path /home/sggpls/Documents/siim-pneumothorax/data_for_train/origin_img/ --masks_path /home/sggpls/Documents/siim-pneumothorax/data_for_train/masks_img/ --lr=0.001 --wd... | yura03101995/siim_pneumo | pytorch_scripts/train_fold.py | train_fold.py | py | 19,141 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "sys.path.append",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "torch.__version__",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "torchvision.tran... |
41459329538 | import requests, json
from Schools import School
from concurrent.futures import ThreadPoolExecutor
from bs4 import BeautifulSoup
from Houses.Home import Home
import re
def get_request(fetch_url: str, as_json=False):
headers = {
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537... | nicholaschristian/hf | Helpers/Helpers.py | Helpers.py | py | 7,731 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "Schools.School.School",
... |
28409179208 | #!/usr/bin/python
# -*-coding:utf-8 -*-
u"""
:创建时间: 2021/1/5 14:35
:作者: 苍之幻灵
:我的主页: https://cpcgskill.com
:QQ: 2921251087
:爱发电: https://afdian.net/@Phantom_of_the_Cang
:aboutcg: https://www.aboutcg.org/teacher/54335
:bilibili: https://space.bilibili.com/351598127
"""
import os
import uuid
import hashlib
def decode(s... | cpcgskill/CPMel | old/CPCLI/utils.py | utils.py | py | 3,577 | python | en | code | 5 | github-code | 18 | [
{
"api_name": "uuid.uuid4",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "hashlib.md5",
"line_number": 100,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 115,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 1... |
2546647486 | #!/usr/bin/env python
from __future__ import print_function, division
import matplotlib
import os
mplbackend = os.environ.get('MPLBACKEND', 'Qt4Agg')
matplotlib.use(mplbackend)
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import argparse
import numpy as np
import re
def numeric(x):
try:... | SaierLaboratory/TCDBtools | bin/plot_from_tsv.py | plot_from_tsv.py | py | 9,962 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "os.environ.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.use",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",... |
71776484521 | # Program Name : driver.py
# Description : implement and compare several search algorithms \
# and collect some statistics related to their performances of 8puzzle game
# Input Parameter : <method> <board>
# <method> : bfs (Breadth-First Search) , dfs (Depth-First Search), ast (A-Star Search)
# <board> : is a sequ... | pseemaJohn/8-puzzle-board | driver1.py | driver1.py | py | 12,735 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.deque",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "heapq.heappush",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "heapq.heappush",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "heapq.heappop",
"... |
70988181160 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from .tgcn import ConvTemporalGraphical
class st_gcn(nn.Module):
r"""Applies a spatial temporal graph convolution over an input graph sequence.
Args:
in_channels (int): Number of channels in the inpu... | buptzqr/golfdbPipeline | gcn/st_gcn_alone.py | st_gcn_alone.py | py | 3,567 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "torch.nn.Module",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "tgcn.ConvTemporalGraphical",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "torch.nn.Seque... |
70031209641 | import copy
import datetime
import pytz
import urllib
from sqlalchemy.orm import exc
from flask import abort
def get_or_create(session, model, **kwargs):
instance = session.query(model).filter_by(**kwargs).first()
if instance:
return instance, False
else:
instance = model(**kwargs)
... | boreq/archive_chan_flask | archive_chan/lib/helpers.py | helpers.py | py | 1,917 | python | en | code | 8 | github-code | 18 | [
{
"api_name": "pytz.utc.localize",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pytz.utc",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetime.dat... |
42383538221 | # -*- coding:utf-8 -*-
from datetime import datetime,timedelta
from airflow import DAG
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.python_operator import BranchPythonOperator
from airflow.providers.snowflake.operators.snowflake import SnowflakeOperator
from airflow.sensors.extern... | roganOh/portfolio | chequer/chequerETL/run_dags/suspend_snowflake_querypie.py | suspend_snowflake_querypie.py | py | 4,231 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "datetime.datetime",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "airflow.DAG",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "datetime.datetime... |
24911294103 | import click
from tq.connection import rc
from tq.logger import info
from tq.worker import Worker, ScheduledWorker, FailedWorker
default_queues = 'main'
queue_help = 'Queues for worker, separated by commas'
scheduled_worker_help = 'Scheduled worker'
failed_worker_help = 'Failed worker'
@click.command()
@click.opt... | whoisprakhar/tq | cli.py | cli.py | py | 1,073 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "tq.worker.Worker",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "tq.worker.ScheduledWorker",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "tq.worker.FailedWorker",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "tq.... |
16476487160 | from app.MicStream import MicStream
import pyaudio
class MicStreamBuilder():
DEFAULT_CHANNEL = 2
def build(self, format_bit: int, rate: int, frames: int):
"""マイクの入力ストリーム生成し返却します。
デバイスを0番から順番に探し、名前によって利用できるマイクか判定します。
予定出力チャンネルでのストリーム開設を目指すが、失敗したらチャンネル数を1減らします。"""
print("Creatin... | yuto-moriizumi/sotuken | Streamer/app/MicStreamBuilder.py | MicStreamBuilder.py | py | 1,838 | python | ja | code | 0 | github-code | 18 | [
{
"api_name": "pyaudio.PyAudio",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "app.MicStream.MicStream",
"line_number": 27,
"usage_type": "call"
}
] |
71844422761 | from utils import megre_pair, get_sorted_vocab
def bpe_train(train_text="data/smalltrain.txt", save_vocab="data/10000.txt", vocab_size=10000, min_frequency=3):
"""训练词表并存储.
Args:
train_text: 文件的输入路径
save_vocab: 生成的输出路径
vocab_size:词表的大小
min_frequency: 最小出现词频
"""
import t... | xuyifan-0731/chinese-token-based-on-BPE | BPE_train.py | BPE_train.py | py | 1,688 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "time.time",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "utils.get_sorted_vocab",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_numb... |
37510874745 | "Runs the test problem."
def test_cubic():
import numpy as np
from . import cubic
claw = cubic.setup(solver_type="sharpclaw")
# For the classic solver with solver.limiters = pyclaw.limiters.tvd.vanleer,
# nonclassical solutions occur...
claw.run()
sol = claw.solution.state.get_q_global()
... | clawpack/pyclaw | examples/cubic_1d/test_cubic.py | test_cubic.py | py | 723 | python | en | code | 148 | github-code | 18 | [
{
"api_name": "numpy.linalg.norm",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "nose.main",
"line_number": 26,
"usage_type": "call"
}
] |
9655661194 | import matplotlib.pyplot as plt
from PIL import Image
from torchvision import transforms
import numpy as np
def image_loader(path, size=None, normalize=False):
"""convert an image to torch tensor of desired size
Parameters
----------
path : string
Path to image
size : tuple
w x h... | mrcyme/Deep-Music-Visualiser | dataloader.py | dataloader.py | py | 1,905 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "torchvision.transforms.ToTensor",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 26,
"usage_type": "call"
},
{
... |
29883950099 | import cv2
import glob
from operator import itemgetter
import os
FLANN_INDEX_KDTREE = 0
class Match:
ref_images = []
sift = None
flann = None
def __init__(self):
self.sift = cv2.xfeatures2d.SIFT_create()
index_params = dict(algorithm=FLANN_INDEX_KDTREE, trees=5)
search_param... | swagata-kundu/ir-bootle | match.py | match.py | py | 2,302 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cv2.xfeatures2d.SIFT_create",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.xfeatures2d",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "cv2.FlannBasedMatcher",
"line_number": 20,
"usage_type": "call"
},
{
"api_name":... |
40119792763 | from random import random
from sklearn.neighbors import KDTree
from numpy import array, ndarray
from scipy.stats import f
class Hopkins:
def __init__(self, data:ndarray, area_width:int, area_height:int, random_data:ndarray = None) -> None:
self.N = len(data)
self.X = data
self.x_random = ra... | justdanyul/snakeden | snakeden/hopkins.py | hopkins.py | py | 1,438 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.ndarray",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "sklearn.neighbors.KDTree",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.array",
... |
653283080 | from faker import Faker
from datetime import datetime
import csv, pandas, os
import json
fake = Faker(['es_ES'])
total= 2000 #1000000
time_file = datetime.now().strftime("%Y-%m-%d-%H-%M-%S")
destinationcsv="db-"+ str(time_file)+"-tot"+(str(total))+ ".csv"
destinationjson="db-"+ str(time_file)+"-tot"+(str(total))+ "... | agustinjaume/GCP_Work_flow_ETL | data/generacion_bd_esp.py | generacion_bd_esp.py | py | 1,224 | python | en | code | 7 | github-code | 18 | [
{
"api_name": "faker.Faker",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "csv.writer",
"li... |
23472090306 | # -*- coding: utf-8 -*-
__author__ = 'Douglas Uba'
__email__ = 'douglas.uba@inpe.br'
import goes, goes.utils
from itertools import chain
import os
import s3fs
def download(bucket, products, start, end, hours, channels, output, progress=None):
# Connection with S3 GOES AWS file system
fs = s3fs.S3FileSystem(... | uba/goes-downloader | goes/downloader.py | downloader.py | py | 2,468 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "s3fs.S3FileSystem",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "goes.utils.generateListOfDays",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "goes.utils",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "goes.... |
84022593 | """
Functions to QC imputed data (in hdf5 format)
@ Author: Harald Ringbauer, 2021
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import os as os
import sys as sys
import h5py
def get_gp_df(path_h5 = "", chs = [1,], iids = ["iid1",],
cutoffs = [0.5,0.6,0.7,0.8,0.9]):
"""... | hringbauer/ancIBD | package/ancIBD/IO/h5_qc.py | h5_qc.py | py | 2,888 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "pandas.DataFrame",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "h5py.File",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number":... |
43475277412 | # -*- coding: utf-8 -*-
"""
@Author: xiezizhe
@Date: 23/6/2020 上午11:51
"""
from typing import List
class Solution:
def maxProduct(self, nums: List[int]) -> int:
if not nums:
return 0
ret = nums[0]
sums = [1]
for n in nums:
if n == 0:
su... | forrest0402/leetcode | python/152. Maximum Product Subarray.py | 152. Maximum Product Subarray.py | py | 696 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "typing.List",
"line_number": 12,
"usage_type": "name"
}
] |
22024531462 | from django.views.generic import CreateView, UpdateView, DeleteView
from django.views.generic.detail import DetailView
from django.contrib import messages
from django.shortcuts import redirect
from django_filters.views import FilterView
from .filters import TaskFilter
from django.utils.translation import gettext_lazy a... | leilanimoone/python-project-52 | task_manager/tasks/views.py | views.py | py | 2,152 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "task_manager.mixins.TasksMixin",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django_filters.views.FilterView",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "filters.TaskFilter",
"line_number": 14,
"usage_type": "name"
},
{
... |
11291140773 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
name: 用友ICC struts2远程命令执行
referer: http://www.wooyun.org/bugs/wooyun-2010-023876
author: Lucifer
description: 用友ICC系统存在struts2框架漏洞。
'''
import urllib
import requests
def UrlProcessing(url):
if url.startswith("http"):#判断是否有http头,如果没有就在下面加入
res = urllib.parse... | A099/Medusa | OA/Yonyou/Yonyou_icc_struts2.py | Yonyou_icc_struts2.py | py | 2,442 | python | en | code | null | github-code | 18 | [
{
"api_name": "urllib.parse.urlparse",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "urllib.parse",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "urllib.parse.urlparse",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "urllib.... |
32821987025 | import argparse
import csv
import collections
import logging
import math
import random
import traceback
import pathlib
import pickle
import warnings
import dirichlet
import joblib
import numpy as np
import scipy.stats
import scipy.optimize
import sklearn
from sklearn.linear_model import LogisticRegression
import toml
... | FairyDevicesRD/statistical-quality-estimation | optimize.py | optimize.py | py | 20,683 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.basicConfig",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.empty",... |
35323146241 | # coding: UTF-8
from typing import Union
import requests
# using-functions
def init():
"""The initialization of this program"""
from os import mkdir
from sys import exit
try:
mkdir('tmp')
except FileExistsError:
pass
except PermissionError:
print('Tempora... | labo-China/Bilibili_viewer | scripts/tool.py | tool.py | py | 8,092 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.mkdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.rmdir",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 26,
"usa... |
28007839278 | from collections import defaultdict
def dfs(graph, stack, visited):
while stack:
v = stack.pop()
for a in graph[v]:
if visited[a] == 0:
stack.append(a)
visited[a] = - visited[v]
else:
if visited[a] == visited[v]:
... | yein-lee/PS | 백준/Gold/1707. 이분 그래프/이분 그래프.py | 이분 그래프.py | py | 957 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.defaultdict",
"line_number": 21,
"usage_type": "call"
}
] |
69876550759 |
import psycopg2
from psycopg2 import sql
import berserk
API_TOKEN = "LICHESS_API_TOKEN"
db_params = {
'dbname': 'DB_NAME',
'user': 'postgres',
'password': 'admin',
'host': 'localhost',
'port': '5432'
}
session = berserk.TokenSession(API_TOKEN)
client = berserk.Client(session=session)
def store... | suveshmoza/reachhub_assignment | backend/scripts/setup_db.py | setup_db.py | py | 1,405 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "berserk.TokenSession",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "berserk.Client",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "psycopg2.connect",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "psycopg2.sql.SQL... |
26050164881 | from collections import Counter
s = "aassddaaffg"
# 1. using Counter
x = Counter(s)
min = len(s) + 1 # because any frequency can not be greater than the length of the string
min_char = ''
print(x)
for key, val in x.items():
print(f"{key} : {val}")
if val < min:
min_char = key
min = val
print(m... | Sudipta0102/PyBasic | 02.DataTypes/Exercise/sTRINGeX/14.LeastFrequentCharacter.py | 14.LeastFrequentCharacter.py | py | 337 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.Counter",
"line_number": 5,
"usage_type": "call"
}
] |
4269554900 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 28 16:54:02 2021
@author: mike
"""
import os
import yaml
import xarray as xr
from tethys_cdsapi import Downloader
#######################################################
### Testing
base_dir = os.path.realpath(os.path.dirname(__file__))
with ope... | tethys-ts/tethys-cdsapi | tethys_cdsapi/tests/utest_downloader.py | utest_downloader.py | py | 842 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.realpath",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"lin... |
14770155505 | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 13 09:29:53 2018
MacCormack Solver for St Venant Equations.
Simple Channel Flow
@author: Joe Shuttleworth @ Cardiff University
Contact: shuttleworthjd@cardiff.ac.uk
"""
import numpy as np
import matplotlib.pyplot as plt
# Fixed variables
dt = 0.02
... | jshuttleworth/ShallowWaters | MacCormackSolver.py | MacCormackSolver.py | py | 2,551 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.zeros",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 34... |
14900354292 | import logging
import dramatiq
import plaid
import redis.lock
from django.apps import apps
from dramatiq_crontab import cron
from plaid.api.plaid_api import PlaidApi
from plaid.model.transfer_event import TransferEvent
from plaid.model.transfer_event_sync_request import TransferEventSyncRequest
from plaid.model.transf... | Neighborhood-Studios/scary-fast-apps | backend/django/plaid_app/tasks.py | tasks.py | py | 5,510 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.info",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.apps.apps.get_app_config",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.apps.apps",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "redis.l... |
18500962166 | from django.db import models
from category.models import Category
from user.models import TimeStampedModel, User
class Question(TimeStampedModel):
title = models.CharField(max_length=255)
contents = models.TextField(blank=True, default="")
writer = models.ForeignKey(
User, on_delete=models.CASCAD... | TheQuve/quve | question/models.py | models.py | py | 776 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "user.models.TimeStampedModel",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.db.models",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": ... |
33875156895 | import tkinter as tk
import firebase_admin
from firebase_admin import credentials
from firebase_admin import firestore
# Initialize Firebase app
cred = credentials.Certificate("credentials.json")
firebase_admin.initialize_app(cred)
# Create a Firestore client
db = firestore.client()
# Geometry variable for the main ... | Ryan-Morin/Note_Taking_App | main.py | main.py | py | 2,690 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "firebase_admin.credentials.Certificate",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "firebase_admin.credentials",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "firebase_admin.initialize_app",
"line_number": 8,
"usage_type": "call"
... |
38683233306 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#2-10-3-6.py
import base64
import random
def enCodeBase64(myStr):
return base64.b64encode(myStr.encode("utf8"))
def deCodeBase64(myStr):
return base64.b64decode(myStr).decode("utf8")
strTxt="""
1978年出现了著名的RSA算法,它通常是先生成一对RSA密钥,
其中之一是保密密钥,由用户保存;
另一个为公开密钥,可对外公开,... | spxai/interestingPython | src/2-10-3-6.py | 2-10-3-6.py | py | 1,286 | python | zh | code | 0 | github-code | 18 | [
{
"api_name": "base64.b64encode",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "base64.b64decode",
"line_number": 11,
"usage_type": "call"
}
] |
12791472128 | # ----------------------------------------------------------------------------
# Created By : Tobias Mink, Marvin Kemper
# ---------------------------------------------------------------------------
"""
Creates a button for every interaction object in plot.
"""
# -------------------------------------------------------... | TMink/PP21-Mink_Kemper | praxis_projekt_ss_2022/app_window/ui_elements_functions/io_create_plotted_objects_button.py | io_create_plotted_objects_button.py | py | 1,778 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "data.lists.button_selected",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "data.dictionarys.excavation_layers",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "data.dictionarys.segmentation_extraction_layers",
"line_number": 18,
"usage... |
10390321716 | from avatar2 import *
from avatar2.peripherals import *
from pandare import *
import logging
import os
from .peripherals import *
from .hooks import *
from .callbacks import *
from .logger import *
class ShannonEE:
def __init__(self, segments, patches=None, hooks=None, callbacks=None):
self.logger = Logg... | 3akur6/ShannonEE | ShannonEE/ShannonEE.py | ShannonEE.py | py | 4,738 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.DEBUG",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 97,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 97,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_nu... |
14312651070 | from bs4 import BeautifulSoup as bs
from urllib.request import urlopen as uReq
from django.core.files import File
from OpenGovCore.models import States, Parliamentary_Constituencies, Parties, Candidate,Term,Candidature,Central_Legislatures,Questions,Debates,Bills,Parliamentary_Sessions,Attendance
from django.db.models ... | HackForChangeIN/OpenGov | OpenGovCore/management/commands/opengovparser.py | opengovparser.py | py | 14,608 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "OpenGovCore.models.Candidate.objects.get",
"line_number": 32,
"usage_type": "call"
},
{
... |
71184601961 | import argparse
import configparser
import logging
import os
import pathlib
import pwd
import re
import shlex
import smtplib
import subprocess
import sys
import time
from datetime import datetime, timedelta
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from string import Template
... | andbanman/ansible-role-slurm | files/slurm-mail/bin/slurm-send-mail.py | slurm-send-mail.py | py | 15,345 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "typing.Optional",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 55,
"usage_type": "name"
},
{
"api_name": "dat... |
31085287879 | import os
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from models import ConvertRequest, Base
class Database(object):
"""
Controls database operations, viz. add, delete, update, retrieve.
"""
db_connection_string = None
engine = None
session_maker = None
... | draeger-lab/EscherConverter | api/database.py | database.py | py | 1,812 | python | en | code | 14 | github-code | 18 | [
{
"api_name": "os.path.exists",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine"... |
8739794205 | import cv2
image=cv2.imread("c.jpeg")
cv2.namedWindow('Original', cv2.WINDOW_NORMAL)
cv2.resizeWindow('Original', 350,350)
cv2.imshow('Original',image)
grey_image=cv2.cvtColor(image,cv2.COLOR_BGR2GRAY)
cv2.namedWindow('Greyscale', cv2.WINDOW_NORMAL)
cv2.resizeWindow('Greyscale', 350,350)
cv2.imshow('Greyscale',grey_i... | viru2001/Small-Programs | bgr2grey.py | bgr2grey.py | py | 402 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cv2.imread",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "cv2.namedWindow",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "cv2.WINDOW_NORMAL",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "cv2.resizeWindow",
... |
14820539301 | from django.shortcuts import render, redirect, HttpResponse
from .models import *
from django.contrib import messages
# Create your views here.
def logout(request):
request.session.flush()
return redirect('/')
def index(request):
if 'user_id' not in request.session:
return redirect('/')
conte... | Jordan-McGhee/the_wall | the_wall_app/views.py | views.py | py | 1,653 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.shortcuts.redirect",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 19,
"usage_type": "call"
},
{
"api_na... |
26516131965 | from absl import flags
from absl.testing import absltest
from absl.testing import parameterized
from neural_testbed.bandit import run
FLAGS = flags.FLAGS
PAPER_AGENTS = ['mlp', 'bbb', 'dropout', 'ensemble', 'ensemble+', 'hypermodel']
class RunTest(parameterized.TestCase):
@parameterized.parameters([[x] for x in P... | deepmind/neural_testbed | neural_testbed/bandit/run_test.py | run_test.py | py | 553 | python | en | code | 180 | github-code | 18 | [
{
"api_name": "absl.flags.FLAGS",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "absl.flags",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "absl.testing.parameterized.TestCase",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name"... |
13651537758 | import numpy as np
import pandas as pd
from sklearn.preprocessing import RobustScaler, MinMaxScaler, StandardScaler
def scale_data(train, validate, test, scale_type = None, to_scale = None):
'''
returns scaled data of specified type into data frame, will
'''
train_copy = train.copy()
validate_copy... | RAXR-Capstone/project_danger_zone | work_space/XavierWorkspace/PythonScripts/scale.py | scale.py | py | 2,945 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "sklearn.preprocessing.MinMaxScaler",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.RobustScaler",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 25,
"usage_ty... |
29557967754 | from flask import Flask, request, render_template, flash, redirect, send_file, abort
from werkzeug.utils import secure_filename
import os
UPLOAD_FOLDER = 'uploads'
ALLOWED_EXTENSIONS = set(['wav'])
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
def allowed_file(filename):
return '.' in filenam... | Arkanayan/Speech-Recognition | main.py | main.py | py | 2,395 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "flask.request.file... |
7891863169 | from app_prof_retraining.models import ProgramProfRetrain, CategoryProfRetrain
import csv
from django.core.management.base import BaseCommand
def import_data():
with open('/Users/artemgoranskij/Desktop/25.csv') as csvfile:
reader = csv.reader(csvfile, delimiter=';')
for row in reader:
... | artemgoryanskiy/standart | app_prof_retraining/management/commands/import_csv_1.py | import_csv_1.py | py | 648 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "csv.reader",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "app_prof_retraining.models.ProgramProfRetrain.objects.create",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "app_prof_retraining.models.ProgramProfRetrain.objects",
"line_number":... |
72480865319 | """
Ported to Python from this source:
https://www.tweaking4all.com/hardware/arduino/adruino-led-strip-effects/#LEDStripEffectFire
Original comments and variable names maintained.
"""
import random
import typing
from light import Light
from marshmallow import Schema, fields, post_load, validate
from .animation_int... | dullage/maestro | maestro/animations/fire.py | fire.py | py | 2,566 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "marshmallow.Schema",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "marshmallow.fields.Int",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "marshmallow.fields",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "marshmal... |
72494216360 | import numpy as np
import cv2
from skimage.feature import hog
def get_hog_features(img, orient, pix_per_cell, cell_per_block,
vis=False, feature_vec=True):
# Call with two outputs if vis==True
if vis == True:
features, hog_image = hog(img, orientations=orient,
... | galenballew/SDC-Lane-and-Vehicle-Detection-Tracking | Part III - Vehicle Detection and Tracking/features.py | features.py | py | 1,975 | python | en | code | 227 | github-code | 18 | [
{
"api_name": "skimage.feature.hog",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "skimage.feature.hog",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.histogram",
... |
2441514209 | """
small_matrix_app.matrix_app.db_widget.py
This widgets writes data to or loads data from disk
"""
import os
import h5py
from PyQt5 import QtWidgets
from typing import List
import numpy as np
from os import mkdir, remove, path, listdir
from os.path import isfile, join
from matrix_app.all_exceptions import (
... | grace-harper/small-matrix-app | matrix_app/db_widget.py | db_widget.py | py | 6,262 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "typing.List",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 73,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets"... |
14312489591 | # Tensorflow throws a warning:- Instructions for updating: Colocations handled automatically by placer.
# We can ignore his warning or shut it, doesnt matter code works fine(for now).
import nltk
from nltk.stem.lancaster import LancasterStemmer
import numpy as np
import tflearn
import tensorflow as tf
import j... | Siddp278/Chat-bots-example | Restaurant Bot/main.py | main.py | py | 3,877 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "json.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "nltk.word_tokenize",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "string.punctuation",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "nltk.stem.lancas... |
71799779560 | import os, time
from colorama import Fore, init
import getpass
import socket
import subprocess as sp
def times():
times = time.strftime("%H:%M:%S")
times = str(times)
return(times)
def clear():
if os.name == 'nt':
return os.system('cls')
else:
return os.system('clear')
def check_host():
... | hide-wow/speak-py | speak-windows/ui.py | ui.py | py | 2,056 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "time.strftime",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.name",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.system",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 16... |
3405871221 | from .resnet_encoder import resnet18, resnet34
import torch
import torch.nn as nn
import os
import utils
# Citation: Code borrowed from Pytorch. Minor edits by me.
class Model(nn.Module):
def __init__(self, opt, model_dir):
super(Model, self).__init__()
self.encoder_frozen = opt.freeze_encod... | SohamTamba/DeepRL | 2 - Immitation Learning/Racing/model/model.py | model.py | py | 4,350 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "torch.nn.Module",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "resnet_encoder.resnet18",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "resnet_encoder.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.