id
stringlengths
1
265
text
stringlengths
6
5.19M
dataset_id
stringclasses
7 values
1689760
from timetable import Timetable from building import * from timeutils import * from itertools import product from pathlib import Path import sys import matplotlib.pyplot as plt import os class TimetableMetrics(): def __init__(self, timetable, buildings,name): self.table = timetable self.buildings =...
StarcoderdataPython
1641117
""" CanICA """ # Author: <NAME>, <NAME>, # License: BSD 3 clause from operator import itemgetter import numpy as np from scipy.stats import scoreatpercentile from sklearn.decomposition import fastica from sklearn.externals.joblib import Memory, delayed, Parallel from sklearn.utils import check_random_state from .mu...
StarcoderdataPython
3259594
from flask import Flask from flask_login import LoginManager from flask_socketio import SocketIO app = Flask(__name__) app.config["SECRET_KEY"] = "TeamCheesyFTW" login_manager = LoginManager(app) socketio = SocketIO(app, logger=True, engineio_logger=True) from App import routes
StarcoderdataPython
1623000
# Copyright (c) 2010 Google Inc. 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 # notice, this list of conditions and the ...
StarcoderdataPython
125375
<gh_stars>0 __author__ = "<NAME> <<EMAIL>>" __date__ = "$Oct 04, 2016 16:17$" import contextlib import multiprocessing.sharedctypes import numpy from npctypes import types # Used to initiate the array from the shared process heap. _new_value = multiprocessing.sharedctypes._new_value _ndarray_cache = {} def ndarr...
StarcoderdataPython
195893
"""Unit test for directory watcher. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import errno import io import os import shutil import sys import tempfile import unittest import mock from treadmill import dir...
StarcoderdataPython
1779230
from __future__ import annotations import copy import random from functools import partial from typing import Optional import numpy as np from scipy.stats import norm, exponnorm from clovars.scientific import reflect_around_interval class CellSignal: """Represents an abstract Feature that can fluctuate over ti...
StarcoderdataPython
3361695
<reponame>embt/pytfa """ Thermodynamic analysis for Flux-Based Analysis .. moduleauthor:: pyTFA team """ from .tmodel import * from .metabolite import MetaboliteThermo
StarcoderdataPython
3231510
import argparse import os import csv import random import logging from tqdm import tqdm, trange import numpy as np import torch from torch.utils.data import (DataLoader, RandomSampler, SequentialSampler, TensorDataset) from pytorch_pretrained_bert import (OpenAIGPTDoubleHeadsModel, OpenA...
StarcoderdataPython
3206945
""" Summarize the scores in the nc/nc files. These are files that have the phage, the bacteria, some score parameter, and then whether the score is correct at species, genus, family, order, class, phylum, superkingdom """ import sys import os usage = '''<file> <max position> <threshold> The file should be the ncnc.s...
StarcoderdataPython
171745
""" Модуль предоставляет API сервиса конвертации валют """ from decimal import Decimal from converter import converter from converter import error async def convert(currency_from, currency_to, amount): """ Конвертация валюты Params: currency_from - валюта из которой необходимо прео...
StarcoderdataPython
1611826
<gh_stars>1-10 from .basic_gens import means_with_spread from .bnp import sample_CRP, sample_IBP __all__ = ['means_with_spread','sample_CRP', 'sample_IBP']
StarcoderdataPython
20829
<reponame>DesignBuilderSoftware/db-esofile-reader import calendar import logging from collections import namedtuple from datetime import datetime, timedelta from db_eplusout_reader.constants import RP, TS, A, D, H, M from db_eplusout_reader.exceptions import LeapYearMismatch, StartDayMismatch EsoTimestamp = namedtupl...
StarcoderdataPython
61961
<reponame>milenyordanov/advent-of-code<filename>2018/9/1.py<gh_stars>0 # See: https://adventofcode.com/2018/day/9#part1 import re import pprint input_file_name = 'input.txt' with open(input_file_name) as f: content = f.readlines() def parse_marbel_game_description(coordinate_str): toks = coordinate_str.spli...
StarcoderdataPython
3388071
<filename>siteapp/admin.py from django.contrib import admin from .models import Tag class TagAdmin(admin.ModelAdmin): fields = ('slug', 'tag') list_display = ('slug', 'tag') readonly_fields = ('slug',) admin.site.register(Tag, TagAdmin)
StarcoderdataPython
3326744
# NAME : Calculator # URL : https://open.kattis.com/problems/calculator # ============================================================================= # Leverage Python's eval function to make this simple. # ============================================================================= import sys for line in sys.std...
StarcoderdataPython
3205810
from time import sleep import curses if __name__ == "__main__": print("Ejecutar el archivo main.py") else: from src.curses_actions import * from src.menu_conversions import show_options from src.credits import more_info from src.exit_menu import exit_menu def main_menu(stdscr, current_option): ...
StarcoderdataPython
83190
#%% import argparse import time import math import os import torch import torch.nn as nn import torch.onnx from collections import Counter import data import model import utils args_cuda = torch.cuda.is_available() device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') # Hyper-parameters args_train_ba...
StarcoderdataPython
1729514
<gh_stars>1-10 import utime import math from array import array from machine import Pin, PWM, Timer from sound import Sound def read_words(filename): buffer = bytearray(128) with open(filename, 'rb', buffering=0) as file: while True: n = file.readinto(buffer) if n == 0: ...
StarcoderdataPython
1691515
<filename>src/main.py # linear algebra import numpy as np # data processing import pandas as pd import logging def main(): logging.info("Start processing") training_data = pd.read_csv("../data/train.csv") print(training_data.head()) logging.info("the end") if __name__ == "__main__": logging.ba...
StarcoderdataPython
3367742
# # Teacher - Object based on table 'teacher' # # Teacher.py - Modifications by <NAME> <<EMAIL>> # 0.1.0 2020-09-05 Initial version. # # Retrieves table 'teacher' data, or raises and exception for not-found. # (2020-09-23 Used only by File.py:prepublish() ...) # # # .uid: str UTU UID (prima...
StarcoderdataPython
1735285
<gh_stars>0 # Auto generated configuration file # using: # Revision: 1.19 # Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v # with command line options: step3 --conditions auto:run2_mc_hi -s RAW2DIGI,L1Reco,RECO -n 4 --eventcontent RECODEBUG --runUnscheduled --scenario HeavyIons ...
StarcoderdataPython
1751998
<reponame>rgilham/InvenTree<gh_stars>0 import json from django.test import TestCase import django.core.exceptions as django_exceptions from django.core.exceptions import ValidationError from django.conf import settings from djmoney.money import Money from djmoney.contrib.exchange.models import Rate, convert_money f...
StarcoderdataPython
1756825
<filename>datasets/kitti_dataset.py # Copyright Niantic 2019. Patent Pending. All rights reserved. # # This software is licensed under the terms of the Monodepth2 licence # which allows for non-commercial use only, the full terms of which are made # available in the LICENSE file. from __future__ import absolute_import...
StarcoderdataPython
27653
<filename>time/humanize_time.py #!/usr/bin/env python INTERVALS = [1, 60, 3600, 86400, 604800, 2419200, 29030400] NAMES = [('second', 'seconds'), ('minute', 'minutes'), ('hour', 'hours'), ('day', 'days'), ('week', 'weeks'), ('month', 'months'), ('year', '...
StarcoderdataPython
1708190
<reponame>timmartin/skulpt x = 3.14e159
StarcoderdataPython
3390189
import logging import random from tornado import gen from zoonado import exc log = logging.getLogger(__name__) def arguments(parser): parser.add_argument( "--path", "-b", type=str, default="/example-counter", help="ZNode path to use for the barrier." ) parser.add_argument( "--wo...
StarcoderdataPython
3319593
__all__ = ['ttypes', 'constants', 'API']
StarcoderdataPython
1659011
<filename>apps/v1api/views/practitioner.py<gh_stars>1-10 """ bbofuser: apps.v1api FILE: practitioner Created: 8/21/15 10:14 AM functions for managing Practitioner Profile """ __author__ = '<NAME>:@ekivemark' from datetime import datetime from django.conf import settings from apps.v1api.utils import (date_to_iso, ...
StarcoderdataPython
3212476
from jpype import * from time import sleep sleepInterval = 0.4 startJVM(getDefaultJVMPath(), "-ea -cp .") testPkg = JPackage('org').wg3i.test Example = testPkg.Example it = Example() it.setVisible(True) sleep(1) it.clickOnButton() sleep(1) it.clickOnCheckBox() sleep(1) it.clickOnButton() sleep(1) it.cli...
StarcoderdataPython
1694643
# -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2021-03-04 10:52 from __future__ import unicode_literals from django.db import migrations import encrypted_model_fields.fields class Migration(migrations.Migration): dependencies = [ ("beaconsite", "0002_auto_20210304_0716"), ] operations...
StarcoderdataPython
3376921
#!/usr/bin/env python2 """Create a new HDF5 dataset from an old one, resizing (presumed) image data in a supplied list of datasets.""" import argparse import h5py from scipy import ndimage parser = argparse.ArgumentParser() parser.add_argument('--field', action='append', dest=...
StarcoderdataPython
3311264
<reponame>thomasgurry/amplicon_sequencing_pipeline<filename>scripts/Phylogeny.py """ OVERVIEW: Module to compute phylogenetic quantities. """ import os import Formatting as frmt from ete2 import Tree import math def ComputeTreeAbundances(OTU_table_file, tree_file): # Computes L-R type feature from a tree ...
StarcoderdataPython
1634146
import urlparse import logging import socket from cattle import Config from cattle.utils import get_url_port from cattle.process_manager import background log = logging.getLogger('api-proxy') class ApiProxy(object): def __init__(self): self.pid = None def on_startup(self): url = Config.conf...
StarcoderdataPython
1707103
''' Created on Mar 30, 2018 @author: <NAME> ''' from pprint import pprint cars = {} car_1 = {'make': 'BMW', 'speed': 'fast'} car_2 = {'make': 'Mercedes', 'speed': 'good'} car_3 = {'make': 'Porsche', 'speed': 'very fast'} cars['car 1'] = car_1 cars['car 2'] = car_2 cars['c...
StarcoderdataPython
1650422
<gh_stars>0 from random import choice from time import sleep print('-=-'*20) print('\033[91mGAME: JOKENPÔ 👊 🤚 ✌\033[m') print('-=-'*20) jokenpo = ['PEDRA', 'PAPEL', 'TESOURA'] print('''\033[34mOPÇÕES:\033[m [ 0 ] PEDRA [ 1 ] PAPEL [ 2 ] TESOURA''') print('-=-'*20) jogador = int(input('Digite o número correspondente a...
StarcoderdataPython
48789
<reponame>sandro-felicioni/CRAFT-pytorch """ Copyright (c) 2019-present NAVER Corp. MIT License """ # -*- coding: utf-8 -*- import sys import os import time import argparse import torch import torch.nn as nn import torch.backends.cudnn as cudnn from torch.autograd import Variable from PIL import Image import cv2 fr...
StarcoderdataPython
1789504
def test_login_process(test_client, login): """ Тест процесса авторизации: должен быть редирект на Index page, категория алерта - success """ response = login assert response.status_code == 200 assert b'Index page' in response.data assert b'success' in response.data def test_login_inva...
StarcoderdataPython
4839911
<reponame>herbertludowieg/exatomic ## -*- coding: utf-8 -*- ## Copyright (c) 2015-2020, Exa Analytics Development Team ## Distributed under the terms of the Apache License 2.0 #""" #PW Header Subsection Parser ############################## #""" #from exa.typed import TypedProperty #from exa.core.parser import Sections...
StarcoderdataPython
3211146
<filename>fetcher/ukfetcher/__init__.py #!/usr/bin/env python2 # -*- coding: utf-8 -*- # $File: __init__.py # $Date: Sat Dec 14 20:07:30 2013 +0800 # $Author: jiakai <<EMAIL>> """provide fetcher background service, and also utilities for managing fetchers public mongo doc: collection: item { _id: unique int64 id ...
StarcoderdataPython
3291849
from __future__ import absolute_import, division, print_function, unicode_literals from six import python_2_unicode_compatible from canvasapi.canvas_object import CanvasObject from canvasapi.util import combine_kwargs @python_2_unicode_compatible class Login(CanvasObject): def __str__(self): return "{}...
StarcoderdataPython
1626687
import argparse import contextlib import math import os import random import shutil import uuid from pathlib import Path from typing import Tuple import cv2 import imageio import joblib import numpy as np from matplotlib import pyplot as plt from numba import njit, prange from tqdm import tqdm # Parameters brightness...
StarcoderdataPython
1793711
<gh_stars>0 from datetime import datetime class MockWorkbook: def __init__(self, *args, **kwargs): self.active = MockIterRows() @staticmethod def load_workbook(*args): pass @staticmethod def save(*args): return True class MockWorkbookError(MockWorkbook): def __init__(self, *args, **kwargs...
StarcoderdataPython
4811775
# plots mA and mC probabilities above threshold for single molecules # modified from methplotlib # input from guppy&winnow merge or megalodon # # use: # python single_molecule.py -i <bam_file(s)> -w <window> -t <thresh> -b <bed_file> -n <name(s)> # # example use: # python single_molecule_plotly_meg_winnow_guppy_FINAL....
StarcoderdataPython
22288
# !/usr/bin/env python # -*- coding: utf-8 -*- """Conversion between single-channel integer value to 3-channels color image. Mostly used for semantic segmentation. """ from __future__ import annotations import numpy as np import torch from multipledispatch import dispatch from torch import Tensor from onevision.cv....
StarcoderdataPython
1679381
<reponame>iankko/cekit<gh_stars>0 import os import yaml from cekit.descriptor import Descriptor volume_schema = [yaml.safe_load(""" map: name: {type: str} path: {type: str, required: True}""")] class Volume(Descriptor): """Object representing Volume. If 'name' is not present its generated as basename o...
StarcoderdataPython
121117
<reponame>guci314/Chatbot_CN<gh_stars>1-10 #!/usr/bin/env python # coding=utf-8 """ Get the table of actor_to_movie and movie_to_genre. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import sys reload(sys) sys...
StarcoderdataPython
1721469
from rooms.position import Position def created(actor): actor.state['created'] = True def player_joins(player_actor, room): player_actor.state.initialized = True def move_to(actor, x, y): actor.move_to(Position(x, y)) def ping(actor): print "PING" for i in range(10): actor._send_update...
StarcoderdataPython
3352446
<gh_stars>1-10 import gc import warnings from typing import Any, Generator, Iterable, Callable, Optional, Dict, Tuple import numpy as np import pandas as pd import ray from joblib import Parallel, delayed from joblib.externals.loky import get_reusable_executor from ordered_set import OrderedSet from tqdm import tqdm f...
StarcoderdataPython
1699004
from typing import Dict from UE4Parse.BinaryReader import BinaryStream class FStringTable: TableNamespace: str KeysToMetadata: Dict[str, Dict[str, str]] def __init__(self, reader: BinaryStream): self.TableNamespace = reader.readFString() self.KeysToMetadata = {} NumEntries = re...
StarcoderdataPython
3223898
<reponame>pulumi-bot/pulumi-aws # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import pulumi import pulumi.runtime class Connection(pulumi.CustomResource): """ Provides a Co...
StarcoderdataPython
115446
from django.conf.urls.defaults import * urlpatterns = patterns('satchmo.feeds.views', (r'atom/$', 'product_feed', {}, 'satchmo_atom_feed'), (r'atom/(?P<category>\w+)/$', 'product_feed', {}, 'satchmo_atom_category_feed'), (r'products.csv$', 'admin_product_feed', {'template' : "feeds/product_feed.csv"}, 'sat...
StarcoderdataPython
172589
from selenium import webdriver import pyautogui import time from selenium.webdriver.common.action_chains import ActionChains from twilio.rest import Client from playsound import playsound from screen_recorder_sdk import screen_recorder # USING THHIS YOU CAN RECORD SCREEN AND SAVE IT LOCALLY def msg(): ...
StarcoderdataPython
157143
<gh_stars>0 import argparse import os import netCDF4 import numpy as np from helper.mds import mds import time as t from helper.pearson import pearson_corr_distance_matrix import logging ENSEMBLE = "../artificialData/" # Path to ensemble data OUT = "../tmp" # Path to store temporary data VARIABLE_NAME = 'data' # Name...
StarcoderdataPython
77461
from .user import *
StarcoderdataPython
161062
<filename>UR Computer Vision/image captioning/classifier.py import torch import torchvision import torchvision.transforms as transforms import torch.nn as nn import torch.optim as optim classes = ('plane', 'car', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck') # by default, we ship the ...
StarcoderdataPython
120431
#!/usr/bin/python # -*- coding: utf-8 -*- import httpx,json,sys class API: def __init__(self, ApiKey, Version): self._h = 'https://api.cybertkr.com' self._get = httpx.Client(http2=True, timeout=120) self.api_key = ApiKey self.api_version = Version self.api_versionFloat = "...
StarcoderdataPython
1609520
<gh_stars>1-10 from rpython.annotator import model as annmodel from rpython.flowspace.model import Constant from rpython.rlib import rarithmetic, objectmodel from rpython.rtyper import raddress, rptr, extregistry, rrange from rpython.rtyper.error import TyperError from rpython.rtyper.lltypesystem import lltype, llmemor...
StarcoderdataPython
191982
from flask_sqlalchemy import SQLAlchemy from flask import Flask app = Flask( __name__, template_folder='../static/gui/', static_folder='../static/gui/static' ) db = SQLAlchemy() db_filename = 'program.db' app.config['SQLALCHEMY_DATABASE_URI'] = f'sqlite:///{db_filename}' app.config['SQLALCHEMY_TRACK_MODIFICATIONS...
StarcoderdataPython
3362955
# ---------------------------------------------------------------------------- # Copyright (c) 2016-2021, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
StarcoderdataPython
1744427
<filename>examples/model_svd.py #------------------------------------------------------------------------------- # STOCHASTICS-VOLUME-DIVISON MODEL #--------------------------------- #!/usr/bin/env python from cps import * import math, random, time DEBUG = 0 class GillespieChannel(AgentChannel): """ Performs Gil...
StarcoderdataPython
4821641
<filename>Extended/Python/PyPerfmonSample/sds_stream.py<gh_stars>0 import json from sds_stream_index import SdsStreamIndex class SdsStream(object): """Sds stream definition""" def __init__(self, stream_id, name, type_id, description): self.Id = stream_id self.name = name self.__type_id...
StarcoderdataPython
4827763
from requests import get response = get('http://localhost:9200/customer/_doc/1?pretty') print(response.json())
StarcoderdataPython
3307936
""" 26 / 26 test cases passed. Runtime: 204 ms Memory Usage: 15 MB """ class Solution: def wiggleMaxLength(self, nums: List[int]) -> int: n = len(nums) if n < 2: return n # dp[i][0] increase # dp[i][1] decrease dp = [[1] * 2 for _ in range(n)] for i in ran...
StarcoderdataPython
3278570
<reponame>vaidehisinha1/Python-PatternHouse<filename>Alphabetic Patterns/alphabeticpattern57.py alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" print("Enter the no of rows: ") n = int(input()) for i in range(0, n): nflag = n-i for j in range(0, i+1): print(nflag, end=" ") for k in range(0,n-i-1): ...
StarcoderdataPython
3232243
<filename>episodes/migrations/0005_episode_active.py # Generated by Django 2.1.4 on 2019-05-29 03:37 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('episodes', '0004_episode_info'), ] operations = [ migrations.AddField( mode...
StarcoderdataPython
1651626
import torch import torch.nn as nn import torch.optim as optim import numpy as np import six import collections import copy from torch.utils.data import Dataset from collections import defaultdict import h5py from scipy.stats import norm import os SKIP_TYPES = six.string_types class SimpleDataset(Dataset): ''' ...
StarcoderdataPython
1727995
<filename>unscrambler.py import argparse def get_arg(): parser = argparse.ArgumentParser() parser.add_argument('the_key') arg = parser.parse_args() return arg.the_key # generator def open_dictionary(): with open('scrabble-dictionary.txt') as f: for word in f: yield word.strip()...
StarcoderdataPython
57550
<reponame>maxholloway/agent-exchange<filename>examples/prisoners_dilemma/utils.py class BufferList: def __init__(self, maxlen): self.data = [] self.maxlen = maxlen def append(self, el): if len(self.data) == self.maxlen: popped = self.data.pop(0) else: pop...
StarcoderdataPython
3283322
<filename>Modules/Wrappers/SWIG/test/python/PythonTestDriver.py # -*- coding: utf-8 -*- # # Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES) # # This file is part of Orfeo Toolbox # # https://www.orfeo-toolbox.org/ # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not us...
StarcoderdataPython
3243331
<gh_stars>0 # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import pulumi import pulumi.runtime from .. import utilities, tables class GetAccountResult(object): """ A collect...
StarcoderdataPython
182451
""" URLs defined for celery. """ from django.conf.urls.defaults import patterns, url from celery import views urlpatterns = patterns("", url(r'^(?P<task_id>[\w\d\-]+)/done/?$', views.is_task_successful, name="celery-is_task_successful"), url(r'^(?P<task_id>[\w\d\-]+)/status/?$', views.task_status, ...
StarcoderdataPython
1798804
from cc3d.core.PySteppables import * from collections import defaultdict from collections import namedtuple # For convenience we define a named tuple that will store anchor parameters AnchorData = namedtuple('AnchorData', 'lambda_ target_length max_length x y z') class FocalPointPlasticityAnchorSteppable(SteppableBa...
StarcoderdataPython
3278802
<gh_stars>0 ''' Flag of Norway Date: 10.18.21 Author: <NAME> This code draws the Flag of Norway using the colors and proportions specified on https://en.wikipedia.org/wiki/Flag_of_Norway. If the user permits it, the code then goes on to recreate the famous "Wait, it's ALL Norway?" meme, outlining and labeling the fl...
StarcoderdataPython
4804538
#!/usr/bin/env python # -*- coding: utf-8 -*- from werkzeug.security import generate_password_hash, check_password_hash from itsdangerous import TimedJSONWebSignatureSerializer as Serializer from flask_login import UserMixin, AnonymousUserMixin from flask import url_for, current_app from . import login_manager from . i...
StarcoderdataPython
1682792
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ Registry Server Control ======================= Contains methods for controlling the starting and stopping of the local FAIR Data Pipeline registry via the CLI. Contents ======== Functions --------- check_server_running - confirm that the server is running locally ...
StarcoderdataPython
71244
<reponame>FPNAS/ResLT import torch import torchvision import torchvision.transforms as transforms import numpy as np import torchvision.datasets as datasets import numpy as np from PIL import Image import random import math class IMBALANCECIFAR10(torchvision.datasets.CIFAR10): cls_num = 10 data_path="/mnt/pro...
StarcoderdataPython
30874
# coding=utf-8 from builtins import input from optparse import make_option from django.core import exceptions from django.utils.encoding import force_str from django.conf import settings from django.db.utils import IntegrityError from django.core.management import call_command from tenant_schemas.utils import get_ten...
StarcoderdataPython
175372
import signal import os import logging #from multiprocessing_logging import install_mp_handler from multiprocessing import Process, cpu_count from subprocess import call from docopt import docopt # Workflow: # Start Mongo # Launch high level python controller script # Launch external processes # Wait for controller...
StarcoderdataPython
127667
<reponame>magnublo/msc-darkweb-scraping from sqlalchemy import Column, Integer, ForeignKey, String from sqlalchemy import Float, CHAR from definitions import Base, MARKET_NAME_COLUMN_LENGTH, MYSQL_CASCADE, MYSQL_VARCHAR_DEFAULT_LENGTH from src.models import seller_observation TABLE_NAME = 'verified_external_account' ...
StarcoderdataPython
3279834
#!/usr/bin/env python import os import sys from django.core.management import execute_from_command_line def runtests(): os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.settings") argv = sys.argv[:1] + ['test'] + sys.argv[1:] execute_from_command_line(argv) if __name__ == '__main__': runtests...
StarcoderdataPython
4815241
<filename>rellipsoid/rellipsoid.py<gh_stars>1-10 #!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' MIT License Copyright (c) 2018 <NAME> 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 ...
StarcoderdataPython
1651773
<reponame>opendata/LMGTDFY<gh_stars>100-1000 from django.contrib import admin from lmgtfy.models import TLD class TLDAdmin(admin.ModelAdmin): pass admin.site.register(TLD, TLDAdmin)
StarcoderdataPython
1717416
<filename>rrsg_cgreco/_helper_fun/multislice_viewer.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Nov 15 16:55:39 2017 @author: omaier Copyright 2019 <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 ...
StarcoderdataPython
67213
<filename>alipay/aop/api/domain/AlipayEbppIndustryBillNettingRefundModel.py #!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.IndustryExtendField import IndustryExtendField class AlipayEbppIndustryBillNettingRefundModel(object): ...
StarcoderdataPython
3363609
<reponame>SunshineStateDigitalNetwork/ssdn_citrus_maps<gh_stars>0 import json import os import unittest from datetime import date from pathlib import Path from unittest.mock import patch, MagicMock from citrus.cli import transform test_dir_path = os.path.abspath(os.path.dirname(__file__)) def stand_up(self): ""...
StarcoderdataPython
170052
from django.test import TestCase from battle.businesslogic.recorder.effects_impacts.DeckOrderChangedEffectImpact import DeckOrderChangedEffectImpact from battle.businesslogic.tests.factories import create_player_with_deck class DeckOrderChangedEffectImpactTestCase(TestCase): def test_deck_has_proper_order(self):...
StarcoderdataPython
1658572
# Standard imports import datetime import io import json import os # Django imports from django import http from rest_framework import viewsets # Third-party imports import piexif from PIL import Image # Local imports from . import filters, models, serializers, utils from .membership import permissions # Provide A...
StarcoderdataPython
3324135
"""siim_acr_pneumothorax dataset.""" import tensorflow as tf import pandas as pd import numpy as np import tensorflow_datasets.public_api as tfds _CITATION = """ @ONLINE {societyforimaginginformaticsinmedicine(siim)2019, author = "Society for Imaging Informatics in Medicine (SIIM)", title = "SIIM-ACR Pneumothorax Se...
StarcoderdataPython
3340543
# -*- coding: utf-8 -*- """Console script for py_tilt.""" import sys import click from bluetooth._bluetooth import hci_open_dev from py_tilt.main import hci_le_set_scan_parameters, hci_enable_le_scan, monitor_tilt @click.command() def main(args=None): """Console script for py_tilt.""" dev_id = 0 try: ...
StarcoderdataPython
3380008
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu May 30 14:24:59 2019 @author: jdummer """ import yaml yml_lines = [] with open('2019-01-08-oleanna.md', encoding='utf8') as file: for line in file: if line.strip() == "---": break for line in file: if line.strip() ...
StarcoderdataPython
105591
from dzTrafico.BusinessEntities.Simulation import Simulation from NetworkManager import NetworkManager from dzTrafico.BusinessLayer.TrafficAnalysis.LaneChangeControlAlgo import LaneChange from TripManager import TripManager from dzTrafico.BusinessLayer.SimulationCreation.SensorsManager import SensorsManager from dzTraf...
StarcoderdataPython
3283944
<filename>message/apps/utils/middlewares/sso.py # -*- coding:utf-8 -*- """ sso相关的中间件 """ import requests from django.utils.deprecation import MiddlewareMixin from django.contrib.auth import login from django.conf import settings from account.models import User class CheckTicketMiddleware(MiddlewareMixin): """ ...
StarcoderdataPython
1696511
<filename>sim/codebase/Listener.py import subprocess import threading from networktables import NetworkTables #!/usr/bin/env python3 # # This is a NetworkTables client (eg, the DriverStation/coprocessor side). # You need to tell it the IP address of the NetworkTables server (the # robot or simulator). # # When running,...
StarcoderdataPython
3397185
#!/usr/bin/python # =================== Misc vars =================== ## SHOW_CONSOLE_OUTPUT = False # Show the console output when 'make' is called? # ============== Backup related vars ============== ## BACKUPS_DIR = '/storage/emulated/0/theme-backups' BACKUP_OPTIONS = [] # ============= g...
StarcoderdataPython
3329687
<filename>ament_tools/build_types/bazel.py # Copyright 2017 Open Source Robotics Foundation, 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/LICENS...
StarcoderdataPython
188348
from setuptools import find_packages, setup setup( name='src', packages=find_packages(), version='0.1.0', description='Default project setup based on cookiecutter', author='MI', license='MIT', )
StarcoderdataPython
1760145
<filename>scripts/report/print_model1_assoc.py #!/usr/bin/env python # # Copyright 2014+ Carnegie Mellon University # # 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....
StarcoderdataPython
4803358
<reponame>AntoniniP/dash_on_flask import os basedir = os.path.abspath(os.path.dirname(__file__)) class BaseConfig: SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or "postgresql+psycopg2://{user}:{password}@{host}:{port}/{dbname}".format( user = 'postgres', password = '<PASSWORD>', ...
StarcoderdataPython
23244
""" LibriParty Dataset creation by using official metadata. Author ------ <NAME>, 2020 <NAME>, 2020 """ import os import sys import speechbrain as sb from hyperpyyaml import load_hyperpyyaml from speechbrain.utils.data_utils import download_file from local.create_mixtures_from_metadata import create_mixture import js...
StarcoderdataPython