id
stringlengths
1
8
text
stringlengths
6
1.05M
dataset_id
stringclasses
1 value
43025
<reponame>emerginganalytics/ualr-cyber-gym import base64 import onetimepass import os from flask import abort, Flask, redirect from flask_bootstrap import Bootstrap from flask_login import LoginManager, UserMixin from flask_sqlalchemy import SQLAlchemy from globals import ds_client from werkzeug.security import check_p...
StarcoderdataPython
1890191
# -*- coding: utf-8 -*- # Copyright 2016, 2017 Openworx # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). { "name": "Material/United Backend Theme", "summary": "Odoo 11.0 community backend theme", "version": "11.0.1.0.4", "category": "Themes/Backend", "website": "http://www.openw...
StarcoderdataPython
6426649
<reponame>Mr-TelegramBot/python-tdlib<filename>py_tdlib/constructors/authentication_code_type_call.py from ..factory import Type class authenticationCodeTypeCall(Type): length = None # type: "int32"
StarcoderdataPython
126700
<filename>forms/admin.py<gh_stars>0 """Form Admin""" from django.contrib import admin from .models import Form, Question admin.site.register(Form) admin.site.register(Question)
StarcoderdataPython
3281467
<filename>datahub/interaction/migrations/0071_add_large_capital_opportunity_and_update_themes.py<gh_stars>1-10 # Generated by Django 3.1.5 on 2021-02-10 11:57 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('interaction',...
StarcoderdataPython
9722323
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jul 27 15:57:09 2020 @author: AzureD package module test """ variable = "test 22" # module level variables def run(): print(f"Success! Reloaded! {variable}")
StarcoderdataPython
1699222
POKEMON_SPECIES_MEWTWO_JSON_RESPONSE = { "flavor_text_entries": [ { "flavor_text": "It was created by\na scientist after\nyears " "of horrific\fgene splicing and" "\nDNA engineering\nexperiments.", "language": { "n...
StarcoderdataPython
1690153
from urllib.request import urlopen from bs4 import BeautifulSoup import sys import datetime import pandas as pd import tabula import re from janome.tokenizer import Tokenizer import numpy as np def getLastMeetingNo(): df = pd.read_csv('data/monitoring_comments.csv') if len(df.index) > 0: return int(df....
StarcoderdataPython
11211198
"""Setup script for slim.""" from setuptools import find_packages from setuptools import setup setup( name='slim', version='0.1', include_package_data=True, packages=find_packages(), description='tf-slim', )
StarcoderdataPython
11354486
# -*- coding: utf-8 -*- def main(): from collections import deque import sys input = sys.stdin.readline h, w = map(int, input().split()) a = [list(input().rstrip()) for _ in range(h)] sy, sx = 0, 0 gy, gx = 0, 0 inf = 10 ** 18 dist = [[inf for _ in range(w)] for __ in range(h)] ...
StarcoderdataPython
237020
#!/usr/bin/env python -O """ This is the test class for testing Kaplan-Meier module algorithms and models. """ # -*- coding: utf-8 -*- # # tests.survival.TestKaplanMeier.py is part of The RTK Project # # All rights reserved. # Copyright 2007 - 2017 <NAME> andrew.rowland <AT> reliaqual <DOT> com # # Redistributio...
StarcoderdataPython
9734829
#!/usr/bin/python3 # -*- coding: utf-8 -*- import os import sys from PyQt5.QtCore import * from PyQt5.QtWidgets import * from PyQt5.QtNetwork import * from PyQt5.QtWebEngineWidgets import * from PyQt5.QtXmlPatterns import * import meshandler class XmlRestExecutor(QWidget): def __init__(self, iniFile, parent=None...
StarcoderdataPython
1697683
<reponame>jnthn/intellij-community<gh_stars>1-10 print("<selection>Hello</selection> %(name)s" % {"name": "World"})
StarcoderdataPython
11360291
<reponame>Starrah/THU-SuperMoon import torch from SuperMoon.utils.meter import CIndexMeter def test_CIndexMeter(): c_index = CIndexMeter() preds = [0.4, 0.3, 0.6] targets = [0.5, 0.2, 0.4] for pred, target in zip(preds, targets): c_index.add(torch.tensor(pred), torch.tensor(target)) asser...
StarcoderdataPython
1682003
import sqlite3 conn = sqlite3.connect('spider.sqlite') cur = conn.cursor() cur.execute('SELECT * FROM Twitter') count = 0 for row in cur : print row count = count + 1 print count, 'rows.' cur.close()
StarcoderdataPython
100866
<filename>Programming-Basics-with-Python-April-2019/06_conditional_statements_exercise/06_godzilla_vs_kong.py<gh_stars>0 budget = float(input()) statists = int(input()) one_costume_price = float(input()) decor_price = 0.1 * budget costumes_price = statists * one_costume_price if statists >= 150: costumes_price -=...
StarcoderdataPython
8152683
<reponame>y-jeong/RET-SLR<filename>src/1DNPSLR.py<gh_stars>0 # For each given array geometry, this program calculates the extinction cross section, differential scattering cross section (partially driven array), or multi donor-multi acceptor resonance energy transfer (RET) rate import numpy as np import matplotlib.pyp...
StarcoderdataPython
11359038
from funcoes import * def minimo_percurso(grafo,rota): c=0 for i in range(len(rota)): if i==len(rota)-1: break c=grafo[rota[i]][rota[i+1]]+c return c def mudar(lista,index1,index2): lista[index1],lista[index2]=lista[index2],lista[index1] return lista def sortear_n...
StarcoderdataPython
11241670
# Generated by Django 2.2.12 on 2020-06-14 02:08 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('tools', '0004_auto_20200614_0208'), migrations.swappable_dependency(settings.AUTH_...
StarcoderdataPython
1742893
#!/usr/bin/python3 import copy import time with open('21_input', 'r') as f: lines = f.readlines() lines = [l.strip() for l in lines] ingredients_list = [] allergens_list = [] for l in lines: left, right = l.split('(') ingredients = left.strip().split() allergens = [a.replace(',','') for a in right....
StarcoderdataPython
11272691
# -*- coding: utf-8 -*- import os import time import hashlib from django.conf import settings import requests dataroot = "pool/" scriptsroot = "jscharts/" phantomjs = "phantomjs/" staticjs = "d3b/static/" env = "d3b_py2/" tempdir = "tmp/" archivepath = "/var/www/html/server/pool/" def submit_job( reqf, jobname ): ...
StarcoderdataPython
5189298
<filename>magni/cs/reconstruction/sl0/_sigma_start.py """ .. Copyright (c) 2015-2017, Magni developers. All rights reserved. See LICENSE.rst for further information. Module providing functions for calculating the starting value of sigma used in the Smoothed l0 algorithms. Routine listings ----------------...
StarcoderdataPython
1869885
import os import logging from digi import mount def run(): # TBD read from the mount model # TBD dq -> mount.Mounter(os.environ["GROUP"], os.environ["VERSION"], os.environ["PLURAL"], os.environ["NAME"], os.environ.get("NAMESPACE", "de...
StarcoderdataPython
1826343
<filename>seismoTK/S_Filter.py from matplotlib.colors import Colormap from . import Polarization class S_Filter(Polarization): def S(self): #import numpy as np import matplotlib.pyplot as plt from scipy.interpolate import griddata self.SF = self.Pol.drop(columns=["LIN","BAZ"]) ...
StarcoderdataPython
3554973
""" doc """ # message module from .schemas.types import ( # type: ignore # Message MessageType, MessagePayload, # Contact ContactGender, ContactType, ContactPayload, # Friendship FriendshipType, FriendshipPayload, # Room RoomPayload, RoomMemberPayload, # U...
StarcoderdataPython
6565215
<reponame>Draculinio/CherryAS from Driver import * from Capabilities import * caps = Capabilities() caps.add_desired_capability('browserName', 'chrome') caps.add_chrome_option('binary', "C:\\Program Files (x86)\\Google Chrome\\Application\\chrome.exe") caps.add_desired_capability('platform', 'ANY') driver = Driver() ...
StarcoderdataPython
8049170
from base_analayzer import BaseAnalyzer from datas.waypoint import Waypoint import copy import utils.utility as util OFFSET = 1.05 class LaneAnalyzer(BaseAnalyzer): def exists_fields(self, measurement, vehicle): return self.influxdb_accessor.exists_field(measurement, vehicle + "_road") and \ ...
StarcoderdataPython
6530068
import sys sys.path.append("..") import numpy as np from common.util import preprocess, create_co_matrix, cos_similarity, ppmi text = "You say goodbye and I say hello." corpus, word_to_id, id_to_word = preprocess(text) vocab_size = len(word_to_id) C = create_co_matrix(corpus, vocab_size) W = ppmi(C) np.s...
StarcoderdataPython
1631606
#!/usr/bin/env python """this is a test script that prints whatever argument is passed to it from the command line""" import argparse import subprocess as sub if __name__ == "__main__": parser = argparse.ArgumentParser('test') # add the arguments needed to the parser parser.add_argument('--test', dest=...
StarcoderdataPython
247327
line = open("day10.txt", "r").readline() def day10(iterate, sequence): for i in range(iterate): concat = "" first = True second = False sameNumberCounter = 0 secondNum = 0 numCounter = 0 for num in sequence: numCounter += 1 if second ...
StarcoderdataPython
11333434
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the Dropbox sync_history database plugin.""" import unittest from plaso.lib import definitions from plaso.parsers.sqlite_plugins import dropbox from tests.parsers.sqlite_plugins import test_lib class DropboxSyncHistoryPluginTest(test_lib.SQLitePluginTestC...
StarcoderdataPython
3524185
import logging import os from queue import LifoQueue, Queue from typing import Dict, Type, cast from urllib import parse, request from bs4 import BeautifulSoup from bs4.element import Tag from tqdm import tqdm from scraper.graph.base_objects import EntityType, Url from scraper.graph.graph import Graph from scraper.gr...
StarcoderdataPython
3260550
<filename>models/gaussian_mixture.py from pathlib import Path import numpy as np import pandas as pd from sklearn import mixture from tqdm import tqdm class GaussianMixture: def __init__(self, name, k=3): self.name = name self.params_fpath = Path( f"results/gmm_age_posterior_fit_param...
StarcoderdataPython
170540
<filename>aether-kernel/aether/kernel/api/migrations/0006_auto_20180122_1346.py # Generated by Django 2.0.1 on 2018-01-22 13:46 from django.db import migrations import django.utils.timezone import model_utils.fields class Migration(migrations.Migration): dependencies = [ ('kernel', '0005_auto_20180116_1...
StarcoderdataPython
370218
""" (c) 2020 <NAME>, MIT Licence Python Landscape Classification Tool (PyLC) Reference: An evaluation of deep learning semantic segmentation for land cover classification of oblique ground-based photography, MSc. Thesis 2020. <http://hdl.handle.net/1828/12156> <NAME> <<EMAIL>>, June 2020 University of Victoria Mod...
StarcoderdataPython
357511
import pandas as pd from Package.reader import Reader from datetime import datetime, date, time from Package.facebook_sub_readers.date_transformers import main_transfo_timestamp_10 from Package.facebook_sub_readers.own_post_transformers import gen, lists_creator ALL_GENERAL = False ALL_INDEX = False class FacebookPo...
StarcoderdataPython
278233
# Copyright (c) The Diem Core Contributors # SPDX-License-Identifier: Apache-2.0 from dataclasses import replace, asdict from diem.testing.miniwallet import KycSample, Account, PaymentUri, Transaction, PaymentCommand from diem import offchain def test_match_kyc_data(): ks = KycSample.gen("foo") obj = offcha...
StarcoderdataPython
1649649
<filename>utils/logConf.py import logging format="%(asctime)s [%(filename)s:%(lineno)d] %(levelname)-8s %(message)s" logging.basicConfig(level=logging.DEBUG, format=format)
StarcoderdataPython
4966748
<gh_stars>10-100 import copytext import datetime import logging from oauth import get_document import os from peewee import IntegrityError import pytz import time import app_config from util.models import Story from scrapers.npr_api import NPRAPIScraper from scrapers.screenshot import Screenshotter logging.basicConfi...
StarcoderdataPython
1690057
<gh_stars>1-10 # Once for All: Train One Network and Specialize it for Efficient Deployment # <NAME>, <NAME>, <NAME>, <NAME>, <NAME> # International Conference on Learning Representations (ICLR), 2020. import random import numpy as np from search.rm_search.ofa.imagenet_classification.networks import ResNets __all__ ...
StarcoderdataPython
4993793
<reponame>Mifour/Algorithms def retrospectively_best_profit(array): """ given an array of recored stocks during a period, what the best profit possible on that period? O(n**2) time """ best_profit = 0 for buy_day in array: profit = max(array[buy_day:]) - buy_day best_profit = max(best_profit, profit) ret...
StarcoderdataPython
89342
# input a directory, each file is a document import os import sys from gensim import corpora, models from topic.topicio import TopicIO from preprocess.DocTokenizer import DirDocTokenizer, FileDocTokenizer from utils.WordCounter import WordCounter # # Analyze a specific LDA file and output results # Assume the exi...
StarcoderdataPython
92510
<reponame>liuxuan320/CAIL2021<filename>cg_t5_full/classfier.py import argparse import torch from torch.nn.utils.rnn import pad_sequence from module.tokenizer import T5PegasusTokenizer from module.model import MT5PForSequenceClassificationSpan def set_args(): """设置训练模型所需参数""" parser = argparse.ArgumentParser() ...
StarcoderdataPython
9703181
<filename>src/test_baracca.py import os import scipy.io import json import numpy as np import pickle import cv2 import torch import time from torch.utils.data import DataLoader # Import Datasets from src.Datasets.Baracca import Baracca # Import Model from src.models.refinement import LinearModel from src.models.refi...
StarcoderdataPython
3563957
<filename>model/framework/neural_npfp/neural_npfp/results.py import pandas as pd import numpy as np import torch from model import * import seaborn as sns from matplotlib import pyplot as plt from validation_updated import * from prettytable import PrettyTable from rdkit.Chem import AllChem, DataStructs, Draw from rdki...
StarcoderdataPython
19289
<reponame>jmollard/typhon<gh_stars>0 # -*- coding: utf-8 -*- """Functions to estimate the different sources of retrieval error. """ from typhon.oem import common __all__ = [ 'smoothing_error', 'retrieval_noise', ] def smoothing_error(x, x_a, A): """Return the smoothing error through the averaging kerne...
StarcoderdataPython
8002919
from functools import reduce from mpi4py import MPI from itertools import islice from datetime import datetime as time import logging from collections import defaultdict from decomposer import Decomposer class MapReduce(object): def __init__(self, mapper, reducer, communicator=None, subsample=1, shuffler=None, p...
StarcoderdataPython
4996319
<reponame>ZorkAxon/Perv<gh_stars>1-10 ### # Copyright (c) 2020, Zork # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright n...
StarcoderdataPython
5046411
import os.path as osp import torch import torch.nn.functional as F from torch_geometric.datasets import PPI from torch_geometric.data import DataLoader import numpy as np # from torch_geometric.nn import GATConv from nn_local import GATConvGumbel as GATConv from utils_local import StepTau, ClassBoundaryLoss from sklea...
StarcoderdataPython
3567741
# # [EXPERIMENTAL] # # Add databroker components to an mx app container # import atexit import backoff import os import logging import json from buildpack.databroker import connect, streams from buildpack.databroker.config_generator.scripts.configloader import ( configinitializer, ) from buildpack.databroker.conf...
StarcoderdataPython
1944846
# 21.05.29 조건부 표현식 score = 40 if score >= 60: print('pass') else : print('fail') print('pass') if score >= 60 else print('fail') #[조건식이 참인경우] if [조건식] else [조건식이 거짓일 경우]
StarcoderdataPython
8064509
from django.urls import path from .views import Blogview,Blogdetailsview,LandingPageView,Objective1View,Objective2View,Objective3View,Objective4View,Objective5View,Objective6View from .import views urlpatterns = [ path('', LandingPageView, name='landingpage'), path('blog/', Blogview, name='blog'), path('b...
StarcoderdataPython
139349
<reponame>park-sungmoo/odqa_baseline_code import random import unittest import wandb from transformers import set_seed, DataCollatorWithPadding from utils.tools import get_args from utils.tools import update_args, run_test from utils.trainer_qa import QuestionAnsweringTrainer from utils.prepare import prepare_dataset...
StarcoderdataPython
4964001
""" mqlalchemy.tests.__init__ ~~~~~~~~~~~~~~~~~~~~~~~~~ Tests for our new query syntax. """ # :copyright: (c) 2016-2020 by <NAME> and contributors. # See AUTHORS for more details. # :license: MIT - See LICENSE for more details. from __future__ import unicode_literals import unittest import os ...
StarcoderdataPython
6617588
<gh_stars>1-10 __version__="0.1.0.1" __usage__=""" _______ __ __ __ _ _______ __ __ ______ __ _ __ __ | || | | || | | || || | | || | | | | || |_| | | _____|| |_| || |_| ||_ _|| |_| || _ || |_| || | | |_____ | || | | | | || | |...
StarcoderdataPython
3523207
<reponame>b0k0n0n/Hasami_Shogi_Python A_CONSTANT = 97 # constant for ASCII value of 'a' NUMBER_OF_PIECES = 9 # constant for number of pieces each side has to start class HasamiShogiGame: """ Class that creates instance of playable Hasami Shogi G...
StarcoderdataPython
11395259
import minehost # Ensure that the latest are installed # pip install -U setuptools wheel # Build package # python3 setup.py sdist bdist_wheel # Upload to Test PyPi # twine upload -R testpypi dist/* # Upload to PyPi # twine upload dist/* # Install package from Test PyPi # pip install --index-url https://test.pypi.o...
StarcoderdataPython
308319
# -*- coding: utf-8 -*- """Core classes and utilities supporting Bible references. For parsing human readable references, see parse.py. >>> from biblelib.reference import core # construct a reference from individual elements >>> vref = core.Verseref(book=62, chapter=3, verse=4) Verseref('bible.62.3.4') >>> vref.user...
StarcoderdataPython
3400531
#!/bin/bash sweepParamsFile=$1 casesListFile=$2 python2 mexdex/prepinputs.py --SR_valueDelimiter " " --SR_paramsDelimiter "\n" --noParamTag --CL_paramValueDelimiter = $sweepParamsFile $casesListFile
StarcoderdataPython
8009487
<reponame>adoreblvnk/code_solutions<gh_stars>0 from typing import List from collections import defaultdict # Runtime: 101 ms, faster than 90.91% of Python3 online submissions for Group Anagrams. # Memory Usage: 18.5 MB, less than 37.03% of Python3 online submissions for Group Anagrams. # https://leetcode.com/submissio...
StarcoderdataPython
3436428
<reponame>Dreem-Organization/bender-api from __future__ import unicode_literals from django.contrib.postgres.fields import JSONField from .algo import Algo from django.db import models class Parameter(models.Model): DESCRIPTIVE = "descriptive" CATEGORICAL = "categorical" UNIFORM = "uniform" NORMAL = ...
StarcoderdataPython
1906867
<reponame>hfchong/dvc import signal import threading from dvc.logger import Logger class SignalHandler(object): def __enter__(self): if isinstance(threading.current_thread(), threading._MainThread): self.old_handler = signal.signal(signal.SIGINT, self.handler) def handler(self, sig, fram...
StarcoderdataPython
3424579
<reponame>RuijieYu/algo<filename>data/matrix.py #!/usr/bin/env -S python3 -i # pylint: disable=invalid-name import typing; import io; from .. import iters; from ..funcs import keyDispatch as kd; from ..funcs import typeDispatch as td; class Matrix: __slots__: typing.Tuple[str] = ( '_matrix', # '...
StarcoderdataPython
3445570
from bs4 import BeautifulSoup from ._helpers import text_values, lists2dict, MetaList def docket(oscn_html): soup = BeautifulSoup(oscn_html, "html.parser") docket_table = soup.find("table", "docketlist") thead = docket_table.find("thead").find_all("th") rows = docket_table.find("tbody").find_all("tr")...
StarcoderdataPython
9688795
<reponame>hhding/fio-plot<filename>fio_plot/fiolib/dataimport.py import os import sys import csv import pprint as pprint import statistics import fiolib.supporting as supporting def list_fio_log_files(directory): """Lists all .log files in a directory. Exits with an error if no files are found. """ absolu...
StarcoderdataPython
11286281
import io from PIL import Image Image.preinit() class ContentResponseMixin(object): def process_response(self, response): return response.content class JSONResponseMixin(object): def process_response(self, response): return response.json() class ImageResponseMixin(object): def proces...
StarcoderdataPython
6449976
<reponame>Willyoung2017/doc-qa from typing import List, Optional import numpy as np from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics import pairwise_distances from docqa.utils import flatten_iterable from docqa.data_processing.text_utils import NltkPlusStopWords, ParagraphWithInverse f...
StarcoderdataPython
3552547
__author__ = 'roehrig' import time_series_v0x_025deg_3hly def create_time_series_from_rasters(raster_dir, lrs, layer_fieldname, time_series_filename): time_series_v0x_025deg_3hly.create_time_series_from_rasters(raster_dir, lrs, layer_fieldname, time_series_filename)
StarcoderdataPython
6553081
#!/usr/bin/env python """ A script to build specific fasta databases """ from __future__ import print_function import argparse import re import sys class Sequence(object): def __init__(self, header, sequence_parts): self.header = header self.sequence_parts = sequence_parts self._sequence ...
StarcoderdataPython
11375706
from unittest.mock import ANY, Mock, call import pytest from rapiduino.boards.arduino import Arduino from rapiduino.components.led.dimmable_led import DimmableLED from rapiduino.globals.common import OUTPUT PIN_NUM = 1 TOKEN = ANY @pytest.fixture def arduino() -> Mock: arduino = Mock(spec=Arduino) return a...
StarcoderdataPython
9780195
<filename>Wrappers/Python/cil/optimisation/operators/ChannelwiseOperator.py # -*- coding: utf-8 -*- # This work is part of the Core Imaging Library (CIL) developed by CCPi # (Collaborative Computational Project in Tomographic Imaging), with # substantial contributions by UKRI-STFC and University of Manchester. ...
StarcoderdataPython
8048601
<gh_stars>0 # Created by <NAME> at 5:23 PM 3/11/2020 #The modules here are inspired from the paper "Learning and Querying Fast Generative Models for Reinforcement Learning" import torch.nn as nn, time, torch import numpy as np device = torch.device('cuda:1') torch.cuda.set_device(device) print("cuda device isss ", d...
StarcoderdataPython
6510403
import bpy import mathutils import random import sys import json # This enables necessary 'impulse.py' plugin import os path = os.getcwd() impulse_path = os.path.join(path, 'impulse.py') bpy.ops.wm.addon_install(filepath=impulse_path) bpy.ops.wm.addon_enable(module='impulse') bpy.ops.wm.save_userpref() print("Reading...
StarcoderdataPython
273998
<gh_stars>0 import numpy as np import pytest from eski import atoms, drivers, md class TestDriver: @pytest.mark.parametrize( "driver_type,parameters", [ (drivers.Driver, []), pytest.param( drivers.Driver, [0], marks=pytest.mark.raises(excep...
StarcoderdataPython
3335039
class PAMValidationError(Exception): """ Custom exception raised for an Activity Plan validation Error. """ pass class PAMSequenceValidationError(PAMValidationError): """ Custom exception raised for an Activity Plan sequence validation Error. """ pass class PAMTimesValidationError(...
StarcoderdataPython
8191033
## The souce code is from: https://github.com/OniroAI/MonoDepth-PyTorch from __future__ import absolute_import, division, print_function import numpy as np import torch import torch.nn as nn import torch.nn.functional as tf from .modules_camconv import CamConvModule class conv(nn.Module): def __init__(self, num_in...
StarcoderdataPython
5039711
<reponame>clcert/beacon-verifier # Real time script that verifies that the data extracted by the # beacon collector is the same public data that this host can observe, or # has a tolerable delay. import datetime import queue import time import requests import binascii import json import argparse from requests.exceptio...
StarcoderdataPython
8185809
from pathlib import Path import numpy import pytest from numpy import ndarray from bio_embeddings.embed import EmbedderInterface from bio_embeddings.embed.pipeline import embed_and_write_batched from bio_embeddings.utilities.filemanagers import FileSystemFileManager # noinspection PyProtectedMember from bio_embeddin...
StarcoderdataPython
3505142
## @defgroup Analyses-Sizing Sizing # This is the analysis that controls vehicle sizing evaluations. # @ingroup Analyses from . import Sizing
StarcoderdataPython
1910905
ROW = "R" MOUND = "M" POT = "P" TRELLIS = "T" SCATTER = "S" GROW_STYLE = [ (ROW, "in rows"), (MOUND, "in mounds"), (POT, "in pots"), (TRELLIS, "on trellises"), (SCATTER, "by scattering"), ] GROW_STYLE_FORMATTED = [ (ROW, "plant in rows"), (MOUND, "plant in mounds"), (POT, "plant in pot...
StarcoderdataPython
5046903
<filename>source/scripts/python/web/source/web.py #!/usr/bin/python3.5 from os import path from datetime import datetime def index(): basepath = path.dirname(path.abspath(__file__)) with open(path.join(basepath, 'index.html'), 'r') as f: return f.read() def time(): return datetime.now().strftime('%Y-%m-%d...
StarcoderdataPython
1796511
<gh_stars>100-1000 #! ../usr/bin/python2 # import module import subprocess,time,random,sys # colour G = "\033[32m"; O = "\033[33m"; B = "\033[34m"; R = "\033[31m"; W = "\033[0m"; # random.colour x = "\033[" color = (x+"0m",x+"31m",x+"32m",x+"34m",x+"35m",x+"36m") Z = random.choice(color) r = random.choice(color) ...
StarcoderdataPython
6521844
<reponame>NTX-McGill/NeuroTechX-McGill-2021<filename>software/speller/data_collection_platform/backend/dcp/signals/predict.py<gh_stars>1-10 from FBCCA_IT import filter_bank_cca_it import numpy as np import json from scipy.signal import filtfilt, cheby1 def predict_letter(bci_data, subject_id='S08'): prediction = ...
StarcoderdataPython
6629988
<filename>picmodels/migrations/0051_healthcareserviceexpertise.py # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('picmodels', '0050_auto_20180306_1502'), ] operations = [ m...
StarcoderdataPython
3210887
<reponame>gokul-h/rentacar<gh_stars>0 # Generated by Django 3.2.9 on 2021-11-11 08:40 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('payment', '0001_initial'), ] operations = [ migrations.AlterField( model_name='carorder', ...
StarcoderdataPython
5189078
<filename>simple_elasticsearch/tests.py<gh_stars>10-100 import copy from datadiff import tools as ddtools from django.core.paginator import Page from django.test import TestCase from elasticsearch import Elasticsearch import mock try: # `reload` is not a python3 builtin like python2 reload except NameError: ...
StarcoderdataPython
3292820
from .bootstrap import Bootstrap from .linear import LinearGaussianObservations from .base import Proposal from .linearized import Linearized from .local_linearization import LocalLinearization
StarcoderdataPython
3351975
<reponame>uri-yanover/sharik from setuptools import setup, find_packages setup( name="sharik", version="0.4.1", packages=find_packages(), description='A shar(1)-like utility with a programmatic fine-tuned API', author='<NAME>', author_email='<EMAIL>', url='https://github.com/uri-yanover/sha...
StarcoderdataPython
319682
<reponame>shaddyx/scopeton import logging from threading import RLock import typing from scopeton import compat, glob from scopeton.objects import Bean from scopeton.qualifier_tree import QualifierTree from scopeton.scopeTools import getBean_qualifier, callMethodByName, getClassTree, flatten, ScopetonException T = t...
StarcoderdataPython
4801394
__author__ = 'anderson' import sys if sys.version_info < (3, 2): from santos import * else: from santos.santos import TaskScheduling, stopjobs
StarcoderdataPython
139069
<filename>scripts/contech_wrapper++.py #!/usr/bin/env python # C++ Wrapper compiler for contech front end import contech_wrapper contech_wrapper.main(isCpp = True)
StarcoderdataPython
8069259
<gh_stars>0 # -*- coding: utf-8 -*- from flask_restful import Resource, reqparse, abort from flask import request from lista.models.usuario_model import UsuarioModel #from lista.schemas.schemas import UsuarioSchema from lista.schemas.usuario_schema import UsuarioSchema class UsuarioResource(Resource): parser = req...
StarcoderdataPython
291756
<reponame>csmatar/saleor<gh_stars>1-10 from dataclasses import asdict from smtplib import SMTPNotSupportedError from unittest.mock import MagicMock, Mock, patch import pytest from django.core.exceptions import ValidationError from django.core.mail.backends.smtp import EmailBackend from ....core.notify_events import N...
StarcoderdataPython
3451439
import sys import numpy as np from Workspace.Interface.MotionCommandInterface import MotionCommandInterface class MotionState: STATE_MOVE = 'state_move' STATE_SHOOT = 'state_shoot' STATE_STOP = 'state_stop' class MotionKey: KEY_TRANSLATION_VECTOR = 'k_trans' KEY_STATE = 'k_state' KEY_SHOOT_...
StarcoderdataPython
11354769
<filename>steadyStateProcessing.py # USAGE INSTRUCTIONS # Search document for 'Rr =' # Set Rr and data source appropriately. import uncertainties from uncertainties.umath import * from math import pi import pandas as pd import matplotlib.pyplot as plt import seaborn as sns sns.set(style="darkgrid") # Un...
StarcoderdataPython
4868940
from model import Model, gen_batches_by_keys, gen_batches_by_size from train import train_model
StarcoderdataPython
156711
import os, sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) class TestClass: def test_import(self): import superpoint def test_DeepFNet(self): from deepFEPE.models.DeepFNet import main main() def test_ErrorEstimators(self): from deepF...
StarcoderdataPython
6693692
<reponame>vincenttran-msft/azure-sdk-for-python # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Micro...
StarcoderdataPython
3330148
<reponame>Syk326/PythonTest<filename>classes-working.py #!/usr/bin/env python3 # classes.py by <NAME> [http://bw.org/] # This is an exercise file from Python 3 Essential Training on lynda.com # Copyright 2010 The BearHeart Group, LLC # super/parent class class Animal: def talk(self): print('I have something to say...
StarcoderdataPython
3215249
#!/usr/bin/env python """ This example shows hoe the GLSL program for a 2D texture can be modified to achieve all kinds of graphic effects. In this example we will demonstrate sharpening an image using unsharp masking. """ import visvis as vv import numpy as np # First define our part of the shading code # The '>>' ...
StarcoderdataPython