text
string
size
int64
token_count
int64
import discord from discord.ext import commands from .utils import checks from .utils.dataIO import dataIO from __main__ import send_cmd_help from __main__ import settings from datetime import datetime from random import choice from random import sample from copy import deepcopy from collections import namedt...
22,727
9,568
"""Citizens model.""" # Django from django.db import models from django.contrib.auth.models import AbstractUser from django.core.validators import RegexValidator # models from paranuara.companies.models import Company # PostgreSQL fields from django.contrib.postgres.fields import JSONField # Utilities from paranuar...
2,839
891
# -*- coding: utf-8 -*- from cobra.utils import normalize def norm(data): return normalize(data)
103
40
class DispatchConfig: def __init__(self, raw_config): self.registered_commands = {} for package in raw_config["handlers"]: for command in package["commands"]: self.registered_commands[command] = { "class": package["class"], "fullpat...
597
151
import pygame from chess.board import Board from .variable_declaration import black_piece, white_piece, position_piece, board_square_size class Rules: def __init__(self, window): self._init() self.window = window def update(self): self.chess_board.draw_pieces(self.window) self...
2,442
763
import numpy as np from kivygames.games import Game import kivygames.games.noughtsandcrosses.c as c class CellOccupiedError(Exception): pass class NoughtsAndCrosses(Game): minPlayers = 2 maxPlayers = 2 hasAI = True gridShape = (3, 3) def __init__(self): Game.__init__(self) ...
1,542
468
#! /usr/bin/env python import argparse import json import time import urllib.error import urllib.request def main(): parser = argparse.ArgumentParser(description="Download agents from pplapi.com") parser.add_argument("-c", "--count", type=int, default=10, help="Number of agents to download.") parser.add_a...
1,206
381
import functools import re import asyncio from io import BytesIO from discord.ext import commands import discord from Utils import canvas import random class Images: """ Contains commands for manipulation of images. """ def __init__(self, bot): self.bot = bot self.imageClient = canvas...
3,681
1,102
# -*- coding: utf-8 -*- from __future__ import unicode_literals from appconf import AppConf from django.conf import settings # noqa class LabjsConf(AppConf): ENABLED = not settings.DEBUG DEBUG_TOGGLE = 'labjs'
223
78
import awkward as ak from coffea.nanoevents.methods import vector import pytest ATOL = 1e-8 def record_arrays_equal(a, b): return (ak.fields(a) == ak.fields(b)) and all(ak.all(a[f] == b[f]) for f in ak.fields(a)) def test_two_vector(): a = ak.zip( { "x": [[1, 2], [], [3], [4]], ...
10,416
4,664
import roadrunner import teplugins as tel i = 0 #for i in range(100): try: noisePlugin = tel.Plugin ("tel_add_noise") print noisePlugin.listOfProperties() # Create a roadrunner instance rr = roadrunner.RoadRunner() rr.load("sbml_test_0001.xml") # Generate data data = rr.simulate(0, 10, 51...
900
313
from renpy import store class Labels(store.object): """Controls how the labels that display Encyclopaedia data appear. Attributes: percentage_label (str): Placed next to the percentage unlocked number page_label (str): Placed before the entry page displayed page_separator_label (str):...
2,954
857
import logging from ncservice.ncDeviceOps.nc_device_ops import NcDeviceOps from ncservice.ncDeviceOps.task_report import TaskReport from ncservice.ncDeviceOps.threaded.base_thread_class import BaseThreadClass logger = logging.getLogger('main.{}'.format(__name__)) extra = {'signature': '---SIGNATURE-NOT-SET---'} clas...
1,816
515
""" This program visualizes nested for loops by printing number 0 through 3 and then 0 through 3 for the nested loop. """ for i in range(4): print("Outer for loop: " + str(i)) for j in range(4): print(" Inner for loop: " + str(j))
258
88
from collections import defaultdict import graphene import pytest from django.core.exceptions import ValidationError from ....shipping.error_codes import ShippingErrorCode from ..mutations import BaseChannelListingMutation def test_validate_duplicated_channel_ids(channel_PLN, channel_USD): # given channel_i...
4,657
1,543
# -*- coding: utf-8 -*- # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # # Authors: Luc LEGER / Coopérative ARTEFACTS <artefacts.lle@gmail.com> import requests from django.conf import settings from django.contrib impor...
9,843
2,911
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. import socket from twisted.persisted import styles from twisted.internet.base import BaseConnector from twisted.internet import defer, interfaces, error from twisted.python import failure from abstract import ConnectedSocket from ops ...
5,173
1,471
import unittest from pypika import Table from pypika.analytics import Count from pypika.dialects import MSSQLQuery from pypika.utils import QueryException class SelectTests(unittest.TestCase): def test_normal_select(self): q = MSSQLQuery.from_("abc").select("def") self.assertEqual('SELECT "def" ...
2,678
977
import cvxpy as cvx import numpy as np from collections import namedtuple from metric import metric, cd import pandas as pd import sys from helper import make_dataset class Model(namedtuple('Model', 'pred label')): def logits(self): raw_logits = np.clip(np.log(self.pred / (1 - self.pred)), -100, 100) ...
14,860
5,582
import unittest import os import subprocess import base class ExceptionTestCase(base.GenericUtilities, unittest.TestCase): """This class contains a bunch of tests to make sure that textract fails in expected ways. """ def test_unsupported_extension_cli(self): """Make sure unsupported extensi...
1,632
442
"""Queue implementation using circularly linked list for storage.""" class CircularQueue: """Queue implementation using circularly linked list for storage.""" class _Node: """Lightweight, nonpublic class for storing a singly linked node.""" __slots__ = '_element', '_next' def __init__...
1,998
539
# -*- encoding: utf-8 """ Various helper constants and functions. """ import os import re import sys import time import traceback def curr_time(): """Current time in %H:%M""" return time.strftime("%H:%M") def curr_time_sec(): """Current time in %H:%M:%S""" return time.strftime("%H:%M:%S") def mul...
1,389
490
""" :mod:`meshes` -- Discretization =============================== Everything related to meshes appropriate for the multigrid solver. """ # Copyright 2018-2020 The emg3d Developers. # # This file is part of emg3d. # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except...
31,713
10,313
#! /usr/bin/python2 # -*- coding: utf-8 -*- """ Clock function to take running time following Segmatch. """ # BSD 3-Clause License # # Copyright (c) 2019, FPAI # Copyright (c) 2019, SeriouslyHAO # Copyright (c) 2019, xcj2019 # Copyright (c) 2019, Leonfirst # # All rights reserved. # # Redistribution and use in source a...
2,464
867
from office365.runtime.client_object_collection import ClientObjectCollection from office365.runtime.resource_path_service_operation import ResourcePathServiceOperation from office365.sharepoint.view import View class ViewCollection(ClientObjectCollection): """Represents a collection of View resources.""" def...
918
246
from common_src.lib.model.post import Post from common_src.lib.model.source import Source from common_src.scrapers.abstract_scraper import make_soup, remove_dups, now SOURCE_CODE = "second_extinction" WEBSITE = "https://www.secondextinctiongame.com/news" ALT_IMAGE = 'https://www.secondextinctiongame.com/static/242486b...
1,461
535
# # alexnet.py # # Author(s): # Matteo Spallanzani <spmatteo@iis.ee.ethz.ch> # # Copyright (c) 2020-2021 ETH Zurich. # # 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...
3,860
1,435
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('core', '0011_customersetting'), ] operations = [ migrations.AlterField( model_name='customersetting', ...
448
152
#!/bin/python3 # Libraries import sys import array import textwrap # Variable Declaration madlib_selection = "example.txt" madlib_array = array.array('i') copy_state = False user_filler = "" new_madlib = [] if len(sys.argv) != 1: print(len(sys.argv)) if sys.argv[1] == "-": print("This program takes t...
1,068
359
import pytest from django.utils.timezone import now from pretix.base.models import Device, Event, Organizer, Team, User from pretix.base.models.devices import generate_api_token @pytest.fixture def organizer(): return Organizer.objects.create(name='Dummy', slug='dummy') @pytest.fixture def event(organizer): ...
2,558
872
import numpy as np from PIL import Image, ImageOps, ImageEnhance import albumentations as A # ndarray: H x W x C def apply_aug(aug, image): return aug(image=image)["image"] # ----------------------------------- Blur ------------------------------------------- class RandomBlur(): def __init__(self, prob, bl...
11,773
3,977
# -*- coding: utf-8 -*- import bleach import json def strip_html(unclean): """Sanitize a string, removing (as opposed to escaping) HTML tags :param unclean: A string to be stripped of HTML tags :return: stripped string :rtype: str """ return bleach.clean(unclean, strip=True, tags=[], attribu...
2,959
902
import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.tensorboard import SummaryWriter from torch.utils import data from torch import optim import torchvision.models as models from torch.autograd import Variable import torchvision as tv import random import math import time from datetime i...
16,525
5,369
"""Utilities""" import pandas as pd import numpy as np from attrdict import AttrDict import yaml def average_predictions(cv_predictions, n_splits, num_samples = 153164, num_labels = 6): """Average k-fold predictions stored in a dict""" preds = np.zeros((num_samples, num_labels)) for preds_i in cv_predictio...
1,295
487
import airflow from airflow.models import DAG from airflow.operators.dummy_operator import DummyOperator args = { 'owner': 'Mike', 'start_date': airflow.utils.dates.days_ago(2), } dag = DAG( dag_id='exercise1', default_args=args, schedule_interval=None ) t1 = DummyOperator(task_id='task1', dag=da...
530
215
# -*- coding: utf-8 -*- """ Created on Tue Feb 27 10:54:25 2018 @author: jsgosselin """ # ---- Standard Library Imports from itertools import product import os.path as osp import os # ---- Third Party Imports import netCDF4 from geopandas import GeoDataFrame import pandas as pd from shapely.geometry import Point, P...
3,148
1,409
# pylint:disable=ungrouped-imports import uuid import pytest import activitylogs from db.models.activitylogs import ActivityLog from events.registry.experiment import EXPERIMENT_DELETED_TRIGGERED from events.registry.user import USER_ACTIVATED from factories.factory_experiments import ExperimentFactory from factorie...
1,803
500
import unittest from shapy.framework.tcelements import * from shapy.framework.executor import run from tests import TCTestCase class TestIngress(TCTestCase): def setUp(self): self.interface = Interface('lo') def test_ingress_filter(self): q = IngressQdisc() q.add(RedirectFilter('...
420
142
from colorsys import hsv_to_rgb from math import fabs, fmod import os from hippietrap.color import Color class Gradient(object): def __init__(self, palette, num_leds = 1): # palletes are in format [ (.345, (128, 0, 128)) ] self._validate_palette(palette) self.palette = palette sel...
1,844
596
from stix_shifter_utils.utils.entry_point_base import EntryPointBase from stix_shifter_utils.modules.cim.stix_translation.cim_data_mapper import CimDataMapper from stix_shifter_utils.modules.car.stix_translation.car_data_mapper import CarDataMapper from .stix_translation.stix_to_elastic import StixToElastic class Entr...
817
271
from PyQt5.QtWidgets import (QMainWindow, QToolButton, QWidget, QHBoxLayout) from PyQt5.QtGui import QIcon from PyQt5 import QtCore from math import floor import sys class MainWindow(QMainWindow): def __init__(self, browsers, iconsize=72, displayappname=False, x=0, y=0, callback=lambda v: print(v)): ...
1,850
557
""" Crack a password using a genetic algorithm! """ import random as rnd def main(): """ This file implements a genetic algorithm to solve the problem of cracking a given password, by creating 'generations' of different words, selecting the best, breeeding them, applying a simple crossover (randomi...
6,324
1,985
import logging from common.licenses import get_license_info from common.loader import provider_details as prov from common.requester import DelayedRequester from common.storage.image import ImageStore logging.basicConfig( format="%(asctime)s - %(name)s - %(levelname)s: %(message)s", level=logging.INFO ) logger ...
7,985
2,500
# tape variables TS_MAX=1000 # the digital tape model class DTape: def __init__(self,size,alphabet,noopidx=0): if size>TS_MAX: self.size=TS_MAX else: self.size=size if len(alphabet)==0: raise Exception('alphabet has zero symbols') self.alphabet=al...
1,089
391
import json # Output must be returned in the format mentioned below: # https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html#api-gateway-simple-proxy-for-lambda-output-format lambda_response = { "isBase64Encoded": False, "statusCode": 200, "headers": { ...
422
143
import pygame import time import numpy as np import sys gray = (150, 150, 150) white = (255, 255, 255) black = (0, 0, 0, ) red_block = (255, 0, 0) red_border = (76, 0, 19) block_color = (255, 128, 0) border_color = (165,42,42) screen = None SIDE = 50 BORDER = 5 MARGIN = 5 LINE = 1 h_switch = True def __draw_hor...
3,737
1,360
# API from pyramid.scaffolds import PyramidTemplate import os import re import logging def _camelcase_to_upper_camel_case(the_str): if not the_str: return '' return the_str[0].upper() + the_str[1:] def _upper_camelcase_to_camelcase(the_str): if not the_str: return '' return the_str[...
2,852
975
# -*- coding: utf-8 -*- """Test GUI component.""" #------------------------------------------------------------------------------ # Imports #------------------------------------------------------------------------------ #from contextlib import contextmanager from pytest import yield_fixture, fixture, raises import ...
21,364
7,559
# # CommandManager.py # Botpy # # Created by Ashish Ahuja on 4th September 2017. # # import threading import chatexchange as ce class CommandManager: def __init__(self, commands): self.commands = commands self.running_commands = [] def run_command(self, command): if command.privileges...
2,733
675
import os import glob subdirs = glob.glob("tests/periodicities/*"); subdirs = ['tests/periodicities/Month', 'tests/periodicities/Minute', 'tests/periodicities/Week', 'tests/periodicities/Business_Hour', 'tests/periodicities/Business_Day', 'tests/periodicities/Seco...
1,237
427
# # Copyright (C) 2018 Neal Digre. # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE file for details. # # # Portions of this module are copied or lightly modified from the # Tensor2Tensor registry_test module, so here is their license: # # Copyright 2018 The Tensor...
3,494
1,070
"""empty message Revision ID: 8f7565cf50c1 Revises: 872760122cc9, 8652bf9c03ff Create Date: 2020-10-02 11:11:49.823678 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '8f7565cf50c1' down_revision = ('872760122cc9', '8652bf9c03ff') branch_labels = None depends_o...
383
197
# Copyright 2017 MDSLAB - University of Messina # 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 # # U...
13,217
3,902
#!/usr/bin/env python3 import argparse import logging import sys import numpy as np import util def main(): flags = initialize() logging.debug(f'Loading from {flags.in_path}') a = np.load(flags.in_path, allow_pickle=True) all_results_3d = {} for image_path, coords3d_pred in zip(a['image_path'],...
1,406
485
# The MIT License (MIT) # Copyright (c) 2021 by the xcube development team and contributors # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including without limitation...
1,606
544
"""Simulation logs""" from __future__ import annotations # default once 3.10 import sys from enum import Enum from typing import Type, TYPE_CHECKING if TYPE_CHECKING: from core.timeline import Timeline class LogKind(Enum): def __str__(self) -> str: return self.name DEBUG = 0 SIM = 1 class...
1,683
544
# # # # Copyright 2015 Quantopian, 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 la...
3,760
1,227
# Copyright (C) 2020. Huawei Technologies Co., Ltd. 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 without restriction, including without limitation the rights # to us...
7,896
2,201
import sqlite3 connect = sqlite3.connect("production.db") cursor = connect.cursor() cursor.execute("UPDATE PERSON SET edad = 19 WHERE nombre = 'Conker'") connect.commit() connect.close()
195
63
import pygame from StringIO import StringIO import cv2 import os import numpy class Image(object): """ Image object """ def __init__(self): self.display = None def show_image(self, image, width, height): """ Show image """ size = (width, height) s...
1,599
484
import binascii from os import urandom import humanize from django.conf import settings from django.db import models from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from durin.settings import durin_settings from durin.signals import token_renewed User = settings.AUTH_USER_MO...
3,340
1,046
# Copyright (c) 2013 Aparajita Fishman # Change for CudaLint: Alexey T. # License: MIT import os from cuda_lint import Linter, util if os.name=='nt': _exe = os.path.join(os.path.dirname(__file__), 'tidy_win32', 'tidy') else: _exe = 'tidy' class HtmlTidy(Linter): syntax = ('HTML', 'HTML_') cmd = (_exe...
507
210
"set operations for multiple sequences" def intersect(*args): res = [] for x in args[0]: # scan the first list for other in args[1:]: # for all other arguments if x not in other: break # this item in each one? else: res.append(x) #...
640
163
msg_dict = { 'resource_not_found': 'The resource you specified was not found', 'invalid_gender': "The gender you specified is invalid!!", 'many_invalid_fields': 'Some errors occured while validating some fields. Please check and try again', 'unique': 'The {} you inputted already exists',...
3,006
889
from .marshmallow import ma from .schemas import ArticleSchema __all__ = [ 'ma', 'ArticleSchema' ]
109
39
import argparse from time import sleep, time from collections import defaultdict from sqlalchemy import orm, text, insert, delete from sqlalchemy.orm import selectinload import models from app import db from app import logger from scripts.queue import JsonWorks, JsonAuthors, JsonConcepts, JsonInstitutions, JsonVenues...
8,950
2,696
import json import discord from discord.ext import commands from assets import internet_funcs from assets.list_funcs import chunks class Memes(commands.Cog, description="Memes from https://imgflip.com/"): def __init__(self, bot): self.bot = bot with open("config.json") as configFile: ...
3,810
1,207
from forest_fire.server import server server.launch()
55
16
# Prep import json, configparser, pickle, csv, logging, os import pandas as pd from tweepy import AppAuthHandler, API, Cursor # Reading in configuation params = configparser.ConfigParser() params.read('config.ini') # Functions # Takes config file and returns authenticated api object def twitter_auth(config): auth = ...
2,298
808
# # Copyright 2021 Ocean Protocol Foundation # SPDX-License-Identifier: Apache-2.0 # from eth_utils import is_address from web3 import Web3 def sanitize_addresses(addresses): return [Web3.toChecksumAddress(a) for a in addresses if is_address(a)] def compare_eth_addresses(address, checker, logger): """ C...
937
286
"""Auto-generated file, do not edit by hand. DJ metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_DJ = PhoneMetadata(id='DJ', country_code=253, international_prefix='00', general_desc=PhoneNumberDesc(national_number_pattern='[27]\\d{7}', possible_length=(8,)), ...
673
259
#!/usr/bin/env python """ Unicode case folding database conversion utility Parses the database and generates a C++ function which implements the case folding algorithm. The database entries are of the form: <code>; <status>; <mapping>; # <name> <status> can be one of four characters: C - Common mappings S - ma...
4,541
1,498
import itertools import json import logging import re from django.views.generic import TemplateView from django.http import HttpResponse from django.views import View from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin from django.views.decorators.csrf import csrf_exempt from django.short...
115,101
32,489
#!/usr/bin/env python3 import numpy as np from sklearn.neighbors import KernelDensity # Relative tolerance (in percent) for some comparisons on measured data. TOLERANCE = 25 # Lower tolerance for comparison of measured data LTOL = 100 - TOLERANCE # Upper tolerance for comparison of measured data UTOL = 100 + TOLERANCE...
10,352
7,305
import torch from torch import nn from mmcv.cnn.utils import constant_init, kaiming_init class SimAttention(nn.Module): def __init__(self, in_channels): super(SimAttention, self).__init__() self.conv_attn = nn.Conv2d(in_channels, 1, kernel_size=1) self.softmax = nn.Softmax(dim=2) ...
2,698
972
import json import requests from datetime import datetime from playsound import playsound tday=datetime.today().strftime('%Y-%m-%d') right_now=datetime.today().strftime('%I-%M-%p') response = requests.get("https://www.londonprayertimes.com/api/times/?format=json&key=0239f686-4423-408e-9a0c-7968a403d197&year=&mont...
519
211
import pytest from django.test import TestCase from rest_framework import serializers as drf_serializers from pokemon import models, serializers @pytest.mark.django_db class StatsSerializer(TestCase): """ Test Module for StatsSerializer """ def setUp(self): models.Nature.objects.create( ...
6,763
2,095
from sqlpuzzle.exceptions import InvalidArgumentException __all__ = ('parse_args',) # pylint: disable=dangerous-default-value,keyword-arg-before-vararg def parse_args(options={}, *args, **kwds): """ Parser of arguments. dict options { int min_items: Min of required items to fold one tuple. (defa...
4,962
1,599
from __future__ import unicode_literals from django.contrib.auth.models import User from djblets.webapi.errors import PERMISSION_DENIED from reviewboard.reviews.models import ScreenshotComment from reviewboard.webapi.resources import resources from reviewboard.webapi.tests.base import BaseWebAPITestCase from reviewbo...
16,809
4,842
""" Command line tool """ import asyncio from qbapi.request import create_request from qbapi.services.clients import Producer, Consumer async def spider(user_data: tuple) -> None: """spider :param user_data: :type user_data: tuple :rtype: None """ producer_queue = asyncio.Queue() consum...
1,163
364
import unittest import datetime import rdflib # needed for eval(repr(...)) below from rdflib.term import Literal, URIRef, _XSD_DOUBLE, bind, _XSD_BOOLEAN from rdflib.namespace import XSD def uformat(s): return s.replace("u'", "'") class TestLiteral(unittest.TestCase): def setUp(self): pass de...
9,063
3,285
import telegram from emoji import emojize from .base import TextMessageBase class RulingHelpTextMessage(TextMessageBase): """ Ruling help message. Taken from: https://www.iamexpat.nl/expat-info/taxation/30-percent-ruling/requirements """ def get_text(self): message = emojize( ...
2,472
884
import os os.environ['CUDA_VISIBLE_DEVICES']='0' from common import * from dataset import * from model import * def valid_augment(image, mask, infor): return image, mask, infor def train_augment(image, mask, infor): u=np.random.choice(3) if u==0: pass elif u==1: image, mask = do_...
14,312
5,145
import requests import os def get_json(save_dir, adcode): # 获取当前地图轮廓 base_url = 'https://geo.datav.aliyun.com/areas/bound/' + str(adcode) + '.json' full_url = 'https://geo.datav.aliyun.com/areas/bound/' + str(adcode) + '_full.json' base_r = requests.get(base_url) if base_r.status_code == 200: ...
1,283
492
# from sklearn.cluster import DBSCAN,KMeans # # # def run(data,radius=300): # res={} # # 默认参数 epsilon=0.001, min_samples=200 # epsilon = radius / 100000 # # epsilon = 0.003 # min_samples = 100 # db = DBSCAN(eps=epsilon, min_samples=min_samples) # # eps表示两个向量可以被视作为同一个类的最大的距离 # # min_sampl...
703
351
# (c) Copyright [2018-2021] Micro Focus or one of its affiliates. # 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 applicabl...
1,881
613
import re from collections import Counter def is_isogram(word): if not isinstance(word, str) or word == '': return False word = {j for i,j in Counter( re.sub('[^a-z]', '', word.lower()) ).most_common() ...
353
93
''' - Leetcode problem: 23 - Difficulty: Hard - Brief problem description: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example: Input: [ 1->4->5, 1->3->4, 2->6 ] Output: 1->1->2->3->4->4->5->6 - Solution Summary: - Used Resources: --- Bo Zhou ''' # ...
1,011
350
from django.views import generic class IndexView(generic.TemplateView): template_name = 'project/flocx/index.html'
117
35
# Written by Ivan Sapozhkov and Denis Chagin <denis.chagin@emlid.com> # # Copyright (c) 2016, Emlid Limited # All rights reserved. # # Redistribution and use in source and binary forms, # with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions of source code ...
5,833
1,932
# -*- coding: utf-8 -*- """ This module is distributed as part of the Laminaria Core (Python Version). Get the Source Code in GitHub: https://github.com/MrKelpy/LaminariaCore The LaminariaCore is Open Source and distributed under the MIT License """ # Built-in Imports import datetime import random import asyncio impo...
22,613
6,642
# -------------------------------------------------------------------------------------- # Copyright (c) 2013-2021, Nucleic Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # --------------------------------------...
1,280
384
#!/usr/bin/env python # # Copyright (C) 2007 British Broadcasting Corporation and Kamaelia Contributors(1) # All Rights Reserved. # # You may only modify and redistribute this under the terms of any of the # following licenses(2): Mozilla Public License, V1.1, GNU General # Public License, V2.0, GNU Lesser General ...
23,139
6,843
import click from flask.cli import AppGroup from project import app, db from project.dateutils import berlin_tz from project.services.event import ( get_recurring_events, update_event_dates_with_recurrence_rule, ) event_cli = AppGroup("event") @event_cli.command("update-recurring-dates") def update_recurrin...
697
226
import os import re import sys import subprocess import pytest from testplan.common.utils.path import change_directory import platform ON_WINDOWS = platform.system() == 'Windows' KNOWN_EXCEPTIONS = [ "TclError: Can't find a usable init\.tcl in the following directories:", # Matplotlib module improperly installe...
3,647
1,082
from io import StringIO class Template: """ this has information that parsed source code. you can get rendered text with .render() and .render_string() """ def __init__(self, sentencenode, scope): self.sentencenode = sentencenode self.scope = scope def render(self, stream, ...
1,223
307
from core import getattr_path from rest_framework import status from credit.tests.test_views.test_credit_list.test_security_credit_list import SecurityCreditListTestCase class CreditListWithBlankStringFiltersTestCase(SecurityCreditListTestCase): def assertAllResponsesHaveBlankField(self, filters, blank_fields, e...
2,342
670
""" Check for Office file types ViperMonkey is a specialized engine to parse, analyze and interpret Microsoft VBA macros (Visual Basic for Applications), mainly for malware analysis. Author: Philippe Lagadec - http://www.decalage.info License: BSD, see source code or documentation Project Repository: https://github....
3,800
1,391
from st2tests.base import BaseSensorTestCase from third_party_resource import ThirdPartyResource class ThirdPartyResourceTestCase(BaseSensorTestCase): sensor_cls = ThirdPartyResource def test_k8s_object_to_st2_trigger_bad_object(self): k8s_obj = { 'type': 'kanye', 'object': {...
2,699
782
import datetime import getpass import logging import os import pathlib import platform import re import smtplib import sys from contextlib import contextmanager from email.message import EmailMessage from functools import wraps import azure.functions as func import click import gspread import pandas as pd from apsched...
10,728
3,386