text
string
size
int64
token_count
int64
from django.core.management.base import BaseCommand, CommandError from django.conf import settings from porthole import models, brocade class Command(BaseCommand): help = "Command the Brocade switch stacks" args = "" requires_system_checks = False def add_arguments(self, parser): parser.add_...
846
245
"""Tests joulia.unit_conversions. """ from django.test import TestCase from joulia import unit_conversions class GramsToPoundsTest(TestCase): def test_grams_to_pounds(self): self.assertEquals(unit_conversions.grams_to_pounds(1000.0), 2.20462) class GramsToOuncesTest(TestCase): def test_grams_to_ou...
410
166
from django.contrib.auth.models import User from django.test import TestCase from blog.models import Category, Post class Test_Create_Post(TestCase): @classmethod def setUpTestData(cls): test_category = Category.objects.create(name='django') testuser1 = User.objects.create_user( ...
1,127
346
from pathlib import Path from hylfm.hylfm_types import ( CriterionChoice, DatasetChoice, LRSchedThresMode, LRSchedulerChoice, MetricChoice, OptimizerChoice, PeriodUnit, ) from hylfm.model import HyLFM_Net from hylfm.train import train if __name__ == "__main__": train( dataset=...
2,504
1,153
import os import pickle from PIL import Image class PatientToImageFolder: def __init__(self, sourceFolder): self.sourceFolder = sourceFolder # How many patient with contrast SA for each pathology (used for classification) self.contrastSApathologyDict = {} # How many patient with c...
17,055
4,749
import pandas as pd import numpy as np import pickle from sklearn.cross_validation import train_test_split from sklearn.linear_model import LinearRegression from sklearn.metrics import mean_squared_error from math import sqrt from sklearn.svm import SVR from sklearn.svm import LinearSVR from sklearn.preprocessing imp...
2,140
842
import numpy as np import serial import time import matplotlib.pyplot as plt def getData(): ser = serial.Serial('/dev/ttyACM7', 9600) sensorReadings = [] start = time.time() current = time.time() while current - start < 10: data =ser.readline() sensorReadings.append(floa...
602
205
from CMText.TextClient import TextClient # Message to be send message = 'Examples message to be send' # Media to be send media = { "mediaName": "conversational-commerce", "mediaUri": "https://www.cm.com/cdn/cm/cm.png", "mimeType": "image/png" } # AllowedChannels in this ca...
732
249
import pygame from pygame.math import Vector2 class Sound: def __init__(self, manager, snd, volume=1.0): self.manager = manager self.snd = pygame.mixer.Sound(snd) self.snd.set_volume(1.0) self.ttl = snd.get_length() self.playing = True ...
2,630
770
# Copyright 2021 Mohammad Kazemi <kazemi.me.222@gmail.com>. # SPDX-License-Identifier: MIT # Telegram API framework core imports from collections import namedtuple from functools import partial from ganjoor.ganjoor import Ganjoor from telegram.ext import Dispatcher, CallbackContext from telegram import Update # Helper...
1,353
434
import os import sys import struct import re import logging logging.basicConfig(stream=sys.stderr, level=logging.DEBUG) logger = logging.getLogger(__name__) def list_to_md(str_list): output = "" for str in str_list: output = output + "* %s \n" % str return output def str_to_md_list(the_str, sep)...
457
156
import uos as os import time def countdown(): for i in range(5, 0, -1): print("start stubbing in {}...".format(i)) time.sleep(1) import createstubs # import stub_lvgl try: # only run import if no stubs yet os.listdir("stubs") print("stub folder was found, stubbing is not aut...
374
125
# Copyright (C) 2013 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 ...
5,110
1,670
#!/usr/bin/python3 # -*- coding: utf-8 -*- from subprocess import Popen, PIPE emojis="""โ›‘๐Ÿป Helmet With White Cross, Type-1-2 โ›‘๐Ÿผ Helmet With White Cross, Type-3 โ›‘๐Ÿฝ Helmet With White Cross, Type-4 โ›‘๐Ÿพ Helmet With White Cross, Type-5 โ›‘๐Ÿฟ Helmet With White Cross, Type-6 ๐Ÿ’๐Ÿป Kiss, Type-1-2 ๐Ÿ’๐Ÿผ Kiss, Type-3 ๐Ÿ’๐Ÿฝ Kiss,...
257,168
215,277
#!/usr/bin/env python """ ngc - n-grams count License: 3-clause BSD (see https://opensource.org/licenses/BSD-3-Clause) Author: Hubert Tournier """ import getopt import logging import os import re import string import sys import unicode2ascii # Version string used by the what(1) and ident(1) commands: ID = "@(#) $Id:...
19,186
5,560
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2012-2016 GEM Foundation # # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the Licen...
3,104
1,293
# -*- coding: utf-8 -*- """Time Series Forest Regressor (TSF).""" __author__ = ["Tony Bagnall", "kkoziara", "luiszugasti", "kanand77", "Markus Lรถning"] __all__ = ["TimeSeriesForestRegressor"] import numpy as np from joblib import Parallel, delayed from sklearn.ensemble._forest import ForestRegressor from sklearn.tree...
3,713
1,126
""" Django settings for vectorc2 project. Copyright 2019 Sebastian Ryszard Kruk <vectorc2@kruk.me> 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-...
7,766
2,737
from torchvision.datasets.folder import pil_loader, accimage_loader, default_loader from torch import Tensor from pathlib import Path from enum import Enum from collections import namedtuple from torchvision import transforms as T import os import numpy as np import pdb import functools import torch.utils.data as dat...
7,802
2,432
#!/usr/bin/python # # So this script is in a bit of a hack state right now. # This script reads # # # # Graciously copied and modified from: # http://graphics.cs.cmu.edu/projects/im2gps/flickr_code.html #Image querying script written by Tamara Berg, #and extended heavily James Hays #9/26/2007 added dynamic timesli...
16,223
4,704
import os import sys from pyspark.sql.types import * PATH = "/home/ubuntu/work/ml-resources/spark-ml/data" SPARK_HOME = "/home/ubuntu/work/spark-2.0.0-bin-hadoop2.7/" os.environ['SPARK_HOME'] = SPARK_HOME sys.path.append(SPARK_HOME + "/python") from pyspark import SparkContext from pyspark import SparkConf from pyspa...
2,695
853
""" """ from rest_framework import routers from safemasks.resources.rest.serializers import SupplierViewSet, TrustedSupplierViewSet # Routers provide an easy way of automatically determining the URL conf. ROUTER = routers.DefaultRouter() ROUTER.register(r"suppliers", SupplierViewSet, "suppliers") ROUTER.register(r"s...
384
119
############################################################################## # # Copyright (c) 2004-2008 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THI...
47,925
13,868
# Generated by Django 2.2 on 2021-09-11 04:58 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('waterApp', '0010_auto_20210911_1041'), ] operations = [ migrations.AlterField( model_name='gwmonitoring', name='id', ...
410
149
"""The Stratified Space Geometry Package."""
45
13
from django.core.management import BaseCommand import logging # These two lines enable debugging at httplib level (requests->urllib3->http.client) # You will see the REQUEST, including HEADERS and DATA, and RESPONSE with HEADERS but without DATA. # The only thing missing will be the response.body which is not logged. ...
928
261
from functools import partial import os import pytest import dask import dask.array as da from dask.utils_test import inc from dask.highlevelgraph import HighLevelGraph, BasicLayer, Layer from dask.blockwise import Blockwise from dask.array.utils import assert_eq def test_visualize(tmpdir): pytest.importorskip(...
4,179
1,566
# Requires pip install bitarray from bitarray import bitarray import argparse, math def derive_transfer_function(pTransferFunctionString: str) -> list: lTransferFunction = list(map(int, pTransferFunctionString.split(','))) lTransferFunctionValid = True lLengthTransferFunction = len(lTransferFunction) ...
4,612
1,451
import pytest from aiospamc.client import Client from aiospamc.exceptions import ( BadResponse, UsageException, DataErrorException, NoInputException, NoUserException, NoHostException, UnavailableException, InternalSoftwareException, OSErrorException, OSFileException, CantCre...
6,264
1,987
import os import tempfile import importlib import pytest import astropy import astropy.config.paths # Force MPL to use non-gui backends for testing. try: import matplotlib except ImportError: pass else: matplotlib.use('Agg') # Don't actually import pytest_remotedata because that can do things to the # e...
3,534
1,156
''' Models for QtWidgets ''' from collections import deque from math import ceil import datetime as dt import calendar class EventInCalendar__Model: class Text: @staticmethod def getDefault(): return EventInCalendar__Model.Text() def __init__(self, event=None, overflow=Fal...
10,165
3,244
# # Copyright 2016 The BigDL Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
5,457
1,586
#!/usr/bin/env python3 import sys import getopt import xml.etree.ElementTree as ET def processVendors(outFile, vendors): outFile.writelines(["\nconstexpr std::array<std::string_view, ", str( len(vendors)), "> vendors = {{\n"]) for vendor in vendors: outFile.writelines([' \"', vendor.tag, '\"...
20,180
6,471
#!/usr/bin/env python # -*- coding: utf-8 -*- # File : Ampel-core/ampel/cli/AbsStockCommand.py # License : BSD-3-Clause # Author : vb <vbrinnel@physik.hu-berlin.de> # Date : 25.03.2021 # Last Modified Date: 25.03.2021 # Last Modified By : vb <vbrinnel@physik.hu-berlin.de>...
5,629
2,035
from typing import List def solution(records: List[str]): logger = [] id_name = dict() message = {"Enter": "๋‹˜์ด ๋“ค์–ด์™”์Šต๋‹ˆ๋‹ค.", "Leave": "๋‹˜์ด ๋‚˜๊ฐ”์Šต๋‹ˆ๋‹ค."} for record in records: op, id, *name = record.split() if name: id_name[id] = name[0] if op in message: logger....
682
267
""" Implementation of REST API for nets creation """ from flask import Blueprint, request from .utils import typename_to_type from .contexts import contexts nr = Blueprint('nets', __name__) def _create_bool_constant(func): context = request.get_json()['context'] if context is None: return {'result': '...
7,081
2,540
# Copyright 2019 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 required by applica...
3,091
1,107
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for charge.py""" from __future__ import print_function from __future__ import unicode_literals from __future__ import division import logging from rdkit import Chem from molvs.standardize import Standardizer, standardize_smiles from molvs.charge import Reionizer...
5,624
2,468
from django.shortcuts import render from django.core import serializers from .models import User from django.forms.models import model_to_dict from rest_framework import status from rest_framework.response import Response from rest_framework.decorators import api_view, permission_classes from rest_framework.permissions...
1,921
605
# -*- coding: utf-8 -*- from pytest import raises from astral import Astral, AstralError, Location import datetime import pytz def datetime_almost_equal(datetime1, datetime2, seconds=60): dd = datetime1 - datetime2 sd = (dd.days * 24 * 60 * 60) + dd.seconds return abs(sd) <= seconds def test_Location_N...
4,134
1,668
from .jsonc import load, loads, dump, dumps
44
15
########################################################################## # # Copyright 2008-2009 VMware, Inc. # All Rights Reserved. # # 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 withou...
12,648
6,530
__version__ = '4.64.0'
23
14
import gym from gym import spaces, error, utils from gym.utils import seeding import numpy as np import configparser from os import path import matplotlib.pyplot as plt from matplotlib.pyplot import gca font = {'family': 'sans-serif', 'weight': 'bold', 'size': 14} class MappingEnv(gym.Env): def ...
10,188
3,771
# Copyright 2018 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 required by applica...
10,478
3,693
import multiprocessing as mp import subprocess import shutil import os from ..helper import make_path_safe, thirdparty_binary, filter_scp from ..exceptions import CorpusError def mfcc_func(directory, job_name, mfcc_config_path): # pragma: no cover log_directory = os.path.join(directory, 'log') raw_mfcc_path...
10,970
3,245
""" A number of static methods for interpretting the state of the fantasy football pitch that aren't required directly by the client """ from ffai.core import Game, Action, ActionType from ffai.core.procedure import * from ffai.util.pathfinding import * from typing import Optional, List, Dict class ActionSequence: ...
19,640
6,775
# -*- coding: utf-8 -*- """sb-fastapi CLI root.""" import logging import click from sb_backend.cli.commands.serve import serve @click.group() @click.option( "-v", "--verbose", help="Enable verbose logging.", is_flag=True, default=False, ) def cli(**options): """sb-fastapi CLI root.""" if ...
601
222
import dash from dash import html app = dash.Dash(__name__) app.layout = html.Div(children=[html.H1('Data Science', style = {'textAlign': 'center', 'color': '#0FD08D', 'font-size': '...
1,379
362
# -*- coding: utf-8 -*- ################################################################################### from gluon import current from helper import get_constant, execute_remote_cmd, config, get_datetime, \ log_exception, is_pingable, get_context_path from libvirt import * # @UnusedWildImport from log_handler ...
75,380
23,502
# 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. """This module wraps the Android Asset Packaging Tool.""" import os from devil.utils import cmd_helper from pylib import constants _AAPT_PATH = os.path.jo...
1,152
380
setvar('nsamples', getvar('a') + getvar('b'))
46
19
"""Core recipes for Psi4""" from __future__ import annotations from dataclasses import dataclass from typing import Any, Dict from ase.atoms import Atoms from ase.calculators.psi4 import Psi4 from jobflow import Maker, job from monty.dev import requires try: import psi4 except: psi4 = None from quacc.schemas...
2,218
689
#Main Program from Class import Barang import Menu histori = list() listBarang = [ Barang('Rinso', 5000, 20), Barang('Sabun', 3000, 20), Barang('Pulpen', 2500, 20), Barang('Tisu', 10000, 20), Barang('Penggaris', 1000, 20) ] while True: print(''' Menu 1. Tampilkan Barang 2. Tambahkan Barang 3. Ta...
984
460
#coding:utf-8 import numpy as np import tensorflow as tf import os import time import datetime import ctypes import threading import json ll1 = ctypes.cdll.LoadLibrary lib_cnn = ll1("./init_cnn.so") ll2 = ctypes.cdll.LoadLibrary lib_kg = ll2("./init_know.so") class Config(object): def __init__(self): self.in...
13,010
6,029
#!/usr/bin/env python3 """get tag from http://demo.illustration2vec.net/.""" # note: # - error 'ERROR: Request Entity Too Large' for file 1.1 mb # <span style="color:red;">ERROR: Request Entity Too Large</span> from collections import OrderedDict from pathlib import Path from pprint import pformat import imghdr import ...
7,468
2,462
"""Functions for builtin CherryPy tools.""" import logging import re from hashlib import md5 import six from six.moves import urllib import cherrypy from cherrypy._cpcompat import text_or_bytes from cherrypy.lib import httputil as _httputil from cherrypy.lib import is_iterator # Conditional HTT...
23,443
6,851
'''Utility functions''' import multiprocessing from .globalVariables import * def readMathIOmicaData(fileName): '''Read text files exported by MathIOmica and convert to Python data Parameters: fileName: str Path of directories and name of the file containing data ...
3,216
1,036
#! /usr/bin/env python #adam-does# runs SeeingClearly to get the seeing and rms of the image, then uses those to get sextractor thresholds for CR detection #adam-use# use with CRNitschke pipeline #adam-call_example# call it like ./get_sextract_thresholds.py /path/flname.fits output_file.txt #IO stuff: import sys ; sys...
4,041
1,825
import time import multiprocessing class Session: def __init__(self, *, labbox_config, default_feed_name: str): self._labbox_config = labbox_config pipe_to_parent, pipe_to_child = multiprocessing.Pipe() self._worker_process = multiprocessing.Process(target=_run_worker_session, args=(pipe_...
2,843
800
# -*- coding: utf-8 -*- from __future__ import unicode_literals from unittest import skipIf try: from django.core.urlresolvers import reverse except ModuleNotFoundError: from django.urls import reverse from django.db import transaction from aldryn_reversion.core import create_revision as aldryn_create_revisio...
8,114
2,338
# Library for the dynamics of a lumen network # The lumen are 2 dimensional and symmetric and connected with 1 dimensional tubes # # Created by A. Mielke, 2018 # Modified by M. Le Verge--Serandour on 8/04/2019 """ network.py conf.init Defines the class network and associated functions Imports ...
38,971
10,163
# Illustrate upsampling in 2d # Code from Jason Brownlee # https://machinelearningmastery.com/generative_adversarial_networks/ import tensorflow as tf from tensorflow import keras from numpy import asarray #from keras.models import Sequential from tensorflow.keras.models import Sequential #from keras.layers import...
943
372
__all__ = ['scaffold', 'command_set'] from gevent import monkey monkey.patch_all() import csv import os import sys import time import shutil from typing import List import gevent from src.BusinessCentralLayer.setting import logger, DEFAULT_POWER, CHROMEDRIVER_PATH, \ REDIS_MASTER, SERVER_DIR_DATABASE_CACHE, SE...
17,334
6,370
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2016 Daniel Estevez <daniel@destevez.net>. # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either in source code form or as a compiled ...
2,336
786
#!/usr/bin/python # # Start dfplayer. import argparse import os import shutil import subprocess import sys import time _PROJ_DIR = os.path.dirname(__file__) def main(): os.chdir(_PROJ_DIR) os.environ['LD_LIBRARY_PATH'] = '/lib:/usr/lib:/usr/local/lib' arg_parser = argparse.ArgumentParser(description='Star...
2,149
776
def attack(): pass def defend(): pass def pass_turn(): pass def use_ability_One(kit): pass def use_ability_Two(kit): pass def end_Of_Battle(): pass
176
66
#!/usr/bin/env python3 # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
3,368
1,050
import argparse import models model_names = sorted(name for name in models.__dict__ if name.islower() and not name.startswith("__") and callable(models.__dict__[name])) class BaseOptions(): def __init__(self): self.parser = argparse.ArgumentParser(formatter_class...
3,159
878
from flask import Flask, Response from flask_basicauth import BasicAuth from flask_cors import CORS, cross_origin import os #from flask_admin import Admin,AdminIndexView #from flask_admin.contrib.sqla import ModelView from flask_sqlalchemy import SQLAlchemy as _BaseSQLAlchemy from flask_migrate import Migrate, Migr...
2,277
749
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.core.management import BaseCommand from cobl.lexicon.models import LanguageList, \ MeaningList, \ Meaning, \ Lexeme, \ ...
8,438
2,313
import pandas as pd from icu import Collator, Locale, RuleBasedCollator ddf = pd.read_csv("../word_frequency/unilex/din.txt", sep='\t', skiprows = range(2,5)) collator = Collator.createInstance(Locale('en_AU.UTF-8')) # https://stackoverflow.com/questions/13838405/custom-sorting-in-pandas-dataframe/27009771#27009771 ...
1,809
916
# Python import unittest from copy import deepcopy from unittest.mock import Mock # ATS from pyats.topology import Device # Genie from genie.libs.ops.dot1x.ios.dot1x import Dot1X from genie.libs.ops.dot1x.ios.tests.dot1x_output import Dot1xOutput # Parser from genie.libs.parser.ios.show_dot1x import ShowDot1xAllDeta...
3,495
1,139
# ====================================================================== # copyright 2020. Triad National Security, LLC. All rights # reserved. This program was produced under U.S. Government contract # 89233218CNA000001 for Los Alamos National Laboratory (LANL), which # is operated by Triad National Security, LLC for ...
5,218
2,070
from dataclasses import dataclass @dataclass class Channel: id: str
73
22
# -*- coding: utf-8 -*- ########################################################################## # NSAp - Copyright (C) CEA, 2020 # Distributed under the terms of the CeCILL-B license, as published by # the CEA-CNRS-INRIA. Refer to the LICENSE file or to # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html #...
13,174
4,711
# Copyright 2018 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 required by applica...
7,587
2,153
# from PyQt5.QtWidgets import QMessageBox # def raise_error(message: str = "DEFAULT:Error Description:More Information"): # box = QMessageBox() # kind, msg, info = message.split(":") # box.setIcon(QMessageBox.Critical) # box.setWindowTitle(kind + " Error") # box.setText(msg) # box.setInformati...
351
122
""" 759. Employee Free Time We are given a list schedule of employees, which represents the working time for each employee. Each employee has a list of non-overlapping Intervals, and these intervals are in sorted order. Return the list of finite intervals representing common, positive-length free time for all employe...
3,182
962
import os, yaml config = { 'debug': False, 'port': 5000, 'store_path': '/var/storitch', 'pool_size': 5, 'logging': { 'level': 'warning', 'path': None, 'max_size': 100 * 1000 * 1000,# ~ 95 mb 'num_backups': 10, }, 'image_exts': [ '.jpg', '.jpeg', '.png...
1,333
457
import io import os import numpy as np import pandas import json import logging #<== Optional. Log to console, file, kafka from pipeline_monitor import prometheus_monitor as monitor #<== Optional. Monitor runtime metrics from pipeline_logger import log import tenso...
3,727
1,058
import argparse import importlib import os import re import signal import subprocess import sys import time import logging from act.common import aCTLogger from act.common.aCTConfig import aCTConfigAPP from act.arc import aCTDBArc class aCTReport: '''Print summary info on jobs in DB. Use --web to print html that ...
9,465
2,827
from rest_framework.test import APITestCase, APIClient from django.urls import reverse from rest_framework.authtoken.models import Token class UserTest(APITestCase): """ Test the User APIv2 endpoint. """ fixtures = ['dojo_testdata.json'] def setUp(self): token = Token.objects.get(user__us...
3,477
1,156
from flask import Flask from src.models import db from . import config def create_app(): flask_app = Flask(__name__) flask_app.config['SQLALCHEMY_DATABASE_URI'] = config.DATABASE_CONNECTION_URI flask_app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False flask_app.app_context().push() db.init_app(f...
371
134
from dependencies import Injector from dependencies import this from dependencies.contrib.celery import shared_task from examples.order.commands import ProcessOrder @shared_task class ProcessOrderTask(Injector): name = "process_order" run = ProcessOrder bind = True retry = this.task.retry
310
84
ano = int(input('Digite o ano: ')) if (ano%4) == 0: print ('Ele รฉ bissexto') else: print ('Ele nรฃo รฉ bissexto')
115
53
__version__ = '0.0.1' __license__ = 'BSD'
42
23
from datetime import timedelta from typing import Union, List, Optional import click import pandas as pd from flask import current_app as app from flask.cli import with_appcontext from flexmeasures import Sensor from flexmeasures.data import db from flexmeasures.data.schemas.generic_assets import GenericAssetIdField ...
7,655
2,294
mail_settings = { "MAIL_SERVER": 'smtp.gmail.com', "MAIL_PORT": 465, "MAIL_USE_TLS": False, "MAIL_USE_SSL": True, "MAIL_USERNAME": 'c003.teste.jp@gmail.com', "MAIL_PASSWORD": 'C003.teste' }
216
107
#!/usr/bin/env python3.6 # -*- encoding=utf8 -*- import pyquery """ ้œ€ๆฑ‚ๅญ—ๆฎต๏ผš ๆจ™้กŒใ€็™ผ่กจๆ—ฅๆœŸใ€ๅˆ†้กžใ€ๆจ™็ฑคใ€ๅ…งๅฎนใ€ๅœ–็‰‡ ้œ€่ฆ็š„ๅญ—ๆฎตไฟกๆฏ 1. ็ฝ‘็ซ™ๆ นURL 2. ่งฃๆžๅ™จๅๅญ— 3. ่งฃๆžๅ™จ็ฑปๅž‹ 1. PARSER_PASSAGE_URL ๆ–‡็ซ URL 2. PARSER_PASSAGE_TITLE ๆ–‡็ซ ๆ ‡้ข˜ 3. PARSER_PASSAGE_DATE ...
3,071
1,051
#!/usr/bin/env python3 # ---------------------------------------------------------------------------- # Copyright 2019 Drunella # # 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:/...
6,341
2,140
# SPDX-License-Identifier: BSD-3-Clause """ Text decode functions. These functions can be used to get Unicode strings from a series of bytes. """ from codecs import ( BOM_UTF8, BOM_UTF16_BE, BOM_UTF16_LE, BOM_UTF32_BE, BOM_UTF32_LE, CodecInfo, lookup as lookup_codec, ) from collections im...
5,079
1,514
import os import json import gzip from copy import deepcopy, copy import numpy as np import csv import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data import Dataset, DataLoader, RandomSampler from transformers.tokenization_utils import trim_batch class LabelSmoothingLoss(nn.Module)...
43,000
13,685
from typing import Dict from rest_framework import serializers from rest_framework.fields import empty from rest_framework.relations import ManyRelatedField from rest_framework.request import Request from .mixins import BridgerSerializerFieldMixin from .types import BridgerType, ReturnContentType class BridgerManyR...
3,484
1,003
import networkx.algorithms.operators.tests.test_product import pytest from graphscope.experimental.nx.utils.compat import import_as_graphscope_nx import_as_graphscope_nx(networkx.algorithms.operators.tests.test_product, decorators=pytest.mark.usefixtures("graphscope_session")) def test_tenso...
1,198
463
# {team} -> Name of team # {name} -> Name of person who supports team teamMatchStarted: list[str] = [ "{team} are shit", "{team} cunts", "Dirty {team}", "Dirty {team}, dirty {name}", ] drawing: list[str] = [ "{team} level, this is a shit match", "Boring old {team}", "Happy with how it's go...
4,574
1,535
from bench import bench print(bench(100, ''' def fib(n): return n if n < 2 else fib(n-1) + fib(n-2) ''', ''' fib(20) '''))
128
63
# coding=utf-8 from nlpir.native.nlpir_base import NLPIRBase from ctypes import c_bool, c_char_p, c_int, POINTER, Structure, c_float class StDoc(Structure): __fields__ = [ ("sTitle", c_char_p), ("sContent", c_char_p), ("sAuthor", c_char_p), ("sBoard", c_char_p), ("sDatatype...
3,271
1,426
# -*- coding: utf-8 -*- import pytest from mock import Mock from bravado_core.exception import SwaggerMappingError from bravado_core.operation import Operation from bravado_core.param import get_param_type_spec from bravado_core.param import Param from bravado_core.spec import Spec @pytest.fixture def body_param_spe...
1,875
611
# Copyright (c) 2019 Princeton University # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from markdown import markdown import base64 import json import base64 def main(params): try: md = json.loads(base64.decodebytes(params["__...
682
227