text
string
size
int64
token_count
int64
x,y=map(int,input().split(" ")) count=0 for i in range(0,1000): if(x*y==i*i): count+=1 if(count==1): print("yes") else: print("no")
163
75
from rediscluster import RedisCluster rc = RedisCluster( host='clustercfg.cfg-endpoint-name.aq25ta.euw1.cache.amazonaws.com', port=6379, password='password_is_protected', skip_full_coverage_check=True, # Bypass Redis CONFIG call to elasticache decode_responses=True, # decode_responses mu...
654
226
""" This module contains the definition of the DefaultSampler. """ import logging from typing import Iterable from lemonspotter.core.parameter import Direction from lemonspotter.core.sampler import Sampler from lemonspotter.core.variable import Variable from lemonspotter.core.function import Function from lemonspotte...
1,809
450
''' main.py Created by JO HYUK JUN on 2021 Copyright © 2021 JO HYUK JUN. All rights reserved. ''' class Solution: def lengthOfLongestSubstring(self, s: str) -> int: output = 0 str_set = [] for idx, val in enumerate(s): if val in str_set: s...
480
166
# Exploit Title: TyranoScript 5.13b - Arbitrary Code Execution # Date: 27/03/2022 # Exploit Author: Satoki # Vendor Homepage: https://tyrano.jp/ # Software Link: https://github.com/ShikemokuMK/tyranoscript # # Version (Save Data ACE): # TyranoScriptV5 <= 5.04b # TyranoScript <= 4.83 # # Version (Development Data ...
2,532
949
# -*- coding: UTF-8 -*- """(forms.py) Flask-Login Example: Login Form""" from flask_wtf import Form # import from flask_wtf, NOT wtforms from wtforms import StringField, PasswordField from wtforms.validators import InputRequired, Length # Define the LoginRorm class by sub-classing Form class LoginForm(Form): # T...
526
168
from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By __author__='Pruthvi Kumar' # 30 June 2019. # pruthvikumar.123@gmail.com # L...
1,322
378
from .other import * from .acquisition import * from .filtration import * from .preprocessing import * from .recognition import * from .segmentation import * from .visualisation import *
188
51
from django.urls import path from . import views urlpatterns = [ path('bd', views.bdaffair, name="bd_api"), path('home', views.home_data, name='home_api'), path('cultural', views.cultural_insights, name='cultural_api'), path('sports', views.sports_insights, name='sports_api'), path('international',...
1,598
575
import numpy as np from pathlib import Path import itertools from tqdm import tqdm from ..utils import get_imageset import matplotlib.pyplot as plt import cv2 import json from ..metrics.surface_dice import metrics as surface_distance from ..metrics.functional import calc_isolated_fp def calc_segmentation_metrics(confu...
11,544
3,974
# Example package with a console entry point
46
11
""" Handler for the var action tag. """ # pylint: disable=too-few-public-methods,too-many-arguments,protected-access,unused-argument __author__ = "Brian Allen Vanderburg II" __copyright__ = "Copyright 2016-2019" __license__ = "Apache License 2.0" from . import ActionHandler, DefaultActionHandler from ..nodes import ...
1,774
553
import pytest from math import isclose import sys sys.path.append('/Users/pyann/Dropbox (CEDIA)/srd/Model') import srd from srd import quebec # I use https://cffp.recherche.usherbrooke.ca/outils-ressources/guide-mesures-fiscales/credit-impot-prolongation-carriere/ # since they don't seem to adjust for taxabl...
1,623
775
# Type help("robolink") or help("robodk") for more information # Press F5 to run the script # Documentation: https://robodk.com/doc/en/RoboDK-API.html # Reference: https://robodk.com/doc/en/PythonAPI/index.html # Note: It is not required to keep a copy of this file, your python script is saved with the station from...
1,382
480
from game import Game g = Game() while g.running: g.curr_menu.display_menu() g.game_loop()
101
39
class ClickHouseException(Exception): def __init__(self, query: str, err: str): err = "\n".join(err.split(". ")) msg = f"Query\n{query}\n\nError\n{err}" super().__init__(msg)
203
71
from ccdc import cassandra from pyspark.sql.types import ArrayType from pyspark.sql.types import ByteType from pyspark.sql.types import IntegerType from pyspark.sql.types import StructField from pyspark.sql.types import StructType def table(): """Cassandra table name""" return 'pixel' def schema(): """S...
1,474
435
from PyQt5.QtWidgets import QMainWindow from ..ekmap_converter import eKConverter import re from qgis.core import QgsMessageLog class LabelParser: def __init__(self, labeling): self.labeling = labeling def _readTextStyle(self, settings): labelFormat = settings.format() field = settin...
6,471
1,771
# -*- coding: utf-8 -*- # coding by liuyunfei # 2020-4-12 import sys from PyQt5.QtWidgets import QApplication, QMainWindow, QMessageBox from PyQt5.QtCore import QThread, pyqtSignal, QDateTime, QObject, QMutexLocker, QMutex, QTimer from PyQt5.QtGui import QPixmap from PyQt5 import Qt, QtCore from PyQt5.QtCo...
8,069
2,911
__author__ = 'talluri' def sum(*args): if len(args) == 0: return None s = 0 for arg in args: s += arg return s
145
56
"""An implementation of an actor-critic model that is aimed at Atari games.""" import gym import numpy as np import tensorflow as tf import actorcritic.nn as nn from actorcritic.baselines import StateValueFunction from actorcritic.model import ActorCriticModel from actorcritic.policies import SoftmaxPolicy class A...
11,423
3,319
import pandas as pd import marcotti.models.club as mc import marcotti.models.common.enums as enums import marcotti.models.common.overview as mco import marcotti.models.common.personnel as mcp import marcotti.models.common.suppliers as mcs from .workflows import WorkflowBase class MarcottiTransform(WorkflowBase): ...
18,044
5,930
import copy import numpy as np from compressible_tools import * class FuelInjector: """A fuel injector. Parameters ---------- fuel : Species The fluid being fed through the injector. T : float Inlet temperature of injector. A : float Cross-sectional area. """ ...
2,863
952
#!/usr/bin/env python3 # owoencode.py, a part of owoencoder # Made by Glitch, 2020 # https://www.glitchfur.net from sys import argv, stdout, stderr from os.path import exists, split from os import remove KEEP_ORIG = False STDOUT_FLAG = False def main(): if len(argv) < 2: print("The syntax for running th...
1,976
685
# Fix number of node predicates at 1 out of 6 # this ensures queries with larger space of possible nodes # The number of colors in a query is varied from 1 to 5 import argparse import numpy as np from graph_gen import birth_years, genders, num_posts, num_friends possibilities = [1, 3, 4, 5] # do not consider equaliy ...
2,589
851
from django import forms from multiplepagesproject.prodmodels import proddisplay class productforms(forms.ModelForm): class Meta: model = proddisplay fields = "__all__"
195
57
import string from django.template import Context from django.template.loader import get_template from django import template register = template.Library() import crm @register.inclusion_tag('comments/form.html') def render_cedar_comment_form(**kwargs): object = kwargs.pop('object', None) parent_id = kwargs...
1,292
383
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import math import torch import to...
3,504
1,167
from django.db import models class Blog(models.Model): title = models.CharField(max_length=15) date = models.DateField(auto_now_add=True) body = models.TextField() image = models.ImageField(upload_to='images/') #To return title to admin page def __str__(self): return self.title de...
365
116
from copy import copy from modules.parse import parse from modules.equation import grad, node_flatten from modules.matrix import Matrix from modules.util import ProjectException from modules.util import Color, color_string def split_half(data: dict) -> dict: node_root = data["equation"][0] var_list = data["v...
3,845
1,316
import argparse from _version import __version__ def parse(): """Parse command line arguments.""" PARSER = argparse.ArgumentParser() PARSER.add_argument('-b', '--backend', help='Define which Terraform backend to parse', choices=['local', 'consul'], default='...
1,807
535
''' Wrapper for a lockable MPD client ''' from threading import Lock, Thread from random import choice from mpd import MPDClient class LockableMPDClient(MPDClient): def __init__(self, use_unicode=False): super(LockableMPDClient, self).__init__() self.use_unicode = use_unicode self._lock = ...
549
168
# importing libraries from keras.preprocessing.image import ImageDataGenerator from keras.models import Sequential from keras.layers import Conv2D, MaxPooling2D from keras.layers import Activation, Dropout, Flatten, Dense from keras import backend as K img_width, img_height = 224, 224 train_data_dir = 'v_data/train'...
1,928
793
import osc osc.init() # create and send a bundle bundle = osc.createBundle() osc.appendToBundle(bundle, "/test/bndlprt1", [1, 2.2, "333"]) osc.appendToBundle(bundle, "/test/bndlprt2", [4, 5.5, 6]) osc.sendBundle(bundle, "127.0.0.1", 9999)
245
114
import torch import functools from src.core.sampling import rollout_sb3 from intersim.envs import IntersimpleLidarFlatIncrementingAgent from intersim.envs.intersimple import speed_reward from intersim.expert import NormalizedIntersimpleExpert from src.util.wrappers import CollisionPenaltyWrapper, Setobs import numpy as...
2,113
936
from joblib import load from pandas import DataFrame import pickle class FeatureScaling: def __init__(self, user_input, logger_obj, file_obj): try: self.logger_obj = logger_obj self.file_obj = file_obj self.logger_obj.log("INFO", 'Different user input value assign proce...
2,840
805
import socket import threading import json import sys from io import StringIO from .loop import Loop from .const import ( LOGGER ) class Debug_connection(Loop): def __init__(self, parent, connection, client_address): super(Debug_connection, self).__init__("Debug connection", parent._root) sel...
4,073
1,111
from setuptools import setup, find_packages with open("README.md", "r") as f: long_description = f.read() setup(name = "allcopol", version = "0.1.1", description = "AllCoPol: Inferring allele co-ancestry in polyploids", long_description = long_description, long_description_content_type = "text/ma...
972
341
import spec import sonicfeatures import display import random import os class Sample: """Keep track of samples and their stuff.""" def __init__(self, genotype, gen=0, index=0, parents=None, fitness_func=None): self.genotype = genotype self.phentype = None self.fitness_func = fitness_f...
2,686
826
import os class VMWriter(object): def __init__(self,fname): self.outfile = open(fname, 'w') def close(self): self.outfile.close() def write_cmd(self, cmd, arg1 = "", arg2 = ""): self.outfile.write(cmd + " " + str(arg1) + " " + str(arg2) + "\n") def write_push(self...
1,709
601
from typing import Any, Dict, List, Optional, cast from pathlib import Path import yaml CONFIG_FILE_NAME = "config.yml" CONFIG_DIRS = ( Path.home() / Path(".yrs"), Path("/etc/youtube-rss-subscriber"), ) class Config: _instance: Optional["Config"] = None _config: Dict[str, Any] _required_keys: L...
1,945
617
# flake8: noqa from rastervision.analyzer.analyzer import * from rastervision.analyzer.analyzer_config import * from rastervision.analyzer.stats_analyzer import * from rastervision.analyzer.stats_analyzer_config import *
222
70
from tensorflow.keras.applications.densenet import DenseNet121 from tensorflow.keras.layers import Dense, GlobalAveragePooling2D from tensorflow.keras.models import Model from keras import backend as K from settings import Settings import numpy as np from helper import get_train_labels, compute_class_freqs from tensorf...
2,010
652
import sys import numpy as np import math import matplotlib.pyplot as plt from numpy.lib.polynomial import poly import pandas as pd from matplotlib import cm import matplotlib.patheffects as path_effects import random class Run: def __init__(self, run_name, linearities, leniencies, ids): self.run_name = ru...
4,494
1,514
from datetime import datetime from pyetheroll.utils import EtherollUtils, timestamp2datetime class TestEtherollUtils: def test_compute_profit(self): bet_size = 0.10 chances_win = 34 payout = EtherollUtils.compute_profit(bet_size, chances_win) assert payout == 0.19 bet_size...
781
288
# https://codewith.mu/en/tutorials/1.0/microbit from microbit import * flag = True while True: sleep(100) if button_a.was_pressed(): flag = not flag if flag: print((accelerometer.get_x(),)) else: print(accelerometer.get_values())
270
97
from osbot_aws.apis.Fargate import Fargate class Fargate_Cluster(Fargate): def __init__(self, account_id): super().__init__(account_id)
153
58
''' ________ ________ ___ ___ _______ ________ _________ ___ ___ _________ _______ ________ ________ |\ __ \|\ ___ \|\ \ / /|\ ___ \ |\ ___ \|\___ ___\|\ \ / /|\___ ___\\ ___ \ |\ ___ \|\ ___ \ \ \ \|\ \ \ \_|\ \ \ \ / / | \ __/|\ \ \\ \ \|___ \ \_|\ ...
7,156
2,159
students = [] class Student: school_name = "Springfield Elementary" #pass #tells the interpreter just to do nothing def __init__(self,name, student_id=332): self.name = name self.student_id = student_id students.append(self) def __str__(self): return "Student " + self.name def get_name_capitalize(s...
415
157
from ampy.pyboard import Pyboard from ampy.files import Files from .files import led_panel_client, max7219 from os.path import basename from sys import argv def put(): """ Uploads all necessary files to the pyboard. """ if len(argv) < 2: print("Pyboard COM port not specified. Usage: led_panel_...
700
239
''' Into to deep learning Koopman operators === Author: Nicholas Geneva (MIT Liscense) url: https://nicholasgeneva.com/blog/ github: https://github.com/NickGeneva/blog-code === ''' import numpy as np import random import argparse import os, errno, copy, json import torch class Parser(argparse.ArgumentParser): def...
3,241
1,013
""" This test checks the input file generation of a basic job using a python UDF. """ import os from eodc_openeo_bindings.job_writer.basic_writer import BasicJobWriter def test_basic_python_udf(test_folder, out_filepath_basic, backend_processes, S2_filepaths_short): evi_file = os.path.join(test_folder, 'proces...
1,767
622
import socket as sock import os IP = sock.gethostname() CCTV_PORT = 9000 ANDR_PORT = 8000 CUR_DIR = os.getcwd() REC_DIR = os.path.join(CUR_DIR, "record") DB_ADDR = "Database server address" PUSH_ADDR = "Push notification server address" REG_ID = "Registration ID" NOTIF_COUNT = 4 QUEUE_SIZE = 30 REC_FILE_NUM = 60 NO...
336
151
# -*- coding: utf-8 -*- """ Created on Wed Feb 27 14:14:47 2019 @author: DK0086 """ import odema as od import numpy as np from datetime import datetime import pandas as pd import geopy.distance import math import os import time import sys from geopy.geocoders import Nominatim geolocator = Nominatim(u...
7,878
3,494
import GlassdoorScrapeCore.GlassdoorScrapeUtilities as Ut def decode_experience(html_string): if html_string.find("Positive", 0) != -1: return "Positive Experience" elif html_string.find("Neutral", 0) != -1: return "Neutral Experience" elif html_string.find("Negative", 0) != -1: re...
4,398
1,344
import sys,os,base64,time,traceback from datetime import datetime ROOT = os.path.abspath('%s/../..' % os.path.abspath(os.path.dirname(__file__))) sys.path.append(ROOT) os.environ['DJANGO_SETTINGS_MODULE'] = 'qurkexp.settings' SLEEP_TIME = 10 if __name__ == '__main__': from django.conf import settings from qur...
8,626
2,767
# Day 12: Functions # Exercises # Define four functions: add, subtract, divide, and multiply. Each function should take two arguments, and they should print the result of the arithmetic operation indicated by the function name. # When orders matters for an operation, the first argument should be treated as the left o...
4,155
1,224
PROVIDER_SUBMODULE='db'
24
13
""" Contains the trainable sub-network of an ensemble classifier. Handles calling the training and evaluation. """ import torch import torch.nn as nn import torch.optim as optim from matplotlib.pyplot import show from utility.fusion_functions import (train_nn_combiner_model, test_...
3,450
1,207
import sublime import sublime_plugin import os from .gotools_util import Buffers from .gotools_util import GoBuffers from .gotools_util import Logger from .gotools_util import ToolRunner class GotoolsRenameCommand(sublime_plugin.TextCommand): def is_enabled(self): return GoBuffers.is_go_source(self.view) def...
1,639
542
from rest_framework.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView from equipment.serializers import EquipmentSerializer, ItemSerializer from equipment.models import Item, Equipment class ListCreateItemEndpoint(ListCreateAPIView): serializer_class = ItemSerializer queryset = Item.objects.all...
765
212
{%- set modname = cookiecutter.project_slug.replace('-', '') -%} from skbuild import setup {%- if cookiecutter.use_submodules == "No" %} import os import pybind11 {%- endif %} setup( name='{{ modname }}', version='0.0.1', author='{{ cookiecutter.full_name }}', author_email='your@email.com', descri...
1,286
452
import os, platform from clint.textui import colored as color class OperatingSystem(): @staticmethod def os_name(): return platform.system() @staticmethod def user_name(): return platform.uname().node @staticmethod def path(): return os.getcwd() de...
603
199
# Copyright (c) 2019-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # def f_gold ( str ) : n = len ( str ) for i in range ( n ) : if ( str [ i ] != 'a' ) : break if (...
899
334
from rest_framework import routers from user.views import UserViewSet from .views import SampleViewSet router = routers.DefaultRouter() router.register('users', UserViewSet) router.register('samples', SampleViewSet)
218
59
# Copyright 2022 iiPython # Modules import time # Initialization embed_size = 45 # Plugin class class EmbedPlugins(object): def __init__(self, eventmgr) -> None: self.meta = { "name": "Embeds", "author": "iiPython", "id": "embeds" } self.eventmgr = even...
1,249
424
import time, os, xlrd, xlwt, re, webbrowser, time_convert, Process_killer, tkinter as tk from tkinter import messagebox as mb from xlwt import easyxf from threading import Thread from selenium import webdriver from selenium.common.exceptions import SessionNotCreatedException from selenium.webdriver.chrome.options...
11,303
3,770
import uuid from typing import Optional from fastapi import UploadFile, APIRouter from src.services.image_processing import ImageProcessor router = APIRouter(prefix="/file", tags=["passport & ID upload"]) # @router.get("",) # async def index(): # return {"test": "hello world"} @router.post("/upload/") async de...
803
246
# -*- coding: utf-8 -*- import os import argparse import img2pdf import tqdm from natsort import natsorted from PIL import Image def pdf_gen(src, dst): pages = [] for file in natsorted(os.listdir(src)): if os.path.splitext(file)[-1] == '.jpg' or os.path.splitext(file)[-1] == '.jpeg' or os.path.splitex...
1,474
576
import sys import requests import datetime from dateutil.parser import parse from veracode_api_py import VeracodeAPI as vapi def creds_expire_days_warning(): creds = vapi().get_creds() exp = datetime.datetime.strptime(creds['expiration_ts'], "%Y-%m-%dT%H:%M:%S.%f%z") delta = exp - datetime.datetime.now()....
1,113
362
# # Copyright 2017 Adobe. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
3,258
975
import pandas as pd import numpy as np print("Data Loading....") #data = pd.read_csv("adult.csv") data = pd.read_csv("adult_2.csv") # print(data) # print(data.columns) # print(data.shape) # print(data.info()) # print(data.nunique()) data.describe() data.isin(['?']).sum() data = data.replace('?', np.Na...
1,486
530
import network import time sta_if = network.WLAN(network.STA_IF) sta_if.active(True) for _ in range(10): sta_if.connect('RedmiMau', 'mau12397') time.sleep(1) if sta_if.isconnected(): print('Connected.') break time.sleep(11) else: print('Fail')
261
113
## Module to obtain packet data from a pcap/dump file ## and save it in csv format using tshark. ## Filenames of input pcap files are taken from InputFiles.txt ## Tshark options are present in TsharkOptions.txt ## TsharkOptions.txt should not contain the -r option. ## usage: python FilterPackets.py #import global con...
1,313
412
import discord from discord.ext import commands,tasks from datetime import datetime import asyncio from itertools import cycle #number of minutes used at timer for loops MINUTES_TO_WAIT = 30 #in the brackets there's the class you are extending class Start(commands.Cog): def __init__(self, bot, messages=0, joined...
2,829
873
from .helpers import IFPTestCase from intficpy.ifp_game import IFPGame from intficpy.thing_base import Thing from intficpy.things import Surface, UnderSpace from intficpy.actor import Actor, SpecialTopic from intficpy.verb import ( IndirectObjectVerb, GetVerb, LookVerb, SetOnVerb, LeadDirVerb, ...
14,716
4,846
from .spacy_thai import ThaiTagger,ThaiParser,load
51
20
import setuptools import re with open("README.md", "r") as fh: long_description = fh.read() version = '' with open('pydisfish/__init__.py') as f: version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE).group(1) if not version: raise RuntimeError('version is not set') requi...
965
311
import sys if sys.version_info[0] == 2: import Queue as queue else: import queue import os import math import multiprocessing as mp import threading import torch from torch.utils.data import Dataset import numpy as np from data_utils import get_receptive_field, get_sub_patch_shape, \ get_offset, sampl...
9,173
3,285
from .utils import to_ms, to_candle from ..api_candles import ApiCandles from ...timeframes import Timeframes import datetime, time import requests as r class BinanceApiCandles(ApiCandles): _url = 'https://api.binance.com/api/v3/klines' # <Timeframes> : <str - binance str repr> _binance_interv...
2,364
783
import os import random from django.db import models from contests.models import Submission, User, Contest VERDICT = ( ('RTE', 'Run Time Error'), ('MLE', 'Memory Limit Exceeded'), ('TLE', 'Time Limit Exceeded'), ('WA', 'Wrong Answer'), ('CE', 'Compilation Error'), ('IE', 'Internal Error'), ...
2,110
706
#------------------------------------------------------------------------------ # Copyright (c) 2012, Enthought, Inc. # All rights reserved. #------------------------------------------------------------------------------ from enaml.validation.api import IntValidator from .enaml_test_case import EnamlTestCase class...
2,295
681
# core_funcs.py # By: thekraftyman ''' container for all of the core funcs that have been distributed among files ''' from src.lib.async_funcs import * from src.lib.non_async_funcs import *
192
64
import uuid from django.db import models class TimeStampedModel(models.Model): created_at = models.DateTimeField(auto_now_add=True) modified_at = models.DateTimeField(auto_now=True) class Meta(object): abstract = True class PrimaryUUIDModel(models.Model): id = models.UUIDField(primary_key=...
532
166
# -*- coding: utf-8 -*- import gevent from oandapyV20.endpoints.accounts import AccountDetails, AccountChanges class GAccountDetails(gevent.Greenlet): """Greenlet to handle account details/changes. Initially get the AccountDetails and then keep polling for account changes. In case of changes put tho...
1,351
370
import sys from . import Archive from . import Find from . import ParseArgs from . import Interact def iter_urls(opt): """Iterate given urls for saving.""" try: for x in opt["urls"]: Archive.archive(Find.extract_uri_recursive(x, opt["level"]), x, opt["retry"]) ...
802
270
# # Copyright (c) 2017-2018 Joy Diamond. All rights reserved. # @gem('Sapphire.CallStatement') def gem(): require_gem('Sapphire.BookcaseExpression') require_gem('Sapphire.MemberExpression') require_gem('Sapphire.Method') require_gem('Sapphire.Tree') class CallStatementBase(SapphireTrunk): ...
5,613
1,629
"""Unit tests for partial implementation.""" from polar.expression import Expression from polar.variable import Variable from sqlalchemy_oso.partial import dot_op_path def test_dot_op_path(): single = Expression("Dot", [Variable("_this"), "created_by"]) assert dot_op_path(single) == ["created_by"] doubl...
546
166
ELECTRUM_VERSION = '3.0' # version of the client package PROTOCOL_VERSION = '0.10' # protocol version requested # The hash of the mnemonic seed must begin with this SEED_PREFIX = '01' # Standard wallet SEED_PREFIX_2FA = '101' # Two-factor authentication def seed_prefix(seed_type): if seed_t...
426
144
#!/usr/bin/env python from pyshorteners import Shortener """Url class""" class Url(): """This class format participants and add to an url and short the url""" cant_participants = 0 bracket = 0 def __init__(self): self.short_url = Shortener() self.url_final = ['https://scorecounter.com/t...
1,579
577
import os import pandas as pd from plotnine import * import plotnine from matplotlib import pyplot as plt import matplotlib from scipy.spatial.distance import pdist, squareform from skbio.stats.ordination import pcoa from skbio.diversity import beta_diversity from skbio.io import read from skbio.tree import TreeNode im...
5,302
2,113
from graphene_django import DjangoObjectType from accelerator.models import Location class LocationType(DjangoObjectType): class Meta: model = Location only_fields = ( 'street_address', 'timezone', 'country', 'state', 'name', ...
357
91
# -*- coding: utf-8 -*- # # Copyright 2015 Simone Campagna # # 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...
2,835
869
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This module handles the parsing of SALT labels. There are three types of labels (SFeature, SElementId, SAnnotation). Labels can occur as children of these elements: 'layers', 'nodes', 'edges' and '{sDocumentStructure}SDocumentGraph'. """ from lxml.builder import Elem...
3,878
1,147
from feedly.api_client.session import FeedlySession from feedly.api_client.stream import StreamOptions from feedly.api_client.utils import run_example def example_stream_entries(): """ This example will prompt you to enter a category name, download the 10 latest articles from it, and display their titles...
1,214
325
# Program no 5 1stname = input(" Enter 1st name ") lastname = input(" Enter last name ") print 1stname[::-1] print lastname[::-1]
141
58
# -*- coding: utf-8 -*- import codecs import os from setuptools import setup def read(*parts): return codecs.open(os.path.join(os.path.dirname(__file__), *parts), encoding='utf-8').read() setup( name='django-basic-models-behaviors', version=__import__('basic_models_behaviors').__version__, descript...
1,343
412
import logging from uuid import UUID from biplist import Data, Uid from plistutils.utils import parse_mac_absolute_time logger = logging.getLogger(__name__) class NSKeyedArchiveException(Exception): pass class NSKeyedArchiveParser(object): # https://developer.apple.com/documentation/foundation/nskeyed...
10,746
3,233
from . import default # noqa from . import types # noqa from . import standard # noqa
89
28
import random def scale(ele, sx, sy=None): if sy is None: sy = sx ele.scale(sx, sy) def translate(ele, sx, sy=0): ele.translate(sx, sy) def skew_x(ele, angle, sy=None): ele.skewX(angle) def skew_y(ele, angle, sy=None): ele.skewX(angle) def rotate(ele, angle, sy=None): ele.skewX(...
1,131
505