content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import os
from flask import Flask, jsonify
from pyspark import SparkContext, SparkConf
from pyspark.sql import SQLContext
app = Flask(__name__)
conf = SparkConf().setAppName('csv viewer')
sc = SparkContext(conf=conf)
sqlContext = SQLContext(sc)
csv_file = '/user/shelly/panama/offshore_leaks_csvs/Entities.csv'
df = sq... | [
11748,
28686,
198,
6738,
42903,
1330,
46947,
11,
33918,
1958,
198,
6738,
279,
893,
20928,
1330,
17732,
21947,
11,
17732,
18546,
198,
6738,
279,
893,
20928,
13,
25410,
1330,
16363,
21947,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,... | 2.587234 | 235 |
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
labels = ['SVM', 'MLP', '1D-CNN', 'RNN', 'LSTM']
acc = [89, 92, 94, 91, 99]
acc_std = [5, 9, 2, 11, 2]
recall = [85, 94, 88, 89, 99]
x = np.arange (len (labels)) # the label locations
width = 0.30 # the width of the bars
fig, ax = plt.subplots ()... | [
11748,
2603,
29487,
8019,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
198,
23912,
1424,
796,
37250,
50,
15996,
3256,
705,
5805,
47,
3256,
705,
16,
35,
12,
18474,
3256,
705,
49... | 2.272575 | 598 |
import os
from itertools import islice
import torch
from VarNet.torchkit.torchkit import utils
from torch.distributions import Normal
from tqdm import tqdm
from VarNet.discriminator import Discriminator
from VarNet.helpers import cuda_variable, free_params, frozen_params
from VarNet.naf import NAF
from VarNet.util... | [
11748,
28686,
198,
198,
6738,
340,
861,
10141,
1330,
318,
75,
501,
198,
11748,
28034,
198,
6738,
12372,
7934,
13,
13165,
354,
15813,
13,
13165,
354,
15813,
1330,
3384,
4487,
628,
198,
6738,
28034,
13,
17080,
2455,
507,
1330,
14435,
198,... | 2.01524 | 853 |
from . import subject_classifier
| [
6738,
764,
1330,
2426,
62,
4871,
7483,
198
] | 4.125 | 8 |
"""
This module contains the core business logic.
"""
from datetime import datetime
from time import sleep
from typing import NoReturn
import logging
import os
import sys
from getpass import getpass
from dotenv import load_dotenv
from ing_ynab.ynab import YNABClient, YNABError
from ing_ynab.ing import INGClient, Accou... | [
37811,
198,
1212,
8265,
4909,
262,
4755,
1597,
9156,
13,
198,
37811,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
640,
1330,
3993,
198,
6738,
19720,
1330,
1400,
13615,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
25064,
198,
... | 2.483187 | 1,368 |
from __future__ import unicode_literals
from django import template
register = template.Library()
@register.filter
def paginator_slice(page_obj, adjacent_pages=3):
"""
Given a Page object instance return a range of page numbers to show on pagination
controls. Adds first and last page and ellipsis for hi... | [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
1330,
11055,
198,
198,
30238,
796,
11055,
13,
23377,
3419,
628,
198,
31,
30238,
13,
24455,
198,
4299,
42208,
20900,
62,
48369,
7,
7700,
62,
26801,... | 2.666667 | 549 |
"""
342. Power of Four
Given an integer (signed 32 bits), write a function to check whether it is a power of 4.
Example 1:
Input: 16
Output: true
Example 2:
Input: 5
Output: false
Follow up: Could you solve it without loops/recursion?
"""
| [
37811,
198,
31575,
13,
4333,
286,
6675,
198,
15056,
281,
18253,
357,
32696,
3933,
10340,
828,
3551,
257,
2163,
284,
2198,
1771,
340,
318,
257,
1176,
286,
604,
13,
198,
198,
16281,
352,
25,
198,
198,
20560,
25,
1467,
198,
26410,
25,
... | 2.898876 | 89 |
#!/usr/bin/env python
__all__ = ['twitter_download']
from ..common import *
from .universal import *
from .vine import vine_download
site_info = "Twitter.com"
download = twitter_download
download_playlist = playlist_not_supported('twitter')
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
834,
439,
834,
796,
37250,
6956,
62,
15002,
20520,
198,
198,
6738,
11485,
11321,
1330,
1635,
198,
6738,
764,
40082,
1330,
1635,
198,
6738,
764,
26818,
1330,
17793,
62,
15002,
628,
... | 3.402778 | 72 |
# -*- coding: utf-8 -*-
name = u'libpng'
version = '1.6.34'
description = \
"""
libpng library
"""
requires = []
variants = []
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
3672,
796,
334,
6,
8019,
11134,
6,
198,
198,
9641,
796,
705,
16,
13,
21,
13,
2682,
6,
198,
198,
11213,
796,
3467,
198,
220,
220,
220,
37227,
198,
220,
220,
22... | 2.147059 | 68 |
"""
convert_netcdf_to_ascii.py: convert the netcdf files to the ascii format.
"""
from os.path import join
import click
import numpy as np
from mpi4py import MPI
from netCDF4 import Dataset
comm = MPI.COMM_WORLD # pylint: disable=c-extension-no-member
size = comm.Get_size()
rank = comm.Get_rank()
@click.command()
... | [
37811,
198,
1102,
1851,
62,
3262,
66,
7568,
62,
1462,
62,
292,
979,
72,
13,
9078,
25,
10385,
262,
2010,
66,
7568,
3696,
284,
262,
355,
979,
72,
5794,
13,
198,
37811,
198,
6738,
28686,
13,
6978,
1330,
4654,
198,
198,
11748,
3904,
1... | 2.567797 | 236 |
from . import TDMANode, TDMABaseStation
from . import CSMANode, CSMABaseStation
from . import LPDQNode, LPDQBaseStation
from . import DQNNode, DQNBaseStation
from . import ALOHANode, ALOHABaseStation
from . import LORANode, LORABaseStation
import json
import inspect
from enum import Enum
SPECIAL_ATTRIBUTES = ["lat", "... | [
6738,
764,
1330,
13320,
10725,
1098,
11,
13320,
5673,
14881,
12367,
198,
6738,
764,
1330,
9429,
10725,
1098,
11,
9429,
5673,
14881,
12367,
198,
6738,
764,
1330,
406,
5760,
48,
19667,
11,
406,
5760,
48,
14881,
12367,
198,
6738,
764,
1330... | 2.918033 | 122 |
import argparse
import csv
import time
import os
from core_data_modules.traced_data import TracedData, Metadata
from core_data_modules.traced_data.io import TracedDataJsonIO
def create_unique_keys(traced_data_iterable, keys_to_update, group_name):
"""
Acts on the TracedData Object itself(traced_data_iterable)... | [
11748,
1822,
29572,
198,
11748,
269,
21370,
198,
11748,
640,
198,
11748,
28686,
198,
198,
6738,
4755,
62,
7890,
62,
18170,
13,
2213,
2286,
62,
7890,
1330,
833,
2286,
6601,
11,
3395,
14706,
198,
6738,
4755,
62,
7890,
62,
18170,
13,
221... | 2.423022 | 2,085 |
"""
Tagulous test: Model field order
Modules tested:
tagulous.models.fields.SingleTagField
tagulous.models.fields.TagField
"""
from __future__ import absolute_import, unicode_literals
from django.test import TestCase
from tests.lib import TagTestManager
from tests.tagulous_tests_app import models as test_mod... | [
37811,
198,
24835,
6985,
1332,
25,
9104,
2214,
1502,
198,
198,
5841,
5028,
6789,
25,
198,
220,
220,
220,
7621,
6985,
13,
27530,
13,
25747,
13,
28008,
24835,
15878,
198,
220,
220,
220,
7621,
6985,
13,
27530,
13,
25747,
13,
24835,
15878... | 2.235802 | 810 |
from __future__ import unicode_literals
__author__ = 'Daniel Lindsley, Cody Soyland, Matt Croydon, Josh Bohde & Issac Kelly'
__version__ = (0, 10, 0)
| [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
628,
198,
834,
9800,
834,
796,
705,
19962,
9329,
82,
1636,
11,
27035,
30022,
1044,
11,
4705,
327,
3287,
9099,
11,
8518,
44366,
2934,
1222,
10585,
330,
9077,
6,
198,
834,
9641... | 2.923077 | 52 |
#!/usr/bin/env python3
# Download GO Library
# %%%%%%%%%%% Libraries %%%%%%%%%%%#
import os
import json
import hashlib
import urllib.request
from tqdm import tqdm
from auxiliar_functions.globals import go_pkgs
from auxiliar_functions.messages import hashes_differences
# %%%%%%%%%%% Functions %%%%%%%%%%%#
# %%%%%... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
10472,
10351,
10074,
198,
198,
2,
4064,
36917,
36917,
16626,
46267,
4064,
36917,
36917,
16626,
2,
198,
198,
11748,
28686,
198,
11748,
33918,
198,
11748,
12234,
8019,
198,
117... | 3.008696 | 115 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
@python_2_unicode_compatible
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
11,
4112,
62,
11748,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
26791,
... | 3.095238 | 84 |
import orientation, dashboard.resources.woezel_repo as woezel_repo, term, easydraw, system, ugfx, time, wifi, uos, json, sys, gc, woezel
system.serialWarning()
repo = woezel_repo.Repository()
orientation.default()
# Categories list
# Category browsing
# Install application
#Main application
showMessage("Loading... | [
11748,
12852,
11,
30415,
13,
37540,
13,
86,
2577,
17396,
62,
260,
7501,
355,
266,
2577,
17396,
62,
260,
7501,
11,
3381,
11,
2562,
19334,
11,
1080,
11,
334,
70,
21373,
11,
640,
11,
43121,
11,
334,
418,
11,
33918,
11,
25064,
11,
308... | 3.065476 | 168 |
# -*- coding: utf-8 -*-
"""Top-level package for Simple Python package."""
__author__ = """Bineli Hervé"""
__email__ = 'binelimanga@gmail.com'
__version__ = '0.1.0'
from .simple_python_package import * | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
9126,
12,
5715,
5301,
329,
17427,
11361,
5301,
526,
15931,
198,
198,
834,
9800,
834,
796,
37227,
33,
20538,
72,
367,
712,
2634,
37811,
198,
834,
12888,
834,
... | 2.615385 | 78 |
from collections import deque
import json
import time
| [
6738,
17268,
1330,
390,
4188,
198,
11748,
33918,
198,
11748,
640,
628
] | 4.583333 | 12 |
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException
from bs4 import BeautifulSoup
import wget
import sys
# month_string... | [
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11284,
13,
9019,
1330,
5313,
32103,
21321,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11284,
1330,
2938,
62,
17561,
1756,
355,
9940,
1... | 3.128 | 125 |
#
# PySNMP MIB module TOKEN-RING-RMON-MIB (http://pysnmp.sf.net)
# ASN.1 source http://mibs.snmplabs.com:80/asn1/TOKEN-RING-RMON-MIB
# Produced by pysmi-0.0.7 at Fri Feb 17 12:48:35 2017
# On host 5641388e757d platform Linux version 4.4.0-62-generic by user root
# Using Python version 2.7.13 (default, Dec 22 2016, 09:2... | [
2,
198,
2,
9485,
15571,
7378,
337,
9865,
8265,
5390,
43959,
12,
49,
2751,
12,
49,
27857,
12,
8895,
33,
357,
4023,
1378,
79,
893,
77,
3149,
13,
28202,
13,
3262,
8,
198,
2,
7054,
45,
13,
16,
2723,
2638,
1378,
76,
571,
82,
13,
16... | 2.806922 | 12,886 |
import os
import random
import numpy as np
import torch
import torch.nn as nn
from torch.optim.lr_scheduler import StepLR, OneCycleLR
import time
from tqdm import tqdm
from loguru import logger
from args import args
from model import ODEGCN
from utils import generate_dataset, read_data, get_normalized_adj
... | [
11748,
28686,
201,
198,
11748,
4738,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
28034,
201,
198,
11748,
28034,
13,
20471,
355,
299,
77,
201,
198,
6738,
28034,
13,
40085,
13,
14050,
62,
1416,
704,
18173,
1330,
5012,
35972,... | 2.622857 | 175 |
from django.contrib.auth.models import User
from rest_framework import serializers
from mainstore.models import Catalog, Product
# hyperlinkedmodelserializer
#view_name='api:product-detail'
| [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
198,
6738,
1388,
8095,
13,
27530,
1330,
44515,
11,
8721,
628,
198,
2,
8718,
25614,
27530,
48499,
7509,
198,
2,
... | 3.679245 | 53 |
import numpy as np
import srfnef
from .listmode2sinogram import get_center
# def get_image(geometry):
# image_data = np.json_load(geometry['path']).astype(np.float32)
# center = geometry['center']
# size = geometry['size']
# return nef.Image(image_data,center,size)
| [
11748,
299,
32152,
355,
45941,
198,
11748,
27924,
710,
69,
198,
6738,
764,
4868,
14171,
17,
31369,
21857,
1330,
651,
62,
16159,
628,
628,
628,
628,
198,
2,
825,
651,
62,
9060,
7,
469,
15748,
2599,
198,
2,
220,
220,
220,
220,
2939,
... | 2.621622 | 111 |
#import certain functions into the global
#namespace
from app import app
from markdown import markdown
from flask import render_template, render_template_string, request, session
from app.blog_helpers import render_markdown
#safe global import (okay to use)
import flask
import os
app.secret_key = b'M\xb6NP!YC\x19\x... | [
2,
11748,
1728,
5499,
656,
262,
3298,
198,
2,
14933,
10223,
198,
6738,
598,
1330,
598,
198,
6738,
1317,
2902,
1330,
1317,
2902,
198,
6738,
42903,
1330,
8543,
62,
28243,
11,
8543,
62,
28243,
62,
8841,
11,
2581,
11,
6246,
198,
6738,
5... | 2.766038 | 265 |
import pandas as pd
#from obspy.core import UTCDateTime
#import datetime # Basic date and time types
#import scipy.io # ecosystem of open-source software for mathematics, science, and engineering
### Import GeoSEA Modules ###
from .change2dateindex import *
from .change_dtype import *
def extract_df(old_df,index_li... | [
198,
11748,
19798,
292,
355,
279,
67,
198,
2,
6738,
909,
2777,
88,
13,
7295,
1330,
18119,
10430,
7575,
198,
2,
11748,
4818,
8079,
1303,
14392,
3128,
290,
640,
3858,
198,
2,
11748,
629,
541,
88,
13,
952,
1303,
13187,
286,
1280,
12,
... | 2.460817 | 1,812 |
import iewrap
import sys
import math
import time
import numpy as np
from numpy import linalg as LA
import cv2
from scipy.spatial import distance
from munkres import Munkres # Hungarian algorithm for ID assignment
# ---------------------------------------------
# Functions for checking boundary line cr... | [
11748,
220,
769,
2416,
198,
198,
11748,
25064,
198,
11748,
10688,
198,
11748,
640,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
299,
32152,
1330,
300,
1292,
70,
355,
9131,
198,
198,
11748,
269,
85,
17,
198,
6738,
629,
541,
88,
... | 2.645963 | 483 |
# Copyright 2021 The Cirq Developers
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | [
2,
15069,
33448,
383,
21239,
80,
34152,
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,
351,
262,
13789,
13,
198,
2,
921... | 2.772973 | 740 |
# -------------------------------------------------------------------------------
# Copyright IBM Corp. 2017
#
# 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/licens... | [
2,
16529,
24305,
198,
2,
15069,
19764,
11421,
13,
2177,
198,
2,
220,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
705,
34156,
24036,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
1... | 4.229572 | 257 |
#!/usr/bin/env
# -*- coding: utf-8 -*-
# Copyright (C) Victor M. Mendiola Lau - All Rights Reserved
# Unauthorized copying of this file, via any medium is strictly prohibited
# Proprietary and confidential
# Written by Victor M. Mendiola Lau <ryuzakyl@gmail.com>, March 2017
import pylab
import pandas as pd
from data... | [
2,
48443,
14629,
14,
8800,
14,
24330,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
34,
8,
12622,
337,
13,
20442,
30292,
40014,
532,
1439,
6923,
33876,
198,
2,
791,
19721,
23345,
286,
428,
2393... | 3.303797 | 237 |
import os
import glob
import json
import pandas as pd
import numpy as np
from cobra.io import (
read_sbml_model,
load_json_model,
load_yaml_model,
load_matlab_model,
write_sbml_model,
)
SEPERATOR = os.path.sep
PATH = (
os.path.dirname(os.path.dirname(os.path.dirname(os.path.r... | [
11748,
28686,
201,
198,
11748,
15095,
201,
198,
11748,
33918,
201,
198,
201,
198,
11748,
19798,
292,
355,
279,
67,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
201,
198,
6738,
22843,
430,
13,
952,
1330,
357,
201,
198,
220,
220,
... | 2.299934 | 1,517 |
from collections import defaultdict
from csgame.views import over
from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.decorators import user_passes_test
from django.contrib.sessions.models import Session
from django.shortcuts import redirect
from functools impor... | [
6738,
17268,
1330,
4277,
11600,
198,
6738,
50115,
6057,
13,
33571,
1330,
625,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
23848,
40,
23988,
62,
44603,
62,
20608,
198,
6738,
42... | 2.896985 | 398 |
import json
import os
from .utils import read_json
from .converter import yolo_to_coco
def coco_dataset_analysis(path_annotation_dictionary):
'''
Example:
- path_annotation_dictionary ={
'set_name_1': 'coco_annotation_1.json',
'set_name_2': 'coco_annotation_2.json',
... | [
11748,
33918,
198,
11748,
28686,
198,
198,
6738,
764,
26791,
1330,
1100,
62,
17752,
198,
6738,
764,
1102,
332,
353,
1330,
331,
14057,
62,
1462,
62,
66,
25634,
198,
198,
4299,
8954,
78,
62,
19608,
292,
316,
62,
20930,
7,
6978,
62,
12... | 2.092298 | 1,636 |
##################################################################
# Copyright 2018 Open Source Geospatial Foundation and others #
# licensed under MIT, Please consult LICENSE.txt for details #
##################################################################
"""Unit tests for complex validator
"""
import uni... | [
29113,
29113,
2235,
198,
2,
15069,
2864,
4946,
8090,
2269,
2117,
34961,
5693,
290,
1854,
220,
220,
220,
1303,
198,
2,
11971,
739,
17168,
11,
4222,
5725,
38559,
24290,
13,
14116,
329,
3307,
220,
220,
220,
220,
1303,
198,
29113,
29113,
... | 2.348688 | 1,867 |
"""Mathematical functions operating on arrays"""
import numpy as np
def normalize_vec_l2(vecs):
"""Perform l2 normalization on each vector in a given matrix (axis 1)"""
norm = np.linalg.norm(vecs, ord=2, axis=1, keepdims=True) + 1e-6
return vecs / norm
def asmk_kernel(sim, image_ids, *, alpha, similarit... | [
37811,
19044,
10024,
605,
5499,
5361,
319,
26515,
37811,
198,
198,
11748,
299,
32152,
355,
45941,
628,
198,
4299,
3487,
1096,
62,
35138,
62,
75,
17,
7,
303,
6359,
2599,
198,
220,
220,
220,
37227,
5990,
687,
300,
17,
3487,
1634,
319,
... | 2.758242 | 182 |
from lib.nodes import RootNode, TextNode, PartialNode, SectionNode, Node
from lib.misc import TYPES, type_of, evalf, format_value, is_array
from lib.directives import DIRECTIVES, SYMBOLS
from lib.template import Template
from lib.domain import Domain
import json
DEFAULT = {
"error_on_func_failure": False,
"e... | [
6738,
9195,
13,
77,
4147,
1330,
20410,
19667,
11,
8255,
19667,
11,
43689,
19667,
11,
7275,
19667,
11,
19081,
198,
6738,
9195,
13,
44374,
1330,
24412,
47,
1546,
11,
2099,
62,
1659,
11,
819,
1604,
11,
5794,
62,
8367,
11,
318,
62,
1874... | 2.702532 | 158 |
from unittest import TestCase
from shelltools import csv2sortable
import io
import csv
| [
6738,
555,
715,
395,
1330,
6208,
20448,
198,
6738,
7582,
31391,
1330,
269,
21370,
17,
30619,
540,
198,
11748,
33245,
198,
11748,
269,
21370,
198
] | 3.48 | 25 |
from unittest.mock import MagicMock, PropertyMock
import pytest
import abstracts
from aio.api import nist
@abstracts.implementer(nist.ACVE)
@pytest.mark.parametrize("include", ["odd", "even"])
@pytest.mark.parametrize("tracked", [True, False])
@pytest.mark.parametrize("matches", [True, False])
@pyte... | [
198,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
6139,
44,
735,
11,
14161,
44,
735,
198,
198,
11748,
12972,
9288,
198,
198,
11748,
12531,
82,
198,
198,
6738,
257,
952,
13,
15042,
1330,
299,
396,
628,
198,
31,
397,
8709,
82,
13,
... | 2.375635 | 197 |
"""Setup cython code."""
from setuptools import Extension
from setuptools import setup
from setuptools.command.build_ext import build_ext as _build_ext
from Cython.Build import cythonize
class build_ext(_build_ext):
"""Overwrite build_ext."""
def finalize_options(self):
"""Prevent numpy from think... | [
37811,
40786,
3075,
400,
261,
2438,
526,
15931,
198,
198,
6738,
900,
37623,
10141,
1330,
27995,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
6738,
900,
37623,
10141,
13,
21812,
13,
11249,
62,
2302,
1330,
1382,
62,
2302,
355,
4808... | 2.486486 | 296 |
import torch
from saliency.saliency import Saliency
import numpy
try:
import excitationbp as eb
except:
print('Cannot import excitation bp')
| [
11748,
28034,
198,
6738,
3664,
6160,
13,
21680,
6160,
1330,
4849,
6160,
198,
11748,
299,
32152,
198,
198,
28311,
25,
198,
220,
220,
220,
1330,
2859,
3780,
46583,
355,
36649,
198,
16341,
25,
198,
220,
220,
220,
3601,
10786,
34,
34574,
... | 3.102041 | 49 |
"""
ADO MSSQL database backend for Django.
Requires adodbapi 2.0.1: http://adodbapi.sourceforge.net/
"""
from django.db.backends import util
try:
import adodbapi as Database
except ImportError, e:
from django.core.exceptions import ImproperlyConfigured
raise ImproperlyConfigured, "Error loading adodbapi m... | [
37811,
198,
2885,
46,
337,
5432,
9711,
6831,
30203,
329,
37770,
13,
198,
198,
39618,
512,
375,
65,
15042,
362,
13,
15,
13,
16,
25,
2638,
1378,
324,
375,
65,
15042,
13,
10459,
30293,
13,
3262,
14,
198,
37811,
198,
198,
6738,
42625,
... | 2.728571 | 840 |
"""
Use `python cv_dump.py` to create json file.
Uninstall opencv-python before running this script.
"""
import paker
import logging
import numpy as np
file = "cv2.json"
logging.basicConfig(level=logging.NOTSET)
if __name__ == '__main__':
# read cv2 code from json and load it using paker
with open(file, "r")... | [
37811,
198,
11041,
4600,
29412,
269,
85,
62,
39455,
13,
9078,
63,
284,
2251,
33918,
2393,
13,
198,
3118,
17350,
1280,
33967,
12,
29412,
878,
2491,
428,
4226,
13,
198,
37811,
198,
198,
11748,
279,
3110,
198,
11748,
18931,
198,
11748,
2... | 2.239837 | 246 |
from tensorflow.keras import backend as K
from tensorflow.keras import initializers as initializations
from tensorflow.keras.layers import Layer, InputSpec
from tensorflow.keras.utils import get_custom_objects
from tensorflow.python.keras.layers.pooling import GlobalPooling2D
from groupy.gconv.tensorflow_gconv.splitgc... | [
6738,
11192,
273,
11125,
13,
6122,
292,
1330,
30203,
355,
509,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
1330,
4238,
11341,
355,
4238,
4582,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
13,
75,
6962,
1330,
34398,
11,
23412,
22882,
... | 3.441176 | 578 |
import logging
from telegram.ext import Updater,CommandHandler,MessageHandler,Filters
#basic logging
logging.basicConfig(format='%(asctime)s - %(name)s %(levelname)s - %(message)s',level=logging.INFO)
logger=logging.getLogger(__name__)
#
TOKEN="1120204705:AAHyfpz_916XPB0IZkp_OG2oL7sIO1gzGEo"
if __name__ == "__main... | [
11748,
18931,
198,
198,
6738,
573,
30536,
13,
2302,
1330,
3205,
67,
729,
11,
21575,
25060,
11,
12837,
25060,
11,
11928,
1010,
198,
2,
35487,
18931,
198,
6404,
2667,
13,
35487,
16934,
7,
18982,
11639,
4,
7,
292,
310,
524,
8,
82,
532,... | 2.382979 | 141 |
"""Module to load disease data from Mondo Disease Ontology."""
from .base import OWLBase
from disease import PROJECT_ROOT, PREFIX_LOOKUP, logger
from disease.database import Database
from disease.schemas import SourceMeta, SourceName, NamespacePrefix
from pathlib import Path
import requests
import owlready2 as owl
from... | [
37811,
26796,
284,
3440,
4369,
1366,
422,
337,
22311,
17344,
9463,
1435,
526,
15931,
198,
6738,
764,
8692,
1330,
47210,
43,
14881,
198,
6738,
4369,
1330,
21965,
23680,
62,
13252,
2394,
11,
22814,
47084,
62,
43,
15308,
8577,
11,
49706,
1... | 2.0592 | 3,125 |
# -*- coding: utf-8 -*-
# @Author: MaxST
# @Date: 2019-10-28 19:01:21
# @Last Modified by: MaxST
# @Last Modified time: 2019-11-17 15:10:42
default_app_config = 'tof.apps.TofConfig'
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
13838,
25,
5436,
2257,
198,
2,
2488,
10430,
25,
220,
220,
13130,
12,
940,
12,
2078,
678,
25,
486,
25,
2481,
198,
2,
2488,
5956,
40499,
416,
25,
220,
220,
... | 2.240964 | 83 |
'''
Created by auto_sdk on 2020.12.11
'''
from dingtalk.api.base import RestApi
| [
7061,
6,
198,
41972,
416,
8295,
62,
21282,
74,
319,
12131,
13,
1065,
13,
1157,
198,
7061,
6,
198,
6738,
44852,
16620,
13,
15042,
13,
8692,
1330,
8324,
32,
14415,
198
] | 2.580645 | 31 |
from abstractions.storages import FeaturesStorage, UsersStorage, ImagesStorage, TransactionContext
from datetime import datetime
from uuid import UUID, uuid4 | [
6738,
12531,
507,
13,
301,
273,
1095,
1330,
17571,
31425,
11,
18987,
31425,
11,
5382,
31425,
11,
45389,
21947,
198,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
334,
27112,
1330,
471,
27586,
11,
334,
27112,
19
] | 4.157895 | 38 |
from django.db.models import DateField
from markdownx.models import MarkdownxField
from .helpers import SingletonModel, MarkdownModel
| [
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
7536,
15878,
198,
6738,
1317,
2902,
87,
13,
27530,
1330,
2940,
2902,
87,
15878,
198,
198,
6738,
764,
16794,
364,
1330,
5573,
10565,
17633,
11,
2940,
2902,
17633,
198
] | 3.648649 | 37 |
from math import inf
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rcParams
from matplotlib.lines import Line2D
rcParams.update({'figure.autolayout': True})
from util import rotate, dist_2d, angle_2d, find_lighthouse_centers, find_lighthouse_illum_points
def checkCollision(x1, y1, x2, y2, ... | [
6738,
10688,
1330,
1167,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
2603,
29487,
8019,
1330,
48321,
10044,
4105,
198,
6738,
2603,
29487,
8019,
13,
6615,
1330,
6910,
17,
3... | 2.373842 | 3,670 |
# -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... | [
2,
220,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
41906,
17174,
4557,
35625,
198,
2,
45593,
2640,
11,
262,
7311,
276,
42410,
6779,
4482,
286,
262,
10373,
57,
198,
2,
15069,
357,
66,
8,
3717,
12,
1238,
2481,
... | 3.99654 | 289 |
API_URL = "https://api.planets.nu"
GAME_ARCH_DIR = "game_data"
GAME_STATUS_ERROR = -1
GAME_STATUS_INTEREST = 0
GAME_STATUS_NEW = 1
GAME_STATUS_IN_PROGRESS = 2
GAME_STATUS_COMPLETED = 3
# maps race id to race name:
RACE_NAME = ["The Solar Federation",
"The Lizard Alliance",
"The Empire of the B... | [
17614,
62,
21886,
796,
366,
5450,
1378,
15042,
13,
11578,
1039,
13,
28803,
1,
198,
47109,
62,
31315,
62,
34720,
796,
366,
6057,
62,
7890,
1,
198,
198,
47109,
62,
35744,
2937,
62,
24908,
796,
532,
16,
198,
47109,
62,
35744,
2937,
62,... | 2.167785 | 298 |
import os
import json
import requests
######################
# helper functions
######################
# recursively look/return for an item in dict given key
# recursively check for items in a dict given key
# send txt via messenger to id
# -----------------------------------------------------------
| [
11748,
28686,
198,
11748,
33918,
198,
11748,
7007,
198,
198,
14468,
4242,
2235,
198,
2,
31904,
5499,
198,
14468,
4242,
2235,
198,
2,
664,
1834,
2280,
804,
14,
7783,
329,
281,
2378,
287,
8633,
1813,
1994,
628,
198,
2,
664,
1834,
2280,
... | 4.573529 | 68 |
from .base import Organization
from .msr import Runner as MSRRunner
from .psicologa import Runner as PsicologaRunner
from .advogada import Runner as AdvogadaRunner
| [
6738,
764,
8692,
1330,
12275,
198,
6738,
764,
907,
81,
1330,
21529,
355,
6579,
49,
49493,
198,
6738,
764,
862,
291,
928,
64,
1330,
21529,
355,
350,
21383,
928,
64,
49493,
198,
6738,
764,
32225,
519,
4763,
1330,
21529,
355,
8007,
519,
... | 3.644444 | 45 |
import numpy as np
from numpy.random import uniform
import matplotlib.pyplot as plt
directory = "C:/Users/DELL/Desktop/Quant_macro/Pset5"
import os
os.chdir(directory)
import Agent1_23 as a
N_a = 100
## T is defined as a default parameter
agent = a.agent1(N_a)
V, Ga, Gc = agent.problem()
####partial equili... | [
11748,
299,
32152,
355,
45941,
201,
198,
6738,
299,
32152,
13,
25120,
1330,
8187,
201,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
201,
198,
34945,
796,
366,
34,
14079,
14490,
14,
7206,
3069,
14,
36881,
14,
24915,
62... | 2.294333 | 547 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class AsciidocPy3(AutotoolsPackage):
"""Python 3 port of Asciidoc Python.
AsciiDoc is a text... | [
2,
15069,
2211,
12,
1238,
2481,
13914,
45036,
3549,
2351,
4765,
11,
11419,
290,
584,
198,
2,
1338,
441,
4935,
34152,
13,
4091,
262,
1353,
12,
5715,
27975,
38162,
9947,
2393,
329,
3307,
13,
198,
2,
198,
2,
30628,
55,
12,
34156,
12,
... | 2.231595 | 652 |
# -*- coding: utf-8 -*-
"""
Author: Josef Perktold
License: BSD-3
"""
from __future__ import print_function
import numpy as np
from scipy import stats
class NonlinearDeltaCov:
'''Asymptotic covariance by Deltamethod
The function is designed for 2d array, with rows equal to
the number of equations or co... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
13838,
25,
5264,
69,
2448,
21841,
727,
198,
34156,
25,
347,
10305,
12,
18,
198,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
1... | 2.455539 | 3,936 |
from .batch_dot import BatchDot
from .collapse_to_batch import CollapseToBatch
from .envelope import Envelope
from .expand_from_batch import ExpandFromBatch
from .max import Max
from .permute import Permute
from .multiply import Multiply
from .repeat import Repeat
from .repeat_like import RepeatLike
from .squeeze impo... | [
198,
6738,
764,
43501,
62,
26518,
1330,
347,
963,
35,
313,
198,
6738,
764,
26000,
7512,
62,
1462,
62,
43501,
1330,
7778,
7512,
2514,
33,
963,
198,
6738,
764,
268,
1091,
68,
1330,
2039,
1091,
68,
198,
6738,
764,
11201,
392,
62,
6738,... | 3.281818 | 110 |
from bs4 import BeautifulSoup
import requests
import re
from io import BytesIO
def get_url_full_html(url_page_course: str) -> str:
'http://courses.duytan.edu.vn/Modules/academicprogram/CourseClassResult.aspx?courseid=592&semesterid=70×pan=70&t=1596880419589'
if __name__ == '__main__':
print(ge... | [
6738,
275,
82,
19,
1330,
23762,
50,
10486,
201,
198,
11748,
7007,
201,
198,
11748,
302,
201,
198,
6738,
33245,
1330,
2750,
4879,
9399,
201,
198,
201,
198,
201,
198,
4299,
651,
62,
6371,
62,
12853,
62,
6494,
7,
6371,
62,
7700,
62,
... | 2.442177 | 147 |
# ckwg +29
# Copyright 2019 by Kitware, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditi... | [
2,
269,
46265,
70,
1343,
1959,
198,
2,
15069,
13130,
416,
10897,
1574,
11,
3457,
13,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
1231,
198,
2,
17613,
11,
3... | 2.722902 | 3,598 |
from pathlib import Path
import shutil
from django.conf import settings
from django.core import cache, mail
from django.test import TestCase
from django_mail_viewer.backends.database.models import EmailMessage
| [
6738,
3108,
8019,
1330,
10644,
198,
11748,
4423,
346,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
7295,
1330,
12940,
11,
6920,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
198,
6738,
4... | 3.627119 | 59 |
from typing import Tuple, Dict
PROMETHEUS_URL = 'http://10.66.66.53:30782/api/v1/query?query=' # URL do prometheus Istio
PROMETHEUS_KUBE_PROMETHEUS = 'http://10.66.66.53:30298/api/v1/query?query=' # URL do prometheus KubePrometheus
METRICAS = {
'Traffic':
'sum(increase(istio_requests_total{destination_w... | [
6738,
19720,
1330,
309,
29291,
11,
360,
713,
198,
198,
4805,
2662,
2767,
13909,
2937,
62,
21886,
796,
705,
4023,
1378,
940,
13,
2791,
13,
2791,
13,
4310,
25,
1270,
46519,
14,
15042,
14,
85,
16,
14,
22766,
30,
22766,
11639,
220,
1303... | 2.160582 | 3,780 |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
24893,
1087,
318,
10607,
284,
1104,
262,
1280,
2723,
2055,
416,
1642,
5525,
241,
251,
165,
110,
116,
162,
247,
118,
12859,
239,
47,
7252,
50,
33176,
111,
2... | 3.164557 | 395 |
# -*- coding: utf-8 -*-
#
# Author: Tomi Jylhä-Ollila, Finland 2016-2019
#
# This file is part of Kunquat.
#
# CC0 1.0 Universal, http://creativecommons.org/publicdomain/zero/1.0/
#
# To the extent possible under law, Kunquat Affirmers have waived all
# copyright and related or neighboring rights to Kunquat.
#
from k... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
198,
2,
6434,
25,
4186,
72,
449,
2645,
71,
11033,
12,
46,
297,
10102,
11,
17837,
1584,
12,
23344,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
22673,
421,
265... | 2.764706 | 170 |
import os
import logging
from datetime import datetime
import pytz
from tzlocal import get_localzone
| [
11748,
28686,
198,
11748,
18931,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
11748,
12972,
22877,
198,
6738,
256,
89,
12001,
1330,
651,
62,
12001,
11340,
628
] | 3.678571 | 28 |
import json
import boto3
from chalice import Chalice, NotFoundError, BadRequestError
r53 = boto3.client('route53')
app = Chalice(app_name='serverless-ddns')
app.debug = False
@app.route('/', api_key_required=True)
# TODO
# @app.route('/{hostzone}', api_key_required=True)
# def index_hostzone(hostzone):
@app.rout... | [
11748,
33918,
198,
11748,
275,
2069,
18,
198,
6738,
442,
282,
501,
1330,
30529,
501,
11,
1892,
21077,
12331,
11,
7772,
18453,
12331,
198,
198,
81,
4310,
796,
275,
2069,
18,
13,
16366,
10786,
38629,
4310,
11537,
198,
1324,
796,
30529,
... | 2.613924 | 158 |
import base64
from rdflib.term import URIRef
message = "Python is fun"
message_bytes = message.encode('ascii')
base64_bytes = base64.b64encode(message_bytes)
base64_message = base64_bytes.decode('ascii') | [
11748,
2779,
2414,
198,
198,
6738,
374,
67,
2704,
571,
13,
4354,
1330,
37902,
4663,
891,
628,
628,
198,
20500,
796,
366,
37906,
318,
1257,
1,
198,
20500,
62,
33661,
796,
3275,
13,
268,
8189,
10786,
292,
979,
72,
11537,
198,
8692,
24... | 2.736842 | 76 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 expandtab number
"""
Authors: qianweishuo<qzy922@gmail.com>
Date: 2019/9/29 下午9:48
"""
import pytest
from kinoko.text.io import ensure_text, ensure_binary
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
43907,
25,
7400,
11338,
28,
19,
6482,
10394,
28,
19,
4292,
8658,
1271,
198,
37811,
198,
30515,
669,
25,
10662,
666... | 2.323529 | 102 |
import unittest
from sub_string_divisibility import *
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
198,
6738,
850,
62,
8841,
62,
7146,
271,
2247,
1330,
1635,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
198
] | 2.625 | 40 |
import numpy
import matplotlib.pyplot as plt
data = numpy.genfromtxt('data_1961ZA.....53...81W.csv',
skip_header=1,
dtype=[
('r', 'f8'), ('d0', 'f8'), ('d10', 'f8'), ('d20', 'f8'), ('d30', 'f8'),
('d40', 'f8'), ('d50', 'f8'), ('d60', 'f8'), ('d70', 'f8'),
('d80', 'f8'), ('d90', 'f8')])... | [
11748,
299,
32152,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
628,
198,
7890,
796,
299,
32152,
13,
5235,
6738,
14116,
10786,
7890,
62,
1129,
5333,
34892,
12359,
4310,
986,
6659,
54,
13,
40664,
3256,
198,
220,
220,
2... | 2.027832 | 1,545 |
import discord
from discord.ext import commands, menus
import calendar
import traceback
# end imports
guild_id = 836941648117497916 # 216848402435014657
# end guild_id
rlh_logo_url = "https://cdn.discordapp.com/attachments/440306586062159873/737355396993384498/RLH-Bot.png"
# end image URLs
e_... | [
11748,
36446,
198,
6738,
36446,
13,
2302,
1330,
9729,
11,
26798,
198,
11748,
11845,
198,
11748,
12854,
1891,
198,
2,
886,
17944,
628,
198,
70,
3547,
62,
312,
796,
807,
2623,
5824,
1433,
2780,
17657,
2920,
3720,
1433,
220,
220,
220,
22... | 1.940262 | 1,222 |
# Copyright 2020 Jacob Glueck
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
2,
15069,
12131,
12806,
2671,
518,
694,
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,
351,
262,
13789,
13,
198,
2,
921... | 3.475155 | 322 |
import functools
from .requestor import APIRequestor
__all__ = ('PaymentGateway', 'authorize', 'verify', 'capture', 'sale', 'void',
'refund', 'credit', 'force', 'tokenize')
authorize = gateway_method('authorize')
verify = gateway_method('verify')
capture = gateway_method('capture')
sale = gateway_method('sale')... | [
11748,
1257,
310,
10141,
198,
6738,
764,
25927,
273,
1330,
7824,
18453,
273,
198,
198,
834,
439,
834,
796,
19203,
19197,
434,
22628,
1014,
3256,
705,
9800,
1096,
3256,
705,
332,
1958,
3256,
705,
27144,
495,
3256,
705,
21378,
3256,
705,
... | 3.154839 | 155 |
n_neurons = 20 # the size of the system
timesteps = 10000
n_trials = 3
etas = [2, 1, 0.5, 0.25, 0.12]
corr_data = np.zeros((n_trials, len(etas)))
for trial in range(n_trials):
print("Trial {} of {}".format(trial+1, n_trials))
for j, eta in enumerate(etas):
# solution
A, X, Z = simulate_neurons... | [
77,
62,
710,
333,
684,
796,
1160,
1303,
262,
2546,
286,
262,
1080,
198,
16514,
395,
25386,
796,
33028,
198,
77,
62,
28461,
874,
796,
513,
198,
198,
316,
292,
796,
685,
17,
11,
352,
11,
657,
13,
20,
11,
657,
13,
1495,
11,
657,
... | 2.065041 | 492 |
import ndspy
import ndspy.rom
import code
import io
import os
import os.path
from os import path
import json
import copy
from math import floor
| [
11748,
299,
67,
2777,
88,
198,
11748,
299,
67,
2777,
88,
13,
398,
198,
11748,
2438,
220,
198,
11748,
33245,
198,
11748,
28686,
198,
11748,
28686,
13,
6978,
198,
6738,
28686,
1330,
3108,
198,
11748,
33918,
198,
11748,
4866,
198,
6738,
... | 3.145833 | 48 |
from time import perf_counter
from typing import Callable, Set, Any
TimerHandler = Callable
TimeInSeconds = float
| [
6738,
640,
1330,
23035,
62,
24588,
198,
6738,
19720,
1330,
4889,
540,
11,
5345,
11,
4377,
628,
198,
48801,
25060,
796,
4889,
540,
198,
7575,
818,
12211,
82,
796,
12178,
628,
198
] | 3.6875 | 32 |
from __future__ import absolute_import
import datetime
import json
from collections import namedtuple
import pytest
from sqlalchemy import Column
from sqlalchemy import Date
from sqlalchemy import Enum
from sqlalchemy import Integer
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from py... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
11748,
4818,
8079,
198,
11748,
33918,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
198,
11748,
12972,
9288,
198,
6738,
44161,
282,
26599,
1330,
29201,
198,
6738,
44161,
282,
26599... | 3.264368 | 261 |
from Messages.Message import Message
| [
6738,
43534,
13,
12837,
1330,
16000,
201,
198,
201,
198
] | 4 | 10 |
"""
AWS Lambda Layer Builds
"""
import logging
# invoke-release version information
from .version import __version__ # noqa: F401
from .version import __version_info__
VERSION = __version__
# Set default logging handler to avoid "No handler found" warnings.
logging.getLogger(__name__).addHandler(logging.NullHandle... | [
37811,
198,
12298,
50,
21114,
6814,
34398,
10934,
82,
198,
37811,
198,
198,
11748,
18931,
198,
198,
2,
26342,
12,
20979,
2196,
1321,
198,
6738,
764,
9641,
1330,
11593,
9641,
834,
220,
1303,
645,
20402,
25,
376,
21844,
198,
6738,
764,
... | 3.494624 | 93 |
from contextlib import contextmanager
from itertools import product
@contextmanager
| [
6738,
4732,
8019,
1330,
4732,
37153,
198,
6738,
340,
861,
10141,
1330,
1720,
628,
628,
628,
198,
31,
22866,
37153,
628,
628
] | 4.227273 | 22 |
# -*- coding: utf-8 -*-
from .lib import *
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
764,
8019,
1330,
1635,
198
] | 2.15 | 20 |
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.utils import unittest
from photomatic.models import *
from django.contrib.auth.models import User
| [
37811,
198,
1212,
2393,
15687,
3597,
5254,
1262,
262,
555,
715,
395,
8265,
13,
2312,
481,
1208,
198,
12518,
345,
1057,
366,
805,
496,
13,
9078,
1332,
1911,
198,
198,
3041,
5372,
428,
351,
517,
5035,
5254,
329,
534,
3586,
13,
198,
37... | 3.857143 | 77 |
#!/usr/bin/python3
"""
TODO: Module-level description
"""
import argparse
import os
import numpy as np
from ase.io import read, write
from asaplib.compressor import fps, CUR_deterministic
def main(fxyz, fy, prefix, nkeep, algorithm, fmat, fkde, reweight_lambda):
"""
Select frames from the supplied xyz file... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
37811,
198,
51,
3727,
46,
25,
19937,
12,
5715,
6764,
198,
37811,
198,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
257,
325,
13,
952,
... | 2.303132 | 3,289 |
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, include, url
from django.views.generic import View
urlpatterns = patterns('',
url(r'foo$', View.as_view(), name="foo"),
)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
7572,
11,
2291,
11,
19016,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
1330,
3582,
628,
198,
6371,
33279,
82,
... | 2.666667 | 72 |
#!/usr/bin/python3
import os
import os.path
import sys
from ProNAhotMod.lib_parser import *
from ProNAhotMod.lib_featurize import *
import random
import numpy as np
np.random.seed(0)
random.seed( 0 )
| [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
11748,
28686,
198,
11748,
28686,
13,
6978,
198,
11748,
25064,
198,
6738,
1041,
4535,
8940,
5841,
13,
8019,
62,
48610,
1330,
1635,
198,
6738,
1041,
4535,
8940,
5841,
13,
8019,
62,
5036,
25... | 2.727273 | 77 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
# Copyright 2016-2017 Capital One Services, 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 agreed ... | [
2,
15069,
1584,
12,
5539,
9747,
1881,
6168,
11,
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,
11846,
351,
262,
13789,
... | 3.955056 | 178 |
from app import app, db, ma, handlers
from flask import request, jsonify, abort
from app.models import Book
book_schema = BookSchema(strict=True)
books_schema = BookSchema(many=True, strict=True)
# Create a Book
@app.route('/book', methods=['POST'])
# Get single Book
@app.route('/book/<id>', methods=['GET'])
# Ge... | [
6738,
598,
1330,
598,
11,
20613,
11,
17266,
11,
32847,
198,
6738,
42903,
1330,
2581,
11,
33918,
1958,
11,
15614,
198,
6738,
598,
13,
27530,
1330,
4897,
198,
198,
2070,
62,
15952,
2611,
796,
4897,
27054,
2611,
7,
301,
2012,
28,
17821,
... | 2.740331 | 181 |
#!/bin/python3
# Day 1: Quartiles
# https://www.hackerrank.com/challenges/s10-quartiles/problem
if __name__ == "__main__":
number_of_elements = int(input())
elements = list(map(int, input().rstrip().split()))
print("\n".join(map(str,solve(number_of_elements, elements))))
| [
2,
48443,
8800,
14,
29412,
18,
198,
2,
3596,
352,
25,
48748,
2915,
198,
2,
3740,
1378,
2503,
13,
31153,
8056,
962,
13,
785,
14,
36747,
34120,
14,
82,
940,
12,
36008,
2915,
14,
45573,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834... | 2.6 | 110 |
# GridGain Community Edition Licensing
# Copyright 2019 GridGain Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License") modified with Commons Clause
# Restriction; you may not use this file except in compliance with the License. You may obtain a
# copy of th... | [
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24846,
38,
391,
8108,
5061,
10483,
26426,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 3.619855 | 826 |
# Use the append method to add "orange" to the fruits list.
fruits = ["apple", "banana", "cherry"]
fruits.append("orange")
print(fruits)
| [
2,
5765,
262,
24443,
2446,
284,
751,
366,
43745,
1,
284,
262,
15921,
1351,
13,
198,
69,
50187,
796,
14631,
18040,
1600,
366,
3820,
2271,
1600,
366,
2044,
563,
8973,
198,
69,
50187,
13,
33295,
7203,
43745,
4943,
198,
4798,
7,
69,
501... | 3.044444 | 45 |
import os
from os import path
import config
from mock import patch
@patch('config.makedirs')
# pylint: disable=unused-argument
@patch('config.path.exists')
@patch('config.makedirs')
| [
11748,
28686,
198,
6738,
28686,
1330,
3108,
198,
11748,
4566,
198,
6738,
15290,
1330,
8529,
628,
198,
198,
31,
17147,
10786,
11250,
13,
76,
4335,
17062,
11537,
198,
2,
279,
2645,
600,
25,
15560,
28,
403,
1484,
12,
49140,
628,
198,
31,... | 2.984375 | 64 |
import requests
import time
import urllib
import argparse
import json
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from pathlib import Path
from lxml.html import fromstring
import os
import sys
from fake_useragent import UserAgent
'''
Commandline based Go... | [
11748,
7007,
198,
11748,
640,
198,
11748,
2956,
297,
571,
198,
11748,
1822,
29572,
198,
11748,
33918,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
6738,
384,
11925,
1505,
13,
12384... | 2.573119 | 1,183 |
from rest_framework import viewsets
from .models import Cat, Owner
from .serializers import CatSerializer, OwnerSerializer
| [
6738,
1334,
62,
30604,
1330,
5009,
1039,
198,
198,
6738,
764,
27530,
1330,
5181,
11,
23853,
198,
6738,
764,
46911,
11341,
1330,
5181,
32634,
7509,
11,
23853,
32634,
7509,
628,
198
] | 4.064516 | 31 |
#a script to run several replicates of several treatments locally
directory = "HorizMutRateSweepHost0VT05/"
seeds = range(10, 21)
#mut_rates = [0.5, 0.6, 0.7, 0.8, 0.9, 1.0]
mut_rates = [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]
#mut_sizes = [0.002, 0.06, 0.14, 1]
#verts = [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6... | [
2,
64,
4226,
284,
1057,
1811,
2186,
16856,
286,
1811,
13820,
15726,
198,
198,
34945,
796,
366,
27991,
528,
41603,
32184,
40783,
538,
17932,
15,
36392,
2713,
30487,
198,
325,
5379,
796,
2837,
7,
940,
11,
2310,
8,
198,
2,
21973,
62,
9... | 2.030663 | 1,011 |
"""
list sorting
"""
l = [1, 5, 8, 3, 2, 3, 5]
l.sort()
print l
l2 = []
for i in xrange(1000):
l2.append(C((i * 7) % 13, (i * 53) % 41))
print l2
l2.sort()
print l2
| [
37811,
198,
4868,
29407,
198,
37811,
198,
198,
75,
796,
685,
16,
11,
642,
11,
807,
11,
513,
11,
362,
11,
513,
11,
642,
60,
198,
75,
13,
30619,
3419,
198,
4798,
300,
198,
198,
75,
17,
796,
17635,
198,
1640,
1312,
287,
2124,
9521,... | 1.921348 | 89 |
import unittest
from metapack import MetapackDoc
from metapack_db import Database, MetatabManager
from metapack_db.document import Document
from metapack_db.term import Term
from os import remove
from os.path import exists
from sqlalchemy.exc import IntegrityError
test_database_path = '/tmp/test.db'
if __name__ =... | [
11748,
555,
715,
395,
628,
198,
6738,
1138,
499,
441,
1330,
3395,
499,
441,
23579,
198,
6738,
1138,
499,
441,
62,
9945,
1330,
24047,
11,
3395,
265,
397,
13511,
198,
6738,
1138,
499,
441,
62,
9945,
13,
22897,
1330,
16854,
198,
6738,
... | 3.160714 | 112 |
"""
svg.charts package.
"""
__all__ = 'graph', 'plot', 'time_series', 'bar', 'pie', 'schedule', 'util'
| [
37811,
198,
21370,
70,
13,
354,
5889,
5301,
13,
198,
37811,
198,
198,
834,
439,
834,
796,
705,
34960,
3256,
705,
29487,
3256,
705,
2435,
62,
25076,
3256,
705,
5657,
3256,
705,
21749,
3256,
705,
15952,
5950,
3256,
705,
22602,
6,
198
] | 2.47619 | 42 |
from .checks import checks | [
6738,
764,
42116,
1330,
8794
] | 5.2 | 5 |
import os
# Internationalization
# https://docs.djangoproject.com/en/3.2/topics/i18n/
LANGUAGE_CODE = os.getenv("LANGUAGE_CODE", "")
TIME_ZONE = os.getenv("TIME_ZONE", "")
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Setup dates
DATETIME_INPUT_FORMATS = (
"%Y-%m-%d %H:%M:%S", # '2006-10-25 14:30:59'
"%Y... | [
11748,
28686,
628,
198,
2,
4037,
1634,
198,
2,
3740,
1378,
31628,
13,
28241,
648,
404,
305,
752,
13,
785,
14,
268,
14,
18,
13,
17,
14,
4852,
873,
14,
72,
1507,
77,
14,
198,
43,
15567,
52,
11879,
62,
34,
16820,
796,
28686,
13,
... | 1.554307 | 801 |