id
stringlengths
1
265
text
stringlengths
6
5.19M
dataset_id
stringclasses
7 values
1660894
""" Olhand para countries_reviewed na pasta multi_index_2 em multi.py, podemos ver que o agrupamento retorna dados em ordem de índice, ou seja, como imprimiu. Para obter os dados na ordem desejada,por exemplo pelo len, podemos classificá-los nós mesmos. O método sort_values() é útil para isso.""" import pandas as pd ...
StarcoderdataPython
174560
from tqdm import tqdm from argparse import ArgumentParser from subprocess import check_output def wc(filename): return int(check_output(["wc", "-l", filename]).split()[0]) parser = ArgumentParser(description='Creates the entity description file for IndoWiki') parser.add_argument('wiki_file', help='Filename of Wik...
StarcoderdataPython
1659723
# -- coding utf-8 -- # @Time 2022/5/8 下午10:59 # @Author dicardo # @File lottery_view.py # @Software PyCharm from typing import Any from rest_framework import generics, viewsets from rest_framework.request import Request from rest_framework.response import Response from common.api_rest_response import ApiRe...
StarcoderdataPython
1763760
<gh_stars>100-1000 from flask import Blueprint, jsonify, g, current_app, request, abort from flask_rest_jsonapi import Api from commandment.vpp.models import db, VPPAccount from commandment.vpp.schema import VPPAccountSchema vpp_app = Blueprint('vpp_app', __name__) api = Api(blueprint=vpp_app) @vpp_app.route('/api/v...
StarcoderdataPython
3283826
<reponame>kkauder/spack # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os import pytest import llnl.util.tty as tty def test_get_timestamp(monkeypatch): ""...
StarcoderdataPython
1657350
<filename>easy_excel_util/base_field.py # !user/bin/env python3 # -*- coding: utf-8 -*- # Author: ChaoqiYin class BaseField(object): def __init__(self, index, datetime_format=None, col_name=None, converter=None): ''' init :param index: 解析列对应位置,从0开始 :param datetime_format: 字符串/datet...
StarcoderdataPython
1666366
import numpy as np import math def main(): """ # Main This is a backbone of the project. This Fuction runs all the others. """ c_a = [0.2, 1, 0.7] c_b = [0.3, 0.9, 0.8] template = [0.2, 0.9, 0.9] d1 = calculate_euclidian_distance(template, c_a) d2 = calculate_euclidian_distance(templa...
StarcoderdataPython
91160
<reponame>GGP00/soba from mesa import Agent, Model from transitions import Machine from transitions import State import json import configuration.settings class PC(Agent): states = [ State(name='off', on_enter=['set_off']), State(name='on', on_enter=['set_on']), State(name='standby', on_en...
StarcoderdataPython
1628879
<reponame>93TEI/3D_Action_Recognition import numpy as np from helperFunctions import * def f(a): ##array is 3d ##size is 300x25x3 first = 0 last = 300 zeros = np.zeros((25, 3)) if not (a[299, :, :]==0).all(): return a while (first<last): middle = (first + last)//2 if (a[middle,:,:] == 0).all(): last =...
StarcoderdataPython
1627126
# Copyright (C) 2019-2020 Zilliz. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
StarcoderdataPython
3347068
import pathlib from rlbot.agents.base_independent_agent import BaseIndependentAgent from rlbot.botmanager.helper_process_request import HelperProcessRequest class Recorder(BaseIndependentAgent): def get_helper_process_request(self) -> HelperProcessRequest: controller_path = pathlib.Path(__file__).parent....
StarcoderdataPython
73985
import sys sys.path.append('dastro_bot/_default_settings')
StarcoderdataPython
182222
""" 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"); you may not use this ...
StarcoderdataPython
186961
from flask import Flask, request, redirect, url_for, jsonify # flash render_template import pymongo from bson.objectid import ObjectId from datetime import datetime, timedelta import requests import re import json import function import api import webpage client = pymongo.MongoClient('mongodb+srv://dbUser:o5jzqcHzu...
StarcoderdataPython
3316341
<reponame>lcasi/jupyterhub-sqlauthenticator #!/usr/bin/env python from setuptools import setup setup(name='sqlauthenticator', version='1.0', description='SQL Authenticator for Jupyterhub', author='<NAME>', license='MIT', author_email='<EMAIL>', url='https://github.com/bcongdon/jupy...
StarcoderdataPython
108475
"""Author: <NAME> Email: <EMAIL> network.py is a basic implementation of a one layer linear neural network, to examine an implementation of backpropagation. It is based on the basic model of the Perceptron. Information on that can be found at: https://en.wikipedia.org/wiki/Perceptron The intent of this specific ...
StarcoderdataPython
1715187
# -*- coding: utf-8 -*- import xlrd from datetime import timedelta from django.db import connection from django.test import override_settings from django.utils.timezone import now from bluebottle.time_based.tests.factories import ( PeriodActivityFactory, PeriodParticipantFactory, DateActivityFactory ) from blu...
StarcoderdataPython
10148
<gh_stars>1-10 # Given a singly linked list, determine if it is a palindrome. # Definition for singly-linked list. class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next class Solution: def isPalindrome(self, head: ListNode) -> bool: fast = slow = head #...
StarcoderdataPython
112186
from time import sleep from pratidarshan import ( pradarshanam, alert, get_registry, lang_code, AJAY, sahAyikA, display_lang_lists, display_lang_data, start_thread, start_file, update_win, urlopen, ) from pystray import MenuItem as item, Menu as menu, Icon as SysTray from...
StarcoderdataPython
1617465
#!/usr/bin/env python2.7 # -*- coding:UTF-8 -*-2 u"""decorator.py Copyright (c) 2019 <NAME> This software is released under BSD license. デコレータモジュール。 """ import pygame as _pygame def set_decorator(subject, groups=None): u"""デコレータ設定。 """ class __Top(Decorator): u"""上部デコレータ。 """ def...
StarcoderdataPython
3355219
<reponame>mtroeschel/isaac import asyncio import logging from asyncio import coroutine import aiomas from aiomas import expose from openvpp_agents.core.controller.management import TopologyManager from openvpp_agents.core.controller.scheduling import DayAheadScheduler logger = logging.getLogger(__name__) # TODO: ma...
StarcoderdataPython
3274457
import numpy #numpy is used to make some operrations with arrays more easily import pandas as pd from sklearn.metrics import mean_squared_error, r2_score import matplotlib.pyplot as plt from sklearn.preprocessing import MinMaxScaler __errors__= []; #global variable to store the errors/loss for visualisation columns...
StarcoderdataPython
3336218
<filename>test/flow/flow_0007/start.py #!/usr/bin/env python3 import sys MODULE = "START" def main(): print(0) sys.exit(0) if __name__ == '__main__': main()
StarcoderdataPython
3281612
<gh_stars>10-100 from ..config import * from ply.lex import lex as plex # lex tokens = ( 'bofx', 'eofx', 'newline', 'tab', 'interpolant', 'lce', 'rce', 'string', ) def t_newline(t): r'\n' return t def t_tab(t): r'\t' return t def t_interpolant(t): r'\{(?P<fmt>[^\{:]*):(?P<arg>[^\}]+)\}' t.value = Inte...
StarcoderdataPython
80006
<gh_stars>0 # pylint: disable=redefined-outer-name """Tests for export """ import json from unittest.mock import patch import pytest from falcon import testing from service.transforms.transform import TransformBase from service.resources.export import Export import service.microservice CLIENT_HEADERS = { "ACCESS_K...
StarcoderdataPython
3297441
<gh_stars>1-10 """configflow - is the configuration management library for Python.""" from configflow import exceptions from configflow import sources __title__ = "configflow" __summary__ = "configflow - is the configuration management library for Python." __uri__ = "https://configflow.readthedocs.io/en/latest" __v...
StarcoderdataPython
3216342
<filename>thunder/we_media/apps.py # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps import AppConfig class WeMediaConfig(AppConfig): name = 'we_media'
StarcoderdataPython
6859
<gh_stars>0 from django.apps import apps from django.db import models from django.db.models.signals import post_save, pre_delete from typing import Type, Optional, List, cast, TYPE_CHECKING from maestro.backends.django.settings import maestro_settings from maestro.backends.django.contrib.factory import create_django_da...
StarcoderdataPython
172774
<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- import json from sqlalchemy.orm import sessionmaker from nebula.views import event_default from nebula.dao.eventmeta_dao import EventMetaDefaultDao from nebula.models import EventMeta from base import WebTestCase, wsgi_safe, Auth_Code with open('nebula/test...
StarcoderdataPython
195707
"""Base Factory to help in model tests.""" from factory.alchemy import SQLAlchemyModelFactory from muckr_api.extensions import database class BaseFactory(SQLAlchemyModelFactory): """Base factory.""" class Meta: """Factory configuration.""" abstract = True sqlalchemy_session = databa...
StarcoderdataPython
1718939
from shared.models import db class Users(db.Model): email = db.Column(db.String(80), primary_key=True) password = db.Column(db.String(80)) name = db.Column(db.Text) role = db.Column(db.Integer, default=1) # Admin is level 10 articles = db.relationship('Post', backref='user') def __init__(sel...
StarcoderdataPython
3337598
<reponame>Jerome1434/ampscan<filename>ampscan/trim.py<gh_stars>10-100 # -*- coding: utf-8 -*- """ Package for dealing with trimming the AmpObject mesh Copyright: <NAME> 2020, <EMAIL> """ import numpy as np from numbers import Number import os from scipy import spatial import copy # Used by doc tests filename = os.pat...
StarcoderdataPython
3298584
#from tkinter import * import tkinter as tk from PIL import ImageTk, Image, ImageDraw import cv2 import datetime datet = str(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")) root = tk.Tk() #app = tk.Frame(root, bg="white") #app.gri) lmain=tk.Label(root) #canvas= tk.Canvas(lmain) #Arduino = canvas.create_recta...
StarcoderdataPython
33548
<gh_stars>10-100 class hparams: sample_rate = 16000 n_fft = 1024 #fft_bins = n_fft // 2 + 1 num_mels = 80 hop_length = 256 win_length = 1024 fmin = 90 fmax = 7600 min_level_db = -100 ref_level_db = 20 seq_len_factor = 64 bits = 12 seq_len = seq_len_factor * hop_...
StarcoderdataPython
3211477
<reponame>jaythecaesarean/bitmovin-api-sdk-python from bitmovin_api_sdk.account.information.information_api import InformationApi
StarcoderdataPython
3274112
import yaml class BuildTestError(Exception): """Class responsible for error handling in buildtest. This is a sub-class of Exception class.""" def __init__(self, msg, *args): """This class is used for printing error message when exception is raised. Args: msg (str): message to...
StarcoderdataPython
1765752
import setuptools setuptools.setup( name = 'OWLPy', version = '0.2.5.4', license='MIT', description = 'Python Driver and Models for the OWL API', author = '<NAME>', author_email = '<EMAIL>', url = 'https://github.com/spydernaz/OWLPy.py', keywords = ['API', 'OWL', 'Overwatch', 'Overwatch League'], pack...
StarcoderdataPython
3228923
<reponame>Abigail-Wood/CRAFT<gh_stars>1-10 #!/usr/bin/env python3 # Goal: extract all lines that read '- Log10-BF of >= one causal SNP : 0.476 in [rsid].log_sss files, then match rsid in filename to index line in .index file and append the value in a new column at the end of the row. import argparse import sys import...
StarcoderdataPython
62046
import pytest import datetime from gps_time.core import GPSTime from gps_time.leapseconds import LeapSeconds @pytest.mark.parametrize("year,leap_seconds", [ (1981, 0), (1982, 1), (1983, 2), (1984, 3), (1986, 4), (1989, 5), (1991, 6), (1992, 7), (1993, 8), (1995, 10), (1997, 11), (1998, 12), (2000, 13), ...
StarcoderdataPython
3314829
<reponame>eteq/nbcollection-1 import argparse from nbcollection.ci.commands.utils import validate_and_parse_inputs from nbcollection.ci.scanner.utils import find_build_jobs from nbcollection.ci.generate_ci_environment.utils import gen_ci_env def run_generate_ci_environment(options: argparse.Namespace) -> None: v...
StarcoderdataPython
92661
<reponame>AIMultimediaLab/AI4Media-EaaS-prototype-Py2-public # -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): depends_on = ( ("authenz", "0002_auto__add_cl...
StarcoderdataPython
109413
from datetime import datetime import pprint from django.core.management.base import NoArgsCommand import sys import os from corehq.apps.app_manager.models import Application from corehq.apps.hqcase.management.commands.ptop_generate_mapping import MappingOutputCommand from corehq.pillows import dynamic from corehq.pillo...
StarcoderdataPython
1675778
""" Code Author: <NAME> (<EMAIL>) """ import os import argparse import numpy as np from autoencoder_models.GraphDiffVAE import GraphDiffVAE from data.data_processing import get_gene_expression_data from data.build_graphs import build_correlation_graph def init_arg(): parser = argparse.ArgumentParser() parse...
StarcoderdataPython
60751
<filename>usernamerules/simple.py def simple(user_data, with_separator=''): return [with_separator.join(user_data)]
StarcoderdataPython
1606307
from django.contrib.auth import get_user_model from rest_framework import serializers User = get_user_model() class UserViewSerializer(serializers.ModelSerializer): class Meta: model = User fields = ['id', 'name', 'email', 'created_at', ...
StarcoderdataPython
3271494
<gh_stars>1-10 import details while (1): print("-+--+--+--+--+--+--+ Welcome to XYZ Blood Banks -+--+--+--+--+--") print("+--+--+--+--+--+--+- 1.List of Donors +--+--+--+--+--+-") print("+--+--+--+--+--+--+- 2.Add Hospital +--+--+--+--+--+--+--") print("+--+--+--+--+--+--+- ...
StarcoderdataPython
43669
# -*- coding: utf-8 -*- from collections import OrderedDict from . import instance import future.utils # https://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/ # # Instance creation: # metaclass.__call__() # instance = class.__new__(self,) # class.__init__(instance,...) # return in...
StarcoderdataPython
3216626
import cass def get_user(request): if 'username' in request.session: try: user = cass.get_user_by_username(request.session['username']) return { 'username': user.username, 'password': <PASSWORD>, 'is_authenticated': True } ...
StarcoderdataPython
3322896
<reponame>smolendawid/ubaar-competition<filename>api/server_inference.py import os import pandas as pd from feature_extraction.date_utils import date_features from feature_extraction.coords_features import coord_features from feature_extraction.other_features import raw_features, categorical_features from feature_extra...
StarcoderdataPython
1617073
<reponame>hfboyce/tableau_course<filename>_build/jupyter_execute/lectures/lecture2.py # Splitting and Cross-validation *<NAME>, April 21st 2021* # Importing our libraries import pandas as pd import numpy as np from sklearn.tree import DecisionTreeClassifier from sklearn.dummy import DummyClassifier from sklearn.neig...
StarcoderdataPython
104486
from .command_line import *
StarcoderdataPython
3290116
import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) import fxpmath as fxp from fxpmath.objects import Fxp from fxpmath import utils import numpy as np import time def test_perf_clip(repeat=100): exec_time_vals = np.zeros(repeat) for i in range(repeat): ...
StarcoderdataPython
25267
<reponame>mchalapuk/python-api quedex_public_key = """-----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1 <KEY> <KEY> -----END PGP PUBLIC KEY BLOCK-----"""
StarcoderdataPython
1778527
<gh_stars>0 import re from math import inf from heapq import heappush, heappop from typing import List, Any def create_cave(depth: int, tx: int, ty: int) -> List[List[int]]: """ Creates the cave according to the cave generation rules. Since the cave is essentially infinite a constant size padding is appl...
StarcoderdataPython
56646
import numpy as np class DataLoader(object): def __init__(self, fpath1, fpath2, maxlen1, maxlen2, vocab_fpath): self.sents1, self.sents2 = self.load_data(fpath1, fpath2, maxlen1, maxlen2) self.token2idx, self.idx2token = self.load_vocab(vocab_fpath) self.maxlen1 = maxlen1 self.maxle...
StarcoderdataPython
4812917
#!/usr/bin/python from manber_myers import * import unittest class MMTest(unittest.TestCase): def testEmpty(self): res = manberMyers("") self.assertEqual([], res) def testOneLetter(self): res = manberMyers("a") self.assertEqual([0], res) def testWord(self): res = m...
StarcoderdataPython
1680609
<reponame>jbobo/sawtooth-next-directory # Copyright 2018 Contributors to Hyperledger Sawtooth # # 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....
StarcoderdataPython
1605123
<reponame>123electric/123SmartBMS-Venus #!/usr/bin/env python3 import argparse import os import serial import serial.tools.list_ports import struct import sys import threading import time from collections import deque from datetime import datetime from dbus.mainloop.glib import DBusGMainLoop from gi.repository import G...
StarcoderdataPython
8277
<gh_stars>1-10 # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Nebula, 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/L...
StarcoderdataPython
3358963
<reponame>VoprosiKira/l2<filename>directions/models.py import base64 import calendar import collections import logging from cda.integration import get_required_signatures import datetime import os import re import time import unicodedata from datetime import date from typing import List, Optional, Union from django.co...
StarcoderdataPython
1711570
<gh_stars>1-10 from django.test import TestCase from django.utils import timezone from dateutil.relativedelta import relativedelta from django.contrib.auth.models import User from issues.models import Issue from .utils import misc class TestAccounts(TestCase): """ Tests for accounts """ def setUp(self...
StarcoderdataPython
1784532
#!/usr/bin/env python from __future__ import division import htpc, cherrypy, logging, xmlrpclib, base64 from cherrypy.lib.auth2 import require, member_of from htpc.helpers import serve_template, fix_basepath, striphttp class RTorrent(object): def __init__(self): self.logger = logging.getLogger('modules.rt...
StarcoderdataPython
3297582
from tests.unit.dataactcore.factories.staging import DetachedAwardFinancialAssistanceFactory from tests.unit.dataactvalidator.utils import number_of_errors, query_columns from datetime import date from dateutil.relativedelta import relativedelta _FILE = 'fabs4_detached_award_financial_assistance_3' def test_column_h...
StarcoderdataPython
101794
<filename>third_party/syntaxSQL/data_augment/fix_wikisql_tables.py import re import json BANNED = re.compile(r'[\'"\[\]().:]') tables = json.load(open('wikisql_tables.json')) for schema in tables: for i, (table_id, column_name) in enumerate(schema['column_names_original']): if table_id == -1: ...
StarcoderdataPython
3246793
import socket import html import base64 from datetime import datetime, timedelta from contextlib import contextmanager from typing import Any, Iterator, Union, Dict import urllib3 from django.conf import settings from django.utils import timezone from celery import shared_task from celery.task import BaseTask import ...
StarcoderdataPython
131964
<filename>typescript/libs/service_proxy.py<gh_stars>1000+ import sublime from . import json_helpers from .global_vars import IS_ST2 from .node_client import CommClient from .text_helpers import Location class ServiceProxy: def __init__(self, worker_client=CommClient(), server_client=CommClient()): self....
StarcoderdataPython
3240643
<reponame>LiquidNalee/MiniPkmnShowdown<filename>engine/game/BattleEngine.py from random import randint from engine.game import InputHandler from engine.game.BattleDisplay import displayPlayers, displayBattleGameState, displayUsedMove, \ displaySwitch, displayEndOfBattle from engine.pkmn.types.TypesBaseRuleSet impo...
StarcoderdataPython
1783084
<gh_stars>0 """ Programmer: <NAME> Purpose: An entry point for the MIREX 2017 cover song ID task """ import numpy as np import scipy.io as sio from multiprocessing import Pool as PPool from BatchCollection import * from sys import exit, argv import pandas as pd import numpy as np from configparser import ConfigParser f...
StarcoderdataPython
1685888
<reponame>tampansky/fsf #!/bin/usr/python import requests from bs4 import BeautifulSoup import time import os import random sleep = time.sleep #colors blue='\e[1;34m' cyan='\e[0;36m' green='\e[0;34m' okegreen='\033[92m' lightgreen='\e[1;32m' grey="\033[0;37m" purple="\033[0;35m" yellow="\033[1;33m" Purp...
StarcoderdataPython
4816245
<reponame>influence-usa/pupa<filename>pupa/settings.py import os import importlib import sys import dj_database_url DATABASE_URL = os.environ.get('DATABASE_URL', 'postgis://pupa:pupa@localhost/opencivicdata') SECRET_KEY = 'non-secret' INSTALLED_APPS = ('opencivicdata.apps.BaseConfig', 'pupa',) # scrape settings ENAB...
StarcoderdataPython
4806824
<gh_stars>0 # Generated by Django 2.0.10 on 2019-02-19 01:43 from django.db import migrations, models import kbspre.users.models class Migration(migrations.Migration): dependencies = [ ('images', '0006_auto_20190219_1043'), ] operations = [ migrations.AddField( model_name='c...
StarcoderdataPython
4827858
#! /usr/bin/env python import requests import socket import threading import logging import mraa # change this to the values from MCS web console DEVICE_INFO = { 'device_id' : 'D4ciQz0u', 'device_key' : '<KEY>' } # change 'INFO' to 'WARNING' to filter info messages logging.basicConfig(level='INFO') heartBea...
StarcoderdataPython
3265123
import login.config as config import pytest import argparse try: # For Python 3.5 and later import configparser except ImportError: # Fall back to Python 2 import ConfigParser as configparser # noqa: F401 args = {'profile': 'test-profile', 'web_console_login': True, 'print_auth_url': ...
StarcoderdataPython
3325057
#coding=UTF-8 ''' Created on 2012-10-12 @author: s00228753 ''' class Grantee(object): def __init__(self, grantee_id = None, grantee_name = None, group = None): self.grantee_id = grantee_id self.grantee_name = grantee_name self.group = group #================================...
StarcoderdataPython
1685826
<gh_stars>1-10 # encoding: utf-8 # module QuantConnect.API calls itself API # from QuantConnect.Common, Version=2.4.0.0, Culture=neutral, PublicKeyToken=null # by generator 1.145 # no doc # imports import datetime import Newtonsoft.Json import Newtonsoft.Json.Linq import QuantConnect import QuantConnect.API import Qua...
StarcoderdataPython
101240
<filename>sdk/python/pulumi_google_native/cloudsearch/v1/_inputs.py<gh_stars>10-100 # coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing imp...
StarcoderdataPython
3355308
<reponame>rsdoherty/azure-sdk-for-python<filename>sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_event_grid_publisher_client_enums.py # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under...
StarcoderdataPython
1684792
<reponame>frostspb/torskel<gh_stars>10-100 """ Writing evet logs into base """ import tornado.log from tornado.queues import Queue from tornado.options import options class TorskelEventLogController: """ Class for write events """ def __init__(self): self.logger = tornado.log.gen_log ...
StarcoderdataPython
34146
<gh_stars>100-1000 from typing import cast, List, Optional, Tuple import h11 import pytest from wsproto import WSConnection from wsproto.connection import SERVER from wsproto.events import ( AcceptConnection, Event, RejectConnection, RejectData, Request, ) from wsproto.extensions import Extension ...
StarcoderdataPython
184725
from xml.dom import minidom import os import numpy as np #Pre-define parameters EMPTY_CELL = 20 AGENT_CELL = 1 class Create_XML(): def __init__(self): #create file self.root = minidom.Document() self.xml = self.root.createElement('mujoco') self.root.appendChild(self.xml) ...
StarcoderdataPython
3317678
<gh_stars>1-10 from zeit.cms.i18n import MessageFactory as _ import html import json import logging import pkg_resources import six import xml.sax.saxutils import zeit.cms.browser.form import zeit.cms.browser.view import zope.browserpage import zope.formlib.form import zope.i18n import zope.viewlet.manager import zope....
StarcoderdataPython
3262930
from __future__ import annotations import dataclasses import logging import os import sys import time from typing import TYPE_CHECKING, Dict, Iterator, List, Tuple import click if TYPE_CHECKING: import mypy_boto3_ec2.service_resource as ec2_resources from mypy_boto3_cloudwatch.client import CloudWatchClient ...
StarcoderdataPython
1706960
<filename>biolopy/db/phylo.py from __future__ import annotations import logging import re from collections.abc import Callable, Iterable, Iterator from typing import NamedTuple, TypeAlias from ..util import cli _log = logging.getLogger(__name__) def main(argv: list[str] = []): parser = cli.logging_argparser() ...
StarcoderdataPython
3280235
<filename>sarpy/io/general/nitf_elements/nitf_head.py """ The main NITF header definitions. """ import logging from .base import NITFElement, UserHeaderType, _IntegerDescriptor,\ _StringDescriptor, _StringEnumDescriptor, _NITFElementDescriptor, _RawDescriptor, \ _ItemArrayHeaders from .security import NITFSec...
StarcoderdataPython
3299938
<filename>profiles_api/urls.py<gh_stars>0 from django.urls import path, include from rest_framework.routers import DefaultRouter from .views import HelloApiView, HelloViewSet, UserProfileViewSet, UserLoginApiView app_name = 'profiles_api' router = DefaultRouter() router.register('hello-viewset', HelloViewSet, basenam...
StarcoderdataPython
1607493
# ElectrumSV - lightweight Bitcoin SV client # Copyright (C) 2011 <EMAIL> # Copyright (C) 2017 <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 restriction, # including withou...
StarcoderdataPython
1717102
<filename>pyexphys/cardio/__init__.py<gh_stars>1-10 import cardiac import energy import respiration
StarcoderdataPython
198362
<gh_stars>0 from typing import Optional import requests from countapi.common import ( API_BASE, NotOKError, filter_params, int_from_optional_bool, ) class CreateResponse: namespace: str key: str value: int def __init__(self, namespace: str, key: str, value: int) -> None: sel...
StarcoderdataPython
1624871
import os from keras.models import * from keras.layers import * from keras.applications import * from keras import backend as K import tensorflow as tf import mtcnn_detect_face def emotion_recognition_model(weight_path): base_model = MobileNet(weights=None, include_top=False, input_shape=(128, 128, 3)) ...
StarcoderdataPython
4822652
# OpenMM-based potential energy term. # It can be added to any other force field. from MMTK.ForceFields.ForceField import ForceField, EnergyTerm from MMTK import ParticleScalar, ParticleVector, SymmetricPairTensor import simtk.openmm import simtk.openmm.app as OpenMM_app import numpy as np try: from Scientific._ve...
StarcoderdataPython
4833567
#%% import pandas as pd import numpy as np from datetime import datetime import os import pickle # List down file paths #dir_data = "../smoking-lvm-cleaned-data/final" exec(open('../env_vars.py').read()) dir_data = os.environ['dir_data'] dir_picklejar = os.environ['dir_picklejar'] # Read in data data_dates = pd.read...
StarcoderdataPython
3218903
<reponame>jnthn/intellij-community 0 < x and True and x < 2
StarcoderdataPython
1709676
import os.path as osp import os import logging import sys from subprocess import PIPE, Popen from threading import Thread, Lock from datetime import timedelta, datetime import time import glob import shutil try: from Queue import Queue, Empty except ImportError: from queue import Queue, Empty # python 3.x...
StarcoderdataPython
1722873
import tkinter as tk # Used for main gui import tkinter.ttk as ttk # Used for pretty widgets import tkinter.messagebox as msg # Used for gui messages import tkinter.filedialog # Used for gui filedialog import os # Create files, search directories import shutil ...
StarcoderdataPython
72435
<filename>steps/step49.py if '__file__' in globals(): import os, sys sys.path.append(os.path.join(os.path.dirname(__file__), '..')) import math import numpy as np import dezero import dezero.functions as F from dezero import optimizers from dezero.models import MLP max_epoch = 300 batch_size = 30 hidden_size ...
StarcoderdataPython
3271356
import numpy as np import tensorflow as tf from config import FLAGS class RNN(object): def __init__(self, train=True, ru=False): with tf.variable_scope("RNN_Network", reuse=ru): with tf.name_scope("Placeholders"): self.decoder_input = tf.placeholder(tf.int32, ...
StarcoderdataPython
3375363
<reponame>pshn111/CMPUT-366 #!/usr/bin/env python """ """ import numpy.random as rnd def rand_in_range(max): # returns integer, max: integer return rnd.randint(max) def rand_un(): # returns floating point return rnd.uniform() def rand_norm (mu, sigma): # returns floating point, mu: floating point, sigma:...
StarcoderdataPython
3236881
# Copyright (c) 2021, 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 of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
StarcoderdataPython
119888
<reponame>dstufft/buffbot # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'gui/AddSpell.ui' # # Created by: PyQt5 UI code generator 5.15.1 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. ...
StarcoderdataPython
3288370
<gh_stars>0 # -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-06-25 14:53 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('events', '0004_auto_20170625_1318'), ] operations = [ migration...
StarcoderdataPython