id
stringlengths
1
265
text
stringlengths
6
5.19M
dataset_id
stringclasses
7 values
3323135
<gh_stars>1-10 from service import retrieveStoicQuote, retrieveNotionDatabase import utils from tokens import SECRETS from send_email import send_email import html_email as html import datetime from datetime import timezone # Notion api config password = f"Bearer {SECRETS['notion_test_token']}" headers = { "Author...
StarcoderdataPython
142828
<gh_stars>0 import requests endpoint = 'https://swapi.py4e.com/api' response = requests.get(f"{endpoint}/people/", {'search': 'luke'}).json() luke_skywalker = response['results'][0] print(f"\nLuke Skywalker = {luke_skywalker}")
StarcoderdataPython
163808
import logging from datetime import datetime import pandas as pd import geopandas as gpd logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) def export_watering_data(df_watering): """Write data about watered trees and information about trees to csv and geojson files. Args: watered_tr...
StarcoderdataPython
3304165
import sys from os import path import enum import platform DEVICE_ID = 'RF8N32YBMGG' # FIGHTING_COLOR = "528cca" FIGHTING_COLOR = "5995d2" # DEVICE_ID = '2785a241e41c7ece' # FIGHTING_COLOR = "3c5e85" COPY_FIGHT_TOTAL_COUNT = 5 if platform.system() == 'Windows': VIRTUAL_DISK = 'R:' VIRTUAL_CREATE_CMD = 'imdisk...
StarcoderdataPython
1714895
<filename>MachineLearning/HMM/Application/HMM_POS-Tagging.py # coding: utf-8 # # HMM词性标注 import nltk import sys from nltk.corpus import brown print(brown.tagged_sents()[0]) print(len(brown.tagged_sents()[0])) #预处理,添加start和end tag brown_tags_words = [ ] for sent in brown.tagged_sents(): brown_tags_words.append...
StarcoderdataPython
3301592
<reponame>Phyoeieibo/python-exercises from sys import argv script,user_name=argv prompt ='>' print("Hi %s ,I'm the %s script." %(user_name,script)) print("I'd like to ask you a few questions.") print("Do you like me %s?" % user_name) likes=input(prompt) print("where do you live %s?" % user_name) lives=input(prompt) pri...
StarcoderdataPython
1645751
<reponame>mitodl/mit-xpro # Generated by Django 2.1.7 on 2019-05-10 13:10 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL...
StarcoderdataPython
85835
<filename>test/functional/test-framework/storage_devices/disk.py # # Copyright(c) 2019-2020 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause-Clear # import itertools from enum import IntEnum from test_utils import disk_finder from test_utils.output import CmdException from test_utils.size import Unit from tes...
StarcoderdataPython
1612220
<filename>docs/_ext/Add2Build.py import os import shutil def copyImages(): # get relevant directories cwd = os.getcwd() contentdir = cwd + "/content" buildimagesdir = cwd + "/_build/html/_images" # check if images directory exists if not os.path.isdir(buildimagesdir): os.mkdir(buildim...
StarcoderdataPython
3245180
"""Collection of abstract base classes used elsewhere""" import abc class OrchestrationManager(abc.ABC): """Interface collecting the methods that manage orchestration""" @abc.abstractmethod def reregister_include_file_watchers(self, old_include_files, new_include_files): """reregister the includ...
StarcoderdataPython
124723
# -*- coding: utf-8 -*- """setuptools-based setup.py for imacropy. Tested on Python 3.6. Usage as usual with setuptools: python3 setup.py build python3 setup.py sdist python3 setup.py bdist_wheel --universal python3 setup.py install For details, see http://setuptools.readthedocs.io/en/latest/setu...
StarcoderdataPython
4819302
from ..engine.base_node import Node class Wrapper(Node): def __init__(self, node, **kwargs): self.layer = node super(Wrapper, self).__init__(**kwargs)
StarcoderdataPython
147649
import pandas as pd import matplotlib.pyplot as plt import numpy as np colors = ['r', 'g', 'b', 'c'] run_to_label = { 0: '$k=0$', 1: '$k=4$', 2: '$k=1$', 3: '$k=4$ only' } fig, ax = plt.subplots(nrows=1, ncols=2, num='k_moment') # fig.suptitle('k_moment', fontsize=20) # source for i in range(4): ...
StarcoderdataPython
4822857
from flask import Flask, current_app import logging import os import sys import json import requests from context import app from services.ws_service import ws_service_blueprint __author__ = '<EMAIL>' # Initialize application. app = Flask("psdm_mongo_ws") # Set the expiration for static files app.config['SEND_FILE_...
StarcoderdataPython
3329606
<gh_stars>0 import os, sys from Bio import SeqIO from Bio import pairwise2 import time import itertools import multiprocessing as mp from abutils.utils.alignment import global_alignment, muscle from abutils.core.sequence import Sequence, read_fasta from collections import Counter import pandas as pd import numpy as ...
StarcoderdataPython
3364960
<reponame>wataken44/galette #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ configure.py """ from common import * def main(): run("configure.yml") if __name__ == "__main__": main()
StarcoderdataPython
4827105
<reponame>thepeytongreen/pyCGM<gh_stars>10-100 import unittest import pyCGM_Single.pyCGM as pyCGM import numpy as np import pytest rounding_precision = 6 class TestPycgmAngle(): """ This class tests the functions used for getting angles in pyCGM.py: getangle_sho getangle_spi getangle getHeadan...
StarcoderdataPython
4825083
from .task import Task from .cluster_data import ClusterData from .compare_target_molecule import CompareTargetMolecule from .see_property_variation_with_similarity import SeePropertyVariationWithSimilarity from .visualize_dataset import VisualizeDataset from .identify_outliers import IdentifyOutliers from .measure_sea...
StarcoderdataPython
3352681
<filename>src/inference.py import argparse import joblib from pathlib import Path import pandas as pd import config from sklearn.preprocessing import LabelEncoder def run(model_filenames, ensemble, submit_filename): # Load the testing data df = pd.read_csv(config.TESTING_FILE) row_ids = df['row_id'] ...
StarcoderdataPython
4824838
<reponame>ShankarNara/shogun<gh_stars>1-10 #!/usr/bin/env python import numpy as np def gen_data(num_classes,num_samples,dim): np.random.seed(0) covs = np.array([[[0., -1. ], [2.5, .7]], [[3., -1.5], [1.2, .3]], [[ 2, 0 ], [ .0, 1.5 ]]]) X = np.r_[np.dot(np.random.randn(num_samples, dim), covs[0]) + np...
StarcoderdataPython
138564
# -*- mode:python; coding:utf-8 -*- # Copyright (c) 2021 IBM Corp. All rights reserved. # # 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 # https://www.apache.org/licenses/LICENSE-2.0 # # ...
StarcoderdataPython
4833321
import argparse import d3rlpy from d3rlpy.algos import DQN from d3rlpy.datasets import get_atari from d3rlpy.metrics.scorer import evaluate_on_environment from d3rlpy.metrics.scorer import td_error_scorer from d3rlpy.metrics.scorer import discounted_sum_of_advantage_scorer from d3rlpy.metrics.scorer import average_val...
StarcoderdataPython
3341802
""" package to voxelize an embedded graph """ import numpy as np def Bresenham3D(p1, p2): #from https://www.geeksforgeeks.org/bresenhams-algorithm-for-3-d-line-drawing/ x1, y1, z1 = p1 x2, y2, z2 = p2 ListOfPoints = [] ListOfPoints.append((x1, y1, z1)) dx = abs(x2 - x1) dy = abs(y2 - y1) ...
StarcoderdataPython
3387267
import time import json from dataclasses import dataclass, asdict, fields from typing import Optional from datetime import datetime from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() class User(db.Model): __tablename__ = 'user' id = db.Column(db.Integer, primary_key=True) public_id = db.Column(db...
StarcoderdataPython
3234274
import json from urllib.parse import urlparse from core_data_modules.cleaners import somali, Codes from core_data_modules.data_models import Scheme, validators from dateutil.parser import isoparse def _open_scheme(filename): with open(f"code_schemes/{filename}", "r") as f: firebase_map = json.load(f) ...
StarcoderdataPython
3201857
#!/usr/bin/env python3 import os from pexpect import pxssh import argparse DEFAULT_USERNAME = 'root' DEFAULT_PASSWORD = <PASSWORD> parser = argparse.ArgumentParser(description='Retrieve information about a NetOS machine and store it on disk.') parser.add_argument('hostname', type=str, help='Hostname', nargs='?', de...
StarcoderdataPython
1682314
<filename>src/kappaml_core/cli.py """ This is a skeleton file that can serve as a starting point for a Python console script. """ import argparse import logging import sys from river import ( compose, datasets, facto, metrics, model_selection, optim, preprocessing, reco, ) from river.e...
StarcoderdataPython
3388455
<filename>claims_to_quality/analyzer/models/measures/measure_code.py """Model representing one encounter/procedure/quality code in a measure definition.""" from schematics.models import Model from schematics.types import StringType from schematics.types.compound import ListType class MeasureCode(Model): """This m...
StarcoderdataPython
21551
import datetime, os, base64 from flask import Flask, jsonify, request, Blueprint from dbstore import dbconf import json from bson import json_util # process kill # lsof -i tcp:3000 file_upload = Blueprint('uploadAPI', __name__) app = Flask(__name__) def song_upload(val): try: # content = request.get_j...
StarcoderdataPython
101689
<reponame>LambArchie/Competition-Manager<gh_stars>0 """ Controls pages directly related to the overall competitions """ from flask import render_template, flash, redirect, url_for, request from flask_login import login_required, current_user from app import db from app.database.models import Competition from app.compet...
StarcoderdataPython
55313
<reponame>wong-justin/quick-bible '''Setup (one-time) to prepare data for gui.''' import constants # import sys # sys.path.insert(0, '../env/Lib/site-packages') from striprtf.striprtf import rtf_to_text import requests import glob import re import json from io import BytesIO from zipfile import ZipFile # from time i...
StarcoderdataPython
3262608
# Copyright (c) 2020 The Regents of the University of Michigan # All rights reserved. # This software is licensed under the BSD 3-Clause License. """Define utilities for handling NumPy arrays.""" import warnings try: import numpy NUMPY = True _numpy_cache_blocklist = (numpy.ndarray,) except ImportError: ...
StarcoderdataPython
1721175
# coding:utf-8 # 使用ftplib库开启ftp服务 from pyftpdlib.authorizers import DummyAuthorizer # 授权 from pyftpdlib.handlers import FTPHandler from pyftpdlib.servers import FTPServer def run_ftp(): # 新建一个用户组 authorizer = DummyAuthorizer() # 将用户名、密码、指定目录、权限添加到里面 authorizer.add_user('fan', 'root', '/Users/zhouwei/...
StarcoderdataPython
3262983
<gh_stars>1-10 # -*- coding: UTF-8 -*- from amber.utils import run_from_ipython from amber.bootstrap.grid_search import grid_search from amber.objective.motif import MotifKLDivergence from amber.modeler import KerasModelBuilder from amber.architect.reward import KnowledgeReward, LossAucReward from amber.architect.mode...
StarcoderdataPython
1746445
#!/usr/bin/env python import csv import sys import pprint # Function to convert a csv file to a list of dictionaries. Takes in one variable called "variables_file" def csv_dict_list(variables_file): # Open variable-based csv, iterate over the rows and map values to a list of dictionaries containing key/value pairs di...
StarcoderdataPython
9333
from .rohon_gateway import RohonGateway
StarcoderdataPython
3346902
<reponame>mrgokul/aggcluster import numpy as np from collections import OrderedDict __author__ = "<NAME>" __copyright__ = "Copyright 2014, LatentView Analytics Pvt. Ltd." __email__ = "<EMAIL>" __status__ = "Development" __version__="0.0.1" class SparseFeatureDistanceMatrix(np.ndarray): def __new__(cls, recor...
StarcoderdataPython
1784710
<reponame>jorgeles/TFM # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('heuristica', '0019_resultados_propietario'), ] operatio...
StarcoderdataPython
4834254
# Generated by Django 3.0.4 on 2020-03-20 11:44 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('solo_rog_api', '0013_delete_log'), ] operations = [ migrations.AlterModelOptions( name='document', options={'ordering': ['-s...
StarcoderdataPython
112341
<reponame>henniggroup/symbolic-regression-utilities import os import re import numpy as np import pandas as pd import sympy from sympy.parsing.sympy_parser import parse_expr from sympy.calculus.singularities import is_monotonic from sympy.calculus.singularities import is_increasing from sympy.calculus.singularities ...
StarcoderdataPython
149829
<filename>dw_scraper.py from __future__ import unicode_literals from bs4 import BeautifulSoup import requests import json import re import datetime from pymongo import MongoClient connection = MongoClient() db = connection.event_scrape collection = db["dw_test"] url_list = ["http://www.dw.com/search/?languageCode=...
StarcoderdataPython
3342525
# Copyright 2015 Google Inc. All rights reserved. # # 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 law or a...
StarcoderdataPython
3222088
"""Auto-generated file, do not edit by hand. BT metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_BT = PhoneMetadata(id='BT', country_code=975, international_prefix='00', general_desc=PhoneNumberDesc(national_number_pattern='[17]\\d{7}|[2-8]\\d{6}', possible_length...
StarcoderdataPython
134977
"""This module contains the general information for SyntheticFile ManagedObject.""" import sys, os from ...ucsmo import ManagedObject from ...ucscoremeta import UcsVersion, MoPropertyMeta, MoMeta from ...ucsmeta import VersionMeta class SyntheticFileConsts(): pass class SyntheticFile(ManagedObject): """Thi...
StarcoderdataPython
1780986
"""Provide the grid on which Nyles is discretized. TODO: implement handling of the halo (ghost points). TODO: distinguish between total Lx, nx and sub-domain Lx, nx TODO: multi-core handling: domain of second core starts at Lx/2, not Lx """ import numpy as np # Local imports from variables import Scalar, Vector impo...
StarcoderdataPython
3288022
from tkinter import * from tkinter import messagebox as MessageBox from tkinter import colorchooser as ColorChooser from tkinter import filedialog as FileDialog root = Tk() def test(): # color = ColorChooser.askcolor(title="Elige un color") # print(color) # ruta = FileDialog.askopenfilename(title="Abir u...
StarcoderdataPython
46171
<filename>examples/ipcount/ipcount.py # BEGIN_COPYRIGHT # # Copyright 2009-2014 CRS4. # # 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 # # ...
StarcoderdataPython
196677
<filename>nextdl/extractor/raywenderlich.py from __future__ import unicode_literals import re from ..compat import compat_str from ..utils import (ExtractorError, int_or_none, merge_dicts, try_get, unescapeHTML, unified_timestamp, urljoin) from .common import InfoExtractor from .vimeo import Vime...
StarcoderdataPython
3332012
<reponame>codehack9991/VOCOWA<gh_stars>1-10 # You are given a car in a grid with initial state # init = [x-position, y-position, orientation] # where x/y-position is its position in a given # grid and orientation is 0-3 corresponding to 'up', # 'left', 'down' or 'right'. # # Your task is to compute and return the car's...
StarcoderdataPython
111771
# Generated by Django 3.0.4 on 2020-05-09 09:56 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('blog', '0002_auto_20200509_0450'), ] operations = [ migrations.AlterField( model_name='comment', name='approved_comm...
StarcoderdataPython
89873
<filename>yarn/PhilReinholdPygrape/cuda_l1_wvd.py import pycuda.autoinit import pycuda.driver as drv import numpy as np from pycuda.compiler import SourceModule import time src = """ #if %(use_double)d #define FLOAT double #define IFLOAT unsigned long long int #define F2I __double_as_longlong #define I2F __longlong_as...
StarcoderdataPython
1764409
<reponame>fahlmant/openshift-tools # pylint: skip-file def main(): ''' ansible oc module for router ''' module = AnsibleModule( argument_spec=dict( state=dict(default='present', type='str', choices=['present', 'absent']), debug=dict(default=False,...
StarcoderdataPython
157099
<gh_stars>1-10 #! /usr/bin/env python # script.py -- Make typescript of terminal session. # Usage: # -a Append to typescript. # -p Use Python as shell. # Author: <NAME>. import os, time, sys import pty def read(fd): data = os.read(fd, 1024) file.write(data) return data shell = 'sh' filename = 'typescript' mode =...
StarcoderdataPython
4838083
# coding: utf-8 # !/usr/bin/env python from setuptools import setup DISTNAME = 'quantamatics' DESCRIPTION = "Quantamatics Open Source API Package" LONG_DESCRIPTION = "" MAINTAINER = 'Facteus, Inc.' AUTHOR = 'Facteus Platform team' AUTHOR_EMAIL = '<EMAIL>' URL = "https://github.com/Quantamatics/quantamatics" LICENSE = ...
StarcoderdataPython
1600995
<reponame>codedsk/hubcheck-hubzero-tests<gh_stars>1-10 import unittest import sys import os import pytest import re from string import Template import hubcheck from hubcheck.testcase import TestCase2 from hubcheck.shell import ContainerManager pytestmark = [ pytest.mark.container, pytest.mark.rappture...
StarcoderdataPython
1700881
# Author: allannozomu # Runtime: 96 ms # Memory: 13.4 MB class Solution: def findMedianSortedArrays(self, nums1: List[int], nums2: List[int]) -> float: union = nums1 + nums2 union.sort() if (len(union) % 2): return union[len(union) // 2] return (union[len(union) // 2] + ...
StarcoderdataPython
3247390
import datetime from datetime import date from django.contrib.auth.models import User from django.db.models import QuerySet, Subquery, OuterRef, F, Q, Count, ExpressionWrapper, FloatField, Sum, Case, When, \ Value, CharField from django.db.models.functions import Coalesce from django.shortcuts import get_object_or_4...
StarcoderdataPython
3295651
<filename>apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/base/ir/ir_qweb/__init__.py # -*- coding: utf-8 -*- from odoo.tools import safe_eval, html_escape as escape from . import fields from . import assetsbundle from .assetsbundle import AssetsBundle from .qweb import unicodifier, QWebException from .ir_...
StarcoderdataPython
1789016
#!/usr/bin/env python file= open("/home/slingerriperxd/Desktop/arch1.txt", "rb") file2= open("/home/slingerriperxd/Desktop/arch2.txt", "wb") contfile= int(file.read()) imprime= ' ' cnt= 0 while cnt < contfile: imprime= '*' + imprime file2.write(imprime) file2.write('\n') cnt+=1 while cnt >= 1: cnt2=0 imprime...
StarcoderdataPython
3362477
from sklearn.preprocessing import StandardScaler from sklearn.linear_model import LogisticRegression from sklearn.pipeline import make_pipeline from sklearn.datasets import load_iris from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score pipe = make_pipeline( StandardScaler...
StarcoderdataPython
1743060
<filename>communicate/exceptions/learning_styles_exceptions.py class NoLearningStylesException(Exception): """Should be called if no learning styles exist""" pass
StarcoderdataPython
1707918
import csv import os from collections import OrderedDict from copy import deepcopy from dagster import ( ExecutionTargetHandle, InputDefinition, Materialization, OutputDefinition, Path, as_dagster_type, input_hydration_config, lambda_solid, output_materialization_config, pipelin...
StarcoderdataPython
3241254
<gh_stars>0 # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'B3-GUI-v2.ui' # # Created by: PyQt5 UI code generator 5.11.3 # # WARNING! All changes made in this file will be lost! import sys from PyQt5 import QtCore, QtGui, QtWidgets class ListNode: def __init__(self, val=0, nex=Non...
StarcoderdataPython
1765840
from PyQt5 import QtGui from PyQt5.QtWidgets import (QWidget, QPushButton, QVBoxLayout, QVBoxLayout, QHBoxLayout, QStackedWidget) from PyQt5.QtCore import pyqtSignal, pyqtSlot class Pager(QWidget): finished = pyqtSignal() changed = pyqtSignal(int) def __init__(self, parent=None): QWidget.__init__(...
StarcoderdataPython
181174
#! Простые задачки. # 1. Даны два целых числа, отличных от нуля. Найдите их сумму, # произведение, разность, частное. def test_1(a, b): if str(a).isdigit() and str(b).isdigit(): return a + b, a * b, a - b, a / b return "Error" print(test_1(1, 4)) # 2. Поменяйте местами значения д...
StarcoderdataPython
8455
class Dummy(): def __init__(self, data): self.name = data['name'] self.age = data['age'] self.city = data['city'] class DummyData(): def __init__(self): self.results = [ Dummy({ 'name': 'PA', 'age': 29, 'city': 'Paris'...
StarcoderdataPython
52990
<gh_stars>0 import inspect import re import os.path import json import secrets import time import logging import sys from web3 import ( Web3, HTTPProvider ) from eth_account import Account as EthAccount from starfish import Ocean from starfish.account import Account as OceanAccount from wallet_manager.wallet_...
StarcoderdataPython
190422
#!/usr/bin/env python3 # Author: <NAME> # Contact: <EMAIL> """Define data preprocessing operations for **PETGEM**.""" # --------------------------------------------------------------- # Load python modules # --------------------------------------------------------------- import numpy as np import h5py import meshio ...
StarcoderdataPython
143074
# (c) 2012-2013 Continuum Analytics, Inc. / http://continuum.io # All Rights Reserved # # conda is distributed under the terms of the BSD 3-clause license. # Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause. from __future__ import print_function, division, absolute_import import sys from os.path imp...
StarcoderdataPython
1649371
<gh_stars>0 from contextlib import contextmanager from pkgutil import extend_path from .tournament import Tournament # ks. https://docs.python.org/3/library/pkgutil.html # tämä siksi, että mm. robostat-web voi erottaa omaan pakettiin __path__ = extend_path(__path__, __name__) default_tournament = Tournament() @conte...
StarcoderdataPython
158987
<filename>nutils/mesh.py # Copyright (c) 2014 Evalf # # 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, merg...
StarcoderdataPython
79558
<reponame>mohbandy/probr-core<filename>device_captures/models.py from captures.models import Capture from django.db import models from devices.models import Device class DeviceCapture(Capture): device = models.ForeignKey(Device)
StarcoderdataPython
1799866
<reponame>jmeisele/fastapi-tf """ Author: <NAME> Date: October 1, 2020 Email: <EMAIL> Scope: App for Tensorflow Doggo classifier """ from fastapi import FastAPI from app.api.routes.router import api_router from app.core.config import (API_PREFIX, APP_NAME, APP_VERSION, IS_DEBUG) from app.core.event_handlers import (st...
StarcoderdataPython
1626043
<reponame>reijnnn/IBM-DataStage-API<gh_stars>10-100 from config import * from ibm_datastage_api import DSAPI, convert_char_p_to_list dsapi = DSAPI() hproj = None hjob = None try: _, err = dsapi.DSLoadLibrary(API_LIB_FILE) if err: raise Exception("Loading the library failed: {}".format(err)) print...
StarcoderdataPython
1620703
<filename>scripts/python/impute_dropouts.py """ Script to impute dropouts in normalized scRNAseq data using MAGIC Reference: <NAME>., <NAME>., <NAME>., <NAME>., <NAME>., <NAME>., … <NAME>. (2018). Recovering Gene Interactions from Single-Cell Data Using Data Diffusion. Cell, 174(3), 716–729.e27. https://doi.org/10.1...
StarcoderdataPython
62412
<filename>code/model_comparison.py import numpy as np import pandas as pd import matplotlib.pyplot as plt import bambi as bmb import arviz as az from bambi import Prior from scipy.stats import halfnorm from scipy.stats.kde import gaussian_kde from pathlib import Path folder = Path('E:/ALBERTO/expe20-21/repetition_de...
StarcoderdataPython
3282485
<filename>code2vec.py<gh_stars>10-100 from vocabularies import VocabType from config import Config from interactive_predict import InteractivePredictor from model_base import Code2VecModelBase def load_model_dynamically(config: Config) -> Code2VecModelBase: assert config.DL_FRAMEWORK in {'tensorflow', 'keras'} ...
StarcoderdataPython
3214695
<reponame>Wastecoinng/mvp_beta<gh_stars>0 from django.urls import path from django.conf.urls import url from . import views urlpatterns = [ # ONBOARDING path('', views.splash, name='splash'), # location bot path('location_bot', views.location_bot, name='location_bot'), path('bot_api', views.bot_ap...
StarcoderdataPython
1601303
import os import os.path ############################################################################### def if_exist_rm (fname): if os.path.exists(fname): os.remove(fname) ############################################################################### def if_exist (fname): while (not os.path.exist...
StarcoderdataPython
1765023
<gh_stars>1-10 from DataSyncerUtils import replace_directory, get_latest_ios_documents, MACOS_DATA_DOCUMENTS_PATH # Replaces the iOS build's Documents directory with the latest macOS container's Documents directory. # 1. Download the iOS build's container. # 2. Change IOS_DATA_CONTAINER_PATH and MACOS_DATA_DATA_PATH ...
StarcoderdataPython
1657482
<gh_stars>0 from django.apps import AppConfig class ProjectConfig(AppConfig): """Config of the root Django application.""" name = "django_project"
StarcoderdataPython
26564
from flask import Blueprint api = Blueprint('api', __name__) from . import authentication, videos, shows, users, comments, errors
StarcoderdataPython
1605956
<gh_stars>0 # coding:utf-8 # %% # 使うモジュールの指定 # turtleというモジュールを使う import turtle # %% SHAPE = 'turtle' COLOR = 'blue' # %% kame = turtle.Turtle() # %% SHAPE = 'kame' #'turtle'なら問題ない # %% try: kame.shape(SHAPE) except turtle.TurtleGraphicsError as e: # 変数`e`にはエラーの説明文が代入される. print(f'例外処理:{e}, turtleに変えます') # `...
StarcoderdataPython
1707400
"""IIIF Presentation API implementation.""" from ._version import __version__
StarcoderdataPython
198816
<gh_stars>0 from django.db import connection from django.contrib import admin from .models import Platform @admin.register(Platform) class TenantAdmin(admin.ModelAdmin): list_display = ('name', 'schema_name', 'domain_url') def get_queryset(self, request): schema_name = connection.schema_name ...
StarcoderdataPython
196714
<reponame>h4ck3rm1k3/NLP-project # -*- coding: utf-8 -*- # Copyright © 2007-2008 Stockholm TreeAligner Project # Author: <NAME> <<EMAIL>> # Licensed under the GNU GPLv2 """This module contains classes for building result sets for TIGERSearch queries . The result builder classes evaluate a TigerSearch query based on th...
StarcoderdataPython
1634572
<gh_stars>10-100 import torch def compute_align_loss(model, desc_enc, example): '''model: a nl2code decoder''' # find relevant columns root_node = example.tree rel_cols = list(reversed([val for val in model.ast_wrapper.find_all_descendants_of_type(root_node, "column")])) rel_tabs = list(reversed([v...
StarcoderdataPython
116264
<filename>payment/filter.py from django_filters import FilterSet from .models import TransportationFeeListModel class TransportationFeeListFilter(FilterSet): class Meta: model = TransportationFeeListModel fields = { "id": ['exact', 'iexact', 'gt', 'gte', 'lt', 'lte', 'isnull', 'in', 'ra...
StarcoderdataPython
1718193
<gh_stars>0 from app import app, db from flask import flash, redirect, url_for, request, session from app.forms import editItemForm from app.models.item import Item from app.models.user import User @app.route('/edititem/', methods=['POST']) def editItem(): """Handles Edit Item form submissions and updates the ite...
StarcoderdataPython
4809500
<filename>python_programs/kheapsort_test.py from .kheapsort import kheapsort def test_main(): assert list(kheapsort([3, 2, 1, 5, 4], 2)) == [1, 2, 3, 4, 5] assert list(kheapsort([5, 4, 3, 2, 1], 4)) == [1, 2, 3, 4, 5] assert list(kheapsort([1, 2, 3, 4, 5], 0)) == [1, 2, 3, 4, 5] if __name__ == "__main__...
StarcoderdataPython
1643467
<gh_stars>1-10 from django.conf.urls import url from .views.contact_venture_settings import AjaxContactVentureFormView from .views.contact_venture_settings import AjaxLocationVentureFormView from .views.contact_venture_settings import AjaxMediaVentureFormView from .views.contact_venture_settings import ContactCompanyF...
StarcoderdataPython
51398
<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Sun Feb 05 20:42:19 2017 @author: david """ import audio_features0 import string import json import time #Enter Artist Track and confirm lyrics and analysis a = raw_input('Artist: ') ; b = raw_input('Track: ') # a = 'london grammar'; b = 'oh woman' if...
StarcoderdataPython
3292038
<reponame>sorasful/minos-python from __future__ import ( annotations, ) from enum import ( Enum, ) from typing import ( Union, ) class SagaStatus(Enum): """Saga Status class.""" Created = "created" Running = "running" Paused = "paused" Finished = "finished" Errored = "errored" ...
StarcoderdataPython
29172
<filename>tests/common/scripts/cleaning/test_strip.py<gh_stars>10-100 from common.scripts.cleaning import strip def test_clean_identity(): assert strip(None) == "" assert strip("NaN") == "" row_input = "Holà chicanos" assert strip(row_input) == row_input
StarcoderdataPython
146698
<gh_stars>10-100 # Autogenerated from KST: please remove this line if doing any edits by hand! import unittest from enum_to_i_class_border_1 import EnumToIClassBorder1 class TestEnumToIClassBorder1(unittest.TestCase): def test_enum_to_i_class_border_1(self): with EnumToIClassBorder1.from_file('src/enum_0...
StarcoderdataPython
110560
# -*- encoding: utf-8 -*- # Copyright (c) 2019 Dantali0n # # 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 ...
StarcoderdataPython
108663
def calculate_line_diff(): # SAME LINE line1_start = (41.88695, -87.63248) line1_end = (41.88692, -87.63539) line2_start = (41.88695, -87.62951) line2_end = (41.88695, -87.63248) # NOT THE SAME LINE # line1_start = (41.87523, -87.64807) # line1_end = (41.8777, -87.64545) # line2_start = (41.87437, -87.642...
StarcoderdataPython
1782490
<filename>flaskr/log/log.py<gh_stars>0 import logging import time def config_log(): logging.basicConfig( filename="app_log/app.log", format='%(levelname)s:%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p') def warning_log(module, msg): logging.warning("{0}:{1}".format(module,msg)) def error_log(module...
StarcoderdataPython
3273797
import re from stellarisdashboard.parsing.errors import StellarisFileFormatError WHITESPACE = re.compile(r"[\t\n ]+") EQ_OR_BR = re.compile(r"[={}]") Q_STR = re.compile(r'"((\\")|[^"])*"') IDENTIFIER = re.compile(r"[a-zA-Z0-9_:.]+") FLOAT = re.compile(r"-?[0-9]+\.[0-9]*") INT = re.compile(r"-?[0-9]+") REG_EXES = [ ...
StarcoderdataPython
4813591
<reponame>til-unc/mhcgnomes from mhcgnomes import parse, Allele from mhcgnomes.allele_annotations import ( parse_annotations_from_allele_fields, ) from nose.tools import eq_ def test_questionable_A_01_281Q(): result = parse("A*01:281Q") eq_(result, Allele.get("HLA", "A", "01", "281", annotation="Q")) e...
StarcoderdataPython