content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from django.utils.translation import ugettext_lazy as _
from django.template.loader import render_to_string
class AdminThumbnail(object):
"""
A convenience utility for adding thumbnails to Django's admin change list.
"""
short_description = _('Thumbnail')
allow_tags = True
def __init__(self,... | [
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
62,
75,
12582,
355,
4808,
198,
6738,
42625,
14208,
13,
28243,
13,
29356,
1330,
8543,
62,
1462,
62,
8841,
628,
198,
4871,
32053,
35523,
7,
15252,
2599,
198,
220,
220,
220... | 2.927273 | 220 |
import sys
import numpy as np
import pandas as pd
from odapi.settings import settings
if __name__ == "__main__":
main()
| [
11748,
25064,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
16298,
15042,
13,
33692,
1330,
6460,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
2... | 2.888889 | 45 |
# This __init__.py file for the eclipse package is automatically generated by the build system
from eclipse import * | [
2,
770,
11593,
15003,
834,
13,
9078,
2393,
329,
262,
25872,
5301,
318,
6338,
7560,
416,
262,
1382,
1080,
198,
6738,
25872,
1330,
1635
] | 4.833333 | 24 |
import tensorflow as tf
from ..utils import shape_list
from ..fastspeech2.model import FastSpeechVariantPredictor
from ..fastspeech.layer import get_initializer
from ..fastspeech.model import Model as FastSpeech
| [
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
11485,
26791,
1330,
5485,
62,
4868,
198,
6738,
11485,
7217,
45862,
17,
13,
19849,
1330,
12549,
5248,
3055,
23907,
415,
47,
17407,
273,
198,
6738,
11485,
7217,
45862,
13,
29289,
1330,
651,
... | 3.736842 | 57 |
# DECLARE AND ASSIGNMENT (=)
first_name = "danish"
last_name = "karim"
country = "USA"
city = "Florida"
is_married = False
batch = "FA20"
age = 55
gpa = 0.1
is_failed = True
comment = "Badly Failed"
skills = ["html", "css", "js", "python", "react"]
# MULTIPLE DECLARATION
roll_no, name, email = 12, "Ikram", "ikram.kha... | [
198,
2,
27196,
43,
12203,
5357,
24994,
16284,
10979,
46121,
8,
198,
11085,
62,
3672,
796,
366,
67,
7115,
1,
198,
12957,
62,
3672,
796,
366,
21070,
320,
1,
198,
19315,
796,
366,
14053,
1,
198,
19205,
796,
366,
31135,
1,
198,
271,
6... | 2.513126 | 419 |
# -*- coding: utf-8 -*-
# Copyright (c) 2018-2020 Christiaan Frans Rademan <chris@fwiw.co.za>.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
66,
8,
2864,
12,
42334,
1951,
544,
272,
1305,
504,
5325,
8463,
1279,
354,
2442,
31,
44482,
14246,
13,
1073,
13,
4496,
28401,
198,
2,
1439,
2489,
10395,
... | 2.761589 | 1,057 |
from flask import render_template,request,redirect,url_for
from . import main
from ..requests import get_sources,get_articles
# Views
@main.route('/')
def index():
'''
View root page function that returns the category page and its data
'''
# Getting get source
category_sources = get_sources('gener... | [
6738,
42903,
1330,
8543,
62,
28243,
11,
25927,
11,
445,
1060,
11,
6371,
62,
1640,
198,
6738,
764,
1330,
1388,
198,
6738,
11485,
8897,
3558,
1330,
651,
62,
82,
2203,
11,
1136,
62,
26845,
198,
198,
2,
29978,
198,
31,
12417,
13,
38629,... | 3.071429 | 266 |
# 4. Зеленчукова борса
# Градинар продавал реколтата от градината си на зеленчуковата борса. Продава зеленчуци за N лева на килограм и плодове за M лева за килограм.
# Напишете програма, която да пресмята приходите от реколтата в евро ( ако приемем, че едно евро е равно на 1.94лв).
N_kg_price = float(input())
M_kg_pri... | [
2,
604,
13,
197,
140,
245,
16843,
30143,
16843,
22177,
141,
229,
35072,
31583,
25443,
110,
16142,
12466,
109,
15166,
21169,
21727,
16142,
198,
2,
12466,
241,
21169,
16142,
43666,
18849,
22177,
16142,
21169,
12466,
123,
21169,
25443,
112,
... | 1.292553 | 376 |
from src.rest_client import RestClient
| [
6738,
12351,
13,
2118,
62,
16366,
1330,
8324,
11792,
198,
220
] | 3.636364 | 11 |
#!/usr/bin/env python
from setuptools import setup, find_packages
setup(name='cabot-alert-mattermost',
version='1.0.0',
description='A mattermost alert plugin for Cabot by Affirm',
author='Affirm',
author_email='spam@affirm.com',
url='http://github.com/Affirm/cabot',
packages=find_... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
40406,
7,
3672,
11639,
66,
397,
313,
12,
44598,
12,
47635,
1712,
3256,
198,
220,
220,
220,
220,
220,
2196,
11... | 2.420455 | 176 |
import logging
import math
import os
from datetime import timedelta
from typing import Dict
from pydantic import BaseModel, Field
from PyDSS.reports.reports import ReportBase
logger = logging.getLogger(__name__)
class FeederLossesMetricsModel(BaseModel):
"""Data model for metrics describing feeder losses"""
... | [
198,
11748,
18931,
198,
11748,
10688,
198,
11748,
28686,
198,
6738,
4818,
8079,
1330,
28805,
12514,
198,
6738,
19720,
1330,
360,
713,
198,
198,
6738,
279,
5173,
5109,
1330,
7308,
17633,
11,
7663,
198,
198,
6738,
9485,
5258,
50,
13,
4892... | 2.46554 | 769 |
# Digite algum nome
nome = str(input('Digite o nome completo: '))
# Variáveis
nomelist = nome.split()
nome2 = nome.rfind(max(' '))
nome2C = nome[nome2:].lstrip()
# Prints Formatadas
print(f'O nome completo que você digitou: {nome}')
print(f'O seu Primeiro nome: {nomelist[0]}')
print(f'O seu último nome: {nome2C}')
| [
2,
7367,
578,
435,
70,
388,
299,
462,
198,
77,
462,
796,
965,
7,
15414,
10786,
19511,
578,
267,
299,
462,
1224,
1462,
25,
705,
4008,
198,
2,
15965,
6557,
303,
271,
198,
26601,
46331,
796,
299,
462,
13,
35312,
3419,
198,
77,
462,
... | 2.20979 | 143 |
# -*- coding: utf-8 -*-
import re
from callee import Contains, Not
from helpers.matching import assert_match_success, assert_match_failure, assert_matcher_description
from lemoncheesecake.matching.matchers import *
from lemoncheesecake.matching.matchers.string import make_pattern_matcher
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
302,
198,
198,
6738,
2386,
7197,
1330,
49850,
11,
1892,
198,
198,
6738,
49385,
13,
15699,
278,
1330,
6818,
62,
15699,
62,
13138,
11,
6818,
62,
15699,
62,
3... | 3.118812 | 101 |
#!/usr/bin/env python
"""The Brubeck oAuth module."""
version = "0.1.11"
version_info = (0, 1, 12)
__all__ = [ 'base',
'handlers',
'queries',
'settings']
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
464,
1709,
3266,
694,
267,
30515,
8265,
526,
15931,
198,
198,
9641,
796,
366,
15,
13,
16,
13,
1157,
1,
198,
9641,
62,
10951,
796,
357,
15,
11,
352,
11,
1105,
8,
198,
... | 1.92 | 100 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from lxml import etree
from pythonic_testcase import PythonicTestCase
from .. import xsd
__all__ = ['SimpleTypeTestCase']
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
300,
19875,
1330,
2123,
631,
198,
6738,
21015,
291,
62,
9288,
7442,... | 3.014493 | 69 |
print(
'-----------------------------------------\n'\
'Practical python education || Exercise-25:\n'\
'-----------------------------------------\n'
)
print(
'Task:\n'\
'-----------------------------------------\n'\
'Write a Python program to check whether a specified value is contained in a group of valu... | [
4798,
7,
198,
220,
705,
3880,
45537,
59,
77,
6,
59,
198,
220,
705,
47,
36112,
21015,
3707,
8614,
32900,
12,
1495,
7479,
77,
6,
59,
198,
220,
705,
3880,
45537,
59,
77,
6,
198,
220,
1267,
198,
198,
4798,
7,
198,
220,
705,
25714,
... | 3.388759 | 427 |
from bs4 import BeautifulSoup
import requests
import json
department_codes = ['ACSC','ANAT','ARBC','ARCH','ASSC','BIOC','BIOE','BIOL','BMNG','CANA','CHEE','CHEM','CHIN','CIVL','CLAS','COMM','CH&E','CPST','CSCI','CTMP','CRWR','DMUT','DISM','EMSP','ERTH','ECON','ECED','ENGI','ENGM','ENGL','ENVE','ENVS','EURO','FILM','FO... | [
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11748,
7007,
198,
11748,
33918,
198,
198,
10378,
1823,
62,
40148,
796,
37250,
2246,
6173,
41707,
1565,
1404,
41707,
1503,
2749,
41707,
31315,
41707,
1921,
6173,
41707,
3483,
4503,
41707,
348... | 2.272849 | 1,499 |
import numpy as np
from torch import nn
KERNEL_SIZE = 3
STRIDE = 2
padding = 0
dilation = 1 | [
11748,
299,
32152,
355,
45941,
198,
6738,
28034,
1330,
299,
77,
198,
198,
42,
28778,
3698,
62,
33489,
796,
513,
198,
18601,
14114,
796,
362,
198,
39231,
796,
657,
198,
67,
10520,
796,
352
] | 2.705882 | 34 |
from rest_framework import serializers
from api.models import ShortUrl
| [
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
6738,
40391,
13,
27530,
1330,
10073,
28165,
198
] | 4.4375 | 16 |
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license tagsrmation.
import os
import docker
import github
def image_tag_prefix():
"""
Return a prefix to use on all tags
"""
# put the prefix as an attribute on this functi... | [
2,
15069,
357,
66,
8,
5413,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
5964,
13,
4091,
38559,
24290,
2393,
287,
262,
1628,
6808,
329,
1336,
5964,
15940,
26224,
341,
13,
198,
11748,
28686,
198,
11748,
36253,
198,
11748,... | 2.764706 | 459 |
import argparse
import pandas as pd
if __name__ == '__main__':
main()
| [
11748,
1822,
29572,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419,
628
] | 2.62069 | 29 |
from __future__ import print_function, division
import os
import torch
import pandas as pd
from skimage import io, transform
import numpy as np
import matplotlib.pyplot as plt
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, utils
from transform_pairimage import Pair_Resize, ToTensor... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
11,
7297,
198,
11748,
28686,
198,
11748,
28034,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
1341,
9060,
1330,
33245,
11,
6121,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
294... | 3.608696 | 92 |
# -*- coding: utf-8 -*-
"""GEOMETRY MODULE
This module contains many operations commonly necessary for dealing with data
on the celestial sphere, such as projections to a tangent plane and measuring
angular distances between points.
"""
__all__ = ['projections', 'measures']
from . import *
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
8264,
2662,
2767,
18276,
33893,
198,
198,
1212,
8265,
4909,
867,
4560,
8811,
3306,
329,
7219,
351,
1366,
198,
261,
262,
33258,
16558,
11,
884,
355,
19887,
28... | 3.746835 | 79 |
import tensorflow as tf
from exercise.slim_train_test import SlimTrainMgr
from exercise.slim_eval_test import SlimEvalMgr
if __name__ == "__main__":
obj= V3PipelineTest()
obj.run() | [
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
5517,
13,
82,
2475,
62,
27432,
62,
9288,
1330,
34199,
44077,
44,
2164,
198,
6738,
5517,
13,
82,
2475,
62,
18206,
62,
9288,
1330,
34199,
36,
2100,
44,
2164,
198,
220,
220,
220,
220,
19... | 2.165049 | 103 |
# -*- coding: utf-8 -*-
from functools import reduce
from itertools import zip_longest
from math import ceil
from math import floor
from math import log
from scipy import ndimage
import numpy as np
def morton_array(shape):
"""
Return array with Morton numbers.
Inspired by:
https://graphics.stanford... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
1257,
310,
10141,
1330,
4646,
198,
6738,
340,
861,
10141,
1330,
19974,
62,
6511,
395,
198,
6738,
10688,
1330,
2906,
346,
198,
6738,
10688,
1330,
4314,
198,
67... | 2.486424 | 2,173 |
import os
from django.utils.translation import gettext_lazy as _
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent.parent
SECRET_KEY = os.environ['SECRET_KEY']
# Application definition
INSTALLED_APPS = [
'award',
'django.contrib.admin',
'django.contrib.auth',
'django.cont... | [
11748,
28686,
198,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
651,
5239,
62,
75,
12582,
355,
4808,
198,
6738,
3108,
8019,
1330,
10644,
628,
198,
33,
11159,
62,
34720,
796,
10644,
7,
834,
7753,
834,
737,
411,
6442,
22446,
800... | 2.25632 | 1,424 |
import numpy as np
import numpy.testing as npt
import slippy.surface as s
import slippy.contact as c
| [
11748,
299,
32152,
355,
45941,
198,
11748,
299,
32152,
13,
33407,
355,
299,
457,
198,
11748,
1017,
41214,
13,
42029,
355,
264,
198,
11748,
1017,
41214,
13,
32057,
355,
269,
628,
198
] | 3.21875 | 32 |
from nest_py.core.api_clients.crud_api_client import CrudApiClient
from nest_py.core.api_clients.api_client_maker import ApiClientMaker
def run_entry_crud_ops(tablelike_schema, crud_client, result_acc):
"""
performs basic smoke tests on a TablelikeEntry endpoint by using
TablelikeSchema's ability to gener... | [
6738,
16343,
62,
9078,
13,
7295,
13,
15042,
62,
565,
2334,
13,
6098,
463,
62,
15042,
62,
16366,
1330,
3864,
463,
32,
14415,
11792,
198,
6738,
16343,
62,
9078,
13,
7295,
13,
15042,
62,
565,
2334,
13,
15042,
62,
16366,
62,
10297,
1330... | 2.527328 | 988 |
import unittest
import pytest
import numpy as np
from autograd.tensor import Tensor
from autograd.functional import exp | [
11748,
555,
715,
395,
198,
11748,
12972,
9288,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
1960,
519,
6335,
13,
83,
22854,
1330,
309,
22854,
198,
6738,
1960,
519,
6335,
13,
45124,
1330,
1033
] | 3.428571 | 35 |
# Implement atoi which converts a string to an integer.
# The function first discards as many whitespace characters as necessary until the first non-whitespace character is found.
#Then, starting from this character, takes an optional initial plus or minus sign followed by as many numerical digits as possible, and in... | [
2,
48282,
379,
23013,
543,
26161,
257,
4731,
284,
281,
18253,
13,
198,
198,
2,
383,
2163,
717,
1221,
1371,
355,
867,
13216,
10223,
3435,
355,
3306,
1566,
262,
717,
1729,
12,
1929,
2737,
10223,
2095,
318,
1043,
13,
220,
198,
2,
6423,... | 3.283969 | 655 |
from source.exceptions.not_found import NotFoundException
from source.repositories.player import PlayerRepository
import source.commons.message as message
| [
6738,
2723,
13,
1069,
11755,
13,
1662,
62,
9275,
1330,
1892,
21077,
16922,
198,
6738,
2723,
13,
260,
1930,
270,
1749,
13,
7829,
1330,
7853,
6207,
13264,
198,
11748,
2723,
13,
9503,
684,
13,
20500,
355,
3275,
628
] | 4.105263 | 38 |
# Definition for a binary tree node.
a = Solution()
b = 3
res = a.allPossibleFBT(b)
for i in res:
print("end print", i.val, i.left, i.right)
| [
2,
30396,
329,
257,
13934,
5509,
10139,
13,
198,
64,
796,
28186,
3419,
198,
65,
796,
513,
198,
411,
796,
257,
13,
439,
47,
4733,
37,
19313,
7,
65,
8,
198,
1640,
1312,
287,
581,
25,
198,
220,
220,
220,
3601,
7203,
437,
3601,
1600... | 2.5 | 58 |
# encoding: utf-8
# Copyright 2015-present The Scikit Flow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... | [
2,
21004,
25,
3384,
69,
12,
23,
198,
198,
2,
220,
15069,
1853,
12,
25579,
383,
10286,
15813,
27782,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
3415... | 2.598351 | 849 |
from flask_jwt_extended import current_user
from macro.conduit.database import (Model, SurrogatePK, db,
reference_col, relationship)
followers_assoc = db.Table("followers_assoc",
db.Column("follower", db.Integer, db.ForeignKey("userprofile.user_id")),
... | [
6738,
42903,
62,
73,
46569,
62,
2302,
1631,
1330,
1459,
62,
7220,
198,
198,
6738,
15021,
13,
17561,
5013,
13,
48806,
1330,
357,
17633,
11,
4198,
3828,
378,
40492,
11,
20613,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,... | 2.142132 | 197 |
from route53.change_set import ChangeSet
from route53.exceptions import Route53Error
class ResourceRecordSet(object):
"""
A Resource Record Set is an entry within a Hosted Zone. These can be
anything from TXT entries, to A entries, to CNAMEs.
.. warning:: Do not instantiate this directly yourself. Go ... | [
6738,
6339,
4310,
13,
3803,
62,
2617,
1330,
9794,
7248,
198,
6738,
6339,
4310,
13,
1069,
11755,
1330,
18956,
4310,
12331,
198,
198,
4871,
20857,
23739,
7248,
7,
15252,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
317,
20857,
1... | 2.449023 | 4,708 |
from django.shortcuts import HttpResponseRedirect
from django.urls import reverse_lazy
from django.db import connection
import logging
import time
import operator
logger = logging.getLogger(__name__)
class QueryCountMiddleware(object):
"""
This middleware will log the number of queries run
and the total... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
367,
29281,
31077,
7738,
1060,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
62,
75,
12582,
198,
6738,
42625,
14208,
13,
9945,
1330,
4637,
198,
11748,
18931,
198,
11748,
640,
198,
11748,
... | 3.21118 | 161 |
import os
import sys
import pymysql
DBHOST = os.environ['DB_HOST']
DBPORT = os.environ['DB_PORT']
DB_USERNAME = os.environ['DB_USER']
DB_PASSWORD = os.environ['DB_PASSWORD']
DB_NAME = os.environ['DB_NAME']
| [
11748,
28686,
198,
11748,
25064,
198,
198,
11748,
279,
4948,
893,
13976,
198,
198,
11012,
39,
10892,
796,
28686,
13,
268,
2268,
17816,
11012,
62,
39,
10892,
20520,
198,
11012,
15490,
796,
28686,
13,
268,
2268,
17816,
11012,
62,
15490,
2... | 2.348315 | 89 |
import board
import busio
import adafruit_vl53l0x
i2c = busio.I2C(board.SCL, board.SDA)
sensor = adafruit_vl53l0x.VL53L0X(i2c)
sensor.measurement_timing_budget = 200000
print('Range: {}mm'.format(sensor.range))
| [
11748,
3096,
198,
11748,
1323,
952,
198,
11748,
512,
1878,
4872,
62,
19279,
4310,
75,
15,
87,
198,
72,
17,
66,
796,
1323,
952,
13,
40,
17,
34,
7,
3526,
13,
50,
5097,
11,
3096,
13,
50,
5631,
8,
198,
82,
22854,
796,
512,
1878,
4... | 2.229167 | 96 |
import pytest
from merchantsguide.roman2int import roman2int
| [
11748,
12972,
9288,
198,
198,
6738,
21779,
41311,
13,
47119,
17,
600,
1330,
374,
5185,
17,
600,
628,
198
] | 3.368421 | 19 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import exchange_portal.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,
198,
11748,
5163,
62,
634,
282,
13,
27530... | 3.044444 | 45 |
""" example plugin to extend a /test route """
from fastapi import APIRouter
router = APIRouter()
@router.get("/test")
async def tester():
""" test route """
return [{"result": "test"}]
| [
37811,
1672,
13877,
284,
9117,
257,
1220,
9288,
6339,
37227,
198,
6738,
3049,
15042,
1330,
3486,
4663,
39605,
198,
198,
472,
353,
796,
3486,
4663,
39605,
3419,
198,
198,
31,
472,
353,
13,
1136,
7203,
14,
9288,
4943,
198,
292,
13361,
8... | 2.925373 | 67 |
import rospy
from sensor_msgs.msg import CompressedImage
class Model():
"""This class is to wrap any segmentation model from libraries such as pytorch, tensorflow."""
def on_start(self):
r"""Start callback.
This method is being called before the rospy.spin loop.
It is necessary for ... | [
11748,
686,
2777,
88,
198,
6738,
12694,
62,
907,
14542,
13,
19662,
1330,
3082,
2790,
5159,
628,
198,
4871,
9104,
33529,
198,
220,
220,
220,
37227,
1212,
1398,
318,
284,
14441,
597,
10618,
341,
2746,
422,
12782,
884,
355,
12972,
13165,
... | 2.615385 | 364 |
# -*- coding: utf-8 -*-
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from openvino.runtime import Model
from openvino.runtime import Shape, Type
from openvino.runtime.op import Parameter
import openvino.runtime.opset8 as ops
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
34,
8,
2864,
12,
1238,
1828,
8180,
10501,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
198,
6738,
1280,
85,
2879,
... | 3.011364 | 88 |
from api.devices import controllers
from api.router import Router
class DevicesRouter(Router):
""" Devices router class. """
def register_routes(self, api):
""" Register and relate devices endpoints with controllers. """
api.add_resource(controllers.Devices, '/devices')
| [
6738,
40391,
13,
42034,
1330,
20624,
198,
6738,
40391,
13,
472,
353,
1330,
48538,
628,
198,
4871,
29362,
49,
39605,
7,
49,
39605,
2599,
198,
220,
220,
220,
37227,
29362,
20264,
1398,
13,
37227,
628,
220,
220,
220,
825,
7881,
62,
81,
... | 3.23913 | 92 |
from django import template
from django.conf import settings
import flickrapi
import json
register = template.Library()
# Flickr Tag
@register.simple_tag
@register.simple_tag
@register.simple_tag
@register.inclusion_tag('tags/flickr_api.html', takes_context=True) | [
6738,
42625,
14208,
1330,
11055,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
11748,
26810,
2416,
72,
198,
11748,
33918,
198,
198,
30238,
796,
11055,
13,
23377,
3419,
628,
198,
2,
27085,
17467,
198,
31,
30238,
13,
36439,
62,
129... | 3.280488 | 82 |
import idc, idautils
color = 0xffd0d0
if __name__ == '__main__':
main()
| [
11748,
4686,
66,
11,
4686,
2306,
4487,
198,
198,
8043,
796,
657,
47596,
67,
15,
67,
15,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419,
628
] | 2.194444 | 36 |
# python3 -m pip install pycryptodomex uvarint pyteal web3 coincurve
import sys
sys.path.append("..")
from admin import PortalCore, Account
from gentest import GenTest
from base64 import b64decode
from typing import List, Tuple, Dict, Any, Optional, Union
import base64
import random
import time
import hashlib
import... | [
2,
21015,
18,
532,
76,
7347,
2721,
12972,
29609,
375,
462,
87,
334,
7785,
600,
12972,
660,
282,
3992,
18,
11194,
333,
303,
198,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
7203,
492,
4943,
198,
198,
6738,
13169,
1330,
25663,
... | 2.757624 | 623 |
import cv2
import numpy as np
import rospy
import matplotlib.pyplot as plt
import sys
from scheduler import SCHEDULER
from constants import *
import os
import sys
# * Variables
# variables for matching
# Initiate SIFT description detector
Orb = cv2.ORB_create()
# create BFMatcher object
Bf = cv2.BFMatcher(cv2.NORM_H... | [
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
686,
2777,
88,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
25064,
198,
6738,
6038,
18173,
1330,
22374,
1961,
6239,
1137,
198,
6738,
38491,... | 2.277857 | 7,054 |
import numpy as np
def JupiterOvalNorth():
'''
Return the longitude and latitudes of the statistical main oval
from Nichols et al, 2017 (doi:10.1002/2017GL073029)
'''
Lat = np.array([88.7,87.8,86.8,85.9,85.0,84.1,83.3,82.4,81.5,80.7,
79.9,79.1,78.3,77.5,76.8,76.1,75.5,74.9,74.3,73.7,
73.1,72.4,71.7,7... | [
11748,
299,
32152,
355,
45941,
628,
198,
4299,
22721,
46,
2100,
14157,
33529,
198,
197,
7061,
6,
198,
197,
13615,
262,
890,
3984,
290,
3042,
10455,
286,
262,
13905,
1388,
41186,
198,
197,
6738,
38403,
2123,
435,
11,
2177,
357,
34023,
... | 1.449282 | 2,090 |
"""Tune experiment configuration for SVG(1) on CartPoleSwingUp.
This can be run from the command line by executing
`python scripts/tune_experiment.py 'SVG(1)' --local-dir <experiment dir>
--config examples/svg_one_cartpole_defaults.py --stop timesteps_total 100000`
"""
from ray import tune
| [
37811,
51,
1726,
6306,
8398,
329,
45809,
7,
16,
8,
319,
13690,
47,
2305,
50,
5469,
4933,
13,
198,
198,
1212,
460,
307,
1057,
422,
262,
3141,
1627,
416,
23710,
198,
63,
29412,
14750,
14,
83,
1726,
62,
23100,
3681,
13,
9078,
705,
50... | 3.126316 | 95 |
from __future__ import annotations
import math
from collections import defaultdict
from time import sleep
from typing import Tuple
import client
from enums import ActiveStatus, BootedStatus, EposStatus, OneUnit, Uptime
from models import SlotRange, Validator
import config
def get_keys_not_in_config(validato... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
11748,
10688,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
640,
1330,
3993,
198,
6738,
19720,
1330,
309,
29291,
198,
198,
11748,
5456,
198,
6738,
551,
5700,
1330,
14199,
19580,
11,
18892,... | 3.547445 | 137 |
"""
Get information about the converage across the genome to csv and bedgraph
"""
import argparse
import collections
import os
import sys
import matplotlib
import numpy as np
import pandas as pd
from tqdm import tqdm
matplotlib.use("Agg")
# Needed for imports
sys.path.append(os.path.dirname(os.getcwd()))
from commo... | [
37811,
198,
3855,
1321,
546,
262,
369,
1857,
1973,
262,
19270,
284,
269,
21370,
290,
3996,
34960,
198,
37811,
198,
198,
11748,
1822,
29572,
198,
11748,
17268,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
11748,
2603,
29487,
8019,
198,
... | 2.519802 | 2,424 |
soma = contador = 0
while True:
n = int(input('Digite um número[999 finaliza o programa]: '))
if n == 999:
break
soma += n
contador += 1
print(f'Foram digitados {contador} números, e a soma entre eles é igual a {soma}.')
| [
82,
6086,
796,
542,
7079,
796,
657,
198,
198,
4514,
6407,
25,
198,
220,
220,
220,
299,
796,
493,
7,
15414,
10786,
19511,
578,
23781,
299,
21356,
647,
78,
58,
17032,
2457,
23638,
267,
1430,
64,
5974,
705,
4008,
198,
220,
220,
220,
... | 2.236364 | 110 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import shutil
import sys
import tempfile
from observations.r.immi2 import immi2
def test_immi2():
"""Test module immi2.py by downloading
immi2.csv and testing shape of
extracted data has 2485 rows an... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
4423,
346,
198,
11748,
25064,
198,
11748,
20218,
7753,
198,
198,
6738,
13050,
... | 2.908046 | 174 |
#!/usr/bin/python
# Copyright 2018 The Tulsi Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
15069,
2864,
383,
33219,
72,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
40... | 2.650943 | 1,378 |
# -*- coding: utf-8 -*-
"""
@Time : 2017/12/4 15:42
@Author : Elvis
awa2.py
watch --color -n1 gpustat -cpu
CUDA_VISIBLE_DEVICES=1 python awa2_attr1.py
zsl_resnet18_fc00_awa2 : Sigmoid + dropout 0.5 Acc: 92.320% (5614/6081) ZSL Acc: 24.939% (1742/6985)
Acc: 72.684% (5077/6985)
"""
import torch
from torch import... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
31,
7575,
220,
220,
220,
1058,
2177,
14,
1065,
14,
19,
1315,
25,
3682,
198,
31,
13838,
220,
1058,
35169,
628,
14908,
17,
13,
9078,
198,
8340,
1377,
8043,
... | 2.471148 | 1,681 |
#!python
from ext_logging import VERSION
from setuptools import setup, find_packages
entry_points = {
'console_scripts': [
'ngrep = ext_logging.scripts.ngrep.py',
]
}
setup(
name='ext_logging',
version=VERSION,
description='Advanced Logging for Ops writing in Python',
author='Sergii Py... | [
2,
0,
29412,
198,
6738,
1070,
62,
6404,
2667,
1330,
44156,
2849,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
13000,
62,
13033,
796,
1391,
198,
220,
220,
220,
705,
41947,
62,
46521,
10354,
685,
198,
220,
... | 2.626794 | 209 |
import tensorflow as tf
from tensorflow.keras import layers
from tensorflow.keras import datasets, layers, optimizers, Sequential, metrics, Model, Input
from tensorflow.keras.preprocessing.image import ImageDataGenerator
# for i in range(10):
# model.fit(train_images[:100], train_labels[:100])
| [
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
1330,
11685,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
1330,
40522,
11,
11685,
11,
6436,
11341,
11,
24604,
1843,
11,
20731,
11,
9104,
11,
23412,
198,
... | 3.14433 | 97 |
# -*- coding: utf-8 -*-
"""
format-sql
Makes your SQL readable.
Copyright (c) 2014, Friedrich Paetzke (paetzke@fastmail.fm)
All rights reserved.
"""
from format_sql.parser import InvalidSQL
from format_sql.shortcuts import format_sql
__version__ = '0.12.0'
__author__ = 'Friedrich Paetzke'
__license__ = 'BSD'
__copyr... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
18982,
12,
25410,
198,
44,
1124,
534,
16363,
31744,
13,
198,
198,
15269,
357,
66,
8,
1946,
11,
46099,
11243,
23773,
365,
357,
8957,
23773,
365,
31,
7217,
4... | 2.866142 | 127 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.conf import settings
import radpress.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,
4981,
11,
15720,
602,
198,
11748,
4818,
8079,
198,
6738,
42625,
... | 3.254545 | 55 |
import torch
import torch.nn as nn
import torch.nn.functional as F
import Utils.utils as utils
from Models.Encoder.resnet_skip import SkipResnet50
from Models.Poly.conv_lstm import AttConvLSTM
from Models.Poly.first_v import FirstVertex
from Models.Evaluator.evaluator import Evaluator
from Models.GGNN.poly_ggnn import... | [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
198,
11748,
7273,
4487,
13,
26791,
355,
3384,
4487,
198,
6738,
32329,
13,
27195,
12342,
13,
411,
3262,
62,
48267,
1330,
... | 2.553936 | 343 |
#The idea is to collect the necessary screenshots for traing the model
#Whenever the key is pressed the screenshot is taken
#Based on the key press it is stored to the particular folder
#Which are Used later for training
import keyboard#Uses This Module To Detect The Key Press
import pyautogui#USed To Take Scre... | [
2,
464,
2126,
318,
284,
2824,
262,
3306,
23322,
329,
1291,
278,
262,
2746,
201,
198,
2,
28877,
262,
1994,
318,
12070,
262,
22032,
318,
2077,
220,
201,
198,
2,
15001,
319,
262,
1994,
1803,
340,
318,
8574,
284,
262,
1948,
9483,
220,
... | 2.255029 | 1,392 |
# MIT License
# Copyright (c) 2020 Jdeep
# 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 use, copy, modify, merge, publish,... | [
2,
17168,
13789,
198,
198,
2,
15069,
357,
66,
8,
12131,
449,
22089,
198,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
2,
286,
428,
3788,
290,
3917,
10314,
3696,
357,
1169,
3... | 3.21021 | 666 |
"""Author: Yiming Zhang"""
try:
from torch.utils.tensorboard import SummaryWriter
except:
from tensorboardX import SummaryWriter
from torch.utils.data import DataLoader, RandomSampler
from utils import *
logger = logging.getLogger(__name__)
| [
37811,
13838,
25,
575,
320,
278,
19439,
37811,
198,
28311,
25,
198,
220,
220,
220,
422,
28034,
13,
26791,
13,
83,
22854,
3526,
1330,
21293,
34379,
198,
16341,
25,
198,
220,
220,
220,
422,
11192,
273,
3526,
55,
1330,
21293,
34379,
198,... | 3.21519 | 79 |
from setuptools import setup, find_packages
import glob
with open('README.md') as f:
long_description = f.read()
setup(
name='bbb_pru_adc',
version='1.3.0',
description='Streaming capture of ADC on BeagleBone (Black)',
long_description=long_description,
long_description_content_type='text/mar... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
11748,
15095,
198,
198,
4480,
1280,
10786,
15675,
11682,
13,
9132,
11537,
355,
277,
25,
198,
220,
220,
220,
890,
62,
11213,
796,
277,
13,
961,
3419,
198,
198,
40406,
7,
... | 2.49323 | 517 |
import random
import pprint
import time
import datetime
import uuid
import tempfile
import os
from copy import copy
from socket import gethostname
import pickle
import torch.nn as nn
import wandb
import torch
import numpy as np
import pickle as pkl
import absl.flags
from absl import logging
from ml_collections import ... | [
11748,
4738,
198,
11748,
279,
4798,
198,
11748,
640,
198,
11748,
4818,
8079,
198,
11748,
334,
27112,
198,
11748,
20218,
7753,
198,
11748,
28686,
198,
6738,
4866,
1330,
4866,
198,
6738,
17802,
1330,
651,
4774,
3672,
198,
11748,
2298,
293,
... | 3.705426 | 129 |
"""OBC_Server URL Configuration"""
from django.contrib import admin
from django.urls import include, path
from obc_server.obc_sync import views
urlpatterns = [
path('api-auth/', include('rest_framework.urls', namespace='rest_framework')),
path('admin/', admin.site.urls),
path('activities/', views.Activity... | [
37811,
46,
2749,
62,
10697,
10289,
28373,
37811,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
2291,
11,
3108,
198,
6738,
909,
66,
62,
15388,
13,
672,
66,
62,
27261,
1330,
5009,... | 2.859155 | 142 |
#!/usr/bin/env python3
import numpy as np
import cv2 as cv
# Para a leitura dos arquivos de imagem:
import glob
# Prepara os criterios a serem usados:
# Define a precisao, numeros de iteracoes a serem feitos e outras informacoes
criteria = (cv.TERM_CRITERIA_EPS + cv.TERM_CRITERIA_MAX_ITER, 30, 0.001)
# Prepara os p... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
355,
269,
85,
198,
198,
2,
2547,
64,
257,
443,
270,
5330,
23430,
610,
421,
452,
418,
390,
3590,
368,
25,
198,
11748,
150... | 2.279088 | 1,272 |
from __future__ import annotations
import os
from typing import Dict, Any as Value
from .exceptions import NoSuchEnvironmentVariableError
| [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
11748,
28686,
198,
6738,
19720,
1330,
360,
713,
11,
4377,
355,
11052,
198,
198,
6738,
764,
1069,
11755,
1330,
1400,
16678,
31441,
43015,
12331,
628
] | 4.272727 | 33 |
# Copyright 2019 DeepMind Technologies Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | [
2,
15069,
13130,
10766,
28478,
21852,
15302,
13,
1439,
6923,
33876,
13,
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,
11846,
35... | 3.816901 | 284 |
#Importação de pacotes
from datetime import date
#Variaveis
ano_atual = date.today().year
maior = menor = 0
#Entrada de dados
for i in range(1, 8):
nasc = int(input('{}º Ano de nascimento: '.format(i)))
#Processamento
idade = ano_atual - nasc
if idade <= 18:
menor += 1
else:
maior +=... | [
2,
20939,
64,
16175,
28749,
390,
23503,
6421,
198,
6738,
4818,
8079,
1330,
3128,
198,
2,
53,
10312,
303,
271,
198,
5733,
62,
265,
723,
796,
3128,
13,
40838,
22446,
1941,
198,
2611,
1504,
796,
1450,
273,
796,
657,
198,
2,
14539,
81,
... | 2.201923 | 208 |
import os,subprocess,json,csv,datetime
import requests
from caltechdata_api import caltechdata_write
from caltechdata_api import caltechdata_edit
from py_dataset import dataset
# Requires Dataset
# Set up the google sheets "client_secret" following these
# [instructions](https://github.com/caltechlibrary/dataset/blob/... | [
11748,
28686,
11,
7266,
14681,
11,
17752,
11,
40664,
11,
19608,
8079,
198,
11748,
7007,
198,
6738,
2386,
13670,
7890,
62,
15042,
1330,
2386,
13670,
7890,
62,
13564,
198,
6738,
2386,
13670,
7890,
62,
15042,
1330,
2386,
13670,
7890,
62,
1... | 1.707879 | 8,719 |
from time import sleep
import numpy as np
from numpy.linalg import norm
from pinocchio import SE3, AngleAxis, Quaternion
q0 = Quaternion(SE3.Random().rotation)
q1 = Quaternion(SE3.Random().rotation)
viz.applyConfiguration('world/box', [0, 0, 0] + list(q0.coeffs()))
sleep(.1)
for t in np.arange(0, 1, .01):
q = nler... | [
6738,
640,
1330,
3993,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
299,
32152,
13,
75,
1292,
70,
1330,
2593,
198,
6738,
6757,
420,
40900,
1330,
7946,
18,
11,
42375,
31554,
271,
11,
2264,
9205,
295,
198,
198,
80,
15,
796,
2264,
92... | 2.328638 | 213 |
from threeML import *
from conftest import data_list_bn090217206_nai6, get_grb_model
# Define two dummy functions to return always the same model and the same
# dataset
| [
6738,
1115,
5805,
1330,
1635,
198,
6738,
369,
701,
395,
1330,
1366,
62,
4868,
62,
9374,
2931,
2999,
1558,
22136,
62,
38600,
21,
11,
651,
62,
2164,
65,
62,
19849,
628,
198,
2,
2896,
500,
734,
31548,
5499,
284,
1441,
1464,
262,
976,
... | 3.320755 | 53 |
from flask import Markup
from pandas import DataFrame
from app.base_view import BaseView
from flask_security import current_user
| [
6738,
42903,
1330,
2940,
929,
198,
6738,
19798,
292,
1330,
6060,
19778,
198,
6738,
598,
13,
8692,
62,
1177,
1330,
7308,
7680,
198,
6738,
42903,
62,
12961,
1330,
1459,
62,
7220,
628
] | 4.0625 | 32 |
import multiprocessing
import datetime
import time
import base64
from core.search_tester import SearchTester
from core.elasticsearch import ElasticSearch
| [
11748,
18540,
305,
919,
278,
198,
11748,
4818,
8079,
198,
11748,
640,
198,
11748,
2779,
2414,
198,
198,
6738,
4755,
13,
12947,
62,
4879,
353,
1330,
11140,
51,
7834,
198,
6738,
4755,
13,
417,
3477,
12947,
1330,
48567,
18243,
628,
628,
... | 3.809524 | 42 |
import twisted.web._flatten as _f
_f.escapeForContent = efc
| [
11748,
19074,
13,
12384,
13557,
2704,
41769,
355,
4808,
69,
198,
198,
62,
69,
13,
41915,
1890,
19746,
796,
304,
16072,
198
] | 2.772727 | 22 |
expense_report = """1933
1963
1924
1832
1949
1826
1681
1548
1881
1973
1558
1979
1803
1975
1867
1934
1986
1220
1878
1985
2006
1535
1522
1884
1380
1922
1905
1582
1456
1877
1959
1953
634
1875
366
1968
1887
1848
1779
1894
1606
1429
1900
1309
2007
1944
1901
1559
1484
1996
1837
1892
1989
1684
1952
1990
1974
1890
1883
1993
15... | [
11201,
1072,
62,
13116,
796,
37227,
1129,
2091,
198,
45192,
198,
1129,
1731,
198,
1507,
2624,
198,
1129,
2920,
198,
1507,
2075,
198,
1433,
6659,
198,
1314,
2780,
198,
1507,
6659,
198,
40220,
198,
1314,
3365,
198,
33581,
198,
1507,
3070,... | 1.953526 | 624 |
# -*- encoding: utf-8 -*-
# from django.db import IntegrityError
# from django.test import TestCase
#
# from crm.tests.model_maker import (
# make_contact,
# make_user_contact,
# )
# from crm.tests.scenario import (
# default_scenario_crm,
# )
# from login.tests.scenario import (
# default_scenario_logi... | [
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
422,
42625,
14208,
13,
9945,
1330,
39348,
12331,
198,
2,
422,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
2,
198,
2,
422,
1067,
76,
13,
41989,
13,
19849,
62,
... | 2.131679 | 524 |
import hashlib
import logging
import os
from typing import Any
logger = logging.getLogger("file_manager")
import trio
import torrent as tstate
# async def move_file_to_final_location(self):
# self._file_wrapper.move_file_to_final_location()
| [
11748,
12234,
8019,
198,
11748,
18931,
198,
11748,
28686,
198,
6738,
19720,
1330,
4377,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7203,
7753,
62,
37153,
4943,
198,
198,
11748,
19886,
198,
198,
11748,
24458,
355,
256,
5219,
... | 3.011628 | 86 |
import urllib.request, urllib.parse, urllib.error
import oauth
import hidden
# https://apps.twitter.com/
# Create App and get the four strings, put them in hidden.py
| [
11748,
2956,
297,
571,
13,
25927,
11,
2956,
297,
571,
13,
29572,
11,
2956,
297,
571,
13,
18224,
201,
198,
11748,
267,
18439,
201,
198,
11748,
7104,
201,
198,
201,
198,
2,
3740,
1378,
18211,
13,
6956,
13,
785,
14,
201,
198,
2,
1361... | 2.932203 | 59 |
import unittest
from KSPModule.Token import Tokenizer, Token
| [
11748,
555,
715,
395,
198,
198,
6738,
509,
4303,
26796,
13,
30642,
1330,
29130,
7509,
11,
29130,
628
] | 3.5 | 18 |
from random import randint
from random import choice
l=[[1,2,3],[4,5,6],[7,8,9]]
board=[1,2,3,4,5,6,7,8,9]
print("WELCOME to TIC TAC TOE".center(100,"*"))
print_board()
print("Lets assign you as player 1 and you have assigned x")
chance=randint(1,2)
ch='y'
player1=0
player2=0
while ch=='y':
l=[[1,2,3],[4,5,6],[7,8,... | [
6738,
4738,
1330,
43720,
600,
198,
6738,
4738,
1330,
3572,
198,
75,
28,
30109,
16,
11,
17,
11,
18,
38430,
19,
11,
20,
11,
21,
38430,
22,
11,
23,
11,
24,
11907,
198,
3526,
41888,
16,
11,
17,
11,
18,
11,
19,
11,
20,
11,
21,
11... | 1.847361 | 701 |
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 et:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ### ### ... | [
2,
795,
16436,
25,
532,
9,
12,
4235,
25,
21015,
26,
12972,
12,
521,
298,
12,
28968,
25,
604,
26,
7400,
12,
10394,
25,
604,
26,
33793,
12,
8658,
82,
12,
14171,
25,
18038,
532,
9,
12,
198,
2,
409,
25,
900,
39747,
28,
19,
40379,
... | 3.14881 | 168 |
#!/usr/bin/env python
##############################################################################
# Copyright 2016-2017 Rigetti Computing
#
# 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 Lic... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
29113,
29113,
7804,
4242,
2235,
198,
2,
15069,
1584,
12,
5539,
24666,
24851,
38589,
198,
2,
198,
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
11... | 2.991549 | 710 |
import abc
import copy
import enum
import logging
import os
import re
from typing import Any, Tuple, Iterable, Union, Dict, List, Optional
from phdTester import commons
from phdTester.common_types import KS001Str, SlottedClass
class Aliases(SlottedClass):
"""
Structure allowing you to map an official name ... | [
11748,
450,
66,
198,
11748,
4866,
198,
11748,
33829,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
302,
198,
6738,
19720,
1330,
4377,
11,
309,
29291,
11,
40806,
540,
11,
4479,
11,
360,
713,
11,
7343,
11,
32233,
198,
198,
6738,
872... | 2.468122 | 11,403 |
# System test: test_sys_keys_mismatch_outer
import os
from rift_expect_session import RiftExpectSession
| [
2,
4482,
1332,
25,
1332,
62,
17597,
62,
13083,
62,
76,
1042,
963,
62,
39605,
198,
198,
11748,
28686,
198,
6738,
36788,
62,
1069,
806,
62,
29891,
1330,
21222,
3109,
806,
36044,
198
] | 3.181818 | 33 |
"""
Given two strings containing backspaces (identified by the character ‘#’), check if the two strings are equal.
Example 1:
Input: str1="xy#z", str2="xzz#"
Output: true
Explanation: After applying backspaces the strings become "xz" and "xz" respectively.
"""
# Time: O(M + N) Space: O(1)
main() | [
198,
198,
37811,
198,
198,
15056,
734,
13042,
7268,
736,
2777,
2114,
357,
19107,
416,
262,
2095,
564,
246,
2,
447,
247,
828,
2198,
611,
262,
734,
13042,
389,
4961,
13,
198,
198,
16281,
352,
25,
198,
198,
20560,
25,
965,
16,
2625,
... | 2.869159 | 107 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-10-26 06:08
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,
2,
2980,
515,
416,
37770,
352,
13,
24,
319,
1584,
12,
940,
12,
2075,
9130,
25,
2919,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
... | 2.781818 | 55 |
# coding=utf-8
import os
from io import BytesIO
import numpy as np
from PIL import Image
from mindspore.mindrecord import FileWriter
from .segbase import SegDataset
__all__ = ['Cityscapes']
seg_schema = {
"file_name": {"type": "string"},
"data": {"type": "bytes"},
"label": {"type": "bytes"}
}
| [
2,
19617,
28,
40477,
12,
23,
198,
198,
11748,
28686,
198,
6738,
33245,
1330,
2750,
4879,
9399,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
350,
4146,
1330,
7412,
198,
6738,
2000,
2777,
382,
13,
10155,
22105,
1330,
9220,
34379,
198,
... | 2.689655 | 116 |
from .utilities import predict_class
from sklearn.metrics import balanced_accuracy_score, precision_score, recall_score, f1_score, \
label_ranking_average_precision_score, label_ranking_loss, classification_report, plot_confusion_matrix, \
confusion_matrix
import matplotlib.pyplot as plt
from pprint import ppri... | [
6738,
764,
315,
2410,
1330,
4331,
62,
4871,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
12974,
62,
4134,
23843,
62,
26675,
11,
15440,
62,
26675,
11,
10014,
62,
26675,
11,
277,
16,
62,
26675,
11,
3467,
198,
220,
220,
220,
6167,
62... | 2.355063 | 2,301 |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
#
# 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 ... | [
2,
15069,
6186,
13,
785,
11,
3457,
13,
393,
663,
29116,
13,
1439,
6923,
33876,
13,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
17168,
12,
15,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597... | 3.189189 | 629 |
#!/usr/bin/env python3
# Copyright(c) 2014-2019 Daniel Kraft
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Utility routines for auxpow that are needed specifically by the regtests.
# This is mostly about actually *solving* an ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
15069,
7,
66,
8,
1946,
12,
23344,
7806,
41828,
198,
2,
4307,
6169,
739,
262,
17168,
3788,
5964,
11,
766,
262,
19249,
198,
2,
2393,
27975,
45761,
393,
2638,
1378,
2503,
13,
4... | 2.88491 | 782 |
#!/usr/bin/python
import sys
import os.path
template = '''
#include <iostream>
#include <cxxtest/TestSuite.h>
#include <mockcpp/mockcpp.hpp>
#include <testngppst/ResourceCheckPoint.h>
#include <testngpp/%s.h>
USING_MOCKCPP_NS
USING_TESTNGPP_NS
class Test%s: public CxxTest::TestSuite
{
private:
TESTNGPPST_R... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
25064,
198,
11748,
28686,
13,
6978,
198,
198,
28243,
796,
705,
7061,
198,
198,
2,
17256,
1279,
72,
455,
1476,
29,
198,
198,
2,
17256,
1279,
66,
87,
742,
395,
14,
14402,
5606,
... | 2.172185 | 302 |
import threading
import time
exitFlag = 0
threadLock = threading.Lock()
threads = []
t1 = myThread(1, "Thread(1)", 1)
t2 = myThread(2, "Thread(2)", 2)
threads.append(t1)
threads.append(t2)
t1.start()
t2.start()
t1.join()
t2.join()
print("Exit main Thread")
| [
11748,
4704,
278,
198,
11748,
640,
198,
198,
37023,
34227,
796,
657,
628,
198,
16663,
25392,
796,
4704,
278,
13,
25392,
3419,
198,
16663,
82,
796,
17635,
628,
198,
83,
16,
796,
616,
16818,
7,
16,
11,
366,
16818,
171,
120,
230,
16,
... | 2.163934 | 122 |
from plone import api
from plone.app.controlpanel.security import ISecuritySchema
def setup_security(portal):
""" Add security controlpanel settings.
"""
site = api.portal.get()
#site security setup!
security = ISecuritySchema(site)
security.set_enable_user_folders(True)
security.use_uuid... | [
6738,
458,
505,
1330,
40391,
198,
6738,
458,
505,
13,
1324,
13,
13716,
35330,
13,
12961,
1330,
3180,
721,
1684,
27054,
2611,
628,
198,
198,
4299,
9058,
62,
12961,
7,
634,
282,
2599,
198,
220,
220,
220,
37227,
3060,
2324,
1630,
35330,
... | 2.793388 | 121 |
from world.region import get_region_description_id_from_zone_id
import services
import sims4.telemetry
import telemetry_helper
TELEMETRY_GROUP_STORY_PROGRESSION = 'STRY'
TELEMETRY_GROUP_HOUSEHOLD = 'HOHO'
TELEMETRY_HOOK_PLAYED_SIM_INFO_WORLD = 'PSIW'
TELEMETRY_HOOK_TOWNIE_SIM_INFO_WORLD = 'TSIW'
TELEMETRY_HOOK_REGION_I... | [
6738,
995,
13,
36996,
1330,
651,
62,
36996,
62,
11213,
62,
312,
62,
6738,
62,
11340,
62,
312,
198,
11748,
2594,
198,
11748,
985,
82,
19,
13,
46813,
41935,
198,
11748,
5735,
41935,
62,
2978,
525,
198,
9328,
2538,
47123,
18276,
62,
46... | 2.159794 | 388 |
import json
import os
import cv2
# 根路径,里面包含images(图片文件夹),annos.txt(bbox标注),classes.txt(类别标签),以及annotations文件夹(如果没有则会自动创建,用于保存最后的json)
root_path = '/home/ubuntu/user_space/cocoapi/PythonAPI/pycocotools/mydata/data/'
# 用于创建训练集或验证集
phase = 'train'
# 训练集和验证集划分的界线
split = 130
#
dataset = {'images': [], 'annotations': [], '... | [
11748,
33918,
198,
11748,
28686,
198,
11748,
269,
85,
17,
198,
198,
2,
10545,
254,
117,
164,
115,
107,
36181,
226,
171,
120,
234,
34932,
234,
165,
251,
95,
44293,
227,
28938,
104,
17566,
7,
32368,
122,
31965,
229,
23877,
229,
20015,
... | 1.638515 | 3,043 |
"""Tests for the Numeric field"""
import pytest
from swissdta.fields import Numeric
from swissdta.records.record import DTARecord
FIELD_LENGTH = 5
class NRecord(DTARecord):
"""Subclass of DTARecord for testing the Numeric field"""
field = Numeric(length=FIELD_LENGTH)
@pytest.mark.parametrize(('value', 'e... | [
37811,
51,
3558,
329,
262,
399,
39223,
2214,
37811,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
1509,
747,
67,
8326,
13,
25747,
1330,
399,
39223,
198,
6738,
1509,
747,
67,
8326,
13,
8344,
3669,
13,
22105,
1330,
24311,
1503,
721,
585... | 2.342222 | 450 |
if __name__ == '__main__':
iris = load_iris()
data = iris.data
Y = iris.target
data_1 = my_mds(data, 2)
data_2 = MDS(n_components=2).fit_transform(data)
plt.figure(figsize=(8, 4))
plt.subplot(121)
plt.title("my_MDS")
plt.scatter(data_1[:, 0], data_1[:, 1], c=Y)
plt.subplo... | [
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
628,
198,
220,
220,
220,
4173,
271,
796,
3440,
62,
29616,
3419,
198,
220,
220,
220,
1366,
796,
4173,
271,
13,
7890,
198,
220,
220,
220,
575,
796,
4173,
271,
13,
1... | 1.898305 | 236 |