id
stringlengths
1
8
text
stringlengths
6
1.05M
dataset_id
stringclasses
1 value
283636
""" Find Keyword =============================================================================== Finds a string in the terms of a column of a document collection. >>> from techminer2 import * >>> directory = "/workspaces/techminer2/data/" >>> find_keyword(contains='artificial intelligence', directory=directory) artif...
StarcoderdataPython
11386403
<filename>pyNastran/converters/avl/test_avl_gui.py import os import unittest import numpy as np from cpylog import get_logger import pyNastran from pyNastran.gui.testing_methods import FakeGUIMethods from pyNastran.converters.avl.avl import read_avl from pyNastran.converters.avl.avl_io import AVL_IO PKG_PATH = pyNas...
StarcoderdataPython
35272
<gh_stars>10-100 from typing import Any, Dict, Generator, List, Optional import torch from torch import nn, optim from torch.utils.data import DataLoader from tensorboardX import SummaryWriter from probnmn.config import Config from probnmn.utils.checkpointing import CheckpointManager class _Trainer(object): r""...
StarcoderdataPython
8063262
<gh_stars>0 from engagevoice.sdk_wrapper import * RC_CLIENT_ID="" RC_CLIENT_SECRET="" RC_USERNAME="" RC_PASSWORD="" RC_EXTENSION="" LEGACY_USERNAME= "" LEGACY_PASSWORD= "" MODE = "ENGAGE" def get_account_dial_groups(): print ("get_account_dial_groups()") try: endpoint = "admin/accounts/~/dialGroups...
StarcoderdataPython
3476408
import re from cast.Lexer import Lexer, PatternMatchingLexer from cast.Token import ppToken from cast.pp_Parser import pp_Parser from cast.SourceCode import SourceCodeString from cast.Logger import Factory as LoggerFactory moduleLogger = LoggerFactory().getModuleLogger(__name__) def parseDefine( match, lineno, colno,...
StarcoderdataPython
8149929
""" base class for pvoutput """ from datetime import datetime, time from math import floor import re from typing import Any, AnyStr from .exceptions import InvalidRegexpError, DonationRequired def round_to_base(number, base): """rounds down to a specific base number based on answer in https://stackoverflow....
StarcoderdataPython
5076444
<reponame>B-Trindade/Distributed-Chat from dataclasses import dataclass import datetime @dataclass class Message: sender: str receiver: str content: object timestamp: datetime
StarcoderdataPython
1779959
from dbnd import task def f1(): pass def f2(): pass def f3(): pass def f4(): pass def f5(): pass @task def f6(): pass
StarcoderdataPython
97114
<reponame>anxodio/aoc2021 from pathlib import Path from typing import List import itertools def measurement_increases_counter(measurements: List[int]) -> int: return sum( measurement2 > measurement1 for measurement1, measurement2 in itertools.pairwise(measurements) ) def test_measurement_inc...
StarcoderdataPython
1673743
from pathlib import Path import pytest from pytest import approx import themisasi as ta from datetime import datetime, timedelta, date # R = Path(__file__).parent datfn = R / "thg_l1_asf_gako_2011010617_v01.cdf" cal1fn = R / "themis_skymap_gako_20110305-+_vXX.sav" cal2fn = R / "thg_l2_asc_gako_19700101_v01.cdf" asse...
StarcoderdataPython
355780
<filename>src/genie/libs/parser/iosxe/tests/ShowIpNatStatistics/cli/equal/golden_output_1_expected.py<gh_stars>100-1000 expected_output = { "active_translations": {"dynamic": 0, "extended": 0, "static": 0, "total": 0}, "cef_punted_pkts": 0, "cef_translated_pkts": 0, "dynamic_mappings": { "inside...
StarcoderdataPython
5029388
<filename>convert_gt.py from math import ceil import os from tqdm import tqdm from dict2xml import dict2xml import shutil if __name__=='__main__': data_root = os.path.join(os.getcwd(), '..', 'CCTSDB') anno_ori_file = os.path.join(data_root, 'GroundTruth', 'groundtruth0000-9999.txt') anno_convert_folder = o...
StarcoderdataPython
3345618
<reponame>larribas/dagger-contrib<gh_stars>1-10 """Collection of serializers for Pandas DataFrames (https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html).""" from dagger_contrib.serializer.pandas.dataframe.as_csv import AsCSV # noqa from dagger_contrib.serializer.pandas.dataframe.as_parquet import AsPar...
StarcoderdataPython
1859231
""" This script evaluates the likelihood for a range of values timing it in the process to investigate the time complexity. $ source venv/bin/activate $ python timing.py demo-data.json demo-output.json demo-config.jso """ import algo1 # algo1 is the required algorithm we need from the popsize-distribution # reposit...
StarcoderdataPython
5109340
<filename>spyrk/__init__.py # This file is part of Spyrk. # # Spyrk is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Spyrk is...
StarcoderdataPython
1602742
from matrix import * def split(t): """ Split a matrix into 4 squares """ midRow = int(t.rows/2) midCol = int(t.cols/2) topLeft = t.subMatrix(0, 0, midRow - 1, midCol - 1) topRight = t.subMatrix(0, midCol, midRow - 1, t.cols - 1) bottomLeft = t.subMatrix(midRow, 0, t.rows - 1, midCol - 1...
StarcoderdataPython
28921
# # Copyright (C) 2018 Pico Technology Ltd. See LICENSE file for terms. #
StarcoderdataPython
11282131
<reponame>earth2marsh/python-oauth<filename>setup.py #!/usr/bin/env python #from distutils.core import setup from setuptools import setup, find_packages setup(name="oauth2", version="1.2.1", description="Library for OAuth version 1.0a.", author="<NAME>", author_email="<EMAIL>", url="http:...
StarcoderdataPython
1755884
import logging from pyzeebe import Job logger = logging.getLogger(__name__) class TaskState: def __init__(self): self._active_jobs = list() def remove(self, job: Job) -> None: try: self._active_jobs.remove(job.key) except ValueError: logger.warning("Could not...
StarcoderdataPython
1935170
<gh_stars>0 from pathlib import Path import pytest from ixmp import TimeSeries from ixmp.backend import ItemType from ixmp.backend.base import Backend, CachingBackend from ixmp.testing import make_dantzig class BE1(Backend): """Incomplete subclass.""" def noop(self, *args, **kwargs): pass class BE2(Back...
StarcoderdataPython
3510017
<gh_stars>0 #!/usr/bin/env python import os import sys import argparse import math from EMAN2 import * def main(): progname = os.path.basename(sys.argv[0]) usage = progname + """ [options] <input> Process input. """ args_def = {'apix':1.25, 'num':3} parser = argparse.ArgumentParser() parser.add_argument("in...
StarcoderdataPython
6440144
from sqlalchemy.testing import eq_, assert_raises_message, assert_raises, is_ from sqlalchemy import testing from sqlalchemy.testing import fixtures, engines from sqlalchemy import util from sqlalchemy import ( exc, sql, func, select, String, Integer, MetaData, and_, ForeignKey, union, intersect, except_, union...
StarcoderdataPython
4981099
import pandas as pd import numpy as np import time import seaborn as sb import requests import matplotlib.pyplot as plt from pandas_datareader import data as web from sklearn.linear_model import Lasso from sklearn.preprocessing import StandardScaler from sklearn.model_selection import RandomizedSearchCV as rcv from skl...
StarcoderdataPython
1965299
import tensorflow as tf def close_crop(image, patch_size): image.set_shape([None, None, 3]) width = 178 height = 218 new_width = 140 new_height = 140 left = (width - new_width) // 2 top = (height - new_height) // 2 right = (width + new_width) // 2 bottom = (height + new_height) /...
StarcoderdataPython
1912759
<reponame>nvllsvm/file_to_bitmap import setuptools setuptools.setup( name='bmp-transcode', version='0.3.0', description='Transcode ordinary files to and from bitmap images.', long_description=open('README.rst').read(), author='<NAME>', author_email='<EMAIL>', url='https://github.com/nvllsv...
StarcoderdataPython
11391330
<gh_stars>0 ## @package onnx # Module caffe2.python.onnx.backend """Backend for running ONNX on Caffe2 To run this, you will need to have Caffe2 installed as well. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals ...
StarcoderdataPython
1811042
''' Implementation of the HTCPCP protocol for raspberry pi ''' __version__ = '1.0.0'
StarcoderdataPython
12852843
#!/usr/bin/python # Copyright (c) 2015-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 require...
StarcoderdataPython
3370142
<gh_stars>0 from django.contrib import admin # Register your models here. from .models import ScoreData admin.site.register(ScoreData)
StarcoderdataPython
9799479
def Main(a: int, b: int) -> int: """ :param a: :param b: :return: """ j = 0 return b
StarcoderdataPython
1995292
<filename>manila/share/drivers/netapp/dataontap/cluster_mode/lib_multi_svm.py # Copyright (c) 2015 <NAME>. 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 # # ...
StarcoderdataPython
1691276
from tsp.TSPGame import TSPGame as Game from tsp.NNetShell import NNetShell from TSPMCTS import TSPMCTS import numpy as np from utils import * args = dotdict({ 'numEps': 5, # Number of complete self-play games to simulate during a new iteration. 'numMCTSSims': 20, # Number of games moves ...
StarcoderdataPython
6541668
<reponame>Accenture/Docknet import json import math import os import pickle import sys from typing import List, Optional, Union, TextIO, BinaryIO import numpy as np from docknet.initializer.abstract_initializer import AbstractInitializer from docknet.layer.abstract_layer import AbstractLayer from docknet.function.cos...
StarcoderdataPython
3372371
#In this script I will try to assess any possible difference #in treatment outcome across patients of different groups #(isolated with hierarchical clustering on snps genotypes) import pandas as pd from scipy import stats #importing table with treatment infos df_rr = pd.read_csv('./checks/delta_pl_ther.tsv', sep = '...
StarcoderdataPython
4812580
<gh_stars>1-10 import os import hydra import jax import jax.numpy as jnp from flax.serialization import to_state_dict from omegaconf import DictConfig, OmegaConf from models.jax import get_model from neural_kernels.nads import mixed_derivative_nad_decomposition from utils.misc import get_apply_fn @hydra.main(config...
StarcoderdataPython
8199332
<filename>website/dbCache.py from website import session needToRecompute = True def recompute(): global cachedDBData, nextUserId, needToRecompute cachedDBData = [ row for row in session.execute( "SELECT id, username, password, misc FROM keyspace1.data;" ) ] for row...
StarcoderdataPython
8017995
import py from pypy import conftest from pypy.translator.translator import TranslationContext from pypy.translator.llsupport.wrapper import new_wrapper from pypy.rpython.rmodel import PyObjPtr from pypy.rpython.llinterp import LLInterpreter from pypy.rpython.lltypesystem import lltype class TestMakeWrapper: def ...
StarcoderdataPython
12862220
<filename>dmm/dmm_data/__init__.py all=['load']
StarcoderdataPython
3252975
<reponame>guaix-ucm/azotea # -*- coding: utf-8 -*- # ---------------------------------------------------------------------- # Copyright (c) 2020 # # See the LICENSE file for details # see the AUTHORS file for authors # ---------------------------------------------------------------------- #-------------------- # Syste...
StarcoderdataPython
3330308
<gh_stars>0 """Combined single command for bundling and deploying the selected targets.""" import argparse import typing from reviser import interactivity from ..commands import bundler from ..commands import deployer def get_completions( completer: "interactivity.ShellCompleter", ) -> typing.List[str]: """S...
StarcoderdataPython
11321232
<reponame>Tawkat/Autonomous-Code-Review-Usefulness-Measurement class QuestionMark: def __init__(self,review): self.review=review self.count=0 def getQuestionMark(self): file=self.review str=file.lower() count=str.count('?') #print("Total QuestionMark: %s" % co...
StarcoderdataPython
11253066
<gh_stars>0 # vim: sw=4:ts=4:et import datetime import json import logging import os.path import shutil import uuid import requests # the expected format of the event_time of an alert event_time_format = '%Y-%m-%d %H:%M:%S' # current protocol version # update this protocol number when you update the protocol # this...
StarcoderdataPython
3352703
from aiogoogle import Aiogoogle from aiogoogle.auth.creds import ServiceAccountCreds from django.conf import settings scopes = [ 'https://www.googleapis.com/auth/drive', ] class GoogleManager: __instance = None @classmethod def instance(cls): ''' Get a single instance per process. ...
StarcoderdataPython
5184526
def test_read(client, seeder, utils): _, admin_unit_id = seeder.setup_base() custom_widget_id = seeder.insert_event_custom_widget(admin_unit_id) url = utils.get_url("api_v1_custom_widget", id=custom_widget_id) response = utils.get_json(url) utils.assert_response_ok(response) assert response.jso...
StarcoderdataPython
11253868
<gh_stars>1-10 # Generated by Django 3.0.6 on 2020-05-27 18:52 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Company', f...
StarcoderdataPython
6450132
import json import pytest from datetime import datetime from django.db import connection from model_mommy import mommy from rest_framework import status from usaspending_api.search.tests.test_mock_data_search import non_legacy_filters, legacy_filters from usaspending_api.awards.v2.lookups.lookups import all_award_typ...
StarcoderdataPython
12824987
import json import os import re import shutil import sys import time winrm = True ssh = False keep_input_artifact = True vmx_data_post = False compression_level = 0 chocolatey = False add_debugging = True set_packer_debug = False add_debug_log = True add_unzip_vbs = False add_shell_command = False add_ssh_uninstaller ...
StarcoderdataPython
11381037
"""Tests for fooof.core.strings.""" from fooof.core.strings import * from fooof.core.strings import _format, _no_model_str ################################################################################################### ###############################################################################################...
StarcoderdataPython
3367913
<filename>donation/migrations/0003_auto_20161021_0002.py<gh_stars>1-10 # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('donation', '0002_transitionaldonationsfilefromdrupal'), ] ope...
StarcoderdataPython
4908573
# coding:utf-8 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"...
StarcoderdataPython
11226647
# -*- coding: utf-8 -*- """ randomforest_classifier.py: implements the random forest classifier, it's fitting and prediction @author: <NAME> """ # IMPORTS from sklearn import ensemble as ensemble # FUNCTIONS def RandomForestClassifier(max_depth, random_state, n_estimators): """ Returns the Random Forest Cl...
StarcoderdataPython
4900088
# -*- coding: utf-8 -*- from torch import nn from torchvision import models class CNNNet(nn.Module): def __init__(self, out_dim, **kwargs): super(CNNNet, self).__init__() self.model = models.resnet18(pretrained=False) self.model.fc = nn.Sequential( # nn.Linear(2048, 2048), ...
StarcoderdataPython
41011
<filename>tests/test_nafigator.py<gh_stars>1-10 #!/usr/bin/env python """Tests for `nafigator` package.""" import unittest unittest.TestLoader.sortTestMethodsUsing = None from deepdiff import DeepDiff from click.testing import CliRunner from nafigator import NafDocument, parse2naf from os.path import join class ...
StarcoderdataPython
361674
import cv2 import numpy as np vc = cv2.VideoCapture('./oriImgs/test.avi') # 创建混合高斯模型用于背景建模 fgbg = cv2.createBackgroundSubtractorMOG2() kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (3, 3)) while True: ret, frame = vc.read() if frame is None: break fgmask = fgbg.apply(frame) # 形态学开运...
StarcoderdataPython
5144312
<reponame>RaulRPrado/tev-binaries-model<filename>applications/process_raw_data.py #!/usr/bin/python3 import matplotlib.pyplot as plt import numpy as np import math import logging import astropy.units as u from astropy.io import ascii logging.getLogger().setLevel(logging.DEBUG) if __name__ == '__main__': ''' ...
StarcoderdataPython
11201314
import os import numpy as np from typing import List, Optional, Callable from .. import backend as F from ..convert import heterograph as dgl_heterograph from ..base import dgl_warning, DGLError import ast import pydantic as dt import pandas as pd import yaml class MetaNode(dt.BaseModel): """ Class of node_data i...
StarcoderdataPython
4892573
<filename>engine/keyandstate.py<gh_stars>0 # ibus-byrninpikak - byrninpikak IME # # Copyright (c) 2022 Harsiharsi # # 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.or...
StarcoderdataPython
11266886
from opfu.stock import Stock if __name__ == '__main__': stock_1 = Stock(10, 3, is_short=True) print(stock_1.payoff(20)) stock_1.graph_payoff() print(stock_1.find_break_even())
StarcoderdataPython
3266544
<reponame>jmossberg/ParseBankStatement # coding=utf-8 # see: https://www.python.org/dev/peps/pep-0263/ import argparse import re import time import os.path class ErrorInputLineEndsWithCsv(Exception): def __init__(self, message): self.message = message class ErrorOutputFileAlreadyExists(Exception): ...
StarcoderdataPython
4852773
<reponame>Daniela-Sanchez/ClienteServidor<filename>cssenv/Scripts/csaplication/Administrador/serializers.py # ----------------------------- Librerias ----------------------------- from rest_framework import routers, serializers, viewsets # ----------------------------- Modelos ----------------------------- from Admini...
StarcoderdataPython
6540199
<filename>tests/flattened_schema.py FLATTENED_SCHEMA = { ("definitions", "location"): { "type": "object", "properties": { "country": {"type": "string"}, "stateNumber": {"type": "integer"}, }, }, ("properties", "coordinate", "items"): { "type": "object"...
StarcoderdataPython
3513400
<reponame>kev0960/HwaTu import unittest from game import HwaTu, Player, Card class HwaTuTest(unittest.TestCase): def setUp(self): self.game = HwaTu() def test_play_card_simple(self): # Case 1 self.game.cards_on_pile = [Card(5)] self.game.opened_cards = [Card(1), Card(2)] earned_card = self.ga...
StarcoderdataPython
5107822
#!/usr/bin/env python3 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test sync # from test_framework import BitcoinTestFramework from authproxy import AuthServiceProxy, JSONR...
StarcoderdataPython
109189
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Contribution', fields=[ ('id', models.AutoField...
StarcoderdataPython
3500478
""" """ from typing import List, Callable, NamedTuple import argparse import json import logging import os from string import Template import sys import hashlib import torch from flask import Flask, request, Response, jsonify, render_template, send_from_directory from flask_cors import CORS from gevent.pywsgi import ...
StarcoderdataPython
4984195
# -*- coding: utf-8 -*- """ imapy.structures ~~~~~~~~~~~~~~~~ This module contains data structures used by Imapy :copyright: (c) 2015 by <NAME>. :license: MIT, see LICENSE for more details. """ class CaseInsensitiveDict(dict): """Case-insensitive dictionary object""" def __init__(self, ...
StarcoderdataPython
5074867
<filename>avionics/bootloader/bootloader_client_test.py # Copyright 2020 Makani Technologies LLC # # 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/LICENS...
StarcoderdataPython
1865533
# -*- coding: utf-8 -*- # flake8: noqa """Remo dataset module. This module contains functions to work with REMO datasets. """ # flake8: noqa from . import cal, codes from .cal import parse_dates def preprocess(ds, use_cftime=False): """preprocessing for opening with xr.open_mfdataset This function can be ...
StarcoderdataPython
12849959
<reponame>agnisain123/CodeChef-1<filename>Beginner/Easy Math/easy_math.py t=int(input()) for _ in range(t): n=int(input()) a=list(map(int, input().split())) max_sum=0 for j in range(n): for k in range(j+1, n): num=a[j]*a[k] add=0 while(num!=0): ...
StarcoderdataPython
5170153
<gh_stars>0 """ 用户你好! lightmysql是一个可以简单地使用Python操作MySQL数据库的扩展。 我们的主要功能是根据Python传入的列表和字典生成MySQL语言,并通过pymysql提交。 由于以轻量为目标,我们暂时保留了INSERT SELECT UPDATE DELETE四条语句,创建库、表等操作没有写入。 针对未适配的操作,你可以通过run_code()函数手动编写SQL语句、MySQL客户端或使用图形化软件操作。 下面将介绍各个函数的详细功能和传参方式。 我们假设我们的MySQL中存在一个名为yxzl的数据库,其中有一个名为users的数据表, 表中有两个字段:name(TEXT) 和 ag...
StarcoderdataPython
5065929
#PDF imports from pdf2image import convert_from_path import IPython from IPython.display import Image from IPython.display import display import cv2 import numpy as np # HTML imports from IPython.core.display import HTML import re def loadpdf(pdfname, dpi=1000): images = convert_from_path(pdfname, dpi=dpi) re...
StarcoderdataPython
145905
import numpy as np from VariableUnittest import VariableUnitTest from gwlfe.Output.Loading import StreamBankNSum class TestStreamBankNSum(VariableUnitTest): def test_StreamBankNSum(self): z = self.z np.testing.assert_array_almost_equal( StreamBankNSum.StreamBankNSum_f(z.NYrs, z.DaysM...
StarcoderdataPython
9783027
<gh_stars>0 from django.db import models from django.contrib.auth.models import User # Create your models here. class TrackerFilter(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE, primary_key=True) chart_type = models.IntegerField(default=1) number_of_data = models.IntegerField(d...
StarcoderdataPython
8145429
<filename>geo/geophys/gpr/metadata.py<gh_stars>0 from os.path import isfile, join from collections import OrderedDict import pandas as pd class MetaData: """A base class to create a csv for metadata logging and loading. The attributes of the metadata are defined by the child class. Attributes: ...
StarcoderdataPython
285506
<reponame>BeorEdain/BillMe class Bills: """A class that is used to build the Bills""" def __init__(self, digest): self.title = digest.get("title") self.short_title = digest.get("shortTitle") self.collection_code = digest.get("collectionCode") self.collection_name = digest.get("co...
StarcoderdataPython
1668138
from typing import List from pygls.lsp.types import Model class LanguageServerConfiguration(Model): # type: ignore enable_lint_on_save: bool enable_code_action: bool lint_targets: List[str] format_targets: List[str] @classmethod def default(cls) -> "LanguageServerConfiguration": ret...
StarcoderdataPython
366319
""" A watchdog is a little piece of software that monitors our filesystem looking for any changes (like the creation, change or deletion of a file or of a directory). When a change occurs, the watchdog report it to us raising a specific event that we can handle. For example, let’s suppose you have developed a program ...
StarcoderdataPython
6480290
#!/usr/bin/env python3 # -*- coding: utf-8 -*- def reserve(s): return s[::-1] # 引数「s」に格納されている文字列の最後から1文字ずつさかのぼって要素(文字)を取り出す orig = "good" result = reserve(orig) print(result) # 要件1:文字列を反転する関数「reverse」を書く # 出力2:doog
StarcoderdataPython
259242
import requests from bs4 import BeautifulSoup from time import sleep, strftime, gmtime from random import randint #returns the unique semester identifier def getSemester(): #start a new web scraping session s = requests.session() #download the main page of classes html = s.get("https://ntst.umd.edu/soc") #parse...
StarcoderdataPython
4862173
import tarfile from galaxy.model.unittest_utils.store_fixtures import ( deferred_hda_model_store_dict, history_model_store_dict, one_hda_model_store_dict, ) from galaxy_test.api.test_histories import ImportExportTests from galaxy_test.base.api_asserts import assert_has_keys from galaxy_test.base.populators...
StarcoderdataPython
3558820
<filename>dags/ethereum_kovan_export_dag.py from __future__ import print_function from ethereumetl_airflow.build_export_dag import build_export_dag from ethereumetl_airflow.variables import read_export_dag_vars # airflow DAG DAG = build_export_dag( dag_id='ethereum_kovan_export_dag', **read_export_dag_vars( ...
StarcoderdataPython
4800296
<filename>validation.py # validation.py # A tool to quantify the similarity between extracted pen annotated regions and manually annotated regions from WSI thumbnails. # Created by <NAME>, MSKCC # <EMAIL> # # <NAME>, Yarlagadda DVK, <NAME>, Fuchs TJ: Overcoming an Annotation Hurdle: Digitizing Pen Annotations from...
StarcoderdataPython
8060579
<reponame>aserhiychuk/pyreinforce<filename>pyreinforce/distributed/distributed.py<gh_stars>10-100 import random import logging import time from uuid import uuid4 from threading import Thread import multiprocessing as mp from multiprocessing import connection, Process, Pipe, Barrier, Value from multiprocessing.managers ...
StarcoderdataPython
6447858
<reponame>lucasaciole/projetoProntuario<gh_stars>0 from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.home, name='home'), url(r'^pacientes/$', views.paciente_index, name='paciente_index'), url(r'^paciente/(?P<id>\d+)/$', views.paciente_detalhes, name='paciente_detalhes'),...
StarcoderdataPython
11335927
<gh_stars>100-1000 def rewrite(text): print("\r" + text, end="") def next_line(text=""): print(text)
StarcoderdataPython
9724116
# coding=utf-8 # Copyright 2020 The Google Research Authors. # # 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 applicab...
StarcoderdataPython
145715
<gh_stars>1-10 # -*- coding: utf-8 -*- # Copyright 2018-2022 the orix developers # # This file is part of orix. # # orix 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 # (a...
StarcoderdataPython
3583449
import json from vaccineAvailabilityNotifier.client.actionsImpl import ActionsImpl from vaccineAvailabilityNotifier.processors.state_info_processor import StateIdProcessor def get_url(state_id): return 'https://cdn-api.co-vin.in/api/v2/admin/location/districts/' + str(state_id) class DistrictIdProcessor: _...
StarcoderdataPython
11354666
<gh_stars>0 import json from sqlalchemy import Column from sqlalchemy import JSON as SQLAlchemy_JSON from aurora.models import Data class JSON(Data): __pattern__ = '(?i).*\.json$' data = Column(SQLAlchemy_JSON) def __init__(self, file): self.file = file with open(file.fullp...
StarcoderdataPython
8037061
<filename>feincms_handlers/__init__.py """ This is for FeinCMS >= 1.5. For older versions use the legacy module. Usage Example: from feincms_handlers import handlers handler = handlers.MasterHandler([handlers.AjaxHandler, handlers.FeinCMSHandler]) urlpatterns += patterns('', url(r'^$', handlers.FeinCMSHandler.a...
StarcoderdataPython
9742948
#!~/anaconda3/bin/python3 # ****************************************************** # Author: <NAME> # Last modified: 2021-08-04 15:10 # Email: <EMAIL> # Filename: utils.py # Description: # auxillary functions # ****************************************************** import os def check_directory(directory): if ...
StarcoderdataPython
3543934
from typing import Any, Dict from django.contrib.auth import authenticate from rest_framework import permissions, serializers, status from rest_framework.response import Response from rest_framework.views import APIView from kite_runner.utils import tokens from .renderer import UserJSONRenderer class LoginSerializ...
StarcoderdataPython
9735342
from setuptools import setup import argz author = 'bnbdr' setup( name='argz', version='.'.join(map(str, argz.version)), author=author, author_email='<EMAIL>', url='https://github.com/{}/argz'.format(author), description="Argument parsing for the lazy", long_description=argz.__d...
StarcoderdataPython
11352660
import os import onnx from shutil import copyfile from hdfg import hdfgutils from hdfg import load_store from hdfg.passes.flatten import flatten_graph, is_literal import codegen as c from hdfg.hdfg_pb2 import Component, Program from hdfg.visualize import * from .serial.DataFlowGraph import * from codegen.tabla import t...
StarcoderdataPython
8022757
import tkinter as tk root = tk.Tk() # GUI logic here label1 = tk.Label(root, text="Hello tkinter") label1.pack() root.mainloop()
StarcoderdataPython
11201725
""" DFTD3 program need to be installed to test this method. """ from copy import deepcopy from typing import List import numpy as np import pytest import torch from ase import Atoms from ase.build import fcc111, molecule from torch_dftd.testing.damping import damping_method_list from torch_dftd.torch_dftd3_calculator ...
StarcoderdataPython
8117407
''' * Copyright 2018 Canaan Inc. * * 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 agreed to...
StarcoderdataPython
3519384
import os, sys, json, re import cStringIO, StringIO, io from flask import Flask, jsonify, abort, request, make_response import subprocess, requests import logging #planner path - application optic_path='/home/swarup/Documents/optic/debug/optic/optic-clp' ff_path='/home/swarup/Documents/Metric-FF-v2.0/ff' # planner p...
StarcoderdataPython
1782992
<filename>qtstyles/sheet.py<gh_stars>1-10 ''' Defines - Sheet: a class representing a style sheet object with attributes such as path and contents. get_style_sheets: a function that returns a dictionary with style sheet names as keys and sheet objects as values. ''' import os from qtstyles import errors ...
StarcoderdataPython
1708693
import cvxpy as cp import math import numpy as np from collections import OrderedDict from functools import partial from multiprocessing import Pool, cpu_count from scipy.optimize import minimize_scalar from tqdm.auto import tqdm def p_num_samples(epsilon, delta, n_x=3, const=None): """Compute the number of samp...
StarcoderdataPython