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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
31877770121 | import paddle.v2 as paddle
from paddle.utils.merge_model import merge_v2_model
# import network configuration
from mobilenet import mobile_net
if __name__ == "__main__":
image_size = 224
num_classes = 102
net = mobile_net(3 * image_size * image_size, num_classes, 1.0)
param_file = './mobilenet_flowers... | PaddlePaddle/Mobile | deployment/model/merge_config_parameters/merge_model.py | merge_model.py | py | 431 | python | en | code | 70 | github-code | 18 | [
{
"api_name": "mobilenet.mobile_net",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "paddle.utils.merge_model.merge_v2_model",
"line_number": 13,
"usage_type": "call"
}
] |
28936865661 | from django.shortcuts import render
from rest_framework.decorators import api_view
from rest_framework.response import Response
from .models import Post
from .serializers import PostSerializer
@api_view(['GET'])
def index(request):
return Response({"Success": "The setup was successfully"})
@api_view(['GET'])
d... | khanhsonb1c1/movie-server | blogApiApp/views.py | views.py | py | 1,845 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "rest_framework.response.Response",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "rest_framework.decorators.api_view",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "models.Post.objects.all",
"line_number": 16,
"usage_type": "call"
},... |
37040544552 | from PIL import Image, ImageTk
from Consts import*
from Weapon import*
from random import*
class Command:
ButtonImage = None
ButtonPressedImage = None
Name = ''
entity = None
NameTvor = ''
def __init__(self, entity):
self.entity = entity
def SetImage(self, imageFi... | Slavathehiller/DnH | Command.py | Command.py | py | 6,341 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "PIL.Image.open",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "PIL.ImageTk.PhotoImage",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "PIL.ImageTk",
"li... |
21849205330 | from datetime import datetime
import math
import numpy as np
import random as rd
import sys
def anchor(year):
century = math.floor(year/100)
century_anchor = (5*(century%4))%7+2
decade = year-century*100
if decade%2 != 0: decade += 11
decade /= 2
if decade%2 != 0: decade += 11
decade_anchor... | SimonHiesl/Bash-Programs | python_files/dates.py | dates.py | py | 4,776 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "math.floor",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_nu... |
36298007542 | import json_to_db
import os
from requests import get
import cairosvg
PATH = os.getcwd()+"/res/"
def printProgress (iteration, total, prefix = '', suffix = '', decimals = 1, barLength = 100):
formatStr = "{0:." + str(decimals) + "f}"
percent = formatStr.format(100 * (iteration / float(total)))
filledLength = int(roun... | tomomi-h/haitlab-teamd | logo_classify/svg_downloader.py | svg_downloader.py | py | 1,113 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.getcwd",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "json_to_db.Json",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": ... |
4101467487 | import sys
sys.stdin = open('11967.txt')
import collections
dr = [0, 0, -1, 1]
dc = [-1, 1, 0, 0]
def bfs():
deq = collections.deque()
deq.append((1, 1))
visit = [[0 for _ in range(N + 1)] for _ in range(N + 1)]
visit[1][1] = 1
result = 1
while deq:
row, col = deq.popleft()
# pr... | HwnagYoungJun/algorithm | 2020/4월/0427/11967_불켜기_백준.py | 11967_불켜기_백준.py | py | 1,342 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "sys.stdin",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 8,
"usage_type": "call"
}
] |
11855249984 | import logging
import logging.handlers
import time
import datetime
import os
import random
import argparse
import sys
import re
# libs
import requests
from pyquery import PyQuery
# Local
import parse_post
class Topic():
# Topic level stuff
def get_topic_title(self):
# Get the thread title
th... | woodenphone/dump_phpbb | parse_viewtopic.py | parse_viewtopic.py | py | 6,120 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "re.search",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "pyquery.PyQuery",
"line_number": 6... |
13635927692 | from datetime import datetime
import unittest
import asyncio
import time
from ocpp.routing import on, after
from ocpp.v16.enums import Action, RegistrationStatus
from ocpp.v16 import call_result, call
import ocpp.exceptions
import default_platform
import default_central
from test_runner import run_test
class TestCh... | Tinkerforge/tfocpp | test/test_change_availability.py | test_change_availability.py | py | 8,397 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "unittest.TestCase",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "default_central.DefaultChargePoint",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "ocpp.v16.call.ChangeAvailabilityPayload",
"line_number": 22,
"usage_type":... |
21118480184 | """
Given a list of integers, write a function that returns the largest sum of non-adjacent numbers.
Numbers can be 0 or negative.
For example, [2, 4, 6, 2, 5] should return 13, since we pick 2, 6, and 5. [5, 1, 1, 5]
should return 10, since we pick 5 and 5.
Follow-up: Can you do this in O(N) time and constant space?... | rrwt/daily-coding-challenge | daily_problems/problem_0_to_100/test_9.py | test_9.py | py | 1,879 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "daily_problems.problem_0_to_100.problem_9.largest_non_adjacent_sum",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "daily_problems.problem_0_to_100.problem_9.largest_non_adjacent_sum",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pytest.mark... |
32289552630 | from flask import Flask, request, Response
import jsonpickle
import numpy as np
app = Flask(__name__)
import requests as req
url = 'http://localhost:80/Edge/3/1'
@app.route("/capture/", methods=['POST'])
def capture():
r = request
# convert string of image data to uint8
nparr = np.fromstring(r.data, ... | kailashlimba/Edgetensor_Task_FSD | newServer.py | newServer.py | py | 924 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "numpy.fromstring",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_num... |
29693906906 | #!/usr/bin/python
# Python中列表是可变的,这是它区别于字符串和元组的最重要的特点,一句话概括即:列表可以修改,而字符串和元组不能。
a = [66.25, 333, 333, 1, 1234.5]
print(a.count(333), a.count(66.25), a.count('x'))
a.insert(2, -1)
a.append(333)
a.index(333)
a.remove(333)
a.reverse()
a.sort()
'''list.append(x) 把一个元素添加到列表的结尾,相当于 a[len(a):] = [x]。
list.extend(L) 通过添加指定列表的... | Kingson4Wu/python3_demo | src/com/kxw/python/python3-data-structure.py | python3-data-structure.py | py | 6,758 | python | zh | code | 0 | github-code | 18 | [
{
"api_name": "collections.deque",
"line_number": 44,
"usage_type": "call"
}
] |
6831895494 | # jukebox.py
# A GUI interface that shows you artists, their albums,
# and the songs in those albums.
# Lecture: 221. Simple Database Browser
# I left is debug print statements.
# - Jim
import sqlite3
import tkinter
# Connect to the DB:
music_db_conn = sqlite3.connect("./music.sqlite")
# Which artist is presentl... | bjamesm70/Python_Examples | MusicBrowser/jukebox.py | jukebox.py | py | 12,479 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sqlite3.connect",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tkinter.Listbox",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "tkinter.Scrollbar",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "tkinter.VERTIC... |
23870866592 | import random
import argparse
import random
import time
import uuid
import json
import faker
import numpy as np
def random_timestamp_within(start, end, format, prop):
"""Get a time at a proportion of a range of two formatted times.
start and end should be strings specifying times formated in the
given f... | guidj/hale | py/hale/data/ecommerce.py | ecommerce.py | py | 2,738 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "time.mktime",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "time.strptime",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "time.mktime",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "time.strptime",
"line_numbe... |
26906394404 | from tinydb import Query, where
from time import time
import config
import random
from fastapi import APIRouter, Request, Response
from core_common import core_process_request, core_prepare_response, E
from core_database import get_db
router = APIRouter(prefix="/local2", tags=["local2"])
router.model_whitelist = ["... | drmext/MonkeyBusiness | modules/iidx/iidx30pc.py | iidx30pc.py | py | 47,138 | python | en | code | 55 | github-code | 18 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "core_database.get_db",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tinydb.where",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "core_database.get... |
4007153464 | import importlib
import os
import types
from tensorflow.python.platform import tf_logging as logging
_TENSORFLOW_LAZY_LOADER_PREFIX = "_tfll"
class LazyLoader(types.ModuleType):
"""Lazily import a module, mainly to avoid pulling in large dependencies.
`contrib`, and `ffmpeg` are examples of modules that are lar... | tensorflow/tensorflow | tensorflow/python/util/lazy_loader.py | lazy_loader.py | py | 7,103 | python | en | code | 178,918 | github-code | 18 | [
{
"api_name": "types.ModuleType",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "importlib.import_module",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "tensorflow.python.platform.tf_logging.warning",
"line_number": 40,
"usage_type": "call"
},... |
23607375786 |
from sqlalchemy import create_engine, exc
from sqlalchemy.orm import sessionmaker
from database import DBUpdate, DBBase, Game, User, GameKill, Item, GameMod, TeamStats, \
GameMap, GameType, EndCause, Score, Model, HModel, Say, Tell, SayTeam, \
Pk3Files, GameParameter, Team, Config
class DBHandler(ob... | SourceDoctor/Quakealyzer | libs/dbhandler.py | dbhandler.py | py | 14,918 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "database.Game",
"line_number": 38,
"usage_type": "argument"
},
{
"api_name": "database.Game.id",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "sqlalchemy.exc.SQLAlchemyError",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_n... |
27872723106 | import io
import sys
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import time
sys.stdout=io.TextIOWrapper(sys.stdout.detach(),encoding='utf-8')
sys.stderr=io.TextIOWrapper(sys.stderr.detach(),encoding='utf-8')
class NcafeWriteAtt:
#초기화 실행(webdriver 설정)
def __init__(self... | seokhui11111/atom_py | section3/3-7-1.py | 3-7-1.py | py | 943 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.stdout",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "io.TextIOWrapper",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.stdout.detach",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"lin... |
8552769268 | from copy import copy
from itertools import cycle
from random import randint, shuffle, choice
import pygame
from pygame import Color
scale = 2
class Langtonsant:
def __init__(self, screen):
self.ruleslist = None
self.direction = None
self.rules = None
self.position = None
... | Smithsonian64/vEffects | langtonsant.py | langtonsant.py | py | 4,457 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pygame.Surface",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "itertools.cycle",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "itertools.cycle",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "itertools.cycle",
... |
26261520699 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import re
import os
import time
import logging
from . import config
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
import watchdog.events as events
from threading import Thread
from .cleepapi import CleepApi
from .file... | CleepDevice/cleep-cli | cleepcli/watch.py | watch.py | py | 10,954 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "threading.Thread",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "threading.Thread.__init__",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "threading... |
10126809416 | from datetime import datetime
from pytrends.request import TrendReq
from PersistenceLayer.ExternalAPIsORM.ExternalAPIsORMFacade import ExternalAPIsORMFacade
class GoogleTrendsManager:
def __init__(self):
self.pytrends = TrendReq(hl='en-US', tz=360, retries=3)
self.ExternalOrm = ExternalAPIsORMFac... | CiTRuS1993/FakeNewsDashboardServer | BuisnessLayer/ExternalSystemsAPIsManager/GoogleTrendsManager.py | GoogleTrendsManager.py | py | 4,643 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pytrends.request.TrendReq",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PersistenceLayer.ExternalAPIsORM.ExternalAPIsORMFacade.ExternalAPIsORMFacade",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.today",
"line_number"... |
25165902533 | from dash import Dash, dcc, html, Input, Output,ctx
import plotly.express as px
import pandas as pd
import os
import json
app = Dash(__name__)
#directory to data
directory = 'data/norm_data/'
files = os.listdir(directory)
jsonname = 'timestamps.json'
val_jsonname = 'val.json'
#get column names from a random file
d... | curtis161514/Tank_Demo | step4_app.py | step4_app.py | py | 3,360 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "dash.Dash",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number... |
9316347384 | """
Layerwise Optimizer Intraprocessing Algorithm.
"""
import copy
import logging
import math
import numpy as np
import torch
from models import load_model
from skopt import gbrt_minimize
from skopt.space import Real
from utils import get_best_thresh, get_test_objective, get_valid_objective
logger = logging.getLogger... | abacusai/intraprocessing_debiasing | algorithms/layerwiseOpt.py | layerwiseOpt.py | py | 3,375 | python | en | code | 8 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "models.load_model",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "math.inf",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "copy.deepcopy",
... |
16792747601 | import argparse
from pathlib import Path
import typing
import numpy as np
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
from PIL import Image
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision
import torchvision.transforms.functional as F
from torchinfo import ... | popura/itmnet-pytorch | src/test.py | test.py | py | 5,615 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "matplotlib.use",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "omegaconf.DictConfig",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "PIL.Image.BICUBIC",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image",... |
27340988189 | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2012-04-26
@author: shell.xu
'''
import logging
logger = logging.getLogger('http')
BUFSIZE = 8192
CODE_NOBODY = [100, 101, 204, 304]
DEFAULT_PAGES = {
100:('Continue', 'Request received, please continue'),
101:('Switching Protocols',
'Switching to... | shell909090/antigfw | uniproxy/http.py | http.py | py | 8,109 | python | en | code | 92 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
}
] |
10998794342 | """Functions for reviewing HITs"""
from hit_info import *
from hit_results import *
import log
import create
import save
import email_worker
import logging
import pandas as pd
import boto3
import xmltodict
import random
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
def get_pending_hi... | tomerwolgithub/Break | annotation_pipeline/mturk_backend/review.py | review.py | py | 22,495 | python | en | code | 43 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_c... |
21036279262 | import sys
import os
import yaml
import re
import urllib.request
from .drawio_parse.parse import xml2yaml
from .utils.get_yaml import get_yaml
DEBUG_FLAG = True
LEFT = 0
CENTER = 1
RIGHT = 2
class widget_configure:
def __init__(self):
self.x_center = 0
self.y_center = 0
self.x_left = 0
... | Ar-Ray-code/ReadableWidgets | PySide2/pyamlside2/label_configure.py | label_configure.py | py | 10,439 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "re.match",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "utils.get_yaml.get_yaml",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_... |
26638179962 | """ function to normalize libraries to translate DNA sequences into amino
# acid sequences of peptides
#
# inputs:
# mer: number of peptides per sequence
#
# filenamefastq: string containing the filepath, filename, and
# extension of the raw data file from deep sequencing
#
# startflank: sequenc... | stephendl102/PhagePep | translatefastq2.py | translatefastq2.py | py | 10,427 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "time.time",
"line_number": 105,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 108,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 109,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"lin... |
22349042209 |
import nltk
nltk.download('twitter_samples')
from nltk.corpus import twitter_samples
import json
from twitter import *
import gender_guesser.detector as gender
from datetime import *
from ethnicity import *
#import numpy as np
#import os
#import copy
#import difflib
class TweetEmotionClassifier:
... | tianxyi/TwitterDataMiningProject | main.py | main.py | py | 13,394 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "nltk.download",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.twitter_samples.strings",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.twitter_samples",
"line_number": 23,
"usage_type": "name"
},
{
"api_... |
72236397479 | import torch
import torch.nn as nn
import world
if world.adjoint:
from torchdiffeq import odeint_adjoint as odeint
else:
from torchdiffeq import odeint
"""
# ODE Block and ODE function
We use the [torchDiffeq package](https://github.com/rtqichen/torchdiffeq) to design co-evolutionary ODEs.
"""
class ODEFuncti... | jeongwhanchoi/LT-OCF-Tutorial | code/odeblock.py | odeblock.py | py | 5,643 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "world.adjoint",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Module",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torch.sparse.mm",
... |
71285840999 | import matplotlib.pyplot as plt
import numpy as np
class ClickFunction:
"""
Class which represents the function that maps a budget value to the corresponding expected number of clicks
"""
def __init__(self, bound, slope):
self.__bound = bound
self.__slope = slope
def apply_func(se... | Lodz97/DIA-Project | environment/ClickFunction.py | ClickFunction.py | py | 810 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.exp",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplo... |
15111718353 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lotnisko', '0010_auto_20160120_2137'),
]
operations = [
migrations.AlterField(
model_name='startlaneschedulefiel... | edek437/Zastosowanie-informatyki-w-gospodarce-projekt | lotnisko/migrations/0011_auto_20160120_2351.py | 0011_auto_20160120_2351.py | py | 440 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterField",
"line_number": 14,
"usage_type": "call"
},
{... |
30245749717 | import matplotlib.pyplot as plt
import re
import math
f = open('input.txt', 'r')
f1 = f.read()
f.close()
text = f1.split()
spx = []
spy = []
i=0
tr=0
while text[i]!='Summary:':
result = re.split(':', text[i])
if ((result[0]=='192.168.250.3') and (text[i+1]=='->')):
if text[i+7]=='M':
text[i+6]=str(math.ceil(floa... | Sereja2010/Mobilki | Lab2/lab2.py | lab2.py | py | 1,210 | python | ru | code | 0 | github-code | 18 | [
{
"api_name": "re.split",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 27,
"u... |
7709128870 | import RPi.GPIO as GPIO
import time
import pygame
import random
import glob
class of_daemon():
# some daeon stuff here
stdin_path = '/dev/null'
stdout_path = '/tmp/stdout.log'
stderr_path = '/tmp/stderr.log'
pidfile_path = '/var/lock/disp_news.pid'
pidfile_timeout = 20... | Riik/rpi | of_daemonized.py | of_daemonized.py | py | 1,829 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "time.sleep",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO.input",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "random.randint",
"line_number"... |
13761300692 | import datetime
import sys
import os
class Log:
def __init__(self, folder_path, sufix, nice_os):
self.folder_path = folder_path
self.log_sufix = sufix
if nice_os:
self.HEADER = '\033[95m'
self.OKBLUE = '\033[94m'
self.OKGREEN = '\033[92m'
sel... | gcba/phantom_traffic | libs/logs.py | logs.py | py | 1,604 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "datetime.datetime.now",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "da... |
29930842274 | import matplotlib.pyplot as plt
import pandas as pd
df = pd.read_csv('Temperature_Anomaly.csv')#uso la libreria pandas per leggere e gestire il csv per colonne
Year = df.Year
Value = df.Value
df1 = pd.read_csv('CO2_emissions.csv')
Year1 = df1.Year
Total = df1.Total
GasFuel = df1.GasFuel
LiquidFuel = df1.L... | baralssss/PYTHON | ECgraficiEMISSIONIeANOMALIE/graficiEMISSIONIeANOMALIE.py | graficiEMISSIONIeANOMALIE.py | py | 1,499 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.p... |
40600821326 | # -*- coding: utf-8 -*-
# from gevent import monkey
# monkey.patch_all()
import codecs
import json
import os
import random
import flask
from flask import Flask, jsonify
from flask import request
from flask import send_from_directory
from gevent import wsgi
# Подготавливаем tenants.json
tenants_json = os.path.join('.'... | peterkarabinovic/ozmap-editor | app.py | app.py | py | 3,271 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
34580641604 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 23 19:12:16 2022
@author: bmiit202006100110081
"""
import cv2
import numpy as np
# Loading the image
img = cv2.imread('2.jpg')
# preprocess the image
gray_img = cv2.cvtColor(img , cv2.COLOR_BGR2GRAY)
kernel = np.ones((5,5), np.uint8)
# A... | AnviPatel24/DIP | Q1.py | Q1.py | py | 851 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cv2.imread",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "numpy.ones",
"lin... |
13499168260 | import cv2
import glob
method = cv2.TM_SQDIFF_NORMED
# Read the images from the file
large_image = cv2.imread('red-team.png')
champions = glob.glob('test/*.png')
print(champions)
score = 100
scoreLoc = None
for champion in champions:
small_image = cv2.imread(champion)
result = cv2.matchTemplate(small_image, large... | eightbithack/Voideye | historical/cv2test.py | cv2test.py | py | 941 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cv2.TM_SQDIFF_NORMED",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_nu... |
40552406633 | # -*- coding: utf-8 -*-
from datadaemon.base import CCXTGrabber
from os import path
import pandas as pd
from datetime import datetime
from sqlalchemy import create_engine
from collections import defaultdict
from datadaemon.utilities.glob import CONFIG
class rCCXTGrabber(CCXTGrabber):
def __init__(self):
s... | August-Ghost/DataDaemon | datadaemon/base/rgrabber.py | rgrabber.py | py | 4,640 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "datadaemon.base.CCXTGrabber",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.p... |
72852707561 | #!/usr/bin/python3
"""
Contains the TestStateDocs classes
"""
from api.v1.app import app
from api.v1.views import index
from datetime import datetime
import inspect
import pep8
import unittest
from models import storage
class TestIndexDocs(unittest.TestCase):
"""Tests to check the documentation and style of ind... | MercyNJ/AirBnB_clone_v3 | tests/test_api/test_v1/test_views/test_index.py | test_index.py | py | 3,111 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "unittest.TestCase",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "inspect.getmembers",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "api.v1.views.index",
"line_number": 21,
"usage_type": "argument"
},
{
"api_name": "insp... |
38407871553 | import discord
from discord.ext import commands
import logging
from datetime import datetime
class Logger(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.logger = logging.getLogger(__name__) # Creating a logger for this cog
self.setup_logger()
def setup_logger(self):
... | nickshouse/Chao-Bot | src/cogs/logger.py | logger.py | py | 983 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "log... |
23852520958 | import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.optim as optim
import torch_geometric.nn as gnn
from torch_geometric.data import DataLoader
import seaborn as sns
import pandas as pd
from torch_geometric.datasets import Planetoid
from torch_geometric.transforms import NormalizeFe... | Ulteraa/Node_Classification_on_Knowledge_Graph | Node_classification.py | Node_classification.py | py | 3,331 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "torch_geometric.datasets.Planetoid",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch_geometric.transforms.NormalizeFeatures",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 15,
"usage_type": "attri... |
28047406320 | from badchants import has_wrestling_cadence, make_chant
from mastodon import Mastodon
import json
import sys
import random
CELEBS_PATH = 'input/celebrities.json'
def load_names():
celebs = ""
with open(CELEBS_PATH) as f:
file_data = f.read()
celebs = json.loads(file_data)
return celebs['celebrities']
def main... | jamala/badchants | bot.py | bot.py | py | 703 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "json.loads",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "mastodon.Mastodon",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "badchants.has_wrestling_ca... |
4877042979 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
from qiskit import *
import math
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit
get_ipython().run_line_magic('matplotlib', 'inline')
from qiskit.tools.visualization import plot_histogram
from qiskit.visualization import plot_state_city, plot_bloch... | CHFreddy/S_Transfrom_Implementations | Quantum_Circuit_S_Transform.py | Quantum_Circuit_S_Transform.py | py | 8,174 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "math.log",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "math.log",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "qiskit.QuantumRegister",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "qiskit.QuantumRegister",
... |
19743212230 | import sqlite3
conn = sqlite3.connect('coffee.db', check_same_thread=False)
cursor = conn.cursor()
def create_table():
cursor.execute('''
CREATE TABLE IF NOT EXISTS coffee_types (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
description TEXT,
price R... | Denlai7/cofina | coffee.py | coffee.py | py | 784 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sqlite3.connect",
"line_number": 2,
"usage_type": "call"
}
] |
14375465350 | from sklearn.feature_extraction.text import CountVectorizer
from sklearn.naive_bayes import MultinomialNB
from sklearn import metrics
from sklearn.model_selection import cross_val_predict
#Leitura
arq = open('amazon_cells_labelled.txt', 'r')
amazon = []
amazonC = []
for linha in arq:
frase = linha.replace('\t', ' '... | leossantos/Analise-de-Sentimento | Main.py | Main.py | py | 2,427 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "sklearn.feature_extraction.text.CountVectorizer",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "sklearn.naive_bayes.MultinomialNB",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.accuracy_score",
"line_number": 50,
"us... |
8874399211 | import time
from datetime import datetime as dt
# Had to import a few modules for this program to work.
hostsTemp = "hosts"
hostsPath = r"C:/Windows/System32/drivers/etc/hosts"
redirect = "127.0.0.1"
websiteList = ["www.facebook.com", "facebook.com"]
# Set up the hostsPath variable equal to the specific directory of... | rroncallo/Website-Blocker-Program | main.py | main.py | py | 2,951 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 35,
"usage_type": "call"
}
] |
11462523439 | import unittest
import io
import sys
import os
import datetime
from unittest.mock import patch
# Import the functions from your task manager program
from task import main, add_task, list_tasks, mark_completed, save_tasks
class test_task(unittest.TestCase):
def setUp(self):
self.task_file = "test_tasks.tx... | Abinjshaju/Python | test_task.py | test_task.py | py | 2,665 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "unittest.TestCase",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "io.StringIO",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.... |
20347262568 | """Main script.
When launched, it guides the user from choosing a classification method and its parameters to plotting and saving the data.
"""
from modules.helpers import (
choose_classification_method,
choose_split_factor,
plot_and_save_fig,
)
from modules.knn import evaluate_knn, evaluate_knn_optimized... | AlecColas/image-classification | main.py | main.py | py | 1,627 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "modules.helpers.choose_classification_method",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "modules.helpers.choose_split_factor",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "modules.read_cifar.read_cifar",
"line_number": 19,
"usag... |
31889928751 | import argparse
import logging
import os
import re
import shutil
import subprocess
import sys
import tempfile
from datetime import datetime
try:
import yaml
except ImportError:
import ruamel.yaml as yaml
import json
from pkg_resources import parse_version
try:
import markdown
HAVE_MARKDOWN = True
e... | linux-system-roles/auto-maintenance | release_collection.py | release_collection.py | py | 38,518 | python | en | code | 21 | github-code | 18 | [
{
"api_name": "markdown.Markdown",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 62,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
... |
15024365811 | import math
from typing import Optional, Tuple
import torch
import torch.utils.checkpoint
from torch import nn
from torch.nn import CrossEntropyLoss
from transformers import PretrainedConfig
import torch.nn.functional as F
from transformers.modeling_outputs import CausalLMOutputWithPast
from transformers.modeling_uti... | Sanster/padding_free_llm_train | padding_free_train/modeling/unpadded_qwen.py | unpadded_qwen.py | py | 17,865 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "transformers.utils.logging.get_logger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "transformers.utils.logging",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "transformers.PretrainedConfig",
"line_number": 22,
"usage_type": "name"
... |
19096114070 | from typing import List, Optional, Union
import hvplot
import pandas
from .plot import Plot
class ParetoFront(Plot):
"""
This class is used to create a pareto frontier plot of inference time v/s winrate, by framework.
Attributes
----------
plot_title: str,
title of the plot on the dashb... | autogluon/autogluon-dashboard | src/autogluon_dashboard/plotting/pareto_front.py | pareto_front.py | py | 1,762 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "plot.Plot",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "hvplot.Interactive",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "typing.Optional",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"... |
31053121031 | import argparse
import os
from sys import exit
from config import Config
from mangatracker import main
# Allow __main__ to run CLI without PySide2 installed
try:
from mangatracker_gui import gui_main
pyside2_installed = True
except ImportError:
pyside2_installed = False
def gui_main():
print("... | theorangesauce/MangaTracker | src/__main__.py | __main__.py | py | 1,364 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "mangatracker.main",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "mangatracker.main",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "mangatracker_gui.gui_mai... |
24497779158 | import os
import torch
import torch.nn.functional as F
from torch.utils.tensorboard import SummaryWriter
from src.models.network import Net
from src.data.preprocess import testset
from src.constants import MODEL_DIR_PATH, CLASSES
class Evaluator:
def __init__(self):
self.load(os.path.join(MODEL_DIR_PATH... | BeomyoungKim/ml-tdd-tutorial | src/models/evaluator.py | evaluator.py | py | 1,737 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "src.constants.MODEL_DIR_PATH",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.util... |
11384707043 | """
Created on Mon Sep 16 18:31:35 2013
PHYS 613, Assignment 3
Nick Crump
"""
# Problem 2 (EBB2)
"""
Generating the density of states (DOS) by finding energy eigenvalues of
a particle in a 2D infinite square well.
"""
import numpy as np
from math import exp
from LeastSquares import gaussNewton3
import matplotlib.py... | ncrump/ComputationalPhysics | PHYS613 A3 P2InfiniteQuantumWell.py | PHYS613 A3 P2InfiniteQuantumWell.py | py | 3,057 | python | en | code | 42 | github-code | 18 | [
{
"api_name": "numpy.sort",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "matplotlib.pypl... |
4667013251 | import pandas as pd
from settings import FEATURE_CHIN_ENG_DICT
import matplotlib.pyplot as plt
import numpy as np
path = '/media/reid/ext_disk1/blue_alage/dushu/geography_point.csv'
df = pd.read_csv(path)
lon_min, lon_max = df['lon'].min(), df['lon'].max()
lat_min, lat_max = df['lat'].min(), df['lat'].max()
range_st... | ZixianReid/blue_green_alage_prediction | preprocesser/tmp.py | tmp.py | py | 912 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_numb... |
72173662441 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
# if not calling for snakemake rule
try:
sys.stderr = open(snakemake.log[0], "w")
except NameError:
pass
import json
def main(mlst, metadata, assembly_qc, isolate_id, json_path):
# load jsons
with open(metadata, 'r') as fp:
meta_d... | NRW-GEUBT/geuebt-validate | workflow/scripts/create_isolate_sheet.py | create_isolate_sheet.py | py | 2,927 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "sys.stderr",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 25... |
1747817084 | import os, psutil, time, signal, sqlite3, config, subprocess, json
from ruamel.yaml import YAML
import girder_client
import xml.etree.ElementTree as ET
import girder_client
def check_pid(pid):
try:
os.kill(pid, 0)
if (psutil.Process(pid).status() == psutil.STATUS_ZOMBIE):
retu... | Andreja28/FES-API | util.py | util.py | py | 4,914 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "os.kill",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "psutil.Process",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "psutil.STATUS_ZOMBIE",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"... |
25250543462 | # SGAM: Building a Virtual 3D World through Simultaneous Generation and Mapping
# Authored by Yuan Shen, Wei-Chiu Ma and Shenlong Wang
# University of Illinois at Urbana-Champaign and Massachusetts Institute of Technology
import json
import numpy as np
from torch.utils.data import Dataset
from pathlib import Path
impo... | yshen47/SGAM | data/clevr-infinite.py | clevr-infinite.py | py | 8,374 | python | en | code | 56 | github-code | 18 | [
{
"api_name": "os.getpid",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.random.RandomState",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.data... |
26516817915 | import dataclasses
from typing import Tuple
from acme import types
from acme.agents.jax.dqn import learning_lib
from acme.jax import networks as networks_lib
import chex
import jax
import jax.numpy as jnp
import reverb
import rlax
@dataclasses.dataclass
class PrioritizedDoubleQLearning(learning_lib.LossFn):
"""Cli... | deepmind/acme | acme/agents/jax/dqn/losses.py | losses.py | py | 12,102 | python | en | code | 3,100 | github-code | 18 | [
{
"api_name": "acme.agents.jax.dqn.learning_lib.LossFn",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "acme.agents.jax.dqn.learning_lib",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "acme.jax.networks.TypedFeedForwardNetwork",
"line_number": 24,
... |
23435352904 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.touch_actions import TouchActions
from lxml import html
import os
import json
import numpy as np
# Functions
def find_session_id(driver):
# Fin... | DongHur/NeuroDatabase | CrunchBaseScrape.py | CrunchBaseScrape.py | py | 879 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.action_chains.ActionChains",
"line_number": 28,
"usage_type": "cal... |
13036488264 | # encoding=utf-8
import requests
import time
class MethodRequest:
def __init__(self):
pass
def request_value(self, method, url, data, headers):
headers.update({'Connection': 'close'})
print('请求方法: ', method, url, data, headers, type(url))
requests.adapters.DEFAULT_RETRIES... | yangleiqing0/MyFlask | common/method_request.py | method_request.py | py | 1,733 | python | en | code | 7 | github-code | 18 | [
{
"api_name": "requests.adapters",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "requests.session",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "requests.get",
... |
42548020863 | import unittest
import os
import pkg_resources
import sys
try:
# Python 3.3 forward includes the mock module
from unittest import mock
could_import_mock = True
except ImportError:
# Fallback for older python (not included in standard library)
try:
import mock
could_import_mock = Tru... | KarthikRIyer/OpenTimelineIO | tests/test_plugin_detection.py | test_plugin_detection.py | py | 5,666 | python | en | code | null | github-code | 18 | [
{
"api_name": "unittest.TestCase",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "tests.baseline_reade... |
24437517786 | # coding: utf-8
from django.contrib import admin, messages
from django.contrib.admin.options import TabularInline
# from django.core.exceptions import PermissionDenied
# from django import forms
# from django.template import RequestContext
from django.conf.urls import patterns
from django.shortcuts import render
from d... | klebercode/protocolle | protocolle/protocolo/admin.py | admin.py | py | 22,537 | python | pt | code | 0 | github-code | 18 | [
{
"api_name": "protocolle.auxiliar.models.Instituicao_User.objects.get",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "protocolle.auxiliar.models.Instituicao_User.objects",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "protocolle.auxiliar.models.Insti... |
24828544418 | import socket
import sys
import os
import hashlib
import pickle
import rsa
mfile = open("pkda_keyInfo", "rb+")
keys = pickle.load(mfile)
K_A_pub = keys["K_A_pub"]
K_pkda_pri = keys["K_pkda_pri"]
K_server_pub = keys["K_Server_pub"]
keyA = pickle.dumps(K_A_pub)
hasher = hashlib.sha3_512()
hasher.update(keyA)
hashA ... | underhood31/Network-Security | Assignment-4/pkda.py | pkda.py | py | 895 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pickle.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pickle.dumps",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "hashlib.sha3_512",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pickle.dumps",
"line_num... |
46233076074 | import numpy as np
import cv2
img = cv2.imread('watch.jpg', cv2.IMREAD_COLOR)
px = img[55,55]
print(px)
img[55,55] = [0,0,0]
px = img[55,55]
print(px)
#regionofimage
#codetocopyaregionofimagetoanother
#watch_face = img[particular region]
#img[another region of same size] = watch_face
roi = img[100:150, 100:150]
p... | priyanka19697/imageprocessing1 | imageoperations.py | imageoperations.py | py | 425 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cv2.imread",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_COLOR",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "cv2.imshow",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_num... |
75085390441 | # Ethan Groves
# Team 4
# Homework 4
# Oct 20, 2014
# 1) Create a new ipython notebook.
import sklearn as sk
import numpy as np
import scipy as sp
import pandas as pd
import matplotlib.pyplot as plt
# 2) Discuss with your team and decide if you would like to use the same data set for your final
# project. You can ... | egroves01/CMDA | Assignments/EthanGroves_HW4.py | EthanGroves_HW4.py | py | 1,907 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.read_table",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"li... |
21552172845 | # PROGRAMMER: Paul Gonzales
# DATE: month day, 2019
# ASSIGNMENT: Homework #00
# ALGORITHM: How the program works. This should be structured using short, descriptive phrases that are indented appropriately.
import re, collections
def main():
with open("C:\\TestData\\HarryPotterAndTheSorcerersStone.txt", 'r') as ... | Gonz8088/ITEC3312 | Final2019/Final03.py | Final03.py | py | 798 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "re.sub",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 22,
"usage_type": "call"
}
] |
7472438367 | import sys
import logging
import json
import pandas as pd
import numpy as np
import joblib
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
model_type = {
'Logist... | made-ml-in-prod-2021/alekxd | ml_project/src/models.py | models.py | py | 2,439 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sklearn.linear_model.LogisticRegression",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "sklearn.ensemble.RandomForestClassifier",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "pandas.read_csv",
"line_number": 20,
"usage_type": "call"... |
42571727766 | # -*- coding:utf-8 -*-
from image_match.elasticsearch_driver import SignatureES
from elasticsearch import Elasticsearch
from pymongo import MongoClient
from gridfs import GridFS, errors
from bson import errors as ee
class ImageDatabase(object):
__slots__ = ["con", "database", "fs", "ses", "collection"]
def ... | huiele/my-son-task | search_app/model.py | model.py | py | 3,115 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "gridfs.GridFS",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "image_match.elasticsearch_driver.SignatureES",
"line_number": 18,
"usage_type": "call"
},
{
"ap... |
31895873822 | from django.db import migrations
# Non-historical model, i.e. if you change save_product_taxonomy() tomorrow
# the migration will not run the same code as before (at the time the migration was written)
from corgi.tasks.prod_defs import (
slow_remove_product_from_build as current_remove_product_from_build,
)
def ... | RedHatProductSecurity/component-registry | corgi/core/migrations/0082_clean_cdn_relations.py | 0082_clean_cdn_relations.py | py | 1,940 | python | en | code | 19 | github-code | 18 | [
{
"api_name": "corgi.tasks.prod_defs.slow_remove_product_from_build.delay",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "corgi.tasks.prod_defs.slow_remove_product_from_build",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.Migration",
... |
1870489158 | import numpy as np
import matplotlib
matplotlib.use('TkAgg')
from visdom import Visdom
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
x_data = [1.0,2.0,3.0]
y_data = [2.0,4.0,6.0]
w=1.0
# y=wx
def forward(x):
return x * w
def cost(xs,ys):
cost = 0
for x, y in zip(xs, ys):
... | sc-only/PycharmProjects | pythonProject/梯度下降算法.py | 梯度下降算法.py | py | 964 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "matplotlib.use",
"line_number": 3,
"usage_type": "call"
}
] |
16971939431 | #! unzip -qq roads.zip
import os
import numpy as np
import cv2
from glob import glob
import tensorflow as tf
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from tensorflow.keras.layers import Conv2D, Activation, BatchNormalization
from tensorflow.keras.layers import UpSampling2D, ... | Jimut123/SATELLITE | MultiResUNet/jimutmap/MultiResUNET_jimutmap_2.py | MultiResUNET_jimutmap_2.py | py | 12,747 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "tensorflow.test.gpu_device_name",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "tensorflow.test",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.seed",
"line_number": 27,
"usage_type": "call"
},
{
"api_name":... |
17996748560 | import argparse
from .df_tests import vary_df, add_df_parser_options
from .oov_tests import oov_test
from .testing_framework import vary_embeddings, search_test, embed_to_engine, hyperparameters, multirun_map, recall_test
from .bilingual_tests import bilingual
from .testing_io import print_table, display_chart, save_t... | swigder/bilingual-search-engine | search/test/__main__.py | __main__.py | py | 5,203 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "ir_data_reader.readers.keys",
"line_number": 16,
"usage_type": "call"
},
{
"api_n... |
37984328361 | import numpy as np
import random
from collections import defaultdict
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input, LSTM, Dense, Bidirectional, Lambda, dot, RepeatVector, Concatenate
import tensorflow as tf
import tensorflow.keras.backend as K
def generate_data(k):
if k != 'al... | chundrac/slav-dial | SIGMORPHON_2020/util.py | util.py | py | 5,003 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "tensorflow.keras.backend",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "random.seed",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "random.s... |
3433206924 | from django.shortcuts import render
from polls.models import Preference, User
from django.utils import timezone
from django.http import HttpResponse, HttpResponseRedirect
from django.urls import reverse
from django.core.exceptions import PermissionDenied
import os, hashlib, binascii
# Create your views here.
def ind... | xiangf3/lunchOrder | lunch/polls/views.py | views.py | py | 5,670 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.http.HttpResponseRedirect",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.urls.reverse",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "polls.models.Preference.objects.filter",
"line_number": 23,
"usage_type": "call"
}... |
38268975923 | #https://realpython.com/python-opencv-color-spaces/
#Color explorer : http://colorizer.org/
import cv2
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
from matplotlib import colors
from matplotlib.colors import hsv_to_rgb
'''
segmenting one clownf... | mustafa-zarkash/Python-Tutorials | coursework/42_Color_Segmentation/4_color_segmentation_1.py | 4_color_segmentation_1.py | py | 3,790 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cv2.split",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "numpy.shape",
... |
39826636565 | # -*- coding: utf-8 -*-
class Environment:
#std
import sys
import traceback
import unicodedata
import os
#clr
import clr
clr.AddReference('System')
clr.AddReference('System.IO')
clr.AddReference('PresentationCore')
clr.AddReference("PresentationFramewo... | dosymep/AdminExtensions | Admin.tab/Доработка.panel/Доработка.stack/Reserve.pushbutton/script.py | script.py | py | 7,374 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "clr.AddReference",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "clr.AddReference",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "clr.AddReference",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "clr.AddReference",... |
34042504487 | from datetime import datetime, timedelta
import pandas as pd
from pymongo import MongoClient
from misc.inserter import get_actual_cards_info, wh_code
from misc.pathManager import PathManager
try:
conn = MongoClient()
db = conn["gram_base"]
print("Connected successfully!!!")
except:
print("Could not c... | WH1NER7/scan_av | database/main.py | main.py | py | 10,062 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "misc.inserter.get_actual_cards_info",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 26,
"usage_type": "call"
},
{
"api... |
45281001688 | # -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import requests
from collections import defaultdict
# import BeautifulSoup
def download(url="https://www.google.com/search", params={}, retries=3):
resp = None
user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x6... | sigirace/elmo_clone | tutorial/downloads.py | downloads.py | py | 1,536 | python | en | code | null | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "requests.exceptions",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "requests.compat.urljoin",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "request... |
3854740754 | import libvirt
import time
import re
import locale
from libvirt import libvirtError
from libvirttestapi.utils import utils
count = 0
change = 0
required_params = ('guestname',)
optional_params = {}
def check_domain_running(conn, guestname, logger):
""" check if the domain exists, may or may not be active """
... | libvirt/libvirt-test-API | libvirttestapi/repos/domain/console_callback.py | console_callback.py | py | 7,321 | python | en | code | 12 | github-code | 18 | [
{
"api_name": "locale.getpreferredencoding",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "locale.getpreferredencoding",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "libvirttestapi.utils.utils.get_dom_mac_addr",
"line_number": 86,
"usage_type": "c... |
11360152721 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import random
import logging
from flask import Flask
from flask import request
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
logging.basicConfig(filename='bob.log', level=logging.DEBUG)
app = Flask(__name__, static_url_path="/static")
epithets = []
names = {}
... | Lamzin/myPython | EVO/bob/bob.py | bob.py | py | 874 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "flask.F... |
9750844251 | import os
import pygtk
pygtk.require('2.0')
import gtk, gtk.glade, time
from ventana import Ventana
from framework import pclases
import utils
import cmdgtk
class Trazabilidad(Ventana):
"""
Ventana de trazabilidad interna de objetos.
Acepta tanto códigos de trazabilidad como consultas a la BD de SQLObjec... | pacoqueen/cican | formularios/trazabilidad.py | trazabilidad.py | py | 10,657 | python | es | code | 3 | github-code | 18 | [
{
"api_name": "pygtk.require",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "ventana.Ventana",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "ventana.Ventana.__init__",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "ventana.Ventana... |
2130913442 | import chess
import chess.svg
from chessboard import display
from chess import Move
import time
import random
import math
board = chess.Board("8/8/8/8/8/8/8/8 w - - 0 1")
# Erste Königing setzen
"""board.set_piece_at(16,chess.Piece(chess.QUEEN,chess.WHITE))
board.set_piece_at(9,chess.Piece(chess.QUEEN,chess.WHITE))
b... | Baris-Kacar/KI | 2/queenProblem.py | queenProblem.py | py | 28,743 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "chess.Board",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "chess.Piece",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "chess.QUEEN",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "chess.WHITE",
"line_numbe... |
74220159720 | import matplotlib.pyplot as plt
import random
import pandas as pd
import numpy as np
df = pd.DataFrame()
df['y'] = [random.random() for _ in range(200)]
df['I'] = [random.random() for _ in range(200)]
df['II'] = df['y'] + ( [random.random()/4 for _ in range(200)] )
df['IIa'] = np.where( df['II'] <1.0, df['II'], ... | getting-data-science-done/GDSD | Chapter11/generate_data.py | generate_data.py | py | 2,076 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.DataFrame",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_... |
70232779881 | '''manifest.py'''
import json
from datetime import datetime
from typing import List, Union
from fonty.models.font import FontFamily, InstalledFont
from fonty.lib.constants import APP_DIR, MANIFEST_PATH, JSON_DUMP_OPTS
from fonty.lib.list_fonts import get_user_fonts, get_user_fonts_count
from fonty.lib.json_encoder imp... | jamesssooi/fonty | fonty/models/manifest.py | manifest.py | py | 5,062 | python | en | code | 15 | github-code | 18 | [
{
"api_name": "typing.List",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "fonty.models.font.FontFamily",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "typing.Lis... |
40687727251 | from django.contrib import admin
from sofia.admin import sofia_admin_site
from .models import Cart, CartItem
class CartAdmin(admin.ModelAdmin):
empty_value_display = '-empty-'
list_display = ['id', 'customer']
list_display_links = None
list_filter = ['customer']
class CartItemAdmin(admin... | KabakiAntony/sofia | cart/admin.py | admin.py | py | 615 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 13,
"usage_type": "attribute"
... |
73027130280 | from crm.capsule_crm import util
from crm.capsule_crm.entities.capsulecrm_contact import CapsulecrmContact
from crm.capsule_crm.entities.capsulecrm_deal import CapsulecrmDeal
from crm.capsule_crm.entities.capsulecrm_case import CapsulecrmCase
from crm.capsule_crm.entities.capsulecrm_tag import CapsulecrmTag
from crm.ca... | dipendrabaidawa/unified_api | unified/modules/main/categories/crm/capsule_crm/api.py | api.py | py | 12,030 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "crm.capsule_crm.util.get_access_token",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "crm.capsule_crm.util",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "crm.capsule_crm.util.rest",
"line_number": 21,
"usage_type": "call"
},
{
... |
29755352053 | import json
from flask import Flask, request
import json, os
import resource
app = Flask(__name__)
map = {}
# 30 MB can store => 10,000 so 1/MB it will be 333 records now assuming
# 1 gib of RAM which 1000MB net net we can store 333, 000 records and after that we
# can clear the map and write it in file
map_counte... | rushi47/map-reduce | map_reduce/reducer/app/reducer_pr.py | reducer_pr.py | py | 4,445 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 85,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_numbe... |
2210653204 | import os
from board import Board, OutOfBoardException
from collections import namedtuple
coordinates = namedtuple('coordinated', ['x', 'y'])
class GameOfLife:
def __init__(self, board: Board) -> None:
self.board: Board = board
def board_after_lifecycle(self) -> None:
new_board = Board(rows=... | DamianBewicz/GameOfLife | game_of_life.py | game_of_life.py | py | 3,396 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.namedtuple",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "board.Board",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "board.Board",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "board.Board",
"line_... |
731260710 | from torch.utils.data import Dataset
from pathlib import Path
import numpy as np
from PIL import Image
import h5py
import data.MVSDataset
import torch
from torch.nn import functional as F
class MVSDataset(data.MVSDataset.MVSDataset):
def __init__(self, datapath, listfile, mode, nviews, return_depth=False, **kwarg... | fdarmon/wild_deep_mvs | data/md_yao.py | md_yao.py | py | 4,682 | python | en | code | 56 | github-code | 18 | [
{
"api_name": "data.MVSDataset.MVSDataset",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "data.MVSDataset",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pathlib.... |
25956843230 | from django.core.urlresolvers import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from clubs.models import Club
from courses.models import Course, CourseInstruction
from qualifications.models import Certificate, Qualification
from users.models import User
class UserCoursesTes... | sdob/sincserver | users/tests/test_user_courses.py | test_user_courses.py | py | 1,471 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "rest_framework.test.APITestCase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "users.models.User.objects.create_user",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "users.models.User.objects",
"line_number": 13,
"usage_type": "attri... |
17284778196 | import sqlite3
import helpers
conn = sqlite3.connect(helpers.get_file_path('../databases/flights.db'))
cur = conn.cursor()
cur.execute("SELECT * FROM airlines LIMIT 15;")
results = cur.fetchall()
cur.close()
conn.close()
for row in results:
print(row) | eecs110/winter2019 | course-files/lectures/lecture_13/scripts/03_query_all_columns.py | 03_query_all_columns.py | py | 257 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "sqlite3.connect",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "helpers.get_file_path",
"line_number": 4,
"usage_type": "call"
}
] |
33753485433 | from flask import Flask, request
from flask_cors import CORS
import cv2
import numpy as np
app = Flask(__name__)
cors = CORS(app)
drawing = False
import os
import time
import threading
import sys
from Controls.controller_manager import ControllerManager
import Controls.presets as presets
import numpy as np
curr_frame ... | shreystechtips/106a-final-project | Perception/server.py | server.py | py | 4,682 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "Controls.controller_manager.Con... |
40338158969 | #!/usr/bin/python
#Execute this script in the folder with your node-00XX.log outputs to get a graph of initial and final images
import numpy as np
import matplotlib.pyplot as plt
import math
########## INPUT #####################
nodes = 16 #Number of string nodes
######################################
... | SSAGESproject/SSAGES | Examples/User/ElasticBand/2D_Particle/plotter.py | plotter.py | py | 1,639 | python | en | code | 76 | github-code | 18 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 49,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "numpy.array",
... |
10684026774 | from django.shortcuts import render, redirect, get_object_or_404
from django.contrib import messages
from django.http import HttpResponseRedirect, HttpResponse, JsonResponse
from django.urls import reverse_lazy
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.p... | obekediamond/DIssertation_V1 | scores/views.py | views.py | py | 6,517 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "institution.models.Session.objects.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "institution.models.Session.objects",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "institution.models.Session",
"line_number": 19,
"usage_typ... |
16239355590 | import matplotlib.pyplot as plt
import cv2 as cv
structure = cv.imread('WeChat Image_20210320120051.png')
plt.imshow(structure)
plt.show()
# 在OpenCV中,我们要获取一个视频,需要创建一个VideoCapture对象
# 创建读取视频的对象
# cap = cv.VideoCapture()
# 获取视频的某些属性 retval = cap.get(propId)
# 修改视频的属性信息 cap.set(propId, value)
# 判断图像是否读取成功 isornot = cap... | ChengHan111/OpenCV_Python_Learning | OpenCV_Videos_basic_10.py | OpenCV_Videos_basic_10.py | py | 2,471 | python | zh | code | 0 | github-code | 18 | [
{
"api_name": "cv2.imread",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.imshow",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.... |
11523750623 | import unittest
import neural_logic_machines.instance as instance
import neural_logic_machines.problem as problem
import jax.numpy as jnp
class TestInstance(unittest.TestCase):
facts = ['female(alice).',
'male(bob).',
'female(carol).',
'male(dave).',
'sibling(bo... | ChloeSilva/symbolic-neural-networks | src/unit_tests/test_instance.py | test_instance.py | py | 4,324 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "unittest.TestCase",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "neural_logic_machines.problem",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "neural_logic_machines.problem.Problem",
"line_number": 19,
"usage_type": "call"
},
... |
28428756859 | # coding=utf-8
from __future__ import unicode_literals
from collections import OrderedDict
from faker.providers.date_time import Provider as DateTimeProvider
from .. import BaseProvider
import redis
localized = True
class DebitCard(object):
def __init__(self, name, prefixes, length=19):
self.name = name... | nongmei/Faker_extend | providers/debit_card/__init__.py | __init__.py | py | 6,607 | python | en | code | 8 | github-code | 18 | [
{
"api_name": "collections.OrderedDict",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "faker.providers.date_time.Provider.date_time_between",
"line_number": 100,
"usage_type": "call"
},
{
"api_name": "faker.providers.date_time.Provider",
"line_number": 100,
"u... |
14339279379 | """ТЕХНИЧЕСКОЕ ЗАДАНИЕ(сложность: тяжелая)
1. При нажатии на кнопку start, телеграмм бот должен
зайти на сайт KaktusMedia (https://kaktus.media/) и
спарсить категорию “Все новости”
2. При вводе текста должны выйти первые 20
заголовков статей с нумерацией. Должна быть
возможность выбрать новости по нумерации или id
(по... | satarof/Hackathon | Hackathon-Bot/hackathon_bot.py | hackathon_bot.py | py | 4,683 | python | ru | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "decouple.config",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "telebot.TeleBot",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.