id
stringlengths
1
8
text
stringlengths
6
1.05M
dataset_id
stringclasses
1 value
12802956
<reponame>AidanGlickman/sportsreference PARSING_SCHEME = { 'name': 'a', 'games_played': 'td[data-stat="g"]:first', 'wins': 'td[data-stat="wins"]:first', 'losses': 'td[data-stat="losses"]:first', 'win_percentage': 'td[data-stat="win_loss_perc"]:first', 'points_for': 'td[data-stat="points"]:first'...
StarcoderdataPython
155555
<filename>chainer_chemistry/models/mpnn.py from functools import partial from typing import Optional # NOQA import chainer from chainer import cuda, functions # NOQA from chainer_chemistry.config import MAX_ATOMIC_NUM from chainer_chemistry.links import EmbedAtomID from chainer_chemistry.links.readout.ggnn_readout ...
StarcoderdataPython
1855183
<gh_stars>0 import pygame from pygame.locals import * from pygame.font import * import time import random # import raw assets raw_background_img = pygame.image.load("assets\\background.png") raw_upperPillar_img = pygame.image.load("assets\\upper_pillar.png") raw_lowerPillar_img = pygame.image.load("assets\\lower_pill...
StarcoderdataPython
139318
<filename>backend/party/views.py from core.models import Party from rest_framework import generics from .serializers import PartySerializer class PartyListView(generics.ListAPIView): """ Party list view. """ serializer_class = PartySerializer # permission_classes = (permissions.IsAuthenticated,) ...
StarcoderdataPython
6446588
<reponame>RoastVeg/cports<filename>main/xlsatoms/template.py pkgname = "xlsatoms" pkgver = "1.1.3" pkgrel = 0 build_style = "gnu_configure" hostmakedepends = ["pkgconf"] makedepends = ["libxcb-devel"] pkgdesc = "List interned atoms defined on the X server" maintainer = "q66 <<EMAIL>>" license = "MIT" url = "https://xor...
StarcoderdataPython
8153073
"""Export best trajectory GULP .gin input endpoint files for calculation on another computer. """ import os import sys import shutil from PyLib.TinyParser import TinyParser class HostGuestAtomDistances: """Minimum host-guest atom distances at the window, and on the left and right window-sides, for a particular host-g...
StarcoderdataPython
8186837
<reponame>simo955/RecSys_2018<filename>Utils/data/IncrementalSparseMatrix.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on 09/09/2018 """ import scipy.sparse as sps class IncrementalSparseMatrix(object): def __init__(self, auto_create_col_mapper = False, auto_create_row_mapper = False, n_rows ...
StarcoderdataPython
3542081
#!/usr/bin/env python """modbusTask.py: PowerPilot python LoRa""" __version__="0.6.0" __author__="<NAME>" __copyright__="ElectroNet Ltd 2018" from modbus import initModbus, readPilot , getLatestMBError, MB_SUCCESS from logging import Logger import logging import _thread from globs import * from helpers import * impo...
StarcoderdataPython
1744122
import os import pyfits import scipy from scipy import ndimage,optimize # Function poststamp - cuts out a postage stamp from a larger image # # Inputs: # data - full image data array # cx - x value of central pixel # cy - y value of central pixel # csize - length of one side of the postage stamp # Outpu...
StarcoderdataPython
3506101
# -*- coding: utf-8 -*- import random import logging from collections.abc import MutableMapping from weakref import WeakSet from typing import Dict logger = logging.getLogger('scuttlebutt') # type: logging.Logger class RandomlyOrderedDictItem(object): def __init__(self, key, value = None, previous_item: 'Randoml...
StarcoderdataPython
4966617
from .suggestions.searchsuggestion import SearchSuggestion from .suggestions.moviesuggestion import MovieSuggestion from .suggestions.tvshowsuggestion import TVShowSuggestion from .suggestions.peoplesuggestion import PeopleSuggestion from .suggestions.mediasuggestion import MediaSuggestion from .suggestions.textsuggest...
StarcoderdataPython
3341601
<reponame>google-cloud-sdk-unofficial/google-cloud-sdk<filename>lib/googlecloudsdk/command_lib/storage/optimize_parameters_util.py # -*- coding: utf-8 -*- # # Copyright 2021 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complia...
StarcoderdataPython
3266648
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- from django.conf.urls import url, include from django.contrib import admin urlpatterns = [ url(r'^admin/', include(admin.site.urls)), ]
StarcoderdataPython
6698789
<reponame>DiceNameIsMy/fastapi-registration from typing import Optional from pydantic import BaseModel, root_validator class _UserBase(BaseModel): phone: Optional[str] = None email: Optional[str] = None class Config: orm_mode = True class UserRepr(_UserBase): pass class UserProfile(_User...
StarcoderdataPython
4867374
""" Various utils functions for output analysis """ import numpy as np import tensorflow as tf import matplotlib.pyplot as plt import json, re from pathlib import Path from typing import Tuple from pathlib import Path from data_loader import DataModule from basecaller import Basecaller import utils def create_train_h...
StarcoderdataPython
9709736
""" Global variables for the library """ import os BASE_URL = os.environ.get('BASE_URL', 'https://api.repositpower.com') AUTH_PATH = os.environ.get('AUTH_PATH', '{}/v2/auth/login/').format(BASE_URL)
StarcoderdataPython
6651579
<reponame>JennaVergeynst/COVID19-Model<filename>src/covid19model/optimization/run_optimization.py import random import os import numpy as np import matplotlib.pyplot as plt import pandas as pd import datetime import scipy from scipy.integrate import odeint import matplotlib.dates as mdates import matplotlib import scip...
StarcoderdataPython
6507125
<filename>log_stats.py # simple module for reading crawled profile information and logging the stats import json import datetime import csv import argparse from util.settings import Settings def log_stats(username): profile_file = Settings.profile_location + '/' + username + '.json' with open(profile_file, 'r...
StarcoderdataPython
1850306
<gh_stars>0 import os from gevent import socket from gevent.pywsgi import WSGIServer import app sock_path = "{0}run/appserver.sock".format(os.environ["OPENSHIFT_ADVANCED_PYTHON_DIR"]) sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sock.bind(sock_path) sock.listen(256) WSGIServer(sock, app.application).ser...
StarcoderdataPython
1665309
#!/usr/bin/env python # -*- coding: utf-8 -*- import re import datetime, time # Inspired by article: http://www.seehuhn.de/blog/52 class Timezone(datetime.tzinfo): """Convert timestamp from nginx log""" def __init__(self, name="+0000"): self.name = name seconds = int(name[:-2])*3600+int(nam...
StarcoderdataPython
1602238
<reponame>yasuraok/icassp2010<filename>prg/stft.py # -*- coding: utf-8 -*- """ $Date:: $ $Rev:: $ $Author:: $ 至って普通のスペクトログラム算出 """ from numpy import empty, linspace, r_, zeros, real, conj, hstack, vstack from scipy.fftpack import fft, ifft ...
StarcoderdataPython
6547433
<filename>lintcode/660.py """ 660. Read N Characters Given Read4 II - Call multiple times https://www.lintcode.com/problem/read-n-characters-given-read4-ii-call-multiple-times The read4 API is already defined for you. @param buf a list of characters @return an integer you can call Reader.read4(buf) """ class Solution:...
StarcoderdataPython
5064900
# -*- encoding: utf-8 -*- from YamJam import yamjam from configurations import Configuration import os from os.path import join, expanduser CFG = yamjam()['RecomendadorUD'] BASE_DIR = os.path.dirname(os.path.dirname(__file__)) HOME_DIR = expanduser("~")+"/www/Django/RecomendadorUD" MEDIA_DI...
StarcoderdataPython
34003
""" Database models """ from typing import Tuple import attr import sqlalchemy as sa from .settings import DATCORE_STR, SIMCORE_S3_ID, SIMCORE_S3_STR #FIXME: W0611:Unused UUID imported from sqlalchemy.dialects.postgresql #from sqlalchemy.dialects.postgresql import UUID #FIXME: R0902: Too many instance attributes (...
StarcoderdataPython
6631804
<reponame>amitsaha/playground<gh_stars>1-10 """ Find the common elements among two sorted sets Desired time complexity: O(m+n) """ # Uses a hash table (hence uses O(min(m,n)) extra storage # space # This doesn't need the arrays to be sorted def find_common(hash_t, arr): for item in arr: if hash_t.has_key(...
StarcoderdataPython
5149254
"""Avoid colliding predator polygons. This task serves to showcase collisions. The predators have a variety of polygonal shapes and bounce off each other and off the walls with Newtonian collisions. The subject controls a green agent circle. The subject gets negative reward if contacted by a predators and positive rew...
StarcoderdataPython
12839383
<reponame>debian-janitor/ufo2otf-debian<filename>ufo2otf/compilers.py<gh_stars>10-100 #!/usr/bin/env python # -*- coding: utf-8 -*- from os import mkdir from os.path import splitext, dirname, sep, join, exists, basename from subprocess import Popen from diagnostics import diagnostics, known_compilers, FontError import...
StarcoderdataPython
3504880
<filename>pecos/decoders/dummy_decoder/dummy_decoder.py # -*- coding: utf-8 -*- # ========================================================================= # # Copyright 2018 National Technology & Engineering Solutions of Sandia, # LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, # the U.S. Go...
StarcoderdataPython
4857116
#!/usr/bin/python # -*- coding: utf-8 -*- ''' The MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use...
StarcoderdataPython
11235406
#!/usr/bin/env python #------------------------------------------------------------------------------ # Copyright 2015 Esri # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apac...
StarcoderdataPython
3557756
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Train a SciKitLearn K Nearest Neighbors classifier using sample data. """ import json import sys from math import pow, floor from os import path, getcwd import numpy as np import pwm_wave_lib as pwlib from sklearn.neighbors import KNeighborsClassifier from sklearn.ext...
StarcoderdataPython
1628433
<filename>enterprise-repo/enterprepo/pluginrepo/migrations/0007_auto_20170923_1456.py<gh_stars>0 # -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-09-23 14:56 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ...
StarcoderdataPython
3462781
""" Used to generate the number of realisations for a given list of sources. Realisation counts are based on a model as provided by model_Mw, model_NumSim Inputs: A whitespace delimited file with source names and corresponding magnitudes, and a source list file with one source per line. Outputs: A whitespace delimited ...
StarcoderdataPython
302644
from unityagents import UnityEnvironment from src.config import UNITY_ENV_PATH class UnityRun: def __init__(self): self.env = UnityEnvironment(UNITY_ENV_PATH) def __enter__(self): return self.env def __exit__(self): self.env.close()
StarcoderdataPython
1900952
import sqlite3 from fpb.base import common CREATE_TABLE = """ CREATE TABLE IF NOT EXISTS fpb ( id INTEGER PRIMARY KEY, x REAL ); """ INSERT_1D = "INSERT INTO fpb(x) VALUES(?);" CREATE_TABLE_2D = """ CREATE TABLE IF NOT EXISTS fpb ( id INTEGER PRIMARY KEY, x REAL, y REAL ); """ INSERT_2D = "INSERT I...
StarcoderdataPython
3412944
<filename>vit_keras/layers.py # pylint: disable=arguments-differ,missing-function-docstring,missing-class-docstring,unexpected-keyword-arg,no-value-for-parameter import tensorflow as tf import tensorflow_addons as tfa class ClassToken(tf.keras.layers.Layer): """Append a class token to an input layer.""" def ...
StarcoderdataPython
11216513
<gh_stars>1-10 import json """ Contains the load functions that we use as the public interface of this whole library. """ from .parser import JSONParserParams, JSONParser from .parser_listener import ObjectBuilderParserListener from .tree_python import PythonObjectBuilderParams, DefaultStringToScalarConverter from .tr...
StarcoderdataPython
1921407
<reponame>tehnuty/drf-history from settings import * django.setup() from django_nose import NoseTestSuiteRunner def run_tests(*test_args): if not test_args: test_args = ["tests"] test_runner = NoseTestSuiteRunner(verbosity=1) failures = test_runner.run_tests(test_args) if failures: sy...
StarcoderdataPython
3497917
inputString = input( ) print( "Hello, World" ) print( inputString )
StarcoderdataPython
180266
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import scipy.stats as sts from pprint import pprint import os from mnkutil import * sns.set_style('white') sns.set_style('white') sns.set_context('poster') sns.set_palette(['#E97F02', '#490A3D', '#BD1550']) def get_computer_se...
StarcoderdataPython
5095461
<reponame>MenglingHettinger/CarND-Advanced-Lane-Lines import numpy as np import matplotlib.pyplot as plt import matplotlib.image as mpimg import glob import cv2 import pickle def camera_calibration(nx, ny, path, show=True): images = glob.glob(path) objpoints = [] # 3D points in real world space imgpoints ...
StarcoderdataPython
3344416
<gh_stars>1-10 from django.http import HttpResponse, Http404 from django.shortcuts import get_object_or_404, redirect from django.core.urlresolvers import reverse from django.conf import settings from wagtail.wagtailcore import hooks from wagtail.wagtailcore.models import Page, PageViewRestriction from wagtail.wagtail...
StarcoderdataPython
1765061
<filename>regnety/train.py """Script for training RegNetY. Supports TPU training.""" import tensorflow as tf import argparse import os import json import wandb import logging import math import yaml from datetime import datetime from wandb.keras import WandbCallback from regnety.models.model import RegNetY from regne...
StarcoderdataPython
5175990
#!python3 from .test_clients_dummy import test_dummy from ..lib.configs import get_all_config from ..reports.clients_reports import BurpReports import os from ..lib.files import temp_file from invpy_libs import csv_as_dict # Read version from VERSION file __inventory__ = os.path.normpath(os.path.join(os.path.dirname(...
StarcoderdataPython
9625115
<gh_stars>1-10 #!/usr/bin/env python3 import os import argparse import random import math from collections import Counter, defaultdict from typing import NamedTuple from tabulate import tabulate import numpy as np import matplotlib.pyplot as plt from tqdm import tqdm import numba import torch torch.set_num_threads(8)...
StarcoderdataPython
281925
#!c:\am<NAME>\professional\code\python\udemycourse\profiles-rest-api\my_venv\scripts\python.exe from django.core import management if __name__ == "__main__": management.execute_from_command_line()
StarcoderdataPython
8057029
import sys import inspect from typing import * import collections implicit_conversions: Dict[type, Set[type]] = {} warned_for: Set[type] = set() def qualified_name(t): return qualified_type(type(t)) def qualified_type(t): module = t.__module__ if module == 'builtins': return t.__name__ eli...
StarcoderdataPython
1955989
import sys import random import re from collections import defaultdict import pyttsx3 # Initial word boundaries are represented by '#', and final word boundaries are represented by '##'. PHONE_LIST = ( '#', 'AA', 'AE', 'AH', 'AO', 'AW', 'AY', 'B', 'CH', 'D', 'DH', 'EH', 'ER', 'EY', 'F', 'G', 'HH', 'IH', 'IY', 'JH...
StarcoderdataPython
9704068
<filename>paper_exp_lastmin.py # -*- coding: utf-8 -*- """ Created on Fri May 28 21:07:00 2021 @author: chait """ import matplotlib.pyplot as plt import numpy as np from utils import * from rrt_paths import * from sd_metric import * from heatmap import * import copy import matplotlib.animation as animation import cv...
StarcoderdataPython
8033141
<filename>app/classes_feed.py # -*- coding: utf-8 -*- import feedparser import tweepy import time from datetime import datetime import random from threading import Timer from flask import current_app, flash from flask.ext.login import current_user from . import db from . import infos_tweet from .models import Feed, ...
StarcoderdataPython
239303
<reponame>abreza/HOI-CL<filename>scripts/affordance/extract_affordance_feature.py<gh_stars>10-100 # -------------------------------------------------------- # -------------------------------------------------------- from __future__ import absolute_import from __future__ import division from __future__ import print_fu...
StarcoderdataPython
207863
import logging import os import pickle import tqdm from pathlib import Path from ..dataset import GluonCVMotionDataset, DataSample, FieldNames, SplitNames from ..utils.ingestion_utils import crop_video, process_dataset_splits, crop_fn_ffmpeg, \ crop_fn_frame_folder _log = logging.getLogger() _log.setLevel(loggin...
StarcoderdataPython
5118736
<reponame>chenjyw/python-twitter #!/usr/bin/env python from calendar import timegm import rfc822 from twitter import json, TwitterError class DirectMessage(object): """A class representing the DirectMessage structure used by the twitter API. The DirectMessage structure exposes the following properties: ...
StarcoderdataPython
12857915
# coding: utf-8 import os import thriftpy import json import logging from thriftpy.rpc import make_client from xylose.scielodocument import Article, Journal LIMIT = 1000 logger = logging.getLogger(__name__) ratchet_thrift = thriftpy.load( os.path.join(os.path.dirname(__file__))+'/ratchet.thrift') articlemeta_t...
StarcoderdataPython
4985942
# Copyright (c) 2019-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # def f_gold ( arr , N , k ) : maxSum = 0 ; arr.sort ( ) ; i = N - 1 ; while ( i >= 0 ) : if ( arr [ i ] -...
StarcoderdataPython
3513771
""" Ginkgo Base image Contents: GNU compilers version set by the user LLVM/Clang version set by the user Intel ICC and ICPC version set to the latest available version OpenMP latest apt version for Clang+OpenMP Python 2 and 3 (upstream) cmake (upstream) build-essential, git, openssh, curl, v...
StarcoderdataPython
4871611
<reponame>vdloo/raptiformica from raptiformica.actions.mesh import attempt_join_meshnet from tests.testcase import TestCase class TestAttemptJoinMeshnet(TestCase): def setUp(self): self.log = self.set_up_patch('raptiformica.actions.mesh.log') self.update_neighbours_config = self.set_up_patch( ...
StarcoderdataPython
6613935
import argparse import sys, pickle , os parser = argparse.ArgumentParser() parser.add_argument('ckpt_dir' , help="the folder to save checkpoints") parser.add_argument('log_file' , help="the file path to save log file") args = parser.parse_args() sys.path.append('./transformer_xl/') sys.path.append('./src/') impo...
StarcoderdataPython
6568373
<filename>GUI/covid-tracker.py from covid import Covid import matplotlib.pyplot as plt covid=Covid() #storing calling function of Covid name=input("Enter your country name: ") virusdata=covid.get_status_by_country_name(name) remove=['id', 'country', 'latitude', 'longitude', 'last_update'] for i in remove...
StarcoderdataPython
11280296
<reponame>ZeroHarbor/blockstack-storage-drivers #!/usr/bin/env python # -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2014-2015 by Halfmoon Labs, Inc. Copyright (c) 2016 by Blocktatck.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software a...
StarcoderdataPython
3355826
from Agents.Agent import Agent from ZobristHash import ZobristHash class HumanAgent(Agent): def play(self, moves : list, board : list): i = int(input(moves)) return moves[i]
StarcoderdataPython
6641268
<reponame>kallyous/mbla<filename>viper/__init__.py """ Copyright 2017 <NAME> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable l...
StarcoderdataPython
5170676
<reponame>mspasiano/uniTicket from django.contrib import admin from django.contrib.auth import views as auth_views from django.urls import include, path, re_path from django.utils.text import slugify from django.views.generic import RedirectView from . decorators import is_manager, is_operator, is_the_owner from . set...
StarcoderdataPython
254524
<gh_stars>0 #!/usr/bin/env python import pickle import rospkg rospack = rospkg.RosPack() RACECAR_PKG_PATH = rospack.get_path('racecar') PLANNER_PKG_PATH = rospack.get_path('planning_utils') CURRENT_PKG_PATH = rospack.get_path('final') BLUE_FILTER_TOPIC = '/cv_node/blue_data' RED_FILTER_TOPIC = '/cv_node/red_data' i...
StarcoderdataPython
4817352
<gh_stars>1-10 # Generated by Django 3.1.6 on 2021-05-20 06:53 import django.contrib.auth.models from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('authome', '0019_auto_20210406_1517'), ] operations = [ migrations.CreateModel( ...
StarcoderdataPython
1827365
<filename>tests/schema/test_transactions.py<gh_stars>1-10 """Tests for privacy.schema.transaction""" import pytest # from privacy.schema import transaction @pytest.mark.skip(reason="Not Implemented") def test_transaction(mock_transaction_payload): ...
StarcoderdataPython
11253418
nome = str(input('Digite seu nome completo...')).strip() print('Seu nome tem {}'.format('Silva' in nome))
StarcoderdataPython
187467
import math import numpy as np from scipy.spatial.transform import Rotation """ The rotations can of two types: 1. In a global frame of reference (also known as rotation w.r.t. fixed or extrinsic frame) 2. In a body-centred frame of reference (also known as rotation with respect to current frame of reference. It is ...
StarcoderdataPython
6564716
from os import path from setuptools import setup, find_packages project_directory = path.abspath(path.dirname(__file__)) def load_from(file_name): with open(path.join(project_directory, file_name), encoding="utf-8") as f: return f.read() setup( name="dogebuild-tex", version=load_from("dogebuil...
StarcoderdataPython
62798
<reponame>coderextreme/x3dpython from django.apps import AppConfig class X3DConfig(AppConfig): name = 'x3d'
StarcoderdataPython
6593781
<reponame>ATrain951/01.python-com_Qproject import io import unittest from contextlib import redirect_stdout import solution class TestQ(unittest.TestCase): def test_case_0(self): text_trap = io.StringIO() with redirect_stdout(text_trap): solution.symmetric_difference({2, 4, 5, 9}, {2,...
StarcoderdataPython
3529032
<filename>conrad/test/units/adapter/test_base_adapter.py from conrad.adapter import Base class TestBase(object): def test_methods(self): for method in ['connect', 'find', 'update', 'create', 'delete', 'result_dict']: assert hasattr(Base, method), 'Base is missing method {}'.for...
StarcoderdataPython
132784
<filename>tests/test_data.py import numpy as np import pytest import warnings from nexusformat.nexus import * x = NXfield(2 * np.linspace(0.0, 10.0, 11, dtype=np.float64), name="x") y = NXfield(3 * np.linspace(0.0, 5.0, 6, dtype=np.float64), name="y") z = NXfield(4 * np.linspace(0.0, 2.0, 3, dtype=np.float64), name="z...
StarcoderdataPython
3293816
<filename>sdk/cwl/arvados_cwl/pathmapper.py<gh_stars>1-10 import re import logging import uuid import os import arvados.commands.run import arvados.collection from cwltool.pathmapper import PathMapper, MapperEnt, abspath, adjustFileObjs, adjustDirObjs from cwltool.workflow import WorkflowException logger = logging.g...
StarcoderdataPython
1671584
<filename>ros/catch_mouse/scripts/button.py #!/home/ros/.pyenv/shims/python3 # -*- coding: utf-8 -*- import rospy from std_msgs.msg import String from getch import _Getch def 发布指令(): shell输入 = _Getch() rospy.init_node('keyboard', anonymous=True) 指令发送 = rospy.Publisher('/舵机控制/指令', String, queue_size=10) ...
StarcoderdataPython
8020012
<filename>nudging/simulation/utils.py import numpy as np from numpy import fabs from scipy.optimize import bisect from scipy import stats from nudging.dataset.matrix import MatrixData class Bounds(): def __init__(self, value, int_val=False): self.int_val = int_val if isinstance(value, (list, tupl...
StarcoderdataPython
3307880
<gh_stars>1-10 from peewee import * conn = SqliteDatabase("./core_elements/data_controller/data.db") class BaseModel(Model): class Meta: database = conn class UserInfo(BaseModel): id = AutoField(column_name='id') balance = IntegerField(column_name='balance', default=0) experience = IntegerF...
StarcoderdataPython
6493007
from .tool.func import * def topic_admin_2(conn, name, sub, num): curs = conn.cursor() curs.execute("select block, ip, date from topic where title = ? and sub = ? and id = ?", [name, sub, str(num)]) data = curs.fetchall() if not data: return redirect('/topic/' + url_pas(name) + '/sub/' + url_p...
StarcoderdataPython
6465195
#!/usr/bin/env python3 # # Copyright 2022 Graviti. Licensed under MIT License. # """Column Series module."""
StarcoderdataPython
1950583
import logging import re from functools import lru_cache import json import pandas as pd from bioservices import KEGG, UniProt class KeggProteinInteractionsExtractor: def __init__(self, kegg=None, uniprot =None): self._logger = logging.getLogger(__name__) self.kegg = kegg self.uniprot = ...
StarcoderdataPython
6699482
import tensorflow as tf from tensorflow.keras import backend as K from tensorflow.keras import regularizers from tensorflow.keras.layers import Layer class ArcFace(Layer): def __init__(self, n_classes=10, s=30.0, m=0.50, regularizer=None, **kwargs): super(ArcFace, self).__init__(**kwargs) self.n_...
StarcoderdataPython
96330
from scipy.signal import butter from helper import ULogHelper class DiagnoseFailure: def __init__(self, ulog): data_parser = ULogHelper(ulog) data_parser.extractRequiredMessages(['estimator_status', 'vehicle_status']) def change_diagnose(self, timestamps, flags, flag_type): if fl...
StarcoderdataPython
9642417
<reponame>jmdecastel/GEOTADMIN<gh_stars>0 # -*- encoding: utf-8 -*- import os from django.test import TestCase from geotrek.common.tasks import import_datas from geotrek.common.models import FileType class TasksTest(TestCase): def setUp(self): self.filetype = FileType.objects.create(type=u"Photographie")...
StarcoderdataPython
3251449
<reponame>trisadmeslek/V-Sekai-Blender-tools """ Copyright (C) 2021 Adobe. This program 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. This...
StarcoderdataPython
8079809
import torch import random import os from pathlib import Path from flask import Flask, request, jsonify from flask_cors import CORS from captchami.loaders import CaptchaDataset from captchami.neural_net import NeuralNet from captchami.vision import * captcha_service = Flask(__name__) cors = CORS(captcha_service, reso...
StarcoderdataPython
189019
""" Created on Thu Apr 9 @author: nrw This plots residuals, And also takes shelved torque data, adds in torque estimate and residual data And writes it all to a CSV """ import pandas as pd import numpy as np import matplotlib.pyplot as plt import plotly.plotly as py import plotly.offline as po import plotly.graph_o...
StarcoderdataPython
3537613
# Arithmetic tests for DataFrame/Series/Index/Array classes that should # behave identically. from datetime import datetime, timedelta import numpy as np import pytest from pandas.errors import ( NullFrequencyError, OutOfBoundsDatetime, PerformanceWarning) import pandas as pd from pandas import ( DataFrame, ...
StarcoderdataPython
8093516
<gh_stars>0 ''' latin_text_cleaner.py reads text in from one or more text files, removes the punctuation and header/footer info, and writes the output to a file bancks holmes ''' import string import numpy as np from cltk.lemmatize.latin.backoff import BackoffLatinLemmatizer import os #first, build list of filenames f...
StarcoderdataPython
3218180
<reponame>zero1number/redash<gh_stars>1000+ import functools from flask_login import current_user from flask_restful import abort from funcy import flatten view_only = True not_view_only = False ACCESS_TYPE_VIEW = "view" ACCESS_TYPE_MODIFY = "modify" ACCESS_TYPE_DELETE = "delete" ACCESS_TYPES = (ACCESS_TYPE_VIEW, A...
StarcoderdataPython
5160259
<reponame>sunrabbit123/school-info_python import asyncio import datetime from pytz import timezone as tz import re import schoolInfo.util as util @util.except_keyError async def meal( ATPT_OFCDC_SC_CODE: str, SD_SCHUL_CODE: str, MLSV_YMD: datetime.datetime = None, timezone: str = "Asia/Seoul", au...
StarcoderdataPython
1808380
import os import sys import shutil import numpy as np import time, datetime import torch import random import logging import argparse import torch.nn as nn import torch.utils import torch.backends.cudnn as cudnn import torch.distributed as dist import torch.utils.data.distributed sys.path.append("../../") from utils.u...
StarcoderdataPython
4886323
# -*- coding: utf-8 -*- """ Copyright 2018 NAVER Corp. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, pu...
StarcoderdataPython
3339636
# encoding: utf-8 # module PySide.QtGui # from C:\Python27\lib\site-packages\PySide\QtGui.pyd # by generator 1.147 # no doc # imports import PySide.QtCore as __PySide_QtCore import Shiboken as __Shiboken class QCompleter(__PySide_QtCore.QObject): # no doc def activated(self, *args, **kwargs): # real signatur...
StarcoderdataPython
1706341
import glob def get_call_in_pa(program, call_in_pa): f = open(program+"/initial-all/complete"); f.readline() line = f.readline() calls = line.split(",") for i in range(1, len(calls)-1): call_in_pa.add(calls[i]) def get_call_info(program): call_in_pa = set() get_call_in_pa(program, call_in_pa) #print call_i...
StarcoderdataPython
60159
"""Base Class for a Solver. This class contains the different methods that can be used to solve an environment/problem. There are methods for mini-batch training, control, etc... The idea is that this class will contain all the methods that the different algorithms would need. Then we can simply call this class in the ...
StarcoderdataPython
9700096
<reponame>bigstepinc/metal_cloud_ansible_modules #!/usr/bin/python # Copyright: (c) 2018, Bigstep, inc ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'bigstep' } DOCUMENTATION = ''' --- module: metalcloud_infrastructure_deploy short_description: deploy an infrastru...
StarcoderdataPython
8078086
r"""Test :py:mod:`lmp.util.dset` signature.""" import inspect from inspect import Parameter, Signature from typing import Optional import lmp.util.dset from lmp.dset import BaseDset def test_module_function(): """Ensure module function's signature.""" assert inspect.isfunction(lmp.util.dset.load) assert...
StarcoderdataPython
1933599
# 1.You are given a dataset, which is present in the LMS, containing the number of hurricanes occurring in the # United States along the coast of the Atlantic. Load the data from the dataset into your program and plot a # Bar Graph of the data, taking the Year as the x-axis and the number of hurricanes occurring as t...
StarcoderdataPython
11322361
<filename>qf_25_导入模块的语法.py # 模块:在Python里一个py文件,就可以理解为以模块 # 不是所有的py文件都能作为一个模块来导入 # 如果想要让一个py文件能够被导入,模块名字必须要遵守命名规则 # Python为了方便我们开发,提供了很多内置模块 # 5种方式 import time # 1. 使用import 模块名称 直接导入一个模块 from random import randint # 2. from模块名import 函数名,导入一个模块里的方法成者变量 from math import * # 3. from 模块名improt *导入这个模块里的所有方法和变量 import...
StarcoderdataPython
1751715
<gh_stars>0 import sqlite3 from tkinter import * from tkinter import ttk from PIL import ImageTk,Image from tkinter import messagebox import sqlite3 def bookRegister(): bid = bookInfo1.get() title = bookInfo2.get() author = bookInfo3.get() status =selected.get() if bid =="" o...
StarcoderdataPython