id
stringlengths
1
8
text
stringlengths
6
1.05M
dataset_id
stringclasses
1 value
4997753
<filename>analysis/computeLengthDistribution.py #!/usr/bin/env python # FILE: getSeqLengthDistribution.py # AUTHOR: <NAME> # CREATE DATE: 07 June 2020 import os import sys, argparse from Bio import SeqIO import matplotlib.pyplot as plt plt.rc('font',size=6) import numpy as np parser=argparse.ArgumentParser(prog='getSe...
StarcoderdataPython
11231252
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- """ @Time : 2020/11/29 10:56 PM @Author : Caroline @File : #TODO @Description : #TODO """ # %config ZMQInteractiveShell.ast_node_interactivity='all' import os import sys from offline import SparkSessionBase from preprocessing import segmentatio...
StarcoderdataPython
1857068
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jun 19 17:41:23 2019 @author: lg """ #!/usr/bin/python #这是一个很经典的cnn 入门教程了 #################### import tensorflow as tf import sys from tensorflow.examples.tutorials.mnist import input_data from tensorflow.python.framework import graph_util mnist = ...
StarcoderdataPython
8057177
<reponame>kjagiello/django-enumfield<gh_stars>1-10 import django from django.core.management import call_command from django.test.client import RequestFactory from django.db import IntegrityError from django.forms import ModelForm, TypedChoiceField from django.test import TestCase from django.utils import six from dja...
StarcoderdataPython
1905145
<reponame>checkbox451/checkbox451_bot<filename>checkbox451_bot/goods.py from logging import getLogger from checkbox451_bot import checkbox_api log = getLogger(__name__) items = {} def init(): items.update( { f"{good['name'].strip()} {good['price']/100:.2f} грн": { "code": go...
StarcoderdataPython
5112607
import sys sys.path.append(sys.path[0] + "/..") #because python relative imports are weird... from lib.utils import read_input, begin_terminal_block, end_terminal_block, neighbors4 from itertools import cycle from collections import defaultdict from operator import xor from functools import reduce DAY = 14 begin_term...
StarcoderdataPython
11305675
<filename>ride/utils/discriminative_lr.py # Modified from https://github.com/vdouet/Discriminative-learning-rates-PyTorch import functools from typing import Union import numpy as np import torch.nn as nn from ride.utils.logging import getLogger logger = getLogger(__name__) """ Developped by the Fastai team for the...
StarcoderdataPython
1653928
<reponame>spacemanidol/LING573SP20<filename>src/data_input.py<gh_stars>0 #!/usr/bin/python3 # -*- coding: utf-8 -*- import os import gzip import re from datetime import datetime from time import time import pickle import xml.etree.ElementTree as ET """Where data is inputted""" __author__ = '<NAME>, <NAME>, <NAME>, <...
StarcoderdataPython
6513937
<filename>Python3/0288-Unique-Word-Abbreviation/soln.py class ValidWordAbbr: def __init__(self, dictionary): """ :type dictionary: List[str] """ self.abbs = collections.defaultdict(set) for word in dictionary: self.abbs[self._abbreviation(word)].add(word) ...
StarcoderdataPython
8175080
<filename>apps/base/__init__.py """Application base, containing global templates."""
StarcoderdataPython
5024031
import logging from SDM.nodes.BWMiddleWare import BWMiddleWare from SDM.rules.IPSrcPushingRule import IPSrcPushingRule class SrcBWMiddleWare(BWMiddleWare): def __init__(self, ovs_switch, controller_ip="127.0.0.1", switch_ip=None, controller_port=6633, switch_port=None, protocols=None): s...
StarcoderdataPython
170725
#!/usr/bin/python3 '''Routines useful in generation and processing of synthetic data These are very useful in analyzing the behavior or cameras and lenses. All functions are exported into the mrcal module. So you can call these via mrcal.synthetic_data.fff() or mrcal.fff(). The latter is preferred. ''' import nump...
StarcoderdataPython
4944701
"""Function to record challenge information """ ########## # Imports ########## import logging from constants import (CHALL_TBL_COLNAMES, CHALLENGE_INFO_CSV_HEADERS, COL_NB_VIEWER, FULLSCREEN_URL, NB_VIEWER_SOL_TEXT, NB_VIEWER_URL) ########## # Check 1+ challenges solve...
StarcoderdataPython
1961956
"""AdaBound for Tensorflow.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf import re class AdaBoundOptimizer(tf.train.Optimizer): """Optimizer that implements the AdaBound algorithm. See [Luo et al., 2019](https://openr...
StarcoderdataPython
8113704
<filename>saleor/dashboard/blog/views.py from django.conf import settings from django.contrib import messages from django.contrib.auth.decorators import permission_required from django.http import JsonResponse from django.shortcuts import get_object_or_404, redirect from django.template.response import TemplateResponse...
StarcoderdataPython
3497012
import numpy as np import os import tensorflow as tf work_dir = '' image_height, image_width = 150, 150 train_dir = os.path.join(work_dir, 'train') test_dir = os.path.join(work_dir, 'test') no_classes = 2 no_validation = 800 epochs = 50 batch_size = 32 no_train = 2000 no_test = 800 input_shape = (image_height, image_...
StarcoderdataPython
3368368
<gh_stars>10-100 class Restaurant(): def __init__(self, name, cuisine_type): self.name = name.title() self.cuisine_type = cuisine_type def describe_restaurant(self): msg = self.name + " Es el onmbre del restaurante," + self.cuisine_type + " Es el tipo de comida." print("\n" ...
StarcoderdataPython
3294006
<gh_stars>10-100 import json import requests import pywikibot import tqdm site = pywikibot.Site("nl", "wikipedia") repo = site.data_repository() def main(): filename = 'data/composition/52.json' with open(filename, 'r') as fp: members = json.load(fp) for member in tqdm.tqdm(members): if 'ph...
StarcoderdataPython
3592376
## should use mars environment import torch import os, sys, time import numpy as np import pandas as pd import scanpy.api as sc from anndata import AnnData import anndata from matplotlib import pyplot as plt import matplotlib as mpl sys.path.append("../") sys.path.append('/homelocal/wma36/celltyping_refConstruct/tes...
StarcoderdataPython
5109574
<gh_stars>1-10 #!/usr/bin/env python3 """multiprocessing demo.""" import os from multiprocessing import Process, current_process def square(number: int): """ Square number. :return: number² """ result = number * number process = current_process() print(f'{number}² = {result} ' ...
StarcoderdataPython
1739299
# -*- coding: utf-8 -*- """Top-level package for Soroush Python SDK.""" __author__ = """<NAME>""" __email__ = '<EMAIL>' __version__ = '0.2.4' from .soroush_python_sdk import Client
StarcoderdataPython
3465679
<gh_stars>0 # This webscraper will show # item_name # item_price # item_link import requests from bs4 import BeautifulSoup as soup import updater def main(): debug = False # search any item from your browser in amazon.in and paste it url = str(input("Paste your product url here:\n")) # test URL's ...
StarcoderdataPython
8192352
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import unittest from botocore.exceptions import ClientError from fbpcp.error.mapper.aws import map_aws_error from fb...
StarcoderdataPython
5177678
from django.db import models from django.core.exceptions import ValidationError
StarcoderdataPython
8190820
<filename>objectifiedetree/__init__.py __author__ = '<NAME>' __email__ = '<EMAIL>' from os.path import join, dirname __version__ = open(join(dirname(__file__), 'VERSION')).read().strip() __all__ = ['ET', 'ElementTree', 'Element'] from .etree import ElementTree as ET def __getattr__(self, key): return self.find(...
StarcoderdataPython
2075
<gh_stars>1-10 # encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Source' db.create_table('places_source', ( ('id', self.gf('django.db.mo...
StarcoderdataPython
169532
<filename>faoGetLicensesFromFile.py def faoGetLicensesFromFile(sLicensesFilePath): try: from mFileSystemItem import cFileSystemItem; except: with open(sLicensesFilePath, "rb") as oLicensesFile: sbLicenseBlocks = oLicensesFile.read(); else: sbLicenseBlocks = cFileSystemItem(sLicensesFilePath).fs...
StarcoderdataPython
9730557
<filename>main.py import streamlit as st from PIL import Image, ImageColor import numpy as np from sklearn.cluster import KMeans def decompose_colors(image): # Decoposing image into RGB channels red = image[:, :, 0].reshape((-1, 1)) green = image[:, :, 1].reshape((-1, 1)) blue = image[:, :, 2].reshap...
StarcoderdataPython
3268657
<filename>pynode_next/node.py from pynode_next.errors import NodePositionError import uuid from .misc import Color from .core import core class Node: def __init__(self, id=None, value=None): if id is not None: self._id = id else: self._id = str(uuid.uuid4()) if va...
StarcoderdataPython
309852
<reponame>breeze-shared-inc/python_training_01<filename>answer/a10_6_dict_sosa.py my_dict = { "key":"value", "key2":"value2" } # dictに要素[key3:value3]を追加してみよう! my_dict["key3"] = "value3" print(my_dict) # 識別子key2を削除してみよう! my_dict.pop("key2") print(my_dict)
StarcoderdataPython
3519507
from visdom import Visdom import numpy as np import math from collections import defaultdict def draw(imgs, color=True, nr=None, nc=None): import matplotlib.pyplot as plt if nr is None: size = imgs.shape[0] size = int(math.ceil(np.sqrt(size))) nr = nc = size if color: ...
StarcoderdataPython
8099331
<filename>tests/test_driver.py import unittest from mock import Mock, patch, call from scrapy_rethinkdb.driver import RethinkDBDriver, RqlQuery, TableNotFound class RethinkDBDriverTest(unittest.TestCase): def setUp(self): # mocks self.stmt_mock = Mock(spec=RqlQuery) self.table_query_mock...
StarcoderdataPython
1772818
from setuptools.extension import Extension from setuptools import setup, find_packages extensions = [Extension("quicksect", ["src/quicksect.pyx"])] setup(version='0.2.2', name='quicksect', description="fast, simple interval intersection", long_description=open('README.rst').read(), author="<NAME>...
StarcoderdataPython
8133164
# 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 in writing, software # distributed under the...
StarcoderdataPython
6453998
<gh_stars>1-10 # Copyright 2022 The TensorFlow Authors. 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 requ...
StarcoderdataPython
12808297
<reponame>leakyH/PaddleDetection # Copyright (c) 2020 PaddlePaddle Authors. 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...
StarcoderdataPython
8013565
import cv2 import glob import os import argparse from tqdm import tqdm def get_args(): parser = argparse.ArgumentParser('Handrail safety monitoring.') parser.add_argument('--img-dir', type=str, help='source img dir') parser.add_argument('--output-dir', type=str, help='source') args = parser.parse_arg...
StarcoderdataPython
5102719
<reponame>robotice/robotice<filename>robotice/__init__.py __title__ = 'Robotice' __release__ = '54' __version__ = '0.2' __author__ = '<NAME> & <NAME>' __license__ = 'Apache 2.0' __copyright__ = '' ROBOTICE_BANNER=""" ______ _ _ (_____ \ | | _ (_) _____) )_...
StarcoderdataPython
1890306
import os import numpy as np from pynif3d import logger from pynif3d.common.verification import ( check_in_options, check_lengths_match, check_path_exists, check_pos_int, ) from pynif3d.datasets.base_dataset import BaseDataset from pynif3d.datasets.llff_util import ( average_poses, load_data, ...
StarcoderdataPython
1834757
from perm_LQUBO.next_perm import NextPerm import numpy as np class Select: def __init__(self, objective_function=None, response_record=None, data_dict_p=None, current_p=None): self.objective_function = objective_function self.n_q...
StarcoderdataPython
3394658
<reponame>bossm0n5t3r/BOJ import sys def sol(): # sys.stdin = open("./17069/input.txt") input = sys.stdin.readline N = int(input()) house = [list(map(int, input().split())) for _ in range(N)] dp = [] for r in range(N): tmp_row = [] for c in range(N): tmp = [0] * 3 ...
StarcoderdataPython
6601559
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. 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...
StarcoderdataPython
1619287
from random import randint class Dice: def __init__(self, sides=6): self.sides = sides def roll(self): return randint(1, self.sides)
StarcoderdataPython
6557752
""" A simple discord bot which displays the use case of sending a welcome image when a user joins a guild! This is a simple example of a more worked out bot. """ import logging from glob import glob from importlib import import_module from os import getenv from time import perf_counter from dotenv import load_dotenv ...
StarcoderdataPython
12861999
# -*- coding: utf-8 -*- def test_001(settings, finder): result = finder.change_extension("foo.scss", 'css') assert result == "foo.css" def test_002(settings, finder): result = finder.change_extension("foo.backup.scss", 'css') assert result == "foo.backup.css" def test_003(settings, finder): re...
StarcoderdataPython
1978221
from django.utils.encoding import force_bytes from django.utils.http import urlsafe_base64_encode from rest_framework import status from django.core import mail from rest_framework.reverse import reverse from rest_framework.test import APIRequestFactory from authors.apps.authentication.models import User from authors....
StarcoderdataPython
1897817
import openingbook book = openingbook.build_table(10) assert len(book) > 0, "Your opening book is empty" assert all( isinstance(k, tuple) for k in book ), "All the keys should be `hashable`" assert all( isinstance(v, tuple) and len(v) == 2 for v in book.values() ), "All the values should be tuples of (x, y) a...
StarcoderdataPython
6682300
a=input("enter a string") for i in a: if(i=='a' or i=='e' or i=='i' or i=='o' or i=='u' or i=='A' or i=='E' or i=='I' or i=='O' or i=='U'): print(i,"is a vowel") elif(i==' '): continue else: print(i,"is a constonent")
StarcoderdataPython
6540874
#coding: utf-8 from functools import wraps from django.utils.encoding import force_unicode UTF8_HEADER = "text/html; charset=UTF-8" CP1251_HEADER = "text/html; charset=windows-1251" def cp1251(func): @wraps(func) def view(*args, **kwargs): response = func(*args, **kwargs) if response.status_co...
StarcoderdataPython
329878
<filename>tests/test_django.py import time import ujson from django.conf import settings settings.configure( INSTALLED_APPS=['apianalytics'], ALLOWED_HOSTS=['testserver'], MASHAPE_ANALYTICS_SERVICE_TOKEN='SERVICE-TOKEN', MASHAPE_ANALYTICS_ENVIRONMENT='ENVIRONMENT', MASHAPE_ANALYTICS_HOST='localhost', MASHA...
StarcoderdataPython
4938142
<gh_stars>1-10 from .BaseRequest import BaseRequest class AddWorkbookToFavoritesRequest(BaseRequest): """ Add workbook to favorites request for generating API request URLs to Tableau Server. :param ts_connection: The Tableau Server connection object. :type ts_connection: class :param...
StarcoderdataPython
9782530
<filename>Vorlesungsinhalte/2020-11-02_Damen/Python-Code/spielfeld.py # Erzeugt ein neues quadratisches Spielfeld und liefert es zurück def new_spielfeld(h): return [[" "] * h for i in range(h)] # Gibt ein quadratisches Schachbrett auf der Konsole aus def print_spielfeld(feld): hoehe = len(feld) alphabet = "ABCD...
StarcoderdataPython
5136242
<filename>cmd/keyphrase-server/main.py import asyncio import signal import uvloop import logging from dotenv import load_dotenv, find_dotenv import os from os import getenv from boto3 import client from botocore.client import Config from keyphrase.extract_keyphrases import KeyphraseExtractor from keyphrase.transport....
StarcoderdataPython
114004
<gh_stars>1-10 # @Title: 四数之和 (4Sum) # @Author: 18015528893 # @Date: 2021-02-21 12:29:55 # @Runtime: 1324 ms # @Memory: 15.3 MB from typing import List class Solution: def fourSum(self, nums: List[int], target: int) -> List[List[int]]: def nSum(n, start, tar): res = [] if n == 2:...
StarcoderdataPython
11231326
<reponame>Raddock/MountWizzard4 ############################################################ # -*- coding: utf-8 -*- # # # # # # # # # ## ## # ## # # # # # # # # # # # # # # # ## # ## ## ###### # # # # # # # # # Python-based Tool for interaction with the 10m...
StarcoderdataPython
3317496
#! /usr/bin/env python3 from pdoc import cli import os class PdocArgs(object): def __init__(self, modules): self.template_dir = None self.html = True self.http = None self.filter = None self.external_links = None self.overwrite = True self.html_dir = 'docs' ...
StarcoderdataPython
3451358
<reponame>sybila/eBCSgen<filename>Regulations/ConcurrentFree.py from Regulations.Base import BaseRegulation class ConcurrentFree(BaseRegulation): """ Regulation defined as a priority function assigning priority to more important rule. """ def __init__(self, regulation): super().__init__(regula...
StarcoderdataPython
6415479
import os import sys tc = sys.argv[1] #path/name of transcriptome outFile = sys.argv[2] #path/name of output file bams = " ".join(sys.argv[3:]) #list of path/bam files command = "featureCounts -t exon -a {0} -o {1} {2}".format(tc,outFile,bams) print (command) os.system(command)
StarcoderdataPython
1762389
<reponame>TheDataShed/django-annotations # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import uuid class Migration(migrations.Migration): dependencies = [ ('enqueue', '0007_delete_engine'), ] operations = [ migrations.CreateMode...
StarcoderdataPython
6522845
<filename>ldproducts.py<gh_stars>1-10 #!/usr/local/bin/python3 # # load in products from eaidb import EAIdb import csv import re, sys ################################################################ if __name__ == '__main__': import argparse parser = argparse.ArgumentParser(description='Load test descript...
StarcoderdataPython
3491358
<filename>package/cloudshell/cp/vcenter/network/vlan/factory.py from pyVmomi import vim class VlanSpecFactory(object): def __init__(self): self.dvsVlanSpec = { 'Access': vim.dvs.VmwareDistributedVirtualSwitch.VlanIdSpec(), 'Trunk': vim.dvs.VmwareDistributedVirtualSwitch.TrunkVlanSp...
StarcoderdataPython
12841226
<filename>fesim_util.py """ Utility class for fesim By: <NAME> """ import os import subprocess def create_meshinput_file(vardict): """ generate temporary mesh data input file to be read by salome_mesh.py script. """ try: geofile = vardict['GEOFILE'] wrkdir = vardict['WRKDIR'] ...
StarcoderdataPython
1646060
<filename>instrumentserver/testing/dummy_instruments/rf.py import numpy as np from scipy import constants from qcodes import Instrument, ParameterWithSetpoints, find_or_create_instrument from qcodes.utils import validators class ResonatorResponse(Instrument): """A dummy instrument that generates the response of...
StarcoderdataPython
5026103
<reponame>JanmejaiPandey/pyDailyManager from align import Align from mongoConnect import usersDB import os,time Align.centerAlign("Register To the Manager") print("Enter Email ID:") email = input() print("Enter Password:") password = input() usersDB.addUser(email,password) time.sleep(2) os.system("cls") os.system(...
StarcoderdataPython
3257740
<gh_stars>0 from django.http import JsonResponse from django.utils import timezone from datetime import timedelta from labtest.serializers import LocationSerializer from labtest.models import LabTest, Location from django.core import serializers from rest_framework import viewsets def locations(request): # print(...
StarcoderdataPython
9660607
# pylint: disable=unused-argument, no-member, too-many-locals, invalid-name """ create mesh using meshpy """ # Copyright (c) <NAME>. All rights reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. import numpy as np import scipy.linalg as lp from matplotlib.path import Path import matplo...
StarcoderdataPython
344654
<gh_stars>1-10 from PIL import Image from torch.utils.data import Dataset, DataLoader #from torchvision import transforms, utils import tensorflow as tf import numpy as np import os, sys import torchvision import torch os.getcwd() import os.path print(os.path.abspath(os.path.join(os.getcwd(), os.pardir))) sys.path.appe...
StarcoderdataPython
5105504
""" Utilities to manipulate files and directories. """ import glob import zipfile import os def most_recent_file(dir_path, ext=''): """ return the most recent file given a directory path and extension """ query = dir_path + '/*' + ext newest = min(glob.iglob(query), key=os.path.getctime) retur...
StarcoderdataPython
1809467
""" Library Features: Name: lib_data_io_ascii Author(s): <NAME> (<EMAIL>) Date: '20210730' Version: '1.0.1' """ ####################################################################################### # Library import logging import collections import numpy as np import pandas as pd from t...
StarcoderdataPython
6609493
""" Copyright (c) 2021, NVIDIA CORPORATION. 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 in ...
StarcoderdataPython
1893865
<reponame>sinasiruosnejad/leetcode<filename>1.py def string_to_list(string,array): x=input(string) i=1 while x[i]!=']': if x[i]!=',': j=i temp='' while x[j]!=',': if x[j]==']': break temp+=x[j] j+...
StarcoderdataPython
1607249
matriz = [] for c in range(0,9): matriz.append(int(input(f'Digite um valor para [{c}, {c+1}]: '))) print('-='*30) print(f''' [ {matriz[0]} ] [ {matriz[1]} ] [ {matriz[2]} ] [ {matriz[3]} ] [ {matriz[4]} ] [ {matriz[5]} ] [ {matriz[6]} ] [ {matriz[7]} ] [ {matriz[8]} ]''')
StarcoderdataPython
1779071
from starry import kepler, Map from pylab import *#; ion() from pandas import DataFrame from lmfit import report_errors from scipy import optimize as op from time import time import numpy as np import exomast_api # pip install git+https://github.com/exowanderer/exoMAST_API import spiderman as sp import corner import s...
StarcoderdataPython
299675
<reponame>minefarmer/Comprehensive-Python """ Number Data types Integers(int) Floating Point(float) Integer """
StarcoderdataPython
8137037
#!/usr/bin/env python # <NAME> # Filter a Domain CSV file by comparing its feature representation to a feature representation of a different set of samples # Will produce the original Domain CSV file where samples with distance < threshold are removed. import argparse import pandas as pd import numpy as np from sklear...
StarcoderdataPython
11228475
import bisect import os import warnings from pathlib import Path import torch from loguru import logger from torch.utils import data from torch.utils.data.dataset import Dataset, IterableDataset from torchvision.datasets.folder import ( accimage_loader, pil_loader, make_dataset, IMG_EXTENSIONS, ) from ...
StarcoderdataPython
1889967
from floodsystem.datafetcher import fetch_measure_levels from floodsystem.stationdata import build_station_list from floodsystem.plot import plot_water_level_with_fit from floodsystem.flood import stations_highest_rel_level import datetime import matplotlib.pyplot as plt def run(n, p): """ Plots the water lev...
StarcoderdataPython
4802061
<gh_stars>0 # Este projeto está sendo implementado
StarcoderdataPython
11356985
<reponame>yuzhiw/Dense-CoAttention-Network<filename>dense_coattn/data/dataset.py from __future__ import absolute_import from __future__ import print_function from __future__ import division import h5py import random import numpy as np import os import torch import torchvision.transforms as transforms import PIL.Image...
StarcoderdataPython
55488
#!/usr/bin/env python3 # # MIT License # # Copyright (c) 2020-2022 EntySec # # 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...
StarcoderdataPython
4871083
# Intended to be invoked from cmake - don't run directly. import os import pathlib import setuptools import setuptools.command.build_ext import setuptools.command.build_py import shutil import subprocess import sys MODE = None curpath = pathlib.Path(os.path.dirname(os.path.realpath(__file__))) os.chdir(curpath) lib...
StarcoderdataPython
4920468
from cs50 import SQL db = SQL("sqlite:///immuns.db") db.execute("UPDATE msen SET delegate_name = '' WHERE committee = 'General Assembly MS 2' ") db.execute("UPDATE msen SET delegate_school = '' WHERE committee = 'General Assembly MS 2' ")
StarcoderdataPython
4862703
<filename>trieste/acquisition/function/active_learning.py<gh_stars>0 # Copyright 2021 The Trieste Contributors # # 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/li...
StarcoderdataPython
268403
"""Contains the utilities to extend the import machinery and provide support for ``abm``. Extension mechanism work by monkeypatching the ``FileFinder`` class in charge of reading Python several format modules from the local file system. Internally, ``FileFinder`` uses file loaders to read the several formats of Pytho...
StarcoderdataPython
3265374
<gh_stars>0 # -*- coding: utf-8 -*- # # Copyright (C) 2020 CERN. # # Flask-Resources is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Library for easily implementing REST APIs.""" from functools import wraps from webargs import Val...
StarcoderdataPython
3295703
<reponame>uataq/stiltctl """Models representing various spatial coordinate systems.""" from datetime import datetime, timedelta from typing import TYPE_CHECKING, List, Union from pydantic import BaseModel, confloat if TYPE_CHECKING: longitude_type = float latitude_type = float else: # Constrained types in...
StarcoderdataPython
9735747
<gh_stars>10-100 ''' Created on 04.09.2018 @author: rpickhardt This software is a command line tool and c-lightning wrapper for lib_autopilot You need to have a c-lightning node running in order to utilize this program. Also you need lib_autopilot. You can run python3 c-lightning-autopilot --help in order to get a...
StarcoderdataPython
140243
N_ITER_CHEAP = 10 N_ITER_EXACT = 50 EM_ITER_CHEAP = 1 DEFAULT_LAMBDA = (.1, .001) MAX_CLD_SIZE = 150 MAX_TRAJ_LEN = 100 EXACT_LAMBDA = (10, .001) DATA_DIM = 3 #DS_SIZE = 0.03 # for fig8 DS_SIZE = 0.025 # for overhand N_STREAMS = 10 DEFAULT_...
StarcoderdataPython
8083257
import unittest from datetime import datetime, timedelta import download class TestDownloadMethods(unittest.TestCase): def test_get_months_1(self): expected = [] today = datetime.today() expected.append(today.strftime('%Y-%m')) self.assertEqual(download.get_months(1), expected) ...
StarcoderdataPython
3284582
<reponame>tefra/xsdata-w3c-tests from output.models.nist_data.atomic.name.schema_instance.nistschema_sv_iv_atomic_name_pattern_1_xsd.nistschema_sv_iv_atomic_name_pattern_1 import NistschemaSvIvAtomicNamePattern1 __all__ = [ "NistschemaSvIvAtomicNamePattern1", ]
StarcoderdataPython
6478897
<filename>src/icemac/ab/calendar/browser/menu.py from icemac.ab.calendar.interfaces import IEvent from icemac.ab.calendar.interfaces import IRecurringEvent import grokcore.component as grok import icemac.ab.calendar.interfaces import icemac.addressbook.browser.interfaces import icemac.addressbook.browser.menus.menu imp...
StarcoderdataPython
8006678
<reponame>muhammad-abbady/JenTab import re def getWikiID(iri): """ extract the ID from a wikidata IRI used to harmonize between the different namespaces """ match = re.search(r'wikidata\.org.*[\/:]([QPL]\d+)', iri, re.IGNORECASE) if match: return match.group(1) else: ...
StarcoderdataPython
291478
<filename>tests/test_filter.py<gh_stars>10-100 from gtable import Table import numpy as np import pandas as pd def test_filter_1(): a = np.arange(10, dtype=np.double) table_a = Table({'a': a, 'b': a}) assert np.all( table_a.filter(table_a.a > 5).a.values == np.array([6, 7, 8, 9])) def test_filte...
StarcoderdataPython
9753525
<gh_stars>10-100 # -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'ModelTaskMeta.state' db.add_column(u'djcelery_model_modeltaskmeta', 'state'...
StarcoderdataPython
9672644
import pandas as pd import numpy as np import AnalyticGeometryFunctions as ag import itertools as it def updateHypothesisInformation(hypothesisInformation,precisionHypothesisDF,decayHypothesisDF): hypothesisInformation['perceptionPrecision'] = precisionHypothesisDF.values hypothesisInformation['memoryDecay'] ...
StarcoderdataPython
1858939
<gh_stars>1-10 import math from itertools import chain from typing import Dict, Union, Optional from typing import List import geojson import attr from flask_dance.consumer.storage.sqla import OAuthConsumerMixin from flask_login import UserMixin from geoalchemy2 import Geometry, WKTElement, WKBElement from shapely.geo...
StarcoderdataPython
11228343
from classic_tetris_project.tests.helper import * class UserTestCase(TestCase): @lazy def user(self): return UserFactory() @lazy def discord_user(self): return DiscordUserFactory(user=self.user) @lazy def twitch_user(self): return TwitchUserFactory(user=self.user) @l...
StarcoderdataPython
6591078
<reponame>SoulSen/BoostPack<gh_stars>0 from gui import InstallerGUI from tkinter import Tk root = Tk() installer_gui = InstallerGUI(root) root.mainloop()
StarcoderdataPython
3295624
# Copyright (c) 2019 <NAME> # This source code is licensed under the MIT license that can be found in # the accompanying LICENSE file or at https://opensource.org/licenses/MIT. import argparse import pathlib import sys def parseArgs(): def dirPath(pth): pthObj = pathlib.Path(pth) if pthObj.is...
StarcoderdataPython
1874341
<gh_stars>0 # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from components import config as config_component from testing_utils import testing from proto import project_config_pb2 from test import confi...
StarcoderdataPython