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
18809920603
# -*- coding: utf-8 -*- """ Your task is to use the iterative parsing to process the map file and find out not only what tags are there, but also how many, to get the feeling on how much of which data you can expect to have in the map. Fill out the count_tags function. It should return a dictionary with the tag name ...
sarinograsso-zz/udacity-data-analyst-nanodegree
p3-wrangle-openstreetmap-data/code/mapparser.py
mapparser.py
py
1,739
python
en
code
0
github-code
6
[ { "api_name": "xml.etree.cElementTree.parse", "line_number": 18, "usage_type": "call" }, { "api_name": "xml.etree.cElementTree", "line_number": 18, "usage_type": "name" }, { "api_name": "operator.itemgetter", "line_number": 60, "usage_type": "call" }, { "api_name"...
344749226
import subprocess import os from tqdm import tqdm base_dir = "voicedatabase" target_dir = "voicedatabase_wav" os.makedirs(target_dir, exist_ok=True) for name in tqdm(os.listdir(base_dir)): file_path = os.path.join(base_dir, name) new_file_path = file_path.replace(base_dir, target_dir) new_file_path = ne...
chronos123/video_recognition
seetaFace6Python-master_w/turn_mp3_2wav.py
turn_mp3_2wav.py
py
502
python
en
code
0
github-code
6
[ { "api_name": "os.makedirs", "line_number": 9, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 10, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 11,...
1789139276
from PyQt5.QtWidgets import (QGroupBox, QLineEdit, QPushButton, QTabWidget, QCheckBox, QComboBox, QVBoxLayout, QWidget, QDoubleSpinBox, QFormLayout) from PyQt5.QtCore import QLocale class widget(QWidget): """Base class for GUI widgets.""" def __init__(self, title='Control window')...
nvladimus/daoSPIM
microscope_control/src/widget.py
widget.py
py
9,327
python
en
code
10
github-code
6
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 6, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QVBoxLayout", "line_number": 18, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QGroupBox", "line_number": 29, "usage_type": "call" }, { "api_...
18847610254
import pytest import yatest.common as common from cloud.blockstore.tests.python.lib.test_base import run_test DEFAULT_MON_PORT = 8766 TESTS = [ [ "myt1-ct5-13", "cloud/blockstore/tests/loadtest/remote/remote-myt1-ct5-13.txt", "myt1-ct5-13.cloud.yandex.net", 9766, DEFAULT_M...
ydb-platform/nbs
cloud/blockstore/tests/loadtest/remote/test.py
test.py
py
1,777
python
en
code
32
github-code
6
[ { "api_name": "cloud.blockstore.tests.python.lib.test_base.run_test", "line_number": 41, "usage_type": "call" }, { "api_name": "yatest.common.get_param", "line_number": 52, "usage_type": "call" }, { "api_name": "yatest.common", "line_number": 52, "usage_type": "name" },...
7105569271
import sys assert sys.version_info >= (3, 5) # make sure we have Python 3.5+ from pyspark.sql import SparkSession, functions, types #type:ignore # add more functions as necessary def main(inputs, output): observation_schema = types.StructType([ types.StructField('station', types.StringType()), ...
brendanartley/Programming-for-Big-Data-Coursework
week_6/temp_range_sql.py
temp_range_sql.py
py
2,263
python
en
code
0
github-code
6
[ { "api_name": "sys.version_info", "line_number": 2, "usage_type": "attribute" }, { "api_name": "pyspark.sql.types.StructType", "line_number": 10, "usage_type": "call" }, { "api_name": "pyspark.sql.types", "line_number": 10, "usage_type": "name" }, { "api_name": "p...
1002914150
import time import random import sys import numpy as np import scipy.sparse as spa from sklearn.linear_model import SGDClassifier from sklearn.svm import LinearSVC from sklearn.metrics import classification_report from sklearn.model_selection import KFold from utils import readDataset, Processor, Sequencer, test, ...
Refefer/Dagger
baseline.py
baseline.py
py
2,450
python
en
code
29
github-code
6
[ { "api_name": "scipy.sparse.vstack", "line_number": 30, "usage_type": "call" }, { "api_name": "scipy.sparse", "line_number": 30, "usage_type": "name" }, { "api_name": "numpy.vstack", "line_number": 30, "usage_type": "call" }, { "api_name": "sklearn.linear_model.SG...
40005355955
from functools import partial import pytest from xdlang.parser import parse_text def parse_stmt(text): return parse_text(program_text=text, start="statement") @pytest.mark.parametrize( "text,value", [ ("return 42;", "42"), ("return 0.0;", "0.0"), ("return false;", "false"), ...
mbednarski/xdlang
tests/parser/test_parser_return.py
test_parser_return.py
py
586
python
en
code
3
github-code
6
[ { "api_name": "xdlang.parser.parse_text", "line_number": 9, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 12, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 12, "usage_type": "attribute" } ]
31981290467
from pymongo import MongoClient from dotenv import dotenv_values as env import dns.resolver dns.resolver.default_resolver=dns.resolver.Resolver(configure=False) dns.resolver.default_resolver.nameservers=['8.8.8.8'] class Connection: url =env(".env")["DATABASE_STRING"] @classmethod def connect(cls): try: clie...
Crown003/Portfolio
Databases/Database.py
Database.py
py
535
python
en
code
0
github-code
6
[ { "api_name": "dns.resolver.resolver", "line_number": 4, "usage_type": "attribute" }, { "api_name": "dns.resolver", "line_number": 4, "usage_type": "name" }, { "api_name": "dns.resolver.resolver.Resolver", "line_number": 4, "usage_type": "call" }, { "api_name": "d...
27759270841
from ast import arg from rdflib import Graph, RDFS, RDF, URIRef, Namespace, Literal, XSD from owlrl import DeductiveClosure, RDFS_Semantics import random, sys import sys import os import pandas as pd from string import Template import networkx as nx import networkx.algorithms.community as nxcom from scipy import rand ...
GabHoo/The-Game-of-Thrones-Automyth
generator.py
generator.py
py
10,160
python
en
code
1
github-code
6
[ { "api_name": "rdflib.URIRef", "line_number": 16, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 18, "usage_type": "call" }, { "api_name": "rdflib.Literal", "line_number": 18, "usage_type": "call" }, { "api_name": "rdflib.XSD.boolean", "...
650440827
#! /usr/bin/python import os import sys import json from concurrent import futures import luigi import numpy as np import cluster_tools.utils.volume_utils as vu import cluster_tools.utils.function_utils as fu from cluster_tools.cluster_tasks import SlurmTask, LocalTask, LSFTask # # Find Labeling Tasks # class Fin...
constantinpape/cluster_tools
cluster_tools/relabel/find_labeling.py
find_labeling.py
py
4,185
python
en
code
32
github-code
6
[ { "api_name": "luigi.Task", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "luigi.Parameter", "l...
4831701553
from builtins import next from builtins import str from builtins import range from builtins import object import numpy as np from sosdb import Sos from sosdb.DataSet import DataSet from numsos import Inputer import datetime as dt import time import os import sys class DataSource(object): DEF_LIMIT = 1024 * 10...
nick-enoent/numsos
numsos/DataSource.py
DataSource.py
py
40,844
python
en
code
1
github-code
6
[ { "api_name": "builtins.object", "line_number": 14, "usage_type": "name" }, { "api_name": "builtins.str", "line_number": 75, "usage_type": "name" }, { "api_name": "sosdb.Sos.ColSpec", "line_number": 77, "usage_type": "call" }, { "api_name": "sosdb.Sos", "line_...
29589756771
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from odoo import api, fields, models, _ from odoo.exceptions import Warning as UserError import logging _logger = logging.getLogger(__name__) class ExternalSource(models.Model): _name = 'external.source' _description = 'External Source' n...
OdooNodrizaTech/external_odoo
external_odoo_base/models/external_source.py
external_source.py
py
9,478
python
en
code
1
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "odoo.models.Model", "line_number": 10, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 10, "usage_type": "name" }, { "api_name": "odoo.fields.Char"...
31282904597
#!/usr/bin/env python from __future__ import print_function import sys sys.path.append("..") import json import urllib2 import time import cig_codes GITHUB_API_URL = "https://api.github.com" HOOKS_URL = GITHUB_API_URL + "/repos/geodynamics/%s/hooks" TEST_PUSH_HOOK_URL = GITHUB_API_URL + "/repos/geodynamics/%s/hooks/...
geodynamics/cig_backend
git/setup_github.py
setup_github.py
py
3,364
python
en
code
1
github-code
6
[ { "api_name": "sys.path.append", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "urllib2.Request", "line_number": 18, "usage_type": "call" }, { "api_name": "urllib2.urlopen", "li...
28420080170
"""モジュールのインポート""" import numpy as np from scipy import signal from sklearn.cluster import KMeans import pickle from src.visualize_data import ( show_signals, show_peaks, show_amp_means, show_sses, show_amp_clusters, show_signals_with_cluster ) # 自作モジュール """データの読み込み""" n_data = 50 # データ数 n_samples = 2...
T-S1/PracticeVibrationAnalysis
kmeans_ampmean.py
kmeans_ampmean.py
py
2,483
python
ja
code
0
github-code
6
[ { "api_name": "numpy.zeros", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 17, "usage_type": "call" }, { "api_name": "src.visualize_data.show_signals...
43270763213
import json import os import boto3 import time sqs_client = boto3.client('sqs', region_name='us-west-2') kinesis_client = boto3.client('firehose', region_name='us-west-2') cloudwatch_client = boto3.client('cloudwatch', region_name='us-west-2') def handler(event, context): try: lambda_end = time.time() + ...
uw-it-aca/sqs-to-kinesis-worker
index.py
index.py
py
2,438
python
en
code
0
github-code
6
[ { "api_name": "boto3.client", "line_number": 6, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 7, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 8, "usage_type": "call" }, { "api_name": "time.time", "line_number": 13...
650456967
import os import luigi from ..cluster_tasks import WorkflowBase from ..utils import volume_utils as vu from ..morphology import MorphologyWorkflow from . import skeletonize as skeleton_tasks class SkeletonWorkflow(WorkflowBase): input_path = luigi.Parameter() input_key = luigi.Parameter() output_path = l...
constantinpape/cluster_tools
cluster_tools/skeletons/skeleton_workflow.py
skeleton_workflow.py
py
2,984
python
en
code
32
github-code
6
[ { "api_name": "cluster_tasks.WorkflowBase", "line_number": 10, "usage_type": "name" }, { "api_name": "luigi.Parameter", "line_number": 11, "usage_type": "call" }, { "api_name": "luigi.Parameter", "line_number": 12, "usage_type": "call" }, { "api_name": "luigi.Para...
16008764419
# This file is part of botwtools. # # botwtools is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # botwtools is distributed in the hop...
RenaKunisaki/botwtools
codec/sarc/reader/sarc.py
sarc.py
py
2,458
python
en
code
4
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "header.Header", "line_number": 33, "usage_type": "call" }, { "api_name": "sfatheader.SFATHeader", "line_number": 34, "usage_type": "call" }, { "api_name": "sfatnode.SFATNo...
37411695618
from bs4 import BeautifulSoup from bs4.element import Tag from requests import get from . import schema from .db import create_constituencies, create_results, create_summary from .settings import get_settings def scrape(): settings = get_settings() doc = get(settings.election_all_constituency_url).text ...
carneddau/senedd-election
src/senedd_election/scrape.py
scrape.py
py
2,890
python
en
code
0
github-code
6
[ { "api_name": "settings.get_settings", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "settings.election_all_constituency_url", "line_number": 13, "usage_type": "attribute" }, { "ap...
73696096509
import configparser import logging import os from collections import defaultdict __all__ = [ 'ConfigurationError', 'ConfigBuilder' ] class ConfigurationError(Exception): pass class BlueSkyKMLConfigParser(configparser.ConfigParser): """Custom config parser class whose sole contribution is to trans...
pnwairfire/blueskykml
blueskykml/configuration.py
configuration.py
py
12,841
python
en
code
0
github-code
6
[ { "api_name": "configparser.ConfigParser", "line_number": 14, "usage_type": "attribute" }, { "api_name": "collections.defaultdict", "line_number": 39, "usage_type": "call" }, { "api_name": "logging.debug", "line_number": 46, "usage_type": "call" }, { "api_name": "...
4785990380
from collections import defaultdict n = int(input()) l = [] for i in range(1,n+1): tmp = list(input()) cnt = 0 for j in range(n): if tmp[j] == "o": cnt += 1 l.append((cnt,i)) d = defaultdict(list) for i,v in l: d[i].append(v) for i in d: d[i].sort() ans = [] for i in range(n...
K5h1n0/compe_prog_new
abc323/b/main.py
main.py
py
421
python
en
code
0
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 12, "usage_type": "call" } ]
6131237751
""" Tests for pyhap.accessory_driver """ import os import tempfile from unittest.mock import patch, Mock import pytest from pyhap.accessory import (Accessory, Bridge, STANDALONE_AID) from pyhap.accessory_driver import AccessoryDriver @patch("pyhap.accessory_d...
bdrydyk/homecontroller
tests/test_accessory_driver.py
test_accessory_driver.py
py
1,737
python
en
code
0
github-code
6
[ { "api_name": "pyhap.accessory.Accessory", "line_number": 18, "usage_type": "call" }, { "api_name": "pyhap.accessory_driver.AccessoryDriver", "line_number": 19, "usage_type": "call" }, { "api_name": "pyhap.accessory.STANDALONE_AID", "line_number": 20, "usage_type": "name"...
74525065146
from itertools import chain import torch import numpy as np class Visualizer(): def __init__(self, env='cysb'): import visdom self.vis = visdom.Visdom() self.index={} self.env=env def plot(self,name,y): x = self.index.get(name,0) self.vis.line(Y=np.array([y]),X=np...
jimmyyfeng/Tianchi-1
Tianchi_tensorflow/util.py
util.py
py
1,654
python
en
code
5
github-code
6
[ { "api_name": "visdom.Visdom", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 12, "usage_type": "call" } ]
1210248705
# measure the latency of each operation performed when computing the fft with # redis and also the total latency, then save the results to a .csv file import time from statistics import mean import numpy as np import pandas as pd import redis import redisai as rai con = rai.Client(host='localhost', port=6379) r = re...
xolotl18/ML_monitoring
redis_vis/dev/time_metrics.py
time_metrics.py
py
2,542
python
en
code
0
github-code
6
[ { "api_name": "redisai.Client", "line_number": 12, "usage_type": "call" }, { "api_name": "redis.Redis", "line_number": 13, "usage_type": "call" }, { "api_name": "time.time", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.frombuffer", "line_num...
35021380521
"""Book crawl spider""" from scrapy.spiders import CrawlSpider, Rule from scrapy.linkextractors import LinkExtractor from book_scraper.book_loader import BookLoader from book_scraper.items import Book class BookCrawlSpider(CrawlSpider): """Book crawl spider class""" name = 'book_crawl_spider' allowed_d...
OsnovaDT/book_scraper
book_scraper/spiders/book_crawl_spider.py
book_crawl_spider.py
py
1,545
python
en
code
0
github-code
6
[ { "api_name": "scrapy.spiders.CrawlSpider", "line_number": 10, "usage_type": "name" }, { "api_name": "scrapy.spiders.Rule", "line_number": 20, "usage_type": "call" }, { "api_name": "scrapy.linkextractors.LinkExtractor", "line_number": 22, "usage_type": "call" }, { ...
72746063868
# -*- coding:utf-8 -*- __author__ = 'shichao' import os import tensorflow as tf from PIL import Image import cv2 import matplotlib.pyplot as plt def encode_TFRecord(root_dir,filename,classes): ''' encode images and their labels into the TF Record :param cwd: :param filename: :param classes: :r...
csrunner/utils
TFRecord_IO.py
TFRecord_IO.py
py
3,412
python
en
code
0
github-code
6
[ { "api_name": "tensorflow.python_io.TFRecordWriter", "line_number": 18, "usage_type": "call" }, { "api_name": "tensorflow.python_io", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 20, "usage_type": "call" }, { "api_na...
74063454268
import numpy as np ##imports from bokeh.io import output_file from bokeh.plotting import figure,show #My word count days = np.linspace(1,10,10) words = [200,300,400,400,200,500,100,800,200,100] cum = np.cumsum(words) #output file output_file("legend_added.html",title = "With Legends") #create figure fig = figure...
dipanwita2019/Bokeh_plots
02_firstglyph.py
02_firstglyph.py
py
790
python
en
code
0
github-code
6
[ { "api_name": "numpy.linspace", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.cumsum", "line_number": 11, "usage_type": "call" }, { "api_name": "bokeh.io.output_file", "line_number": 15, "usage_type": "call" }, { "api_name": "bokeh.plotting.figure...
3403292676
from tkinter import * import tkinter.font from tkinter.colorchooser import * from tkinter import simpledialog from PIL import Image, ImageDraw, ImageTk from tkinter.messagebox import askyesno import os import tkinter.filedialog root = Tk() root.geometry("800x600") root.title("Paint App") root.configure(background='whi...
trav382/paint_app
paintapp.py
paintapp.py
py
15,679
python
en
code
0
github-code
6
[ { "api_name": "PIL.Image.new", "line_number": 38, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 38, "usage_type": "name" }, { "api_name": "PIL.ImageDraw.Draw", "line_number": 39, "usage_type": "call" }, { "api_name": "PIL.ImageDraw", "line_...
37273677215
'''open.ai gym environment wrapper. reference: https://github.com/openai/gym/tree/master/gym/wrappers''' import gym import numpy as np import cv2 import config class NoopResetEnv(gym.Wrapper): def __init__(self, env, noop_max=30): """start the game with no-op actions to provide random starting positions ...
ZiyuanMa/R2D2
environment.py
environment.py
py
2,139
python
en
code
31
github-code
6
[ { "api_name": "gym.Wrapper", "line_number": 8, "usage_type": "attribute" }, { "api_name": "gym.Wrapper.__init__", "line_number": 13, "usage_type": "call" }, { "api_name": "gym.Wrapper", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.random.ra...
35416595248
import logging import battle.boss import battle.main import memory.main import menu import pathing import save_sphere import screen import vars import xbox import random from paths import ( MacalaniaTempleApproach, MacalaniaTempleEscape, MacalaniaTempleFoyer, MacalaniaTempleTrials, MacalaniaUnderTe...
coderwilson/FFX_TAS_Python
area/mac_temple.py
mac_temple.py
py
14,899
python
en
code
14
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 22, "usage_type": "call" }, { "api_name": "vars.vars_handle", "line_number": 23, "usage_type": "call" }, { "api_name": "xbox.controller_handle", "line_number": 25, "usage_type": "call" }, { "api_name": "memory.main...
27572670921
from django.core.management.base import BaseCommand from django.utils import timezone import string import requests from bs4 import BeautifulSoup import re from jobapp.models import JobModel class Command(BaseCommand): help = 'Get new jobs' def handle(self, *args, **kwargs): url = 'https://www.myjob...
Afeez1131/JobScraperWeb
jobapp/management/commands/jobmag.py
jobmag.py
py
1,633
python
en
code
0
github-code
6
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 9, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 18, "usage_type": "call" }, { "api_name": ...
19347557565
""" This code is used to download the data used to train and test our model """ import os from six.moves import urllib import zipfile raw_dir = os.path.join(os.getcwd(), 'data') def download_url(url, folder, filename): r"""Downloads the content of an URL to a specific folder. Args: url (string): The...
hadarser/ProvablyPowerfulGraphNetworks_torch
utils/get_data.py
get_data.py
py
1,616
python
en
code
39
github-code
6
[ { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 8, "usage_type": "call" }, { "api_name": "os.makedirs", "line_number": 22,...
73558889468
import json import plotly import pandas as pd import sys from nltk.stem import WordNetLemmatizer from nltk.tokenize import word_tokenize from flask import Flask from flask import render_template, request, jsonify from plotly.graph_objs import Bar from sklearn.externals import joblib from sqlalchemy import create_engi...
austin047/udacity-datascience-disaster-res-pipeline
app/run.py
run.py
py
3,666
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "flask.Flask", "line_number": 22, "usage_type": "call" }, { "api_name": "nltk.tokenize.word_tokenize...
1742266102
import pytest import random import numpy as np from scipy.stats import unitary_group import piquasso as pq @pytest.mark.monkey @pytest.mark.parametrize("d", [2, 3, 4, 5]) def test_random_gaussianstate(d): with pq.Program() as prepare_random_program: for i in range(d): r = np.random.normal() ...
Budapest-Quantum-Computing-Group/piquasso
tests/backends/gaussian/test_monkey.py
test_monkey.py
py
716
python
en
code
19
github-code
6
[ { "api_name": "piquasso.Program", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.random.normal", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 15, "usage_type": "attribute" }, { "api_name": "random.uniform...
3588875710
import json import sublime import sublime_plugin import os import re from .jinja2 import Environment class PluginMixin(): def get_selection(self): selections = [] for region in self.view.sel(): if not region.empty(): selections.append(region) if len(selections) ...
mattmc3/subl-codegen
plugin.py
plugin.py
py
2,885
python
en
code
0
github-code
6
[ { "api_name": "sublime.Region", "line_number": 17, "usage_type": "call" }, { "api_name": "sublime.Region", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.basename", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
34201802013
import pygame from pygame.math import Vector2 from pygame import Rect class Block: """ Base class for square or rectangular object """ def __init__(self, position, width, height, color): # Create a rectangle centered around the x and y self.position = position self.rectangle =...
NandoTheessen/Sprint-Challenge--Python-1
src/block.py
block.py
py
3,621
python
en
code
0
github-code
6
[ { "api_name": "pygame.Rect", "line_number": 14, "usage_type": "call" }, { "api_name": "pygame.draw.rect", "line_number": 30, "usage_type": "call" }, { "api_name": "pygame.draw", "line_number": 30, "usage_type": "attribute" }, { "api_name": "pygame.Rect", "line...
12700438398
from django.http import HttpResponse from django.shortcuts import render from .models import add,place,blog # Create your views here. def create(request): var=add.objects.all() return render(request,"index.html",{'gives':var}) def fun(request): var=add.objects.all() make=blog.objects.all() obj=pla...
sanjanapy/travelvlog
travelapp/views.py
views.py
py
611
python
en
code
0
github-code
6
[ { "api_name": "models.add.objects.all", "line_number": 6, "usage_type": "call" }, { "api_name": "models.add.objects", "line_number": 6, "usage_type": "attribute" }, { "api_name": "models.add", "line_number": 6, "usage_type": "name" }, { "api_name": "django.shortcu...
31632163434
import os import sys import numpy as np import tables as tb import pandas as pd import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import matplotlib.colors as clrs import matplotlib.cm as cm from matplotlib.colors import Normalize from invisible_cities....
paolafer/next_analysis
plotting/plot2D_voxels_beersheba.py
plot2D_voxels_beersheba.py
py
3,205
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.use", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.cm.get_cmap", "line_number": 24, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.cm", "line_number": 24, "usage_type": "attribute" }, { "api_name": ...
31180681839
import nltk from nltk.sentiment.vader import SentimentIntensityAnalyzer from tweepy import Stream from tweepy import OAuthHandler from tweepy.streaming import StreamListener import json import datetime ckey='MRblXfNQmvHssuz5zLydkUjuP' csecret='RE2htDqLQfXMu44abXXCC5chWYBfHpkGmnvSsCfKxDdpJeAdX0' atoken='904991952...
ravirajsingh-knit/real-time-twitter-sentiment-analysis
tw_data.py
tw_data.py
py
1,802
python
en
code
1
github-code
6
[ { "api_name": "nltk.sentiment.vader.SentimentIntensityAnalyzer", "line_number": 21, "usage_type": "call" }, { "api_name": "tweepy.streaming.StreamListener", "line_number": 22, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 48, "usage_type": ...
37051109253
#!/usr/bin/env python # coding: utf-8 # # Search for elements with given classes and attributes # In[2]: import requests as req from bs4 import BeautifulSoup # In[3]: URL = 'https://pt.wikipedia.org/wiki/Ariquemes' r = req.get(URL) soup = BeautifulSoup(r.content) # In[4]: links = soup.find_all("a") # findin...
ROHIT-1112/Creation-of-Web-Scraper-in-python
Mod-3.py
Mod-3.py
py
885
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 18, "usage_type": "call" } ]
73993765949
import re import shutil import subprocess import tempfile import pytest import requests import requests.auth import klaus from .utils import * def test_make_app_using_list(): app = klaus.make_app(REPOS, TEST_SITE_NAME) with serve_app(app): response = requests.get(UNAUTH_TEST_SERVER).text as...
jonashaag/klaus
tests/test_make_app.py
test_make_app.py
py
5,924
python
en
code
659
github-code
6
[ { "api_name": "klaus.make_app", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 18, "usage_type": "call" }, { "api_name": "pytest.raises", "line_number": 23, "usage_type": "call" }, { "api_name": "klaus.make_app", "line_...
17371141816
from decimal import Decimal from django.contrib.auth import get_user_model from django.contrib.auth.tokens import default_token_generator from django.core.mail import send_mail from rest_framework import viewsets, status from rest_framework.decorators import action from rest_framework.generics import get_object_or_404...
vavsar/freelance_t
users/views.py
views.py
py
3,549
python
en
code
1
github-code
6
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 16, "usage_type": "call" }, { "api_name": "rest_framework.viewsets.ModelViewSet", "line_number": 19, "usage_type": "attribute" }, { "api_name": "rest_framework.viewsets", "line_number": 19, "usage_type": "...
50554619
# -*- coding: utf-8 -*- """ Created on Fri Jan 27 12:29:45 2023 @author: victor """ import numpy as np import pandas as pd import iminuit import copy import efficiency_fit as acc #remember to have the correct path for this part #currently accessing toy data data = pd.read_csv('cleaned_total_dataset.csv') bin_ranges...
georgesuhk/TBPS_7
fitting/fitting_functions.py
fitting_functions.py
py
16,941
python
en
code
4
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 17, "usage_type": "call" }, { "api_name": "efficiency_fit.n6_polynomial", "line_number": 50, "usage_type": "call" }, { "api_name": "efficiency_fit.popt_costhetak_ls", "line_number": 50, "usage_type": "attribute" }, { ...
28573784122
from sklearn.datasets import load_iris from sklearn.neural_network import MLPClassifier from sklearn import tree import numpy as np import warnings warnings.filterwarnings("ignore") import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from sklearn import datasets from sklearn.decomposition i...
dixitomkar1809/MultipleModels
Main.py
Main.py
py
19,925
python
en
code
0
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 28, "usage_type": "call" }, { "api_name": "sklearn.neural_network...
30138175095
# !/usr/local/python/bin/python # -*- coding: utf-8 -*- # (C) Wu Dong, 2020 # All rights reserved # @Author: 'Wu Dong <wudong@eastwu.cn>' # @Time: '2020-04-13 10:52' """ 演示 pre-request 框架验证字符串任意包含测试 """ from flask import Flask from pre_request import pre, Rule app = Flask(__name__) app.config["TESTING"] = True client...
Eastwu5788/pre-request
examples/example_filter/example_contains_any.py
example_contains_any.py
py
903
python
en
code
55
github-code
6
[ { "api_name": "flask.Flask", "line_number": 13, "usage_type": "call" }, { "api_name": "pre_request.Rule", "line_number": 20, "usage_type": "call" }, { "api_name": "pre_request.pre.catch", "line_number": 25, "usage_type": "call" }, { "api_name": "pre_request.pre", ...
17542699256
# *** Important Note: This part should be executed only after executing 'part1.4.py' *** from Cryptodome.Cipher import AES from Cryptodome.Util.Padding import unpad if __name__ == '__main__': cipherFile = open('cipherText.txt', 'rb') # Opening the file containing the cipher text for read cipherText = cipherFil...
Abdullah-00/cryptography-in-python
part1/part1.5.py
part1.5.py
py
970
python
en
code
0
github-code
6
[ { "api_name": "Cryptodome.Cipher.AES.new", "line_number": 11, "usage_type": "call" }, { "api_name": "Cryptodome.Cipher.AES", "line_number": 11, "usage_type": "name" }, { "api_name": "Cryptodome.Cipher.AES.MODE_CBC", "line_number": 11, "usage_type": "attribute" }, { ...
1522094914
import torch from thesis import metrics TARGETS = [ torch.tensor([[0, 0, 1, 1], [1, 0, 2, 1], [1, 1, 2, 2]], dtype=torch.float), torch.tensor([[1, 1, 2, 2], [3, 1, 4, 2], [5, 1, 6, 2], [7, 1, 8, 2]], dtype=torch.float), torch.tensor([[0, 0, 5, 5], [5, 5, 10, 10]], dtype=torch.float), ] PREDICTIONS = [ ...
laitalaj/cvpce
test/metrics_test.py
metrics_test.py
py
5,150
python
en
code
4
github-code
6
[ { "api_name": "torch.tensor", "line_number": 6, "usage_type": "call" }, { "api_name": "torch.float", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.tensor", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.float", "line_numbe...
21052452549
import os import time import openai from colorama import Fore from pprint import pprint openai.api_key = os.getenv("OPENAI_API_KEY") openai.api_base = 'http://47.251.11.225:8080/v1' # Overly simple abstraction until we create something better # simple retry mechanism when getting a rate error or a bad gateway def ...
cttmayi/pylib
pylib/ai/reader/llm.py
llm.py
py
1,395
python
en
code
0
github-code
6
[ { "api_name": "openai.api_key", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.getenv", "line_number": 9, "usage_type": "call" }, { "api_name": "openai.api_base", "line_number": 10, "usage_type": "attribute" }, { "api_name": "openai.ChatCompletio...
18797452563
import socket import os import ocr import boto3 from flask import Flask, flash, request, redirect, url_for from werkzeug.utils import secure_filename dynamodb_resource = boto3.resource('dynamodb', region_name='us-east-1') dynamodb_client = boto3.client('dynamodb', region_name='us-east-1') s3_client = boto3.client('s...
Zut2020/szakdolgozat
docker/ocr/server.py
server.py
py
1,227
python
en
code
0
github-code
6
[ { "api_name": "boto3.resource", "line_number": 8, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 10, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.Flask", "line_numbe...
3986885530
import asyncio from asyncio import Event from datetime import datetime import logging import uvicorn from bareasgi import Application, text_writer, HttpResponse logging.basicConfig(level=logging.DEBUG) LOGGER = logging.getLogger('background_tasks') async def time_ticker(info, shutdown_event): """ This is t...
rob-blackbourn/bareASGI
docs/examples/background_tasks_nt.py
background_tasks_nt.py
py
2,394
python
en
code
26
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 9, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datet...
30969605726
import numpy as np import pandas as pd import joblib ####### ## Get the model trained in the notebook # `../nbs/1.0-asl-train_model.ipynb` ####### model = joblib.load('models/LinSVR.joblib') def preprocess(data): """ Returns the features entered by the user in the web form. To simplify, we set a bun...
PeterLiessem/ML-oblig2
boxoffice/app/predict.py
predict.py
py
4,893
python
en
code
0
github-code
6
[ { "api_name": "joblib.load", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 118, "usage_type": "call" } ]
1379619171
import flask, json from flask import request, jsonify from datetime import datetime, timedelta import db from tools import * app = flask.Flask(__name__) api_url = "/api/v1/" # Show Graphs @app.route('/<controller>', methods=['GET']) def graph(controller): to_time = datetime.now() from_time = to_time + timede...
Thorium0/Sensor-api-project
api/app.py
app.py
py
1,650
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 14, "usage_type": "name" }, { "api_name": "datetime.timedelta...
423251546
import glob import os import tensorflow as tf from PIL import Image import numpy as np AUTOTUNE = tf.data.experimental.AUTOTUNE def image_scaling(img, label): """ Randomly scales the images between 0.5 to 2.0 times the original size. Args: img: Training image to scale. label: Segmentation ma...
AfvanMoopen/cv-leap
segmentation/cityscape_reader.py
cityscape_reader.py
py
7,052
python
en
code
0
github-code
6
[ { "api_name": "tensorflow.data", "line_number": 8, "usage_type": "attribute" }, { "api_name": "tensorflow.random.uniform", "line_number": 19, "usage_type": "call" }, { "api_name": "tensorflow.random", "line_number": 19, "usage_type": "attribute" }, { "api_name": "...
7804684058
import networkx as nx import constants import geom import osmnx as ox from data_source import OpenStreetMap from .util import approx_trail class TrailNetwork(object): """TrailNetwork """ def __init__( self, trail_code, trail_section=None, trail_alternates=...
nst-guide/data
code/trail/network.py
network.py
py
3,892
python
en
code
6
github-code
6
[ { "api_name": "constants.TRAIL_EPSG_XW", "line_number": 38, "usage_type": "attribute" }, { "api_name": "util.approx_trail", "line_number": 48, "usage_type": "call" }, { "api_name": "data_source.OpenStreetMap", "line_number": 53, "usage_type": "call" }, { "api_name...
8651590324
import asyncio import base64 import binascii import json import logging import socket import time from time import sleep from websockets.server import serve from websockets import exceptions as ws_exceptions from .. import ami_conn, ami_parser, node_configs, node_db, ws_broadcaster __BUILD_ID = "@@HEAD-DEVELOP@@" log...
AllStarLink/Allmon3
src/asl_allmon/allmon3_ws_status/__init__.py
__init__.py
py
6,509
python
en
code
7
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "asyncio.IncompleteReadError", "line_number": 43, "usage_type": "attribute" }, { "api_name": "websockets.exceptions.ConnectionClosedError", "line_number": 46, "usage_type": "attrib...
19851190008
from django.shortcuts import render from django.http import HttpResponse, Http404 from .models import Tweet, Target # Create your views here. def index(request): target_user_list = Target.objects.order_by('-target_name')[:5] context = {'target_user_list': target_user_list} return render(request, 'showoff/inde...
RedSquirrelious/nosycolors-v1-command-line
showoff/views.py
views.py
py
991
python
en
code
0
github-code
6
[ { "api_name": "models.Target.objects.order_by", "line_number": 13, "usage_type": "call" }, { "api_name": "models.Target.objects", "line_number": 13, "usage_type": "attribute" }, { "api_name": "models.Target", "line_number": 13, "usage_type": "name" }, { "api_name"...
20908674803
#!/usr/bin/python3 import sys import os import time import multiprocessing import argparse from datetime import datetime from datetime import date from datetime import timedelta from python_generic_modules import se_docker from python_hadoop_modules import kafka from python_hadoop_modules import zookeeper from python_h...
karthikmahesh2611/docker_hadoop
startup_script.py
startup_script.py
py
1,926
python
en
code
0
github-code
6
[ { "api_name": "python_hadoop_modules.zookeeper.launch_zookeeper", "line_number": 20, "usage_type": "call" }, { "api_name": "python_hadoop_modules.zookeeper", "line_number": 20, "usage_type": "name" }, { "api_name": "python_hadoop_modules.kafka.launch_kafka", "line_number": 21...
70746226748
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # -------------------------------------- # @Time : 2020/11/01 # @Author : Oscar Chen # @Email : 530824679@qq.com # @File : test.py # @Description : test demo for lanenet # @IDE: PyCharm Community Edition # -------------------------------------- import os import t...
530824679/LaneNet
test.py
test.py
py
2,488
python
en
code
0
github-code
6
[ { "api_name": "os.path.exists", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 23, "usage_type": "attribute" }, { "api_name": "cv2.imread", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2.IMREAD_COLOR", "line_n...
842017177
from datetime import date, datetime import numpy as np import pandas as pd import ring from ....common.client import Client from ....common.constants import FUTURES STOCK_CURRENCIES = [ { "Currency": "EUR", "RICSuffix": "AS", }, { "Currency": "EUR", "RICSuffix": "BR", ...
webclinic017/data-server
services/backend/app/fetchers/factors/nav/models/forex.py
forex.py
py
3,078
python
en
code
0
github-code
6
[ { "api_name": "common.client.Client", "line_number": 47, "usage_type": "call" }, { "api_name": "ring.lru", "line_number": 50, "usage_type": "call" }, { "api_name": "common.constants.FUTURES", "line_number": 58, "usage_type": "name" }, { "api_name": "numpy.NaN", ...
1705162928
from pyspark.sql import SparkSession from pyspark.sql.functions import col, expr,split # Define a filter_input_data function def filter_input_data(initial_data): df_with_split_height = df.withColumn("height", split(col("height"), "-")) df_with_split_height = df_with_split_height.withColumn("feet", df_wit...
saimanoj1234/sparkoptimization
per_unpre.py
per_unpre.py
py
1,662
python
en
code
0
github-code
6
[ { "api_name": "pyspark.sql.functions.split", "line_number": 6, "usage_type": "call" }, { "api_name": "pyspark.sql.functions.col", "line_number": 6, "usage_type": "call" }, { "api_name": "pyspark.sql.functions.col", "line_number": 11, "usage_type": "call" }, { "api...
71402508987
import csv import datetime import os import board import busio import adafruit_bme280 import adafruit_ina219 # get timestamp # will need clock for non network connected device now = datetime.datetime.now().isoformat() # get data from BME280 try: i2c = busio.I2C(board.SCL, board.SDA) bme280 = adafruit_bme280...
jetolan/weather
get_data.py
get_data.py
py
1,412
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "attribute" }, { "api_name": "busio.I2C", "line_number": 17, "usage_type": "call" }, { "api_name": "board.SCL", ...
14335858804
import argparse import logging import sys import vsc from importlib import import_module from pygen_src.riscv_instr_pkg import (mtvec_mode_t, f_rounding_mode_t, riscv_reg_t, privileged_mode_t, riscv_instr_group_t, data_pattern_t) @vsc.rando...
merledu/azadi-soc
lowrisc_ibex/vendor/google_riscv-dv/pygen/pygen_src/riscv_instr_gen_config.py
riscv_instr_gen_config.py
py
24,213
python
en
code
16
github-code
6
[ { "api_name": "vsc.rand_enum_t", "line_number": 20, "usage_type": "call" }, { "api_name": "pygen_src.riscv_instr_pkg.data_pattern_t", "line_number": 20, "usage_type": "argument" }, { "api_name": "importlib.import_module", "line_number": 25, "usage_type": "call" }, { ...
39145718042
import torch import torch.nn as nn import torch.nn.functional as F from transformers import PretrainedConfig, PreTrainedModel from flash_attn.modules.mha import MHA import math import numpy as np # globals num_features = 5 num_periods = 9 num_classes = 64 class CausalConvolution(nn.Module): def __init__(sel...
mtanghu/Transformer-Trader
trader_models.py
trader_models.py
py
8,185
python
en
code
2
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 20, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 20, "usage_type": "name" }, { "api_name": "torch.nn.Conv1d", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
41360693627
#!/usr/bin/env python # coding: utf-8 # In[1]: import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sbn # In[2]: dataframe= pd.read_excel("merc.xlsx") # In[3]: dataframe # In[4]: dataframe.describe() # In[7]: dataframe.isnull().sum()#NULL OLAN VERİLER KONTROL EDİLM...
mucahitrtn/Python
PythonBtk/CarPriceAnalysis.py
CarPriceAnalysis.py
py
2,824
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_excel", "line_number": 16, "usage_type": "call" }, { "api_name": "seaborn.distplot", "line_number": 40, "usage_type": "call" }, { "api_name": "seaborn.countplot", "line_number": 46, "usage_type": "call" }, { "api_name": "seaborn.scatterp...
14585784078
def getFile(): from PySide import QtGui filters = "Esri ASC (*.asc);;CSV (*.csv);;All files (*.*)" return QtGui.QFileDialog.getOpenFileName(None, "Open DEM,","",filters)[0] def openEsri(filename): grid_space = 1 file = open(filename, "r") templist = [line.split() for line in file.readlines()] ...
JavierBrana/PVPlant
Utils/importDEM.py
importDEM.py
py
2,990
python
en
code
3
github-code
6
[ { "api_name": "PySide.QtGui.QFileDialog.getOpenFileName", "line_number": 4, "usage_type": "call" }, { "api_name": "PySide.QtGui.QFileDialog", "line_number": 4, "usage_type": "attribute" }, { "api_name": "PySide.QtGui", "line_number": 4, "usage_type": "name" }, { "...
35864117166
import dash from dash.dependencies import Output, Input import dash_core_components as dcc import dash_html_components as html import plotly import random import plotly.graph_objs as go # from collections import deque import sqlite3 import pandas as pd app = dash.Dash(__name__) app.layout = html.Div( [ html....
Chris-Valenzuela/Twitter_Sentiment
10_TwitterInput.py
10_TwitterInput.py
py
3,220
python
en
code
0
github-code
6
[ { "api_name": "dash.Dash", "line_number": 16, "usage_type": "call" }, { "api_name": "dash_html_components.Div", "line_number": 17, "usage_type": "call" }, { "api_name": "dash_html_components.H2", "line_number": 18, "usage_type": "call" }, { "api_name": "dash_core_...
30192270929
#导入相应的包 import numpy as np import matplotlib.pyplot as plt import pandas as pd from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score as accu train_size = 0.5 #训练集比例 #sigmoid函数 def sigmoid(x): return 1.0/(1.0+np.exp(-x)) #预测结果函数 def y_hat(x,theta): r...
TJPU-ML/Homework-for-the-fall-semester-of-2018
iris classification/李书豪/李书豪.py
李书豪.py
py
3,591
python
en
code
0
github-code
6
[ { "api_name": "numpy.exp", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.log", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.log", "line_number": 21, ...
43897186086
import pandas as pd from sklearn.preprocessing import PolynomialFeatures from sklearn.linear_model import LinearRegression df = pd.read_csv("/home/anish/PycharmProjects/asdrp/data/final_data.csv", low_memory=False) x = df[['Gender', 'Age', 'Ethnicity', 'Location']] y = df['Income'] poly_fit = PolynomialFeatures(degr...
anishcherukuthota/COVID-Research-ML_Models
ML Models/polynomial_regression.py
polynomial_regression.py
py
607
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.PolynomialFeatures", "line_number": 10, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 13, "usage_type": "call" ...
20214506906
import uuid from flask import jsonify,request, abort from .models import Question from .errors import error400, error404, error422 def get_question(id): data = Question.query.get(id) if not data: return abort(404, description='resource not found') return data def create_question(): data = request.get...
Ismat27/quiz_learn
flaskr/question.py
question.py
py
3,036
python
en
code
0
github-code
6
[ { "api_name": "models.Question.query.get", "line_number": 7, "usage_type": "call" }, { "api_name": "models.Question.query", "line_number": 7, "usage_type": "attribute" }, { "api_name": "models.Question", "line_number": 7, "usage_type": "name" }, { "api_name": "fla...
8996687733
"""code for generating post-decision biases for demonstration purposes """ import os import sys import pickle import numpy as np from scipy.interpolate import interp1d sys.path.append('../..') from src import utils from src.utils import par from src.model_ddm.model import DynamicBiasModel utils.download_dataset("data/...
hyunwoogu/dynamic_bias
src/model_ddm/post_decision_bias.py
post_decision_bias.py
py
4,045
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "src.utils.download_dataset", "line_number": 13, "usage_type": "call" }, { "api_name": "src.utils", ...
16809364914
# /usr/local/bin/python # -*- coding: utf-8 -*- import json import logging import os import time from typing import Tuple import requests from retry import retry class CulilException(Exception): pass class CulilModule(): def __init__(self, sleep=3): self.app_key = os.environ["CULIL_API_KEY"] self.URL_...
sarcastic555/library_reservation
tools/tool_culil.py
tool_culil.py
py
2,716
python
en
code
0
github-code
6
[ { "api_name": "os.environ", "line_number": 20, "usage_type": "attribute" }, { "api_name": "time.sleep", "line_number": 32, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 33, "usage_type": "call" }, { "api_name": "json.loads", "line_number...
40776823861
""" Script to make plots and tables for paper: 1. Comparing results from a single run for four solutions: numerical, leading-order quasi-static, first-order quasi-static and composite - Voltages - Space-dependent variables: - concentration ...
tinosulzer/faster-lead-acid
plots_for_paper.py
plots_for_paper.py
py
20,080
python
en
code
1
github-code
6
[ { "api_name": "numpy.where", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 37, "usage_type": "call" }, { "api_name": "src.numerical.Numerical", "line_number": 52, "usage_type": "name" }, { "api_name": "src.numerical.Numeric...
39607763203
import logging from django.core.management.base import BaseCommand from core.management.commands import configure_logging from core import solr_index configure_logging("index_titles_logging.config", "index_titles.log") _logger = logging.getLogger(__name__) class Command(BaseCommand): help = """ Reindex...
open-oni/open-oni
core/management/commands/index_titles.py
index_titles.py
py
659
python
en
code
43
github-code
6
[ { "api_name": "core.management.commands.configure_logging", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "django.core.management.base.BaseCommand", "line_number": 12, "usage_type": "n...
21417022983
from django.urls import path, include from . import views urlpatterns = [ path('', views.home), path('home/', views.home), path('resources/', views.resources), path('manage/', views.manage), path('manage/scoreboard/', views.download_scoreboard), path('manage/firstblood/', views.firstblood, name='firstbl...
asadse7en/fypCTF
home/urls.py
urls.py
py
587
python
en
code
16
github-code
6
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
15560680356
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('carte', '0018_auto_20161104_1446'), ] operations = [ migrations.AddField( model_name='rate_review', ...
Shashankagarwal181996/carte
carte/migrations/0019_rate_review_user_profile.py
0019_rate_review_user_profile.py
py
426
python
en
code
1
github-code
6
[ { "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.AddField", "line_number": 14, "usage_type": "call" }, { ...
19631530060
import os import itertools import random import src.utils as foo from src.graph import Graph from random import randrange #lista de entradas en formato .txt para evaluar (se puede ver en la carpeta input) lista = ["input_1.txt","input_2.txt","input_3.txt","input_4.txt","input_5.txt"] #variable aleatorea para agarrar ...
CesarJardines/Complejidad-
P02/TSP.py
TSP.py
py
1,974
python
es
code
0
github-code
6
[ { "api_name": "random.randrange", "line_number": 12, "usage_type": "call" }, { "api_name": "src.utils.creaGrafica", "line_number": 22, "usage_type": "call" }, { "api_name": "src.utils", "line_number": 22, "usage_type": "name" }, { "api_name": "src.utils.get_mst", ...
20963459348
from http.client import BAD_REQUEST, OK from src.core.classes.authentication import AuthenticationBase from src.core.database.authentication import Authentication from src.core.database.user_info import UserInfo class SignOut(AuthenticationBase): def __init__(self, admin: bool = False): super().__init__...
ParinovYT/TechnicalSupportCenterProject
src/core/user/authentication/sign_out.py
sign_out.py
py
1,336
python
en
code
2
github-code
6
[ { "api_name": "src.core.classes.authentication.AuthenticationBase", "line_number": 8, "usage_type": "name" }, { "api_name": "src.core.database.user_info.UserInfo", "line_number": 21, "usage_type": "call" }, { "api_name": "http.client.OK", "line_number": 28, "usage_type": ...
35307499675
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import re import sys from typing import Optional, Tuple import typer from pydantic import ValidationError from rich import print from typing_extensions import Annotated sys.path.append('..') from httpfpt.common.yaml_handler import read_yaml from httpfpt.schemas.case_dat...
wu-clan/httpfpt
httpfpt/cli.py
cli.py
py
8,939
python
zh
code
21
github-code
6
[ { "api_name": "sys.path.append", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "typer.Typer", "line_number": 22, "usage_type": "call" }, { "api_name": "re.search", "line_numbe...
74918985146
from collections import defaultdict import networkx as nx orbits = defaultdict(lambda: list()) def orbit_count(key): n_orbits = 0 n_orbits += len(orbits[key]) for subkey in orbits[key]: if subkey in orbits.keys(): n_orbits += orbit_count(subkey) return n_orbits def main(): ...
aarroyoc/advent-of-code-2019
day6/day6.py
day6.py
py
829
python
en
code
0
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 4, "usage_type": "call" }, { "api_name": "networkx.from_dict_of_lists", "line_number": 31, "usage_type": "call" }, { "api_name": "networkx.shortest_path_length", "line_number": 32, "usage_type": "call" } ]
34600648305
from nltk.corpus import words import pandas as pd import numpy as np # from ..section1.dates import date_sorter correct_spellings = words.words() spelling_series = pd.Series(correct_spellings) def jaccard(entries, grams): """ :parameter :param entries:the words to be corrected :param grams:the d...
anantsrivastava30/TextMining
section2/spellchecker.py
spellchecker.py
py
2,757
python
en
code
0
github-code
6
[ { "api_name": "nltk.corpus.words.words", "line_number": 7, "usage_type": "call" }, { "api_name": "nltk.corpus.words", "line_number": 7, "usage_type": "name" }, { "api_name": "pandas.Series", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.zeros", ...
70483524669
from PyQt5.QtCore import QSize from PyQt5.QtWidgets import QWidget, QPushButton, QSizePolicy, QVBoxLayout, \ QHBoxLayout, QGridLayout, QLabel, QButtonGroup, QScrollArea from PyQt5.QtGui import QIcon, QPixmap class RightWindow(QWidget): status = False __width = 300 layout = QVBoxLayout() qss = "QP...
LeoWei1997/SE_project
UI/RightWindow.py
RightWindow.py
py
7,006
python
en
code
0
github-code
6
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 8, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QVBoxLayout", "line_number": 11, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 33, "usage_type": "argument" }, { "ap...
40982692140
# -*- coding: utf-8 -*- """ Created on Mon Mar 29 17:15:26 2021 @author: BM109X32G-10GPU-02 """ # Native imports from subprocess import Popen from subprocess import PIPE from os import remove import pandas as pd # rdkit imports from rdkit import Chem from rdkit.Chem import Descriptors def rdkit_descriptors(mol): ""...
JinYSun/DeepDonor
screen/basic.py
basic.py
py
5,607
python
en
code
5
github-code
6
[ { "api_name": "rdkit.Chem.Descriptors.descList", "line_number": 33, "usage_type": "attribute" }, { "api_name": "rdkit.Chem.Descriptors", "line_number": 33, "usage_type": "name" }, { "api_name": "rdkit.Chem.MolToSmiles", "line_number": 58, "usage_type": "call" }, { ...
40188060759
from random import random import bcrypt from django.http import JsonResponse from django.views.decorators.csrf import csrf_exempt import json from rest_api.models import Equipos, Jugadoras, Clasificacion, Usuario @csrf_exempt def register(request): if request.method != 'POST': return JsonResponse({'erro...
CeciaVarela/trabajo-fin-ciclo
rest/futfem/rest_api/endpoints.py
endpoints.py
py
5,355
python
es
code
0
github-code
6
[ { "api_name": "django.http.JsonResponse", "line_number": 14, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 15, "usage_type": "call" }, { "api_name": "django.http.JsonResponse", "line_number": 22, "usage_type": "call" }, { "api_name": "django.h...
29857462838
from django.shortcuts import render, redirect from django.http import JsonResponse from .models import User, File import datetime, random, _thread, time, copy import csv,io import pandas as pd from .ddqn import wrapper from .DDPG.baselines import DDPGgive_results def homepage(request) : if not request.session.session_...
geekpradd/Reinforcement-Learning-Stock-Trader
WebPortal/StockApp/views.py
views.py
py
3,764
python
en
code
26
github-code
6
[ { "api_name": "django.shortcuts.render", "line_number": 13, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 19, "usage_type": "call" }, { "api_name": "DDPG.baselines....
28969528737
import argparse import logging import json import shutil import time import os logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') DATA_DIR = os.path.join(os.path.dirname(__file__), 'data') DEVICES_FILE = os.path.join(DATA_DIR, 'things.json') def parse_args(): ...
wizzdev-pl/embedding_terraform_demo
aws_architecture/manage_thing.py
manage_thing.py
py
5,119
python
en
code
0
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_...
36163645980
#!/usr/bin/env python from __future__ import division from __future__ import print_function import datetime import monthdelta def parse_date(date_str): return datetime.datetime.strptime(date_str, "%Y-%m-%d") def unparse_date(date_obj): return date_obj.strftime("%Y-%m-%d") class Company(object): def __ini...
zulip/finbot
money.py
money.py
py
7,809
python
en
code
9
github-code
6
[ { "api_name": "datetime.datetime.strptime", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "attribute" }, { "api_name": "monthdelta.MonthDelta", "line_number": 45, "usage_type": "call" }, { "api_name": ...
20551372866
from django.shortcuts import render from django.http import * from picture.forms import * from picture.models import Picture from django.contrib.auth.decorators import login_required import os from django.urls import reverse import time from urllib.parse import quote # Create your views here. @login_require...
Wlhang/document-manage
picture_manage/picture/views.py
views.py
py
4,881
python
en
code
7
github-code
6
[ { "api_name": "picture.models.Picture.objects.filter", "line_number": 17, "usage_type": "call" }, { "api_name": "picture.models.Picture.objects", "line_number": 17, "usage_type": "attribute" }, { "api_name": "picture.models.Picture", "line_number": 17, "usage_type": "name...
30545088756
import pprint, pickle from sklearn.metrics import mean_squared_error from math import sqrt pkl_file = open('/home/bc/Pictures/multi-step-prediction/neuron=10/data.pkl','rb') data1 = pickle.load(pkl_file) pprint.pprint(data1) data2 = pickle.load(pkl_file) pprint.pprint(data2) print('rmse:',sqrt(mean_squared_error(dat...
limingwu8/ML
RNN/time_series_prediction/read_pickle.py
read_pickle.py
py
349
python
en
code
1
github-code
6
[ { "api_name": "pickle.load", "line_number": 7, "usage_type": "call" }, { "api_name": "pprint.pprint", "line_number": 8, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 10, "usage_type": "call" }, { "api_name": "pprint.pprint", "line_number"...
23245787205
""" Funcion principal que recibe los datos en un diccionario en Json lo reenvia a la funcion genera_resultado y devuelve el dataframe para pintar. """ import json from flask import Flask, jsonify, request import genera_resultado app = Flask(__name__) @app.route('/api/', methods=['POST']) def recibe_datos(): dat...
Morraja/TheBridge-PT-SD-Sept2021
Bloque 4 - Desarrollo y Storytelling/Ejercicios/Completo ETL/api_datos.py
api_datos.py
py
463
python
es
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.request.get_json", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.request", "line_number": 15, "usage_type": "name" }, { "api_name": "genera_resultado.rec...
12719338270
import collections Person = collections.namedtuple('Person', ('name', 'age', 'gender')) ben = Person(name='Ben', age=8, gender='boy') harper = Person('Harper', age=6, gender='girl') friends_list = (ben,harper) for f in friends_list: print(f.name, "is a", f.age, "year old", f.gender, ".") KeyPress = collectio...
MGlaab/CP_Access_Key-Mouse
spare_parts/collections_example.py
collections_example.py
py
939
python
en
code
0
github-code
6
[ { "api_name": "collections.namedtuple", "line_number": 3, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 15, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 34, "usage_type": "call" }, { "api_name": "p...
27009247728
from sklearn.feature_selection import f_classif, chi2, f_regression, SelectKBest def run(x, y, score_func, k): if type(k) is str: if k != 'all': k = int(k) estimated = SelectKBest(score_func=get_score_func(score_func), k=k) x_new = estimated.fit_transform(x, y) return {"scores_": e...
lisunshine1234/mlp-algorithm-python
feature_engineering/feature_selection/SelectKBest/run.py
run.py
py
589
python
en
code
0
github-code
6
[ { "api_name": "sklearn.feature_selection.SelectKBest", "line_number": 8, "usage_type": "call" }, { "api_name": "sklearn.feature_selection.f_classif", "line_number": 18, "usage_type": "argument" }, { "api_name": "sklearn.feature_selection.f_classif", "line_number": 15, "us...
17940246401
from keras.models import Sequential from keras.layers import Dense, Flatten from keras.layers import Conv2D, MaxPooling2D from keras.optimizers import SGD from keras.utils import to_categorical import numpy as np def cnn_model(train_feature_dir, train_label_dir, test_feature_dir, test_label_dir): train_feature = ...
jingmouren/antifraud
antifraud/methods/CNN_max.py
CNN_max.py
py
1,519
python
en
code
0
github-code
6
[ { "api_name": "numpy.load", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 11, "usage_type": "call" }, { "api_name": "keras.utils.to_categorical", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.load", "li...
31440121652
from django.contrib import admin from django.urls import path,include from . import views urlpatterns = [ path('',views.Dashboard,name='Dashboard'), path('Search/',views.Search,name='Search'), path('DigitalPersonalLoan/',views.Digitalploan,name='Digitalploan'), path('DigitalBusinessLoan/',views.Digital...
HIRAPARANAYAN/verni-by-s
adminDashboard/urls.py
urls.py
py
2,580
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
37045947084
"""Contains the JobViewSet class with handles post and get http request""" from django.shortcuts import get_object_or_404 from rest_framework import viewsets from rest_framework.decorators import api_view from rest_framework.response import Response from rest_framework import status from job_scheduler.models import ...
DKMDebugin/incident-reporting-service
job_scheduler/views/job_view_set.py
job_view_set.py
py
2,236
python
en
code
0
github-code
6
[ { "api_name": "job_scheduler.models.Job.objects.all", "line_number": 33, "usage_type": "call" }, { "api_name": "job_scheduler.models.Job.objects", "line_number": 33, "usage_type": "attribute" }, { "api_name": "job_scheduler.models.Job", "line_number": 33, "usage_type": "n...
10543443002
import json import os import sys from pathlib import Path from typing import Iterator, List, Optional, Tuple import numpy as np BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(BASE_DIR) from benchmark.dataset_config import DatasetConfig from dataset_reader.base_reader import Bas...
myscale/vector-db-benchmark
dataset_reader/json_reader.py
json_reader.py
py
3,592
python
en
code
13
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path.append", "line...
4197601189
import spacy import re import spacy_stanza from negspacy.termsets import termset from negspacy.negation import Negex nlp = spacy.load("en_biobert_ner_symptom") nlp_sz = spacy_stanza.load_pipeline("en", package="mimic", processors={"ner": "i2b2"}) ts = termset("en_clinical") ts.add_patterns({ 'preceding_negations...
PratikMaitra/Sym_chk
model.py
model.py
py
1,572
python
en
code
0
github-code
6
[ { "api_name": "spacy.load", "line_number": 8, "usage_type": "call" }, { "api_name": "spacy_stanza.load_pipeline", "line_number": 10, "usage_type": "call" }, { "api_name": "negspacy.termsets.termset", "line_number": 11, "usage_type": "call" }, { "api_name": "re.sub...
38400052797
"""The Dash app which will display a real-time graph of sentiment scores from the Reddit comments. It updates live sentiment scores by fetching data from AWS RDS. """ import dash import pandas as pd import plotly import dash_core_components as dcc import dash_html_components as html import plotly.graph_objs as go fr...
jeremythai01/Reddit-Sentiment-Analysis-Pipeline
src/services/data_vis/app.py
app.py
py
1,677
python
en
code
0
github-code
6
[ { "api_name": "utils.warehouse_connection.WarehouseConnection.getInstance", "line_number": 17, "usage_type": "call" }, { "api_name": "utils.warehouse_connection.WarehouseConnection", "line_number": 17, "usage_type": "name" }, { "api_name": "dash.Dash", "line_number": 19, ...
35854099541
import sqlite3,datetime def sql_start(): try: global connection,cursor connection = sqlite3.connect('autopay.db') cursor = connection.cursor() response = cursor.execute(''' SELECT * FROM price ''').fetchall() print(response) connection.commit() ...
Adelich27/autopay_bot
work_with_db/select.py
select.py
py
804
python
en
code
0
github-code
6
[ { "api_name": "sqlite3.connect", "line_number": 6, "usage_type": "call" } ]
39628277203
import copy import os import torch import time from torch.autograd import Variable import torch.nn as nn import torch.optim as optim import torch.utils.data as data from tensorboardX import SummaryWriter import sklearn.metrics import numpy as np import torch.backends.cudnn as cudnn import argparse import sys sys.path....
jleesdev/meshdnns
train_meshnet.py
train_meshnet.py
py
6,498
python
en
code
4
github-code
6
[ { "api_name": "sys.path.insert", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "sys.path.insert", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.path", "line_nu...
23313534857
import bpy def drawMenu(self, context): if context.space_data.tree_type != "SFX_NodeTree": return layout = self.layout layout.operator_context = "INVOKE_DEFAULT" layout.operator('sfx.clock_in', text = 'Clock', icon = "CURVE_NCIRCLE" ) layout.menu("SFX_MT_sensors_menu", text= "Sensors", icon = "I...
wiredworks/wiredworks_winches
ui/SFX_node_menu.py
SFX_node_menu.py
py
3,300
python
en
code
12
github-code
6
[ { "api_name": "bpy.types", "line_number": 18, "usage_type": "attribute" }, { "api_name": "bpy.types", "line_number": 26, "usage_type": "attribute" }, { "api_name": "bpy.types", "line_number": 34, "usage_type": "attribute" }, { "api_name": "bpy.types", "line_nu...
5156623921
import yaml DIR = "/config/www/floorplan" def invert_percent(str, offset = 0): return "{}%".format(100 - float(str.strip('%')) + offset) def rotate(element): if element["type"] == "icon": element["tap_action"]["navigation_path"] = element["tap_action"]["navigation_path"].replace("180", "90") ...
ericmatte/HomeAutomation
www/floorplan/rotate-floorplan.py
rotate-floorplan.py
py
1,417
python
en
code
7
github-code
6
[ { "api_name": "yaml.safe_load", "line_number": 29, "usage_type": "call" }, { "api_name": "yaml.dump", "line_number": 38, "usage_type": "call" }, { "api_name": "yaml.dump", "line_number": 45, "usage_type": "call" } ]