content stringlengths 1 1.05M | input_ids listlengths 1 883k | ratio_char_token float64 1 22.9 | token_count int64 1 883k |
|---|---|---|---|
# -*- coding: utf-8 -*-
import logging
from .__version__ import __version__
logging.getLogger(__name__).addHandler(logging.NullHandler())
__author__ = "Rajaram Kaliyaperumal, Arnold Kuzniar, Cunliang Geng, Carlos Martinez-Ortiz"
__email__ = 'c.martinez@esciencecenter.nl'
__status__ = 'beta'
__license__ = 'Apache Li... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
18931,
198,
198,
6738,
764,
834,
9641,
834,
1330,
11593,
9641,
834,
198,
198,
6404,
2667,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
737,
2860,
25060,
7,
64... | 2.677165 | 127 |
from django.contrib import admin
from .models import Post,Author,Tag
# Register your models here.
admin.site.register(Post,PostAdmin)
admin.site.register(Author)
admin.site.register(Tag)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
764,
27530,
1330,
2947,
11,
13838,
11,
24835,
198,
2,
17296,
534,
4981,
994,
13,
628,
198,
28482,
13,
15654,
13,
30238,
7,
6307,
11,
6307,
46787,
8,
198,
28482,
13,
15654,
1... | 3.315789 | 57 |
# -*- coding: utf-8 -*-
'''Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2018 Caleb Bell <Caleb.Andrew.Bell@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
41829,
605,
14044,
8495,
10074,
357,
1925,
1961,
43,
737,
41086,
329,
1429,
21128,
13,
198,
15269,
357,
34,
8,
2864,
40777,
7459,
1279,
34,
32100,
13,
20508,
... | 2.269527 | 25,875 |
# Generated by Django 3.1.14 on 2022-01-24 11:20
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
1415,
319,
33160,
12,
486,
12,
1731,
1367,
25,
1238,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.875 | 32 |
"""Delete command
Author: Rory Byrne <rory@rory.bio>
"""
from typing import Any
from git_plan.cli.commands.command import Command
from git_plan.service.plan import PlanService
from git_plan.util.decorators import requires_initialized, requires_git_repository
| [
37811,
38727,
3141,
198,
198,
13838,
25,
37178,
38245,
1279,
81,
652,
31,
81,
652,
13,
65,
952,
29,
198,
37811,
198,
6738,
19720,
1330,
4377,
198,
198,
6738,
17606,
62,
11578,
13,
44506,
13,
9503,
1746,
13,
21812,
1330,
9455,
198,
6... | 3.402597 | 77 |
from django.contrib import admin
from newspaper2.news.models import News, Event
admin.site.register(News, NewsAdmin)
admin.site.register(Event, NewsAdmin)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
7533,
17,
13,
10827,
13,
27530,
1330,
3000,
11,
8558,
198,
198,
28482,
13,
15654,
13,
30238,
7,
9980,
11,
3000,
46787,
8,
198,
28482,
13,
15654,
13,
30238,
7,
9237,
11,... | 3.340426 | 47 |
import numpy as np
import cv2
CLASSES = ["background", "aeroplane", "bicycle", "bird", "boat",
"bottle", "bus", "car", "cat", "chair", "cow", "diningtable",
"dog", "horse", "motorbike", "person", "pottedplant", "sheep",
"sofa", "train", "tvmonitor"]
net = cv2.dnn.readNetFromCaffe(
... | [
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
198,
31631,
1546,
796,
14631,
25249,
1600,
366,
25534,
20106,
1531,
1600,
366,
65,
35298,
1600,
366,
16944,
1600,
366,
24482,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
2... | 2.203209 | 187 |
"""
Name: Lewis Papapetrou
References: Ernst, Phys. Rev., v167, p1175, (1968)
Coordinates: Cartesian
"""
from sympy import Function, Rational, exp, symbols, zeros
coords = symbols("t x y z", real=True)
variables = ()
functions = symbols("k r s w", cls=Function)
t, x, y, z = coords
k, r, s, w = functions
metric = zeros... | [
37811,
198,
5376,
25,
10174,
14185,
499,
316,
472,
198,
19927,
25,
38129,
11,
8687,
13,
5416,
1539,
410,
21940,
11,
279,
1157,
2425,
11,
357,
42246,
8,
198,
7222,
585,
17540,
25,
13690,
35610,
198,
37811,
198,
6738,
10558,
88,
1330,
... | 2.087838 | 296 |
from django.contrib import admin
from modeltranslation.admin import TranslationAdmin
from product.models import (Category, Discount, Review, Product, Properity, ProperityOption,
Image, ShoppingCart, Tag,Wishlist,Color)
admin.site.register(Review, ReviewAdmin)
admin.site.register(Category, Categ... | [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
953,
2120,
26084,
7592,
13,
28482,
1330,
33322,
46787,
198,
6738,
1720,
13,
27530,
1330,
357,
27313,
11,
43474,
11,
6602,
11,
8721,
11,
45989,
414,
11,
45989,
414,
19722,
11,
... | 3.209524 | 105 |
#!/usr/bin/env python3.6
# vim: ts=4 sw=4
import requests, lxml.html, json, sys, os, configparser, re
from datetime import datetime
from mastodon import *
## Initializing
host = 'https://bpnavi.jp'
ua = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
13,
21,
198,
2,
43907,
25,
40379,
28,
19,
1509,
28,
19,
198,
198,
11748,
7007,
11,
300,
19875,
13,
6494,
11,
33918,
11,
25064,
11,
28686,
11,
4566,
48610,
11,
302,
198,
6738,
4818,
... | 2.085476 | 1,439 |
import numpy as np
import matplotlib.pyplot as plt
from scipy import optimize
# Lecture 11 2-user water allocation example
# First approach: scipy.optimize.linprog
# need matrix form: minimize c^T * x, subject to Ax <= b
c = [-5, -3] # negative to maximize
A = [[10,5], [1,1.5], [2,2], [-1,0], [0,-1]]
b = [20, 3, 4.5... | [
11748,
299,
32152,
355,
45941,
220,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
629,
541,
88,
1330,
27183,
198,
198,
2,
31209,
495,
1367,
362,
12,
7220,
1660,
20157,
1672,
198,
2,
3274,
3164,
25,
629,
54... | 2.240246 | 487 |
## This file used to be programmatically generated for converging to best fit Activity Dependent Inhibition curve.
## But that doesn't give decent result, so set by hand.
import sys
sys.path.extend(["../networks"])
## do not import networkConstants as that imports this file, and it's circular then!!!
from networkConst... | [
2235,
770,
2393,
973,
284,
307,
1430,
49454,
7560,
329,
6718,
2667,
284,
1266,
4197,
24641,
37947,
298,
554,
24108,
12133,
13,
198,
2235,
887,
326,
1595,
470,
1577,
7709,
1255,
11,
523,
900,
416,
1021,
13,
198,
198,
11748,
25064,
198,... | 2.959759 | 497 |
from .utils import defaults_f
DEFAULTS = defaults_f({
'ARTIFACTS_ROOT': '~/agoge/artifacts',
'TQDM_DISABLED': False,
'TRIAL_ROOT': 'Worker',
'BUCKET': 'nintorac_model_serving',
'BASE_URL': 'https://github.com/Nintorac/NeuralDX7-weights/raw/master'
})
from .data_handler import DataHandler
from .mod... | [
6738,
764,
26791,
1330,
26235,
62,
69,
198,
7206,
7708,
35342,
796,
26235,
62,
69,
15090,
198,
220,
220,
220,
705,
7227,
5064,
2246,
4694,
62,
13252,
2394,
10354,
705,
93,
14,
3839,
469,
14,
50179,
3256,
198,
220,
220,
220,
705,
51,... | 2.697297 | 185 |
# *
# **
# Python3
if __name__ == '__main__':
print('Start test as main.')
show_type()
test_mutable()
| [
198,
198,
2,
1635,
220,
220,
628,
198,
2,
12429,
220,
220,
628,
198,
2,
11361,
18,
220,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
3601,
10786,
10434,
1332,
355,
1388,
2637,
8,
198... | 2.098361 | 61 |
# -*- coding: utf-8 -*-
import logging
from scrapystsytem.misc.commonspider import CommonSpider
from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor as sle
logger = logging.getLogger(__name__) | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
18931,
198,
6738,
15881,
88,
301,
1837,
11498,
13,
44374,
13,
9503,
684,
79,
1304,
1330,
8070,
41294,
198,
6738,
15881,
88,
13,
2777,
4157,
1330,
14330,
198,
6738... | 2.96 | 75 |
import uuid
| [
11748,
334,
27112,
628
] | 3.25 | 4 |
from nbexchange.handlers.assignment import Assignment, Assignments
from nbexchange.handlers.collection import Collection, Collections
from nbexchange.handlers.feedback import FeedbackHandler
from nbexchange.handlers.pages import HomeHandler
from nbexchange.handlers.submission import Submission, Submissions
default_han... | [
6738,
299,
65,
1069,
3803,
13,
4993,
8116,
13,
562,
16747,
1330,
50144,
11,
2195,
570,
902,
198,
6738,
299,
65,
1069,
3803,
13,
4993,
8116,
13,
43681,
1330,
12251,
11,
50004,
198,
6738,
299,
65,
1069,
3803,
13,
4993,
8116,
13,
12363... | 3.302817 | 142 |
#!/bin/env python3
import operator
from _operator import attrgetter, itemgetter
from collections import defaultdict, Counter
from functools import reduce, partial
from itertools import chain
from aocd import get_data
EMPTY = type('EMPTY', (int,), dict(__repr__=(f := lambda s: 'EMPTY'), __str__=f))(10)
heights = g... | [
2,
48443,
8800,
14,
24330,
21015,
18,
198,
11748,
10088,
198,
6738,
4808,
46616,
1330,
708,
81,
1136,
353,
11,
2378,
1136,
353,
198,
6738,
17268,
1330,
4277,
11600,
11,
15034,
198,
6738,
1257,
310,
10141,
1330,
4646,
11,
13027,
198,
6... | 2.196172 | 627 |
from detectron2.engine import DefaultPredictor
from detectron2.data import MetadataCatalog
from detectron2.config import get_cfg
from detectron2.utils.visualizer import ColorMode, Visualizer
from detectron2 import model_zoo
import cv2
import numpy as np
import requests
# Load an image
res = requests.get("h... | [
6738,
4886,
1313,
17,
13,
18392,
1330,
15161,
47,
17407,
273,
201,
198,
6738,
4886,
1313,
17,
13,
7890,
1330,
3395,
14706,
49015,
201,
198,
6738,
4886,
1313,
17,
13,
11250,
1330,
651,
62,
37581,
201,
198,
6738,
4886,
1313,
17,
13,
2... | 2.291809 | 586 |
import os
import yaml
import json
import click
import hydra.utils.constants as const
from hydra.utils.git import check_repo
from hydra.utils.utils import dict_to_string, inflate_options
from hydra.cloud.local_platform import LocalPlatform
from hydra.cloud.fast_local_platform import FastLocalPlatform
from hydra.cloud.go... | [
11748,
28686,
198,
11748,
331,
43695,
198,
11748,
33918,
198,
11748,
3904,
198,
11748,
25039,
13,
26791,
13,
9979,
1187,
355,
1500,
198,
6738,
25039,
13,
26791,
13,
18300,
1330,
2198,
62,
260,
7501,
198,
6738,
25039,
13,
26791,
13,
2679... | 3.897436 | 117 |
'''requests
biblioteca beaultiful solp para pginas web.
'''
from builtins import print
import requests
'''compartilhando o cabeario http, vem junto com requesio
cabecalho = {'User-agent': 'Windows 12',
'Referer': 'https://google.com.br'}
meus_cookies = {'Ultima-visita': '10-10-2020'}
meus_dado... | [
7061,
6,
8897,
3558,
201,
198,
65,
29142,
313,
31047,
307,
1721,
4135,
1540,
79,
31215,
279,
1655,
292,
3992,
13,
201,
198,
7061,
6,
201,
198,
6738,
3170,
1040,
1330,
3601,
201,
198,
201,
198,
11748,
7007,
201,
198,
201,
198,
7061,
... | 2.197143 | 350 |
import pygame
import random
import sys
Xfactor = 1.35
Yfactor = 3.2
CELLS = 9
PLAYERS = 2
CORNERS = [1, 3, 7, 9]
NON_CORNERS = [2, 4, 6, 8]
board = {}
for i in range(9):
board[i + 1] = 0
signs = {0: " ", 1: "X", 2: "O"}
winner = None
boardX = 10
boardY = 464
icon = pygame.image.load("ttticon2.png"... | [
11748,
12972,
6057,
201,
198,
11748,
4738,
201,
198,
11748,
25064,
201,
198,
201,
198,
55,
31412,
796,
352,
13,
2327,
201,
198,
56,
31412,
796,
513,
13,
17,
201,
198,
5222,
3069,
50,
796,
860,
201,
198,
31519,
4877,
796,
362,
201,
... | 1.773414 | 5,755 |
# -*- coding: utf-8 -*-
# @Time : 2021/9/18 11:23
# @Author : DaiPuWei
# @Email : 771830171@qq.com
# @File : dataset_utils.py
# @Software: PyCharm
"""
YOLO
"""
import cv2
import numpy as np
from PIL import Image
from matplotlib.colors import rgb_to_hsv, hsv_to_rgb
from utils.model_utils import get_clas... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
7575,
220,
220,
220,
1058,
33448,
14,
24,
14,
1507,
1367,
25,
1954,
198,
2,
2488,
13838,
220,
1058,
39604,
47,
84,
1135,
72,
198,
2,
2488,
15333,
220,
220,
... | 1.98057 | 772 |
import string
if __name__ == "__main__":
print(caesar_cipher("meetMeAtOurHideOutAtTwo", 10))
print(caesar_cipher("woodWoKdYebRsnoYedKdDgy", 10, decrypt=True))
| [
11748,
4731,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
3601,
7,
6888,
18964,
62,
66,
10803,
7203,
47745,
5308,
2953,
5122,
38518,
7975,
2953,
7571,
1600,
838,
4008,
198,
220,
220,
220,
3601... | 2.366197 | 71 |
import json
import logging
from app.abc import StartError
from app.device import DeviceApp, DeviceMessage
from app.device.models import Device
from app.hint import HintApp
from app.hint.defs import HintMessage
from util.storage import DataStore
LOGGER = logging.getLogger(__name__)
| [
11748,
33918,
198,
11748,
18931,
198,
198,
6738,
598,
13,
39305,
1330,
7253,
12331,
198,
6738,
598,
13,
25202,
1330,
16232,
4677,
11,
16232,
12837,
198,
6738,
598,
13,
25202,
13,
27530,
1330,
16232,
198,
6738,
598,
13,
71,
600,
1330,
... | 3.518519 | 81 |
#
# Author: Micha Borzcki
#
# This script creates empty files with study and data object metadata in
# specified space and Oneprovider. It uses JSON files located in directories
# `studies_dir` (= studies) and `data_object_dir` (= data_objects). Positional
# arguments:
# 1. Oneprovider location (IP address or domain).... | [
2,
198,
2,
6434,
25,
38844,
12182,
89,
49108,
198,
2,
220,
198,
2,
770,
4226,
8075,
6565,
3696,
351,
2050,
290,
1366,
2134,
20150,
287,
198,
2,
7368,
2272,
290,
1550,
538,
18657,
1304,
13,
632,
3544,
19449,
3696,
5140,
287,
29196,
... | 2.461712 | 1,332 |
from flask import jsonify, request
import backend.services.user as user_services
from . import bp
| [
6738,
42903,
1330,
33918,
1958,
11,
2581,
198,
198,
11748,
30203,
13,
30416,
13,
7220,
355,
2836,
62,
30416,
198,
198,
6738,
764,
1330,
275,
79,
628,
628,
628,
628
] | 3.566667 | 30 |
# flake8: noqa
from mot.motion_models.base_motion_model import MotionModel
from mot.motion_models.CT_motion_model import CoordinateTurnMotionModel
from mot.motion_models.CV_motion_model import ConstantVelocityMotionModel
| [
2,
781,
539,
23,
25,
645,
20402,
198,
198,
6738,
2369,
13,
38714,
62,
27530,
13,
8692,
62,
38714,
62,
19849,
1330,
20843,
17633,
198,
6738,
2369,
13,
38714,
62,
27530,
13,
4177,
62,
38714,
62,
19849,
1330,
22819,
4559,
17278,
45740,
... | 3.52381 | 63 |
# modu
# Copyright (c) 2006-2010 Phil Christensen
# http://modu.bubblehouse.org
#
#
# See LICENSE for details
"""
Datatypes for managing stringlike data.
"""
import time, datetime
from zope.interface import implements
from modu.editable import IDatatype, define
from modu.util import form, tags, date
from modu.persi... | [
2,
953,
84,
198,
2,
15069,
357,
66,
8,
4793,
12,
10333,
4543,
49195,
198,
2,
2638,
1378,
4666,
84,
13,
46176,
903,
4803,
13,
2398,
198,
2,
198,
2,
198,
2,
4091,
38559,
24290,
329,
3307,
198,
198,
37811,
198,
27354,
265,
9497,
32... | 3.081481 | 135 |
from functions.summation import summation
from functions.subtraction import subtraction
from functions.multiplication import multiplication
from functions.division import division
from functions.exponential import exponential
from functions.root import root
num1 = float(input('nmero 1: '))
num2 = float(input('nmero 2:... | [
6738,
5499,
13,
82,
13929,
341,
1330,
30114,
341,
198,
6738,
5499,
13,
7266,
83,
7861,
1330,
13284,
7861,
198,
6738,
5499,
13,
47945,
3299,
1330,
48473,
198,
6738,
5499,
13,
21426,
1330,
7297,
198,
6738,
5499,
13,
11201,
35470,
1330,
... | 3.079545 | 264 |
! pip install -q librosa nltk
import torch
import numpy as np
import librosa
import librosa.display
import IPython
from IPython.display import Audio
# need this for English text processing frontend
import nltk
! python -m nltk.downloader cmudict
preset = "20180505_deepvoice3_ljspeech.json"
checkpoint_path = "20180505... | [
0,
7347,
2721,
532,
80,
9195,
4951,
64,
299,
2528,
74,
198,
198,
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
9195,
4951,
64,
198,
11748,
9195,
4951,
64,
13,
13812,
198,
11748,
6101,
7535,
198,
6738,
6101,
7535,
13,
... | 3.133433 | 667 |
from discord.ext import commands
from lib import exceptions
import os
import json
configFile = os.path.join(os.getcwd(), "data", "config.json")
with open(configFile, "rb") as f:
config = json.load(f)
| [
6738,
36446,
13,
2302,
1330,
9729,
198,
6738,
9195,
1330,
13269,
198,
198,
11748,
28686,
220,
198,
11748,
33918,
198,
198,
11250,
8979,
796,
28686,
13,
6978,
13,
22179,
7,
418,
13,
1136,
66,
16993,
22784,
366,
7890,
1600,
366,
11250,
... | 2.929577 | 71 |
import gym
import numpy as np
from torchvision.utils import save_image
from .fixobj import FixedObjectGoalEnv
| [
11748,
11550,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
28034,
10178,
13,
26791,
1330,
3613,
62,
9060,
198,
198,
6738,
764,
13049,
26801,
1330,
10832,
10267,
49045,
4834,
85,
628
] | 3.612903 | 31 |
"""Alias command."""
from . import Command
from ...packets import MessagePacket
| [
37811,
40489,
3141,
526,
15931,
198,
198,
6738,
764,
1330,
9455,
198,
6738,
2644,
8002,
1039,
1330,
16000,
47,
8317,
628
] | 3.904762 | 21 |
import numpy as np
def normalize(signal, minimum=None, maximum=None):
"""Normalize a signal to the range 0, 1. Uses the minimum and maximum observed in the data unless explicitly passed."""
signal = np.array(signal).astype('float')
if minimum is None:
minimum = np.min(signal)
if maximum is None... | [
11748,
299,
32152,
355,
45941,
198,
198,
4299,
3487,
1096,
7,
12683,
282,
11,
5288,
28,
14202,
11,
5415,
28,
14202,
2599,
198,
220,
220,
220,
37227,
26447,
1096,
257,
6737,
284,
262,
2837,
657,
11,
352,
13,
36965,
262,
5288,
290,
54... | 2.322608 | 1,181 |
import os
import sys
import hashlib
import importlib
if is_available_boto3():
import boto3
from botocore import UNSIGNED
from botocore.client import Config
else:
raise ModuleNotFoundError("Please install boto3 with: `pip install boto3`.")
| [
11748,
28686,
198,
11748,
25064,
198,
11748,
12234,
8019,
198,
11748,
1330,
8019,
628,
198,
198,
361,
318,
62,
15182,
62,
65,
2069,
18,
33529,
198,
220,
220,
220,
1330,
275,
2069,
18,
198,
220,
220,
220,
422,
10214,
420,
382,
1330,
... | 2.954545 | 88 |
if __name__ == "__main__":
main()
| [
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 2.166667 | 18 |
#!/usr/bin/python
#
# Copyright 2020 Google LLC
#
# 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 ag... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
198,
2,
15069,
12131,
3012,
11419,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287... | 3.617143 | 175 |
from sqlalchemy import *
from sqlalchemy.orm import relationship
from db import db
def __update_id__(fleet):
fleet.id = ':'.join([fleet.deployment_target_id, fleet.fleet_type_id, fleet.name])
| [
6738,
44161,
282,
26599,
1330,
1635,
198,
6738,
44161,
282,
26599,
13,
579,
1330,
2776,
198,
198,
6738,
20613,
1330,
20613,
628,
628,
198,
4299,
11593,
19119,
62,
312,
834,
7,
33559,
2599,
198,
220,
220,
220,
11026,
13,
312,
796,
705,... | 2.913043 | 69 |
from django.contrib import admin
from .models import HypertriviationUser
# Register your models here.
admin.site.register(HypertriviationUser, HypertriviationUserAdmin) | [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
764,
27530,
1330,
6707,
11766,
15104,
3920,
12982,
628,
198,
2,
17296,
534,
4981,
994,
13,
198,
28482,
13,
15654,
13,
30238,
7,
21217,
11766,
15104,
3920,
12982,
11,
6707,
... | 3.638298 | 47 |
###################################################################
######## Follow up email #############
###################################################################
"""
followup_email.py
This is special use case code written to assist bot developers. It consolidates to... | [
29113,
29113,
21017,
198,
7804,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7281,
510,
3053,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
7804,
4242,
198,
29113,
29113,
... | 3.068493 | 511 |
from marshmallow import validate, fields, Schema
| [
6738,
22397,
42725,
1330,
220,
26571,
11,
7032,
11,
10011,
2611,
198
] | 4.166667 | 12 |
#!/usr/bin/env python
# -*- coding: iso-8859-15 -*-
#
# Copyright 2003-2015 CORE Security Technologies
#
# 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/LIC... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
47279,
12,
3459,
3270,
12,
1314,
532,
9,
12,
198,
2,
198,
2,
15069,
5816,
12,
4626,
327,
6965,
4765,
21852,
198,
2,
198,
2,
49962,
739,
262,
24843,
1378... | 3.222222 | 234 |
import os
| [
11748,
28686,
628
] | 3.666667 | 3 |
from .library import *
from .differentiation import *
from .sindy_ball import SINDyBall
from .tests import *
from .utils import *
| [
6738,
764,
32016,
1330,
1635,
198,
6738,
764,
39799,
3920,
1330,
1635,
198,
6738,
764,
82,
521,
88,
62,
1894,
1330,
311,
12115,
88,
23410,
198,
6738,
764,
41989,
1330,
1635,
198,
6738,
764,
26791,
1330,
1635,
198
] | 3.421053 | 38 |
from django.db import models
from django.contrib.auth.models import AbstractUser
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
27741,
12982,
628
] | 3.727273 | 22 |
#!/usr/bin/python
import glob
main()
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
15095,
198,
198,
12417,
3419,
198
] | 2.4375 | 16 |
import base64
import datetime
import email
import logging
import os
import typing
from email.message import Message
from googleapiclient import errors
from email_scrapper.models import Stores
from email_scrapper.readers.base_reader import BaseReader
logger = logging.getLogger(__name__)
| [
11748,
2779,
2414,
198,
11748,
4818,
8079,
198,
11748,
3053,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
19720,
198,
6738,
3053,
13,
20500,
1330,
16000,
198,
198,
6738,
23645,
499,
291,
75,
1153,
1330,
8563,
198,
198,
6738,
3053,
... | 3.592593 | 81 |
a=[1,2,3]
b=[1,1,1]
#d={1:"ONE", 2:"TWO", 3:"THREE", 4:"FOUR", 5:"FIVE", 6:"SIX"}
f=[a[0]+b[0],a[1]+b[1],a[2]+b[2]]
if f[0]==1:
f[0]="ONE"
elif f[0]==2:
f[0]="TWO"
print(f)
| [
64,
41888,
16,
11,
17,
11,
18,
60,
198,
65,
41888,
16,
11,
16,
11,
16,
60,
198,
198,
2,
67,
34758,
16,
11097,
11651,
1600,
362,
11097,
34551,
46,
1600,
513,
11097,
4221,
11587,
1600,
604,
11097,
37,
11698,
1600,
642,
11097,
37,
... | 1.449612 | 129 |
'''
A+B for Input-Output Practice (IV)
Your task is to Calculate the sum of some integers.
Input contains multiple test cases. Each test case contains a integer N,
and then N integers follow in the same line.
A test case starting with 0 terminates the input and this test case is not to be processed.
For each group o... | [
7061,
6,
198,
32,
10,
33,
329,
23412,
12,
26410,
19939,
357,
3824,
8,
198,
198,
7120,
4876,
318,
284,
27131,
378,
262,
2160,
286,
617,
37014,
13,
198,
198,
20560,
4909,
3294,
1332,
2663,
13,
5501,
1332,
1339,
4909,
257,
18253,
399,
... | 2.798419 | 253 |
import multiprocessing
import os
import os.path
import pickle
import librosa
import numpy as np
from scipy import signal
if __name__ == '__main__':
# Establish communication queues
tasks = multiprocessing.JoinableQueue()
# Start consumers
num_consumers = multiprocessing.cpu_count()
print('Crea... | [
11748,
18540,
305,
919,
278,
198,
11748,
28686,
198,
11748,
28686,
13,
6978,
198,
11748,
2298,
293,
198,
198,
11748,
9195,
4951,
64,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
1330,
6737,
628,
628,
198,
361,
11593,
3... | 2.444191 | 439 |
import inspect
import logging
from protean.container import Element, OptionsMixin
from protean.core.event import BaseEvent
from protean.exceptions import IncorrectUsageError
from protean.utils import DomainObjects, derive_element_class, fully_qualified_name
from protean.utils.mixins import HandlerMixin
logger = loggi... | [
11748,
10104,
198,
11748,
18931,
198,
198,
6738,
5915,
272,
13,
34924,
1330,
11703,
11,
18634,
35608,
259,
198,
6738,
5915,
272,
13,
7295,
13,
15596,
1330,
7308,
9237,
198,
6738,
5915,
272,
13,
1069,
11755,
1330,
3457,
47315,
28350,
123... | 3.709677 | 93 |
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 17 10:12:26 2021
@author: Florian Jehn
"""
import os
import pandas as pd
import numpy as np
def read_ipcc_counts_temp():
"""reads all counts of temperatures for all reports and makes on df"""
files = os.listdir(os.getcwd()+os.sep+"Results"+ os.sep + "temperature... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
19480,
8621,
1596,
838,
25,
1065,
25,
2075,
33448,
198,
198,
31,
9800,
25,
4432,
666,
3852,
21116,
198,
37811,
198,
11748,
28686,
198,
11748,
197... | 2.122304 | 3,524 |
from pytest import fixture
from zev.get_filesize import get_filesize
| [
6738,
12972,
9288,
1330,
29220,
198,
198,
6738,
1976,
1990,
13,
1136,
62,
16624,
1096,
1330,
651,
62,
16624,
1096,
628
] | 3.380952 | 21 |
main()
| [
198,
198,
12417,
3419,
198
] | 1.8 | 5 |
#This program calculates the successive values of the following
# calculation: Next value by taking the positive integer added by user
# and if it is even divide it by 2, if it is odd, multiply by
#3 and add 1.Program ends if current value is 1.
#First: I created variable "pnumber" which will be the positive integer ... | [
2,
1212,
1430,
43707,
262,
25175,
3815,
286,
262,
1708,
198,
2,
17952,
25,
7406,
1988,
416,
2263,
262,
3967,
18253,
2087,
416,
2836,
198,
2,
290,
611,
340,
318,
772,
14083,
340,
416,
362,
11,
611,
340,
318,
5629,
11,
29162,
416,
1... | 3.269886 | 352 |
# main function
has33([1, 3, 3])
has33([3, 1, 3])
has33([3, 3, 3])
has33([1, 3, 1, 3])
| [
2,
1388,
2163,
628,
198,
10134,
2091,
26933,
16,
11,
513,
11,
513,
12962,
198,
10134,
2091,
26933,
18,
11,
352,
11,
513,
12962,
198,
10134,
2091,
26933,
18,
11,
513,
11,
513,
12962,
198,
10134,
2091,
26933,
16,
11,
513,
11,
352,
1... | 1.893617 | 47 |
from django.contrib import admin
from django.urls import path, include
from django.conf.urls.static import static
from django.conf import settings
from products.views import (products, index,
products_detail)
from rest_framework_jwt.views import refresh_jwt_token
from users.views import Obta... | [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
11,
2291,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
13,
12708,
1330,
9037,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
... | 2.769697 | 330 |
from survos2.config import Config
import numpy as np
from numpy.lib.function_base import flip
from qtpy import QtWidgets
from qtpy.QtWidgets import QPushButton, QRadioButton
from survos2.frontend.components.base import *
from survos2.frontend.components.entity import (
SmallVolWidget,
TableWidget,
setup_en... | [
6738,
3343,
418,
17,
13,
11250,
1330,
17056,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
299,
32152,
13,
8019,
13,
8818,
62,
8692,
1330,
14283,
198,
6738,
10662,
83,
9078,
1330,
33734,
54,
312,
11407,
198,
6738,
10662,
83,
9078,
13... | 3.192053 | 302 |
import sys
import gzip
import numpy as np
if __name__ == "__main__":
f_names = sys.argv[1:]
max_value = 100000
bin_size = 50
threshold = 0.01
data = []
total_bins = (max_value/bin_size)+1
for no, f_name in enumerate(f_names):
#prefix = f_name.split("/")[-1].replace(".tx... | [
11748,
25064,
198,
11748,
308,
13344,
198,
11748,
299,
32152,
355,
45941,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
628,
220,
220,
220,
277,
62,
14933,
796,
25064,
13,
853,
85,
58,
16,
47715,
198,
220,
220,
... | 1.806078 | 691 |
from tqdm import tqdm
import os
import glob
import pickle
import numpy as np
from imageio import imread, imwrite
import astimp
from multiprocessing import Pool, cpu_count
from functools import partial
def preprocess_one_image(path):
img = np.array(imread(path)) # load image
ast = astimp.AST(img)
c... | [
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
11748,
28686,
198,
11748,
15095,
198,
11748,
2298,
293,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
2939,
952,
1330,
545,
961,
11,
545,
13564,
198,
11748,
6468,
11011,
198,
6738,
18540... | 2.244657 | 1,357 |
from clustering_algorithms import CLARA, PAM, get_initial_points
from data_loaders import load_data
from timer import Timer
from visualizers import plot_data
# FILENAME = "datasets/artificial/sizes3.arff"
FILENAME = "datasets/artificial/zelnik4.arff"
# FILENAME = "datasets/artificial/xclara.arff"
# FILENAME = "dataset... | [
6738,
32966,
1586,
62,
282,
7727,
907,
1330,
7852,
24401,
11,
350,
2390,
11,
651,
62,
36733,
62,
13033,
198,
6738,
1366,
62,
2220,
364,
1330,
3440,
62,
7890,
198,
6738,
19781,
1330,
5045,
263,
198,
6738,
5874,
11341,
1330,
7110,
62,
... | 2.642599 | 277 |
from module import support
from module import fibo
import sys
support.print_func("Runoob")
fibo.fib(1000)
print(fibo.fib2(100))
print(fibo.__name__)
#
fib = fibo.fib
fib(10)
"""
fromimport
Pythonfrom
from modname import name1[, name2[, ... nameN]]
fibo fib
>>> from fibo import fib, fib2
>>> fib(500)
1 1 2 3 5... | [
6738,
8265,
1330,
1104,
198,
6738,
8265,
1330,
12900,
78,
198,
11748,
25064,
198,
198,
11284,
13,
4798,
62,
20786,
7203,
10987,
78,
672,
4943,
198,
198,
69,
26762,
13,
69,
571,
7,
12825,
8,
198,
198,
4798,
7,
69,
26762,
13,
69,
57... | 2.220896 | 335 |
import torch
from einops import rearrange
import svgwrite
###########################################
# Normalization / Standardization functions
###########################################
def normalize_functional(tensor: torch.Tensor, mean: list, std: list):
"""
Standardizes tensor in the channel dimension... | [
11748,
28034,
198,
6738,
304,
259,
2840,
1330,
37825,
858,
198,
11748,
38487,
70,
13564,
628,
198,
29113,
7804,
21017,
198,
2,
14435,
1634,
1220,
8997,
1634,
5499,
198,
29113,
7804,
21017,
198,
198,
4299,
3487,
1096,
62,
45124,
7,
83,
... | 2.644721 | 1,686 |
import cv2
import numpy as np
from skimage import draw
from skimage import io
# Read image
im_in = cv2.imread("analyses/MDA231_stopper_1_c3.tif", cv2.IMREAD_GRAYSCALE);
# Threshold.
# Set values equal to or above 220 to 0.
# Set values below 220 to 255.
th, im_th = cv2.threshold(im_in, 20, 255, cv2.THRESH_BINARY_... | [
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
9060,
1330,
3197,
198,
6738,
1341,
9060,
1330,
33245,
198,
220,
198,
2,
4149,
2939,
198,
320,
62,
259,
796,
269,
85,
17,
13,
320,
961,
7203,
272,
43710,
14,
... | 2.359395 | 1,586 |
from bxcommon.test_utils.abstract_test_case import AbstractTestCase
from bxcommon.messages.bloxroute.txs_message import TxsMessage
from bxcommon.models.transaction_info import TransactionInfo
from bxcommon.test_utils import helpers
from bxcommon.utils.object_hash import Sha256Hash
| [
6738,
275,
87,
11321,
13,
9288,
62,
26791,
13,
397,
8709,
62,
9288,
62,
7442,
1330,
27741,
14402,
20448,
198,
6738,
275,
87,
11321,
13,
37348,
1095,
13,
2436,
1140,
38629,
13,
17602,
82,
62,
20500,
1330,
309,
34223,
12837,
198,
6738,
... | 3.45122 | 82 |
lanche = ('Hambrguer', 'Suco', 'Pizza', 'Pudim', 'Batata Frita')
# Tuplas so imutveis
# lanche[1] = 'Refrigerante' - Esse comando no vai funcionar
print(len(lanche))
print(sorted(lanche))
print(lanche)
print(lanche[-3:])
for comida in lanche:
print(f'Eu vou comer {comida}')
for cont in range(0, len(lanche)):
... | [
75,
6362,
796,
19203,
21281,
1671,
5162,
263,
3256,
705,
5606,
1073,
3256,
705,
47,
9990,
3256,
705,
47,
463,
320,
3256,
705,
24541,
1045,
376,
799,
64,
11537,
198,
2,
16749,
489,
292,
523,
545,
315,
303,
271,
198,
2,
300,
6362,
5... | 2.101796 | 334 |
import yaml
import os
config_file = os.path.join(os.path.dirname(__file__), "config/config.yml")
with open(config_file, 'r') as stream:
CONFIG = yaml.load(stream) | [
11748,
331,
43695,
198,
11748,
28686,
198,
198,
11250,
62,
7753,
796,
28686,
13,
6978,
13,
22179,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
828,
366,
11250,
14,
11250,
13,
88,
4029,
4943,
198,
4480,
1280,
7,
11250,
62,
... | 2.609375 | 64 |
import xml.etree.ElementTree as ET
tree = ET.parse('/Users/zhaoli/workspace/splunk/playground/var/lib/jenkins/jobs/Splunk/jobs/develop/jobs/platform/jobs/cli/jobs/trigger_cli_linux/config.xml')
root = tree.getroot()
# SPs = root.findall("properties/hudson.model.ParametersDefinitionProperty/parameterDefinitions/[huds... | [
11748,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12152,
628,
198,
21048,
796,
12152,
13,
29572,
10786,
14,
14490,
14,
89,
3099,
11106,
14,
5225,
10223,
14,
22018,
2954,
14,
1759,
2833,
14,
7785,
14,
8019,
14,
48796,
5331,
14,
43863,... | 2.860248 | 322 |
import random
def format_fasta(title, sequence):
"""
This formats a fasta sequence
Input:
title - String - Title of the sequence
sequence - String - Actual sequence
Output:
String - Fully formatted fasta sequence
"""
fasta_width = 70 # Number of characters in one line
n... | [
11748,
4738,
198,
198,
4299,
5794,
62,
7217,
64,
7,
7839,
11,
8379,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
17519,
257,
3049,
64,
8379,
198,
220,
220,
220,
23412,
25,
220,
198,
220,
220,
220,
220,
220,
3670,
532,... | 2.594737 | 380 |
import sublime
import os
| [
11748,
41674,
198,
11748,
28686,
628
] | 4.333333 | 6 |
from flask import Flask, render_template
app = Flask(__name__)
app.config['DEBUG'] = True
# Note: We don't need to call run() since our application is embedded within
# the App Engine WSGI application server.
# return render_template('bootstrap_cover.html', name=name)
# @app.route('/rates')
# def helloRates(name=... | [
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
198,
1324,
13,
11250,
17816,
30531,
20520,
796,
6407,
198,
198,
2,
5740,
25,
775,
836,
470,
761,
284,
869,
1057,
3419,
1201,
674,
3586,... | 3.243697 | 119 |
from unittest.mock import Mock, patch
import pytest
import patterns.echo_server_contextvar as main
| [
6738,
555,
715,
395,
13,
76,
735,
1330,
44123,
11,
8529,
198,
198,
11748,
12972,
9288,
198,
198,
11748,
7572,
13,
30328,
62,
15388,
62,
22866,
7785,
355,
1388,
628,
198
] | 3.322581 | 31 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Autor: rique_dev (rique_dev@hotmail.com)
from SSLProxies24.Feed import Feed
from SSLProxies24.Check import CheckProxy
import time
import gc
# Recupera a listagem
prx = Feed().PROXY_LIST
# Inicia classe
chk = CheckProxy()
# Comea validao
chk.validatelist(prx)
# Ativa... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
5231,
273,
25,
374,
2350,
62,
7959,
357,
33865,
62,
7959,
31,
8940,
4529,
13,
785,
8,
198,
198,
6738,
25952... | 2.387543 | 289 |
import math as m
| [
11748,
10688,
355,
285,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220
] | 1.352941 | 34 |
## ========================================================================= ##
## Copyright (c) 2019 Agustin Durand Diaz. ##
## This code is licensed under the MIT license. ##
## hud_b2d.py ... | [
2235,
38093,
2559,
22492,
201,
198,
2235,
15069,
357,
66,
8,
13130,
2449,
436,
259,
11164,
392,
26899,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220... | 2.557522 | 226 |
def get_final_txt(grb, tables, sentences, output_path):
"""
Combine the data from [grb]_final_sentences.txt and [grb]_final_tables.txt.
If a piece of data in tables and another piece in sentecnes are originially
from the same GCN. Put them in the same GCN in [grb]_final.txt.
"""
# Avoid modifyi... | [
4299,
651,
62,
20311,
62,
14116,
7,
2164,
65,
11,
8893,
11,
13439,
11,
5072,
62,
6978,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
29176,
262,
1366,
422,
685,
2164,
65,
60,
62,
20311,
62,
34086,
3007,
13,
14116,
290,
685,... | 2.290058 | 855 |
from solid import *
from solid.utils import *
import util
from util import *
from math import pi
if __name__ == '__main__':
export_scad()
| [
6738,
4735,
1330,
1635,
198,
6738,
4735,
13,
26791,
1330,
1635,
198,
11748,
7736,
198,
6738,
7736,
1330,
1635,
198,
6738,
10688,
1330,
31028,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
10784,... | 3.108696 | 46 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
r"""General solver of the 1D meridional advection-diffusion equation on the sphere:
.. math::
\frac{\partial}{\partial t} \psi(\phi,t) &= -\frac{1}{a \cos\phi} \frac{\partial}{\partial \phi} \left[ \cos\phi ~ F(\phi,t) \right] \\
F &= U(\phi) \psi(\phi) -\frac{K(\phi)}{a} ~ \frac{\partial \psi}{\partial \phi}... | [
81,
37811,
12218,
1540,
332,
286,
262,
352,
35,
4017,
312,
1538,
512,
303,
596,
12,
26069,
4241,
16022,
319,
262,
16558,
25,
198,
198,
492,
10688,
3712,
628,
220,
220,
220,
3467,
31944,
31478,
47172,
18477,
59,
47172,
256,
92,
3467,
... | 2.954688 | 640 |
# Tencent is pleased to support the open source community by making GNES available.
#
# Copyright (C) 2019 THL A29 Limited, a Tencent company. 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... | [
2,
220,
9368,
1087,
318,
10607,
284,
1104,
262,
1280,
2723,
2055,
416,
1642,
15484,
1546,
1695,
13,
198,
2,
198,
2,
220,
15069,
357,
34,
8,
13130,
2320,
43,
317,
1959,
15302,
11,
257,
9368,
1087,
1664,
13,
1439,
2489,
10395,
13,
1... | 3.726872 | 227 |
import uuid
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils import timezone
from django.utils.timesince import timesince
from django.utils.translation import gettext_lazy as _
from dhost.dapps.models import Dapp
| [
11748,
334,
27112,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
11299,
19199,
13,
27530,
1330,
14041,
6030,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
... | 3.511364 | 88 |
data = open("input.txt", "r").readlines()
polymer = data[0]
pair_insertion = {}
for line in data[2:]:
[token, replacement] = line.strip().split(" -> ")
pair_insertion[token] = replacement
result = [i for i in polymer.strip()]
for step in range(0, 10):
next = []
for i, si in enumerate(result):
... | [
7890,
796,
1280,
7203,
15414,
13,
14116,
1600,
366,
81,
11074,
961,
6615,
3419,
198,
198,
35428,
647,
796,
1366,
58,
15,
60,
198,
198,
24874,
62,
28463,
295,
796,
23884,
198,
1640,
1627,
287,
1366,
58,
17,
25,
5974,
198,
220,
220,
... | 2.348485 | 264 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.891892 | 37 |
'''
Tests for utils submodule of the analysis module.
'''
from nose.tools import assert_equal, assert_raises
from coral import analysis, DNA, RNA, Peptide
| [
7061,
6,
198,
51,
3558,
329,
3384,
4487,
850,
21412,
286,
262,
3781,
8265,
13,
198,
198,
7061,
6,
198,
198,
6738,
9686,
13,
31391,
1330,
6818,
62,
40496,
11,
6818,
62,
430,
2696,
198,
6738,
29537,
1330,
3781,
11,
7446,
11,
25897,
... | 3.291667 | 48 |
"""
Carry out template-based replacements in project files
"""
import os
import sys
from string import Template
def replace_name(path, mapping):
"""
Handles replacement strings in the file or directory name
"""
# look for replacement strings in filename
f_split = list(os.path.spli... | [
37811,
201,
198,
34,
6532,
503,
11055,
12,
3106,
36205,
287,
1628,
3696,
201,
198,
37811,
201,
198,
201,
198,
11748,
28686,
201,
198,
11748,
25064,
201,
198,
6738,
4731,
1330,
37350,
201,
198,
201,
198,
201,
198,
4299,
6330,
62,
3672,... | 2.301173 | 767 |
import hashlib
import os
# MD5
# SHA256
# MD5
| [
11748,
12234,
8019,
198,
11748,
28686,
628,
198,
2,
10670,
20,
628,
198,
2,
25630,
11645,
628,
198,
2,
10670,
20,
628,
628,
198
] | 2.333333 | 24 |
import os
import sys
from dotenv import load_dotenv
from facebook_scraper import get_posts
load_dotenv()
print ("hi")
result = []
for post in get_posts(group=os.environ.get("FacebookGroupId"), pages=1,
credentials=(os.environ.get("FacebookUser"), os.environ.get("FacebookPassword"))):
result.... | [
11748,
28686,
198,
11748,
25064,
198,
6738,
16605,
24330,
1330,
3440,
62,
26518,
24330,
198,
6738,
23960,
62,
1416,
38545,
1330,
651,
62,
24875,
198,
198,
2220,
62,
26518,
24330,
3419,
198,
198,
4798,
5855,
5303,
4943,
198,
198,
20274,
... | 2.378906 | 256 |
import os
#github login
SITE = 'https://api.github.com'
CALLBACK = 'https://oneliner.sh/oauth2'
AUTHORIZE_URL = 'https://github.com/login/oauth/authorize'
TOKEN_URL = 'https://github.com/login/oauth/access_token'
SCOPE = 'user'
#redis config
REDIS_HOST = os.environ['REDIS_HOST']
#REDIS_HOST = ... | [
11748,
28686,
198,
2,
12567,
17594,
198,
50,
12709,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
705,
5450,
1378,
15042,
13,
12567,
13,
785,
6,
198,
34,
7036,
31098,
220,
220,
220,
220,
220,
796,
705,
5450,
1378,
26261,
7274,
... | 2.199005 | 201 |
import json
from npt import log
from . import tmpdir
def read_geojson(filename):
"""
Return JSON object from GeoJSON
"""
with open(filename, 'r') as fp:
js = json.load(fp)
return js
| [
11748,
33918,
198,
198,
6738,
299,
457,
1330,
2604,
198,
198,
6738,
764,
1330,
45218,
15908,
628,
198,
4299,
1100,
62,
469,
13210,
1559,
7,
34345,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
8229,
19449,
2134,
422,
32960,
403... | 2.488372 | 86 |
"""
Prueba creacion de usuarios
"""
# import json
from typing import Any, Dict
import pytest
from django.contrib.auth import get_user_model
from apps.user.serializers import UserHeavySerializer
# from django.contrib.auth.models import User
User = get_user_model()
pytestmark = [pytest.mark.django_db, pytest.mark... | [
37811,
198,
6836,
518,
7012,
1126,
49443,
390,
514,
84,
13010,
198,
37811,
198,
198,
2,
1330,
33918,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
133... | 2.908333 | 120 |
import pybullet as p
import pybullet
import time
p.connect(p.GUI)
p.loadURDF("toys/concave_box.urdf")
p.setGravity(0,0,-10)
for i in range (10):
p.loadURDF("sphere_1cm.urdf",[i*0.02,0,0.5])
p.loadURDF("duck_vhacd.urdf")
timeStep = 1./240.
p.setTimeStep(timeStep)
while (1):
p.stepSimulation()
time.sleep(timeStep)
| [
11748,
12972,
15065,
1616,
355,
279,
198,
11748,
12972,
15065,
1616,
220,
198,
11748,
640,
198,
79,
13,
8443,
7,
79,
13,
40156,
8,
198,
79,
13,
2220,
4261,
8068,
7203,
83,
19417,
14,
1102,
66,
1015,
62,
3524,
13,
2799,
69,
4943,
1... | 2.071429 | 154 |
from pylatex import Document, Tabular, Section, NoEscape, Command, MultiRow
from Old.BioCatHubDatenmodell import DataModel
first_name = "some firstname"
last_name = "some lastname"
e_mail = "some@adress.com"
institution = "some institution"
vessel_type = "some vessel"
volume = int(42)
vol_unit = "mol/l"
add_attributes... | [
6738,
279,
2645,
378,
87,
1330,
16854,
11,
16904,
934,
11,
7275,
11,
1400,
36,
6794,
11,
9455,
11,
15237,
25166,
198,
6738,
5706,
13,
42787,
21979,
16066,
27354,
268,
4666,
695,
1330,
6060,
17633,
198,
198,
11085,
62,
3672,
796,
366,
... | 2.666667 | 186 |
import cv2
import numpy as np
import matplotlib.pyplot as plt
pic = cv2.imread('image2.png',0)
#pic = imageio.imread('img/parrot.jpg')
gray = lambda rgb : np.dot(rgb[... , :3] , [0.299 , 0.587, 0.114])
gray = gray(pic)
'''
log transform
-> s = c*log(1+r)
So, we calculate constant c to estimate s
-> c = (L-1)/log(1+|... | [
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
16564,
796,
269,
85,
17,
13,
320,
961,
10786,
9060,
17,
13,
11134,
3256,
15,
8,
198,
2,
16564,
796,
2939,
9... | 2.199052 | 211 |
#!/usr/bin/env python
import pika
import sys
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()
channel.queue_declare(queue='task_queue', durable=True)
message = ''.join(sys.argv[1:]) or 'Hello World!'
for i in range(30):
message = str(i)+' '+i*'.'
ch... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
279,
9232,
198,
11748,
25064,
628,
198,
38659,
796,
279,
9232,
13,
3629,
8629,
32048,
7,
79,
9232,
13,
32048,
48944,
10786,
36750,
6,
4008,
198,
17620,
796,
4637,
13,
17620,
341... | 2.91716 | 169 |
from ConfigParser import SafeConfigParser
from cStringIO import StringIO
import sqlalchemy
from sqlalchemy import create_engine
from sqlalchemy import MetaData
from sqlalchemy.orm import sessionmaker
from os.path import sep
from hashlib import md5
from datetime import datetime, timedelta
import re
import logging
impo... | [
6738,
17056,
46677,
1330,
19978,
16934,
46677,
198,
6738,
269,
10100,
9399,
1330,
10903,
9399,
198,
198,
11748,
44161,
282,
26599,
198,
6738,
44161,
282,
26599,
1330,
2251,
62,
18392,
198,
6738,
44161,
282,
26599,
1330,
30277,
6601,
198,
... | 2.572881 | 590 |
from pathlib import Path
from typing import Union
import yaml
| [
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
4479,
198,
11748,
331,
43695,
628,
628,
198
] | 3.882353 | 17 |
"""
List Comprehension Aninhada
OBJ: Encontrar o maior ou os maiores nmeros de uma lista e imprimir outra lista
"""
listaGenerica = [1, 2, 3, 4, 1, 2, 3, 4, 10, 10, 10, 5, 3, -4]
listaMaior = [x for x in listaGenerica if not False in [True if x >= y else False for y in listaGenerica]]
print(listaMaior) | [
37811,
198,
8053,
3082,
7345,
295,
1052,
259,
71,
4763,
198,
9864,
41,
25,
2039,
3642,
20040,
267,
17266,
1504,
267,
84,
28686,
285,
1872,
2850,
299,
647,
418,
390,
334,
2611,
1351,
64,
304,
848,
3036,
343,
503,
430,
1351,
64,
198,
... | 2.428571 | 126 |
if __name__ == '__main__':
main()
| [
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419,
198
] | 2.105263 | 19 |
#!/usr/bin/python3
a = float(input("Entrez le coefficient dominant du trinome : "))
b = float(input("Entrez le coefficient d'ordre 1 du trinome : "))
c = float(input("Entrez la constante du trinome : "))
nbracines(a, b, c)
nbracines(0, 3, 1)
nbracines(1, 0.2, 0.01)
| [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
64,
796,
12178,
7,
15414,
7203,
14539,
21107,
443,
35381,
11410,
7043,
491,
259,
462,
1058,
366,
4008,
198,
65,
796,
12178,
7,
15414,
7203,
14539,
21107,
443,
35381,
288,
6,
585,
2... | 2.414414 | 111 |