max_stars_repo_path stringlengths 4 237 | max_stars_repo_name stringlengths 6 117 | max_stars_count int64 0 95.2k | id stringlengths 1 7 | content stringlengths 12 593k | input_ids listlengths 7 549k |
|---|---|---|---|---|---|
Model Files/Stroke_Model.py | imsanjoykb/Health-AI | 5 | 164353 | <reponame>imsanjoykb/Health-AI
# Importing Libraries:
import pandas as pd
import numpy as np
import pickle
# for displaying all feature from dataset:
pd.pandas.set_option('display.max_columns', None)
# Reading Dataset:
dataset = pd.read_csv("Stroke_data.csv")
# Dropping unneccsary feature :
dataset = dataset.drop('i... | [
1,
529,
276,
1112,
420,
29958,
9893,
273,
2212,
12072,
29890,
29914,
3868,
4298,
29899,
23869,
13,
29937,
16032,
292,
365,
4626,
4314,
29901,
13,
5215,
11701,
408,
10518,
13,
5215,
12655,
408,
7442,
13,
5215,
5839,
280,
13,
13,
29937,
... |
src/backend/build_models/build_emnist_digits_model.py | Nauheimer/swtp-ocr | 0 | 1604147 | <reponame>Nauheimer/swtp-ocr
#!/usr/bin/python3
import os
import tensorflow as tf
import numpy as np
import pandas as pd
from random import randint
import matplotlib.pyplot as plt
from tensorflow.python.keras.layers.core import Dropout
keras = tf.keras
""" loads each data from emnist digit dataset. The csv mapp file... | [
1,
529,
276,
1112,
420,
29958,
29940,
585,
27400,
29914,
2774,
9392,
29899,
8415,
13,
29937,
14708,
4855,
29914,
2109,
29914,
4691,
29941,
13,
13,
5215,
2897,
13,
13,
5215,
26110,
408,
15886,
13,
5215,
12655,
408,
7442,
13,
5215,
11701,... |
15-more-types/mysum.py | SeirousLee/example-code-2e | 990 | 36170 | import functools
import operator
from collections.abc import Iterable
from typing import overload, Union, TypeVar
T = TypeVar('T')
S = TypeVar('S') # <1>
@overload
def sum(it: Iterable[T]) -> Union[T, int]: ... # <2>
@overload
def sum(it: Iterable[T], /, start: S) -> Union[T, S]: ... # <3>
def sum(it, /, start=0):... | [
1,
1053,
2090,
312,
8789,
13,
5215,
5455,
13,
3166,
16250,
29889,
10736,
1053,
20504,
519,
13,
3166,
19229,
1053,
975,
1359,
29892,
7761,
29892,
5167,
9037,
13,
13,
29911,
353,
5167,
9037,
877,
29911,
1495,
13,
29903,
353,
5167,
9037,
... |
sdp_2021_03/model/user.py | iproduct/intro-python | 3 | 93327 | <filename>sdp_2021_03/model/user.py
from functools import total_ordering
# from decorators import trace_get_attributes
import decorators as dec
# @dec.trace_get_attributes
@total_ordering
class User:
next_id = 0
# @staticmethod
# def increment_next_id():
# User.next_id += 1
@classmethod
... | [
1,
529,
9507,
29958,
4928,
29886,
29918,
29906,
29900,
29906,
29896,
29918,
29900,
29941,
29914,
4299,
29914,
1792,
29889,
2272,
13,
3166,
2090,
312,
8789,
1053,
3001,
29918,
2098,
292,
13,
13,
29937,
515,
10200,
4097,
1053,
9637,
29918,
... |
prickly-pufferfish/python_questions/merge_ranges.py | Vthechamp22/summer-code-jam-2021 | 40 | 24595 | <filename>prickly-pufferfish/python_questions/merge_ranges.py
"""
In HiCal, a meeting is stored as tuples of integers (start_time, end_time). /
These integers represent the number of 30-minute blocks past 9:00am. /
For example: /
(2, 3) # meeting from 10:00 - 10:30 am /
(6, 9) # meeting from 12:00 - 1:30 pm /
Write a f... | [
1,
529,
9507,
29958,
558,
860,
368,
29899,
29886,
3043,
15161,
29914,
4691,
29918,
2619,
29914,
14634,
29918,
29878,
6916,
29889,
2272,
13,
15945,
29908,
13,
797,
6324,
7856,
29892,
263,
11781,
338,
6087,
408,
5291,
2701,
310,
11920,
313,... |
dataset/semi.py | lanyinemt2/ST-PlusPlus | 73 | 41473 | from dataset.transform import crop, hflip, normalize, resize, blur, cutout
import math
import os
from PIL import Image
import random
from torch.utils.data import Dataset
from torchvision import transforms
class SemiDataset(Dataset):
def __init__(self, name, root, mode, size, labeled_id_path=None, unlabeled_id_pa... | [
1,
515,
8783,
29889,
9067,
1053,
274,
1336,
29892,
298,
29888,
3466,
29892,
4226,
675,
29892,
19490,
29892,
1999,
332,
29892,
5700,
449,
13,
13,
5215,
5844,
13,
5215,
2897,
13,
3166,
349,
6227,
1053,
7084,
13,
5215,
4036,
13,
3166,
48... |
R_3_1_1.py | meissnert/StarCluster-Plugins | 1 | 63019 | from starcluster.clustersetup import ClusterSetup
from starcluster.logger import log
class RInstaller(ClusterSetup):
def run(self, nodes, master, user, user_shell, volumes):
for node in nodes:
log.info("Installing R 3.1.1 on %s" % (node.alias))
log.info("...installing dependencies")
node.ssh.execute('apt-g... | [
1,
515,
5810,
19594,
29889,
695,
504,
24197,
786,
1053,
2233,
5402,
26947,
13,
3166,
5810,
19594,
29889,
21707,
1053,
1480,
13,
13,
1990,
390,
3379,
12572,
29898,
6821,
5402,
26947,
1125,
13,
12,
1753,
1065,
29898,
1311,
29892,
7573,
29... |
rpyc/core/netref.py | fruch/rpyc | 0 | 28347 | <gh_stars>0
"""
NetRef - transparent network references implementation.
"""
import sys
import inspect
import types
import cPickle as pickle
from rpyc.core import consts
_local_netref_attrs = frozenset([
'____conn__', '____oid__', '__class__', '__cmp__', '__del__', '__delattr__',
'__dir__', '__doc__', '__geta... | [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
15945,
29908,
13,
6779,
5620,
448,
17772,
3564,
9282,
5314,
29889,
13,
15945,
29908,
13,
5215,
10876,
13,
5215,
16096,
13,
5215,
4072,
13,
5215,
274,
29925,
860,
280,
408,
5839,
280,
... |
server_util/resource_manager.py | igushev/fase_lib | 7 | 52197 | import functools
import os
from fase_lib.base_util import singleton_util
TEMPLATE_SYMBOL = '@'
PIXEL_DENSITY_STEP = 0.25
PIXEL_DENSITY_MIN = 0
PIXEL_DENSITY_MAX = 10
@singleton_util.Singleton()
class ResourceManager():
def __init__(self, resource_dir):
self.resource_dir = resource_dir
def GetResourceDir(s... | [
1,
1053,
2090,
312,
8789,
13,
5215,
2897,
13,
13,
3166,
20851,
29918,
1982,
29889,
3188,
29918,
4422,
1053,
27130,
29918,
4422,
13,
13,
4330,
3580,
29931,
3040,
29918,
14816,
9486,
5607,
353,
18803,
29915,
13,
2227,
29990,
6670,
29918,
... |
adder_python/adder.py | ToolPilotNeural/new_repo | 0 | 99641 | <filename>adder_python/adder.py
import math
def add_two_numbers(a, b) -> int:
return a + b
def subtract_two_numbers(a, b) -> int:
return a - b
def multiply_two_numbers(a, b) -> int:
return a * b
def divide_two_numbers(a, b) -> int:
try:
return a/b
except ZeroDivisionError:
prin... | [
1,
529,
9507,
29958,
328,
672,
29918,
4691,
29914,
328,
672,
29889,
2272,
13,
5215,
5844,
13,
13,
13,
1753,
788,
29918,
10184,
29918,
20326,
29898,
29874,
29892,
289,
29897,
1599,
938,
29901,
13,
1678,
736,
263,
718,
289,
13,
13,
1753... |
BookClub/views/action_views.py | amir-rahim/BookClubSocialNetwork | 4 | 151727 | <filename>BookClub/views/action_views.py
"""Action related views."""
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from django.shortcuts import redirect
from django.views.generic import TemplateView, View
from django.core.exceptions import ObjectDoesNotExist
from BookClu... | [
1,
529,
9507,
29958,
10967,
6821,
431,
29914,
7406,
29914,
2467,
29918,
7406,
29889,
2272,
13,
15945,
29908,
4276,
4475,
8386,
1213,
15945,
13,
3166,
9557,
29889,
21570,
1053,
7191,
13,
3166,
9557,
29889,
21570,
29889,
5150,
29889,
28084,
... |
managers/search_indexes.py | naderm/farnsworth | 0 | 70900 | '''
Project: Farnsworth
Author: <NAME>
Search indexes for the managers app.
'''
from datetime import datetime
from haystack import indexes
from managers.models import Manager, Request, Response, Announcement
class ManagerIndex(indexes.SearchIndex, indexes.Indexable):
''' Index for Managers. '''
text = index... | [
1,
14550,
13,
7653,
29901,
8413,
1983,
12554,
13,
13,
13720,
29901,
529,
5813,
29958,
13,
13,
7974,
18111,
363,
278,
767,
18150,
623,
29889,
13,
12008,
13,
13,
3166,
12865,
1053,
12865,
13,
3166,
14842,
1429,
1053,
18111,
13,
3166,
76... |
user_satisfaction_prediction/evaluation.py | wanlingcai1997/umap_2020_code | 2 | 96959 | import numpy as np
import sklearn.metrics as metrics
from scipy.sparse import csr_matrix
def evaluation_score(label_test, predict_label):
f1_micro=metrics.f1_score(label_test, predict_label, average='micro')
hamm=metrics.hamming_loss(label_test,predict_label)
accuracy = metrics.accuracy_score(label_test, ... | [
1,
1053,
12655,
408,
7442,
13,
5215,
2071,
19668,
29889,
2527,
10817,
408,
21556,
13,
13,
3166,
4560,
2272,
29889,
29879,
5510,
1053,
5939,
29878,
29918,
5344,
13,
13,
1753,
17983,
29918,
13628,
29898,
1643,
29918,
1688,
29892,
8500,
2991... |
HelloLeap.py | KanaadPathak/SimpleTracker-v0.1 | 0 | 118748 | import Leap, sys, thread, time
from Leap import CircleGesture, KeyTapGesture, ScreenTapGesture, SwipeGesture
import matplotlib.pyplot as plt
import numpy as np
directionList = []
totalFrames = 0
def plotGraph ():
print directionList
global totalFrames
print totalFrames
i=0
while i < t... | [
1,
1053,
951,
481,
29892,
10876,
29892,
3244,
29892,
931,
30004,
13,
3166,
951,
481,
1053,
27927,
24110,
29892,
7670,
29911,
481,
24110,
29892,
22666,
29911,
481,
24110,
29892,
3925,
15705,
24110,
30004,
13,
5215,
22889,
29889,
2272,
5317,
... |
detector/effdet_cfg.py | HwangToeMat/tmp | 10 | 190992 | <filename>detector/effdet_cfg.py
from easydict import EasyDict as edict
cfg = edict()
cfg.NMS_THRES = 0.6
cfg.CONFIDENCE = 0.1
cfg.NUM_CLASSES = 80
| [
1,
529,
9507,
29958,
4801,
3019,
29914,
12352,
4801,
29918,
16859,
29889,
2272,
13,
3166,
2240,
2941,
919,
1053,
382,
8995,
21533,
408,
1226,
919,
13,
13,
16859,
353,
1226,
919,
580,
13,
13,
16859,
29889,
29940,
4345,
29918,
4690,
15989... |
src/homework/homework1.py | acc-cosc-1336/cosc-1336-spring-2018-Isaacol77 | 0 | 77697 | <filename>src/homework/homework1.py
def get_hours_since_midnight(seconds):
'''
Type the code to calculate total hours given n(number) of seconds
For example, given 3800 seconds the total hours is 1
'''
return (seconds//3600)
'''
IF YOU ARE OK WITH A GRADE OF 70 FOR THIS ASSIGNMENT STOP HERE.
'''
d... | [
1,
529,
9507,
29958,
4351,
29914,
5184,
1287,
29914,
5184,
1287,
29896,
29889,
2272,
13,
1753,
679,
29918,
29882,
2470,
29918,
16076,
29918,
6563,
11147,
29898,
23128,
1125,
13,
1678,
14550,
13,
1678,
5167,
278,
775,
304,
8147,
3001,
6199... |
.venv/lib/python2.7/site-packages/ansible/module_utils/nxos.py | Achraf-Ben/Ansible- | 0 | 13702 | <gh_stars>0
#
# This code is part of Ansible, but is an independent component.
#
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to... | [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
29937,
13,
29937,
910,
775,
338,
760,
310,
530,
1687,
29892,
541,
338,
385,
7417,
4163,
29889,
13,
29937,
13,
29937,
910,
3153,
934,
11534,
29892,
322,
445,
934,
11534,
871,
29892,
33... |
module_st/F_find_DEM_bn.py | Qinayan/Soil-thickness | 0 | 109408 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 12 15:21:31 2019
@author: qinayan
"""
import os
import numpy as np
def find_DEM_bn(eta):
#-------------
# find the boundary index
#-------------
nrows,ncols = eta.shape
eta_vector = eta.flatten()*1.0
validID = np.where(eta_vector>0... | [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
15945,
29908,
13,
20399,
373,
2598,
22333,
29871,
29896,
29906,
29871,
29896,
29945,
29901,
29906,
... |
holocron/utils/data/collate.py | MateoLostanlen/Holocron | 181 | 145348 | <reponame>MateoLostanlen/Holocron
# Copyright (C) 2019-2021, <NAME>.
# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.
import numpy as np
import torch
from torch import Tensor
from torch.utils.data._utils.c... | [
1,
529,
276,
1112,
420,
29958,
29924,
403,
29877,
29931,
520,
273,
2435,
29914,
19984,
542,
1617,
13,
29937,
14187,
1266,
313,
29907,
29897,
29871,
29906,
29900,
29896,
29929,
29899,
29906,
29900,
29906,
29896,
29892,
529,
5813,
15513,
13,
... |
openstates/data/migrations/0042_delete_personcontactdetail.py | csnardi/openstates-core | 9 | 1604329 | <reponame>csnardi/openstates-core
# Generated by Django 3.2.2 on 2021-10-13 19:07
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("data", "0041_personoffice"),
]
operations = [
migrations.DeleteModel(
name="PersonContactDetail",
... | [
1,
529,
276,
1112,
420,
29958,
2395,
29876,
18015,
29914,
3150,
28631,
29899,
3221,
13,
29937,
3251,
630,
491,
15337,
29871,
29941,
29889,
29906,
29889,
29906,
373,
29871,
29906,
29900,
29906,
29896,
29899,
29896,
29900,
29899,
29896,
29941,
... |
Medium/Remove Covered Intervals.py | Koushik-Deb/LeetCode | 0 | 196399 | class Solution:
def removeCoveredIntervals(self, intervals: List[List[int]]) -> int:
intervals.sort(reverse=True,key=lambda x:(x[1],-x[0]))
# print(intervals)
slen = len(intervals)
count = slen
for i in range(slen-1):
# print(intervals[i],intervals[i+1])
... | [
1,
770,
24380,
29901,
13,
1678,
822,
3349,
29907,
957,
287,
12506,
29879,
29898,
1311,
29892,
18747,
29901,
2391,
29961,
1293,
29961,
524,
24960,
1599,
938,
29901,
13,
4706,
18747,
29889,
6605,
29898,
24244,
29922,
5574,
29892,
1989,
29922,... |
app/consumers.py | hongphuong0211/Shrimp-Farming-Management-System | 1 | 174957 | <filename>app/consumers.py
from channels.generic.websocket import AsyncWebsocketConsumer
import json
class Consumer(AsyncWebsocketConsumer):
async def connect(self):
self.user_name = self.scope['url_route']['kwargs']['user_name']
await self.channel_layer.group_add(
self.user_name,
... | [
1,
529,
9507,
29958,
932,
29914,
25978,
414,
29889,
2272,
13,
3166,
18196,
29889,
19206,
29889,
2676,
11514,
1053,
20688,
3609,
11514,
13696,
4680,
13,
5215,
4390,
13,
13,
13,
1990,
2138,
4680,
29898,
8123,
3609,
11514,
13696,
4680,
1125,... |
src/webpub_manifest_parser/epub/ast.py | tdilauro/webpub-manifest-parser | 1 | 72222 | <reponame>tdilauro/webpub-manifest-parser
from webpub_manifest_parser.core.ast import LinkProperties, Metadata, Node
from webpub_manifest_parser.core.parsers import ArrayParser, EnumParser
from webpub_manifest_parser.core.properties import (
EnumProperty,
IntegerProperty,
Property,
StringProperty,
T... | [
1,
529,
276,
1112,
420,
29958,
1594,
309,
585,
307,
29914,
2676,
5467,
29899,
29135,
29899,
16680,
13,
3166,
1856,
5467,
29918,
29135,
29918,
16680,
29889,
3221,
29889,
579,
1053,
6645,
11857,
29892,
4737,
7221,
29892,
9071,
13,
3166,
185... |
src/ikea_api/__init__.py | momoson/ikea-api-client | 14 | 80891 | <reponame>momoson/ikea-api-client<gh_stars>10-100
from __future__ import annotations
from typing import Any
from ikea_api._constants import Constants
from ikea_api._endpoints.auth import get_guest_token
from ikea_api._endpoints.cart import Cart
from ikea_api._endpoints.item_ingka import IngkaItems
from ikea_api._endp... | [
1,
529,
276,
1112,
420,
29958,
29885,
290,
359,
265,
29914,
9345,
29874,
29899,
2754,
29899,
4645,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29899,
29896,
29900,
29900,
13,
3166,
4770,
29888,
9130,
1649,
1053,
25495,
13,
13,
31... |
generators/lib/length_cutter.py | yautay/polish_wordlists | 4 | 105785 | <reponame>yautay/polish_wordlists
from generators.lib.generator import Generator
class LengthCutter(Generator):
def __init__(self, minimum, maximum, **kwargs):
super(LengthCutter, self).__init__(**kwargs)
self.iterate_over_file(minimum, maximum)
def iterate_over_file(self, _min, _max):
... | [
1,
529,
276,
1112,
420,
29958,
29891,
1300,
388,
29914,
3733,
728,
29918,
1742,
21513,
13,
3166,
1176,
4097,
29889,
1982,
29889,
27959,
1053,
3251,
1061,
13,
13,
13,
1990,
365,
1477,
29907,
6463,
29898,
21575,
1125,
13,
1678,
822,
4770,... |
seqnmf/seqnmf.py | calebweinreb/seqnmf-gpu | 0 | 1605502 | from jax.scipy.signal import convolve2d as conv2
import jax, jax.numpy as jnp
import tqdm
import numpy as np
import seaborn as sns
from matplotlib import pyplot as plt
from matplotlib import gridspec
from .helpers import reconstruct, reconstruct_numpy, shift_factors, compute_loadings_percent_power, get_shapes, shifted_... | [
1,
515,
432,
1165,
29889,
26167,
2272,
29889,
25436,
1053,
378,
1555,
345,
29906,
29881,
408,
7602,
29906,
13,
5215,
432,
1165,
29892,
432,
1165,
29889,
23749,
408,
432,
9302,
13,
5215,
260,
29939,
18933,
13,
5215,
12655,
408,
7442,
13,... |
cookbook/c08/p15_delegate_attribute.py | itpubs/python3-cookbook | 3 | 137690 | <filename>cookbook/c08/p15_delegate_attribute.py
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Topic: 属性访问代理
Desc :
"""
class A:
def spam(self, x):
pass
def foo(self):
pass
class B1:
"""简单的代理"""
def __init__(self):
self._a = A()
def spam(self, x):
# Dele... | [
1,
529,
9507,
29958,
15108,
2909,
29914,
29883,
29900,
29947,
29914,
29886,
29896,
29945,
29918,
21234,
29918,
12715,
29889,
2272,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
13,
29937,
448,
29930,
29899,
8025,
29901,
23616,
29899... |
hanging_points_cnn/create_dataset/merge_all_dataset.py | kosuke55/hanging_points_cnn | 4 | 196021 | #!/usr/bin/env python
# coding: utf-8
import argparse
import glob
import os.path as osp
from merge_dataset import merge_two_dataset
if __name__ == '__main__':
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument(
'--base_dir',
... | [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
29937,
14137,
29901,
23616,
29899,
29947,
13,
13,
5215,
1852,
5510,
13,
5215,
13149,
13,
5215,
2897,
29889,
2084,
408,
288,
1028,
13,
13,
3166,
10366,
29918,
24713,
1053,
10366,
29918,
... |
python_pb2/go/chromium/org/luci/buildbucket/proto/rpc_prpc_pb2.py | allaparthi/monorail | 0 | 161405 | <filename>python_pb2/go/chromium/org/luci/buildbucket/proto/rpc_prpc_pb2.py
# Generated by the pRPC protocol buffer compiler plugin. DO NOT EDIT!
# source: go.chromium.org/luci/buildbucket/proto/rpc.proto
import base64
import zlib
from google.protobuf import descriptor_pb2
# Includes description of the go.chromium.... | [
1,
529,
9507,
29958,
4691,
29918,
24381,
29906,
29914,
1484,
29914,
27433,
1974,
29914,
990,
29914,
6092,
455,
29914,
4282,
21454,
29914,
17529,
29914,
29878,
6739,
29918,
558,
6739,
29918,
24381,
29906,
29889,
2272,
13,
29937,
3251,
630,
4... |
tests/misc/test_log.py | svidoso/ipopo | 65 | 88371 | #!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Tests the log service
:author: <NAME>
"""
# Standard library
import logging
import sys
import time
try:
import unittest2 as unittest
except ImportError:
import unittest # type: ignore
# Pelix
import pelix.framework
import pelix.misc
from pelix.ipopo... | [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
29937,
1192,
10576,
29899,
14934,
29901,
18351,
29899,
29947,
1192,
13,
15945,
29908,
13,
24376,
278,
1480,
2669,
13,
13,
29901,
8921,
29901,
529,
5813,
29958,
13,
15945,
29908,
13,
13,
... |
naturtag/controllers/taxon_search.py | JWCook/inat-image-tagger | 1 | 108074 | """Components for searching for taxa"""
from logging import getLogger
from typing import Optional
from pyinaturalist import RANKS, IconPhoto, Taxon
from PySide6.QtCore import QSize, Qt, Signal, Slot
from PySide6.QtGui import QIcon
from PySide6.QtWidgets import QApplication, QComboBox, QLabel, QPushButton, QWidget
fro... | [
1,
9995,
25503,
363,
11975,
363,
8818,
29874,
15945,
29908,
13,
3166,
12183,
1053,
679,
16363,
13,
3166,
19229,
1053,
28379,
13,
13,
3166,
11451,
262,
18771,
391,
1053,
390,
2190,
17557,
29892,
26816,
25971,
29892,
17847,
265,
13,
3166,
... |
wemake_python_styleguide/visitors/ast/complexity/jones.py | lensvol/wemake-python-styleguide | 1 | 1607652 | # -*- coding: utf-8 -*-
"""
Jones Complexity to count inline complexity.
Based on the original `jones-complexity` project:
https://github.com/Miserlou/JonesComplexity
Original project is licensed under MIT.
"""
import ast
from collections import defaultdict
from statistics import median
from typing import DefaultDi... | [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
13,
15945,
29908,
13,
29967,
2873,
26596,
537,
304,
2302,
10583,
13644,
29889,
13,
13,
29933,
1463,
373,
278,
2441,
421,
29926,
2873,
29899,
19676,
537,
... |
python/test/resource/test_dataset_mixed.py | Fosstack/vmaf | 2,874 | 109074 | <gh_stars>1000+
dataset_name = 'example'
quality_width = 1920
quality_height = 1080
from vmaf.config import VmafConfig
ref_videos = [
{'content_id': 0, 'path': VmafConfig.resource_path('yuv', 'checkerboard_1920_1080_10_3_0_0.yuv'), 'yuv_fmt': 'yuv420p', 'width': 1920, 'height': 1080},
{'content_id': 1, 'pat... | [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29900,
29900,
29974,
13,
24713,
29918,
978,
353,
525,
4773,
29915,
13,
13,
29567,
29918,
2103,
353,
29871,
29896,
29929,
29906,
29900,
13,
29567,
29918,
3545,
353,
29871,
29896,
29900,
... |
cinder/tests/unit/zonemanager/test_cisco_fc_zone_driver.py | lightsey/cinder | 3 | 76346 | # (c) Copyright 2014 Cisco Systems Inc.
# 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
#
# Unl... | [
1,
396,
1678,
313,
29883,
29897,
14187,
1266,
29871,
29906,
29900,
29896,
29946,
315,
275,
1111,
23985,
9266,
29889,
13,
29937,
1678,
2178,
26863,
2538,
9841,
29889,
13,
29937,
13,
29937,
1678,
10413,
21144,
1090,
278,
13380,
19245,
29892,
... |
coreservices/partsrelationshipservice/connectors_scripts/consume_artifact.py | Agera-CatenaX/SpikeEclipseConnectorPRSTractusx | 0 | 66595 | <gh_stars>0
#!/usr/bin/env python3
#
# Copyright 2020 Fraunhofer Institute for Software and Systems Engineering
#
# 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/li... | [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
29937,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29906,
29900,
7347,
348,
1251,
571,
8907,
363,
18540,
322,
23985,
22557,
... |
topfarm/tests/test_constraint/test_capacityComp.py | DTUWindEnergy/TopFarm2 | 4 | 170905 | <gh_stars>1-10
from topfarm.constraint_components.capacity import CapacityConstraint
import numpy as np
import topfarm
from topfarm.tests.test_files import xy3tb
from topfarm._topfarm import TopFarmProblem
from topfarm.easy_drivers import EasySimpleGADriver
def test_capacity_as_penalty():
tf = xy3tb.get_tf(design... | [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
3166,
2246,
29888,
2817,
29889,
13646,
29918,
14036,
29889,
5030,
5946,
1053,
5915,
5946,
21529,
13,
5215,
12655,
408,
7442,
13,
5215,
2246,
29888,
2817,
13,
3166,
22... |
examples/example_ME5ME6.py | bmachiel/python-substratestack | 1 | 39300 | #!/bin/env python
# import the technology's complete stack definition
from example import stack
# in order to decrease simulation times, some metal layers can be removed from
# the stack, allowing more oxide layers to be merged in the next step
stack.remove_metal_layer_by_name('PO1')
stack.remove_metal_layer_by_name... | [
1,
18787,
2109,
29914,
6272,
3017,
13,
13,
29937,
1053,
278,
15483,
29915,
29879,
4866,
5096,
5023,
13,
3166,
1342,
1053,
5096,
13,
13,
13,
29937,
297,
1797,
304,
23806,
17402,
3064,
29892,
777,
11915,
15359,
508,
367,
6206,
515,
13,
... |
decoders/b64Decode.py | crattis/dfir_scripts | 6 | 197700 | <reponame>crattis/dfir_scripts<filename>decoders/b64Decode.py
#! python3
import base64
baseFile = open('base64.txt', 'r')
decode = baseFile.read()
plainFile = open('b64_plain.txt', 'wb')
plainFile.write(base64.b64decode(decode))
baseFile.close()
plainFile.close()
| [
1,
529,
276,
1112,
420,
29958,
7283,
1131,
275,
29914,
2176,
381,
29918,
16713,
29966,
9507,
29958,
7099,
397,
414,
29914,
29890,
29953,
29946,
2772,
401,
29889,
2272,
13,
29937,
29991,
3017,
29941,
30004,
13,
5215,
2967,
29953,
29946,
30... |
demo_numpy/numpy_11_single_array.py | caserwin/daily-learning-python | 1 | 168313 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019-04-17 15:58
# @Author : erwin
import numpy as np
from common.util_function import *
np.set_printoptions(precision=3)
arr = np.linspace(0, 100, 10).reshape((2, 5))
print_line("原始数据")
print_br(arr)
print_line("单个array操作")
print_br(np.add(arr, 2))
print_b... | [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
29937,
732,
2481,
1678,
584,
29871,
29906,
29900,
29896,
29929,
29899,
29900,
29946,
29899,
29896,
29955,
... |
valorant_api/httpclient.py | TriDiscord/valorant-api | 0 | 91386 | <gh_stars>0
import requests
from .exceptions import *
import json
import aiohttp
# class MainClient:
# headers: dict = {}
# run_async: bool
# get = None
# def __init__(self, headers: dict, run_async: bool = False) -> None:
# self.headers = headers
# self.run_async = run_async
# ... | [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
5215,
7274,
13,
3166,
869,
11739,
29879,
1053,
334,
13,
5215,
4390,
13,
5215,
263,
601,
1124,
13,
13,
13,
29937,
770,
4241,
4032,
29901,
13,
29937,
268,
9066,
29901,
9657,
353,
6571,
... |
fire/trace.py | nvhoang55/python-fire | 0 | 886 | <reponame>nvhoang55/python-fire<gh_stars>0
# Copyright (C) 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | [
1,
529,
276,
1112,
420,
29958,
29876,
29894,
1251,
574,
29945,
29945,
29914,
4691,
29899,
8696,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
29937,
14187,
1266,
313,
29907,
29897,
29871,
29906,
29900,
29896,
29947,
5087,
9266,
29889,
1... |
quest/quest_gui.py | Fluorescence-Tools/quest | 0 | 161360 | <gh_stars>0
import tempfile
import sip
sip.setapi('QDate', 2)
sip.setapi('QDateTime', 2)
sip.setapi('QString', 2)
sip.setapi('QTextStream', 2)
sip.setapi('QTime', 2)
sip.setapi('QUrl', 2)
sip.setapi('QVariant', 2)
from PyQt5 import QtGui, QtWidgets
import lib
import lib.ui.rescource_rc
import sys
sys.tracebacklimit = ... | [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
5215,
5694,
1445,
13,
5215,
269,
666,
13,
29879,
666,
29889,
842,
2754,
877,
29984,
2539,
742,
29871,
29906,
29897,
13,
29879,
666,
29889,
842,
2754,
877,
29984,
11384,
742,
29871,
2990... |
src/main/python/grammer/Function.py | photowey/python-study | 0 | 27317 | # -*- coding:utf-8 -*-
# ---------------------------------------------
# @file Function.py
# @description Function
# @author WcJun
# @date 2020/06/20
# ---------------------------------------------
# 求两个数 n 加到 m 的和
def add(n, m):
s = 0
while n <= m:
s += n
n += 1
return s
# 求和
add = add... | [
1,
396,
448,
29930,
29899,
14137,
29901,
9420,
29899,
29947,
448,
29930,
29899,
13,
13,
29937,
448,
2683,
2683,
9072,
13,
29937,
732,
1445,
6680,
29889,
2272,
13,
29937,
732,
8216,
6680,
13,
29937,
732,
8921,
399,
29883,
29967,
348,
13,... |
_weeks/week11/preclass_wednesday.py | nahumj/CSE-431 | 0 | 89061 | <reponame>nahumj/CSE-431<gh_stars>0
import collections
import pprint
import copy
class Node:
def __init__(self, id_, data=None):
self.id_ = id_
self.data = data
def __eq__(self, other):
if isinstance(other, Node):
return self.id_ == other.id_
return False
... | [
1,
529,
276,
1112,
420,
29958,
8723,
398,
29926,
29914,
29907,
1660,
29899,
29946,
29941,
29896,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
5215,
16250,
13,
5215,
282,
2158,
13,
5215,
3509,
13,
13,
1990,
9071,
29901,
13,
1678,
82... |
vhdl_navigation.py | jalucas42/SmartVHDL | 0 | 128761 | from __future__ import absolute_import
import sublime, sublime_plugin
import re, string, os, sys, functools, mmap, pprint, imp, threading
from collections import Counter
from plistlib import readPlistFromBytes
try:
from . import vhdl_module
from .util import vhdl_util
from .util import sublime_util
fr... | [
1,
515,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
13,
13,
5215,
1014,
28046,
29892,
1014,
28046,
29918,
8582,
13,
5215,
337,
29892,
1347,
29892,
2897,
29892,
10876,
29892,
2090,
312,
8789,
29892,
286,
1958,
29892,
282,
2158,
29892... |
consent.py | yawgmoth/NVHanabi | 0 | 75363 |
consent = """<center><table width="800px"><tr><td>
<font size="16"><b>University of Costa Rica<br/> </font>
INFORMED CONSENT FORM for RESEARCH<br/></b>
<b>Title of Study:</b> Hanabi AI Agents<br/>
<b>Principal Investigator:</b> Dr. <NAME> <br/>
<h2>What are some general things you should know about researc... | [
1,
6756,
13,
30004,
13,
3200,
296,
353,
9995,
29966,
5064,
5299,
2371,
2920,
543,
29947,
29900,
29900,
1756,
3254,
509,
5299,
1594,
3238,
13,
29966,
5657,
2159,
543,
29896,
29953,
3254,
29890,
29958,
11574,
537,
310,
17513,
29750,
29966,
... |
CodeWars/6 Kyu/Shoot But As I've Seen It In My Imagination.py | anubhab-code/Competitive-Programming | 0 | 99877 | import math
def find_prob(balls_set, event):
possible = True
num = 1
den = 1
balls = dict()
available_ball = len(balls_set)
for b in balls_set:
if b in balls:
balls[b] += 1
else:
balls[b] = 1
for e in event:
lc = ABBREVIATIONS[e]
if lc... | [
1,
1053,
5844,
13,
13,
1753,
1284,
29918,
22795,
29898,
2135,
29879,
29918,
842,
29892,
1741,
1125,
13,
1678,
1950,
353,
5852,
13,
1678,
954,
353,
29871,
29896,
13,
1678,
972,
353,
29871,
29896,
13,
1678,
26563,
353,
9657,
580,
13,
16... |
coursedashboards/models/term.py | uw-it-aca/course-dashboards | 1 | 152430 | <reponame>uw-it-aca/course-dashboards
from django.utils import timezone
from django.db import models
class Term(models.Model):
SPRING = 'spring'
SUMMER = 'summer'
AUTUMN = 'autumn'
WINTER = 'winter'
QUARTERNAME_CHOICES = (
(WINTER, 'Winter'),
(SPRING, 'Spring'),
(SUMMER, '... | [
1,
529,
276,
1112,
420,
29958,
7262,
29899,
277,
29899,
11989,
29914,
15775,
29899,
14592,
24691,
13,
3166,
9557,
29889,
13239,
1053,
29431,
13,
3166,
9557,
29889,
2585,
1053,
4733,
13,
13,
13,
1990,
11814,
29898,
9794,
29889,
3195,
1125,... |
pytorch_lightning/__init__.py | alanhdu/pytorch-lightning | 3 | 1611149 | <gh_stars>1-10
"""Root package info."""
import logging
import os
from pytorch_lightning.info import ( # noqa: F401
__author__,
__author_email__,
__copyright__,
__docs__,
__homepage__,
__license__,
__version__,
)
_root_logger = logging.getLogger()
_logger = logging.getLogger(__name__)
_lo... | [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
15945,
29908,
10303,
3577,
5235,
1213,
15945,
13,
13,
5215,
12183,
13,
5215,
2897,
13,
13,
3166,
282,
3637,
25350,
29918,
4366,
1076,
29889,
3888,
1053,
313,
29871,
... |
django_tex/environment.py | massimilianoporzio/django-tex | 66 | 71423 | <reponame>massimilianoporzio/django-tex
from jinja2 import Environment
from django_tex.filters import FILTERS
def environment(**options):
options.update(
{
"autoescape": None,
"extensions": ["django_tex.extensions.GraphicspathExtension"],
}
)
env = Environment(**op... | [
1,
529,
276,
1112,
420,
29958,
25379,
326,
20548,
459,
272,
29920,
601,
29914,
14095,
29899,
4776,
13,
3166,
432,
262,
1764,
29906,
1053,
16738,
13,
13,
3166,
9557,
29918,
4776,
29889,
26705,
1053,
383,
6227,
4945,
29903,
13,
13,
13,
... |
torchio/transforms/preprocessing/intensity/histogram_random_change.py | GReguig/torchio | 1 | 89209 | import numpy as np
from ....constants import DATA
from .normalization_transform import NormalizationTransform
from .histogram_standardization import normalize
class HistogramRandomChange(NormalizationTransform):
"""
Same thins as HistogramStandardization but the landmarks is a random curve
"""
def __i... | [
1,
1053,
12655,
408,
7442,
13,
3166,
13035,
3075,
1934,
1053,
360,
8254,
13,
3166,
869,
8945,
2133,
29918,
9067,
1053,
21981,
2133,
13372,
13,
3166,
869,
29882,
391,
13342,
29918,
15770,
2133,
1053,
4226,
675,
13,
13,
13,
1990,
15179,
... |
colour/characterisation/displays.py | wenh06/colour | 1 | 93596 | <filename>colour/characterisation/displays.py
# -*- coding: utf-8 -*-
"""
RGB Display Primaries
=====================
Defines spectral distributions classes for the datasets from
:mod:`colour.characterisation.datasets.displays` module:
- :class:`colour.characterisation.RGB_DisplayPrimaries`: Implements support
... | [
1,
529,
9507,
29958,
1054,
473,
29914,
18609,
4371,
29914,
2218,
12922,
29889,
2272,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
15945,
29908,
13,
28212,
17440,
9724,
4314,
13,
9166,
2751,
29922,
... |
pikarpc/chunked_utils.py | valfrom/python_pika_rpc | 0 | 74578 | from pikarpc.byte_utils import int_to_bytes, int_from_bytes, float_to_bytes, float_from_bytes
from PIL import Image
from pikarpc.image_utils import image_from_byte_array, image_to_byte_array
def bytes_from_value(v, lossless):
result = bytes()
if type(v) == bytes:
result += b'b'
result += v
... | [
1,
515,
282,
638,
279,
6739,
29889,
10389,
29918,
13239,
1053,
938,
29918,
517,
29918,
13193,
29892,
938,
29918,
3166,
29918,
13193,
29892,
5785,
29918,
517,
29918,
13193,
29892,
5785,
29918,
3166,
29918,
13193,
13,
3166,
349,
6227,
1053,
... |
estimation/test/test_boostrap_errors.py | eribean/GIRTH | 0 | 197852 | import unittest
import warnings
import numpy as np
from girth.synthetic import create_synthetic_irt_dichotomous, create_synthetic_irt_polytomous
from girth import (rasch_jml, onepl_jml, twopl_jml, grm_jml, pcm_jml,
rasch_mml, onepl_mml, twopl_mml, twopl_mml_eap, grm_mml_eap, pcm_mml,
grm_mml, rasch_conditi... | [
1,
1053,
443,
27958,
13,
5215,
18116,
1678,
13,
13,
5215,
12655,
408,
7442,
13,
13,
3166,
330,
7515,
29889,
19274,
386,
7492,
1053,
1653,
29918,
19274,
386,
7492,
29918,
2728,
29918,
29881,
436,
327,
290,
681,
29892,
1653,
29918,
19274,... |
syncli/cmd/hosts.py | comodit/synapse-client | 2 | 66737 | <filename>syncli/cmd/hosts.py
""" Manipulate the host resource.
"""
from syncli.cmd.generic import GenericCmd
from syncli.router import register
from syncli.api.hosts import HostsApi
@register(HostsApi)
class HostsCmd(GenericCmd):
attributes = (('status', [{'name': 'ip',
'help': "... | [
1,
529,
9507,
29958,
16593,
492,
29914,
9006,
29914,
23525,
29889,
2272,
13,
15945,
29908,
2315,
666,
5987,
278,
3495,
6503,
29889,
13,
15945,
29908,
13,
13,
3166,
16523,
492,
29889,
9006,
29889,
19206,
1053,
3251,
293,
23651,
13,
3166,
... |
onadata/libs/exceptions.py | BuildAMovement/whistler-kobocat | 38 | 97068 | class NoRecordsFoundError(Exception):
pass
class J2XException(Exception):
pass
| [
1,
770,
1939,
4789,
4339,
9692,
2392,
29898,
2451,
1125,
13,
1678,
1209,
13,
13,
13,
1990,
435,
29906,
29990,
2451,
29898,
2451,
1125,
13,
1678,
1209,
13,
2
] |
multichain.py | MultiChain/multichain-explorer-2 | 8 | 177892 | <reponame>MultiChain/multichain-explorer-2
# -*- coding: utf-8 -*-
# MultiChain Explorer 2 (c) Coin Sciences Ltd
# All rights reserved under BSD 3-clause license
import cfg
import utils
import readconf
import base64
#import requests
from urllib import request
from urllib import parse
import urllib
import json
from c... | [
1,
529,
276,
1112,
420,
29958,
15329,
14688,
29914,
4713,
436,
475,
29899,
735,
14716,
29899,
29906,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
13,
29937,
14974,
14688,
21508,
29871,
29906,
313,
... |
algorithm/graph_theory/even_tree/solution.py | delaanthonio/hackerrank | 1 | 139878 | #!/usr/bin/env python3
"""Solution for https://www.hackerrank.com/challenges/even-tree"""
from collections import defaultdict, deque
from typing import Dict, Set
Vertex = int
Tree = Dict[Vertex, Set[Vertex]]
def trim_tree(tree: Tree, root=1) -> None:
"""Make tree a directed graph."""
for child in tree[root]... | [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
15945,
29908,
13296,
918,
363,
2045,
597,
1636,
29889,
29882,
28940,
10003,
29889,
510,
29914,
305,
16047,
267,
29914,
11884,
29899,
8336,
15945,
29908,
13,
13,
3166,
16250,
1053,
... |
app/mtracker/urls.py | fizista/Mturk-Tracker | 0 | 119500 | <filename>app/mtracker/urls.py
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.core.management import call_command
admin.autodiscover()
def bad(request):
""" Simulates a server error """
1 / 0
urlpatterns = patterns('mtracker'... | [
1,
529,
9507,
29958,
932,
29914,
29885,
3018,
4937,
29914,
26045,
29889,
2272,
13,
3166,
9557,
29889,
5527,
1053,
6055,
13,
3166,
9557,
29889,
5527,
29889,
26045,
1053,
15038,
29892,
3160,
29892,
3142,
13,
3166,
9557,
29889,
21570,
1053,
... |
setup.py | fonar/paypalhttp_python | 0 | 1020 | from setuptools import setup
version = "1.0.0"
long_description = """
PayPalHttp is a generic http client designed to be used with code-generated projects.
"""
setup(
name="paypalhttp",
long_description=long_description,
version=version,
author="PayPal",
packages=["paypalhttp", "paypalhttp/testu... | [
1,
515,
731,
21245,
8789,
1053,
6230,
13,
13,
3259,
353,
376,
29896,
29889,
29900,
29889,
29900,
29908,
13,
13,
5426,
29918,
8216,
353,
9995,
13,
12,
15467,
18210,
5506,
338,
263,
10035,
1732,
3132,
8688,
304,
367,
1304,
411,
775,
298... |
analysis_tools/PYTHON_RICARDO/rpl/tools/voxelization/test_intersection.py | lefevre-fraser/openmeta-mms | 0 | 52514 | """ Represent a triangulated surface using a 3D boolean grid"""
import numpy as np
from scipy import ndimage
import matplotlib.pyplot as plt
import matplotlib.cm as cm
voxel_size = 0.05
#stl_file = "50_standing"
#stl_file = "50p_hunch8"
stl_file = "volume_w_seats"
file_name = "voxels_temp_" + stl_file ... | [
1,
9995,
16314,
263,
3367,
574,
7964,
7101,
773,
263,
29871,
29941,
29928,
7223,
6856,
15945,
19451,
13,
5215,
12655,
408,
7442,
30004,
13,
3166,
4560,
2272,
1053,
29871,
299,
3027,
30004,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
... |
msvc/libpsl-pc.py | kloczek/libpsl | 102 | 148941 | # !/usr/env/python
# Simple script to generate libpsl.pc from libpsl.pc.in
# for Visual Studio builds
import sys
import argparse
from replace import replace_multi
from pc_base import BasePCItems
def main(argv):
parser = argparse.ArgumentParser(description='Setup basic libpsl.pc file info')
parser... | [
1,
396,
1738,
29914,
4855,
29914,
6272,
29914,
4691,
30004,
13,
29937,
12545,
2471,
304,
5706,
4303,
567,
29880,
29889,
6739,
515,
4303,
567,
29880,
29889,
6739,
29889,
262,
30004,
13,
29937,
363,
9249,
7448,
23315,
30004,
13,
30004,
13,
... |
labJS/conf.py | lpomfrey/django-labjs | 0 | 10036 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from appconf import AppConf
from django.conf import settings # noqa
class LabjsConf(AppConf):
ENABLED = not settings.DEBUG
DEBUG_TOGGLE = 'labjs'
| [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
3166,
4770,
29888,
9130,
1649,
1053,
29104,
29918,
20889,
1338,
13,
13,
3166,
623,
5527,
1053,
2401,
16376,
13,
3166,
9557,
29889,
5527,
1053,
6055,
2987... |
eworkshop/utils/models.py | frankfern/eWorkshop-api | 0 | 67489 | from django.db import models
from django.core.validators import RegexValidator
class TimeModel(models.Model):
""" Model that can be inherit to obtain fields like
create time and modified time"""
created = models.DateTimeField(
'created at', auto_now_add=True, help_text='Date time on which objec... | [
1,
515,
9557,
29889,
2585,
1053,
4733,
13,
3166,
9557,
29889,
3221,
29889,
3084,
4097,
1053,
25326,
24204,
13,
13,
13,
1990,
5974,
3195,
29898,
9794,
29889,
3195,
1125,
13,
13,
1678,
9995,
8125,
393,
508,
367,
13125,
304,
4017,
4235,
... |
tests/test_file.py | knc-neural-calculus/exdir | 67 | 92770 | <gh_stars>10-100
# -*- coding: utf-8 -*-
#
# This file is part of Exdir, the Experimental Directory Structure.
#
# Copyright 2017 <NAME>
#
# License: MIT, see "LICENSE" file for the full license terms.
#
# This file contains code from h5py, a Python interface to the HDF5 library,
# licensed under a standard 3-clause BS... | [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29899,
29896,
29900,
29900,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
29937,
13,
29937,
910,
934,
338,
760,
310,
1222,
3972,
29892,
278,
1... |
codegen.py | EXXETA/k8s-python-tools | 1 | 35383 | #
# Copyright (c) 2019 EXXETA AG and others.
#
# This file is part of k8s-python-tools
# (see https://github.com/EXXETA/k8s-python-tools).
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information... | [
1,
396,
13,
29937,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29896,
29929,
382,
6247,
2544,
29909,
16369,
322,
4045,
29889,
13,
29937,
13,
29937,
910,
934,
338,
760,
310,
413,
29947,
29879,
29899,
4691,
29899,
8504,
13,
29937,
... |
gw_bot/api/commands/OSS_Bot_Commands.py | filetrust/GW-Bot | 1 | 171506 | from osbot_aws.apis.Lambda import Lambda
from gw_bot.api.Slack_Commands_Helper import Slack_Commands_Helper
from gw_bot.api.commands.Maps_Commands import Maps_Commands
from osbot_utils.utils import Misc
def use_command_class(slack_event, params, target_class):
channel = Misc.get_value(s... | [
1,
515,
2897,
7451,
29918,
10467,
29889,
11355,
29889,
9099,
1053,
365,
2269,
13,
13,
3166,
330,
29893,
29918,
7451,
29889,
2754,
29889,
29903,
2364,
29918,
5261,
4167,
29918,
10739,
3986,
1053,
317,
2364,
29918,
5261,
4167,
29918,
10739,
... |
main/migrations/0006_auto_20201231_0458.py | AyushHazard/Samskritam | 0 | 102137 | <gh_stars>0
# Generated by Django 3.1.4 on 2020-12-31 04:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0005_auto_20201230_1633'),
]
operations = [
migrations.AlterField(
model_name='competition',
nam... | [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
29937,
3251,
630,
491,
15337,
29871,
29941,
29889,
29896,
29889,
29946,
373,
29871,
29906,
29900,
29906,
29900,
29899,
29896,
29906,
29899,
29941,
29896,
29871,
29900,
29946,
29901,
29945,
29... |
neutron/objects/local_ip.py | congnt95/neutron | 1,080 | 1607081 | <reponame>congnt95/neutron
# Copyright 2021 Huawei, Inc.
# 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... | [
1,
529,
276,
1112,
420,
29958,
21015,
593,
29929,
29945,
29914,
17821,
1617,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29906,
29896,
379,
3357,
26599,
29892,
9266,
29889,
13,
29937,
2178,
10462,
21676,
29889,
13,
29937,
13,
29937,
1678,
... |
pygimli/core/math.py | JuliusHen/gimli | 0 | 114553 | # -*- coding: utf-8 -*-
"""Collection of mathematical functions."""
import numpy as np
from .core import (angle, besselI0, besselI1, besselK0, besselK1, cos,
cot, det, dot, exp, exp10, imag, log, log10, max, median,
min, pow, rand, randn, real, rms, round, rrms, sign,
... | [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
15945,
29908,
7196,
310,
19475,
3168,
1213,
15945,
13,
13,
5215,
12655,
408,
7442,
13,
3166,
869,
3221,
1053,
313,
2521,
29892,
289,
25583,
29902,
29900,... |
{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}.py | farooq-teqniqly/cookiecutter-databricks-notebook | 0 | 108792 | """
The Notebook module.
"""
class Notebook:
"""
This notebook does...
"""
def run(self):
"""
Your notebook code goes here.
"""
notebook = Notebook()
notebook.run()
| [
1,
9995,
13,
1576,
2216,
19273,
3883,
29889,
13,
15945,
29908,
13,
13,
13,
1990,
2216,
19273,
29901,
13,
1678,
9995,
13,
1678,
910,
451,
19273,
947,
856,
13,
1678,
9995,
13,
1678,
822,
1065,
29898,
1311,
1125,
13,
4706,
9995,
13,
47... |
critters/views.py | cfletcher1856/acnhcritters | 0 | 88751 | <gh_stars>0
from django.shortcuts import render
from django.http import HttpResponse
from django.core import serializers
from .models import Fish, Bug
from annoying.decorators import render_to
@render_to('index.html')
def index(request):
return {}
@render_to('critters.html')
def bugs(request):
bugs = Bug.obj... | [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
9557,
29889,
12759,
7582,
29879,
1053,
4050,
13,
3166,
9557,
29889,
1124,
1053,
9056,
5103,
13,
3166,
9557,
29889,
3221,
1053,
7797,
19427,
13,
3166,
869,
9794,
1053,
12030,
29892,
... |
wafextras/lyx2tex.py | tjhunter/phd-thesis-tjhunter | 1 | 32764 | """ Converts some lyx files to the latex format.
Note: everything in the file is thrown away until a section or the workd "stopskip" is found.
This way, all the preamble added by lyx is removed.
"""
from waflib import Logs
from waflib import TaskGen,Task
from waflib import Utils
from waflib.Configure import conf
def ... | [
1,
9995,
1281,
369,
1372,
777,
21261,
29916,
2066,
304,
278,
5683,
29916,
3402,
29889,
13,
13,
9842,
29901,
4129,
297,
278,
934,
338,
12005,
3448,
2745,
263,
4004,
470,
278,
664,
29881,
376,
9847,
11014,
29908,
338,
1476,
29889,
13,
4... |
main.py | mehmet-karagoz/RPG-Battle-Game | 1 | 71953 | import pygame
import random
import button
from pygame import mixer
pygame.init()
clock = pygame.time.Clock()
fps = 60
#game window
screen_width = 800
screen_height = 400
#game variables
current_fighter = 1
total_fighter = 2
action_cooldown = 0
action_wait_time = 90
attack = False
potion = False
potion_effect = 30
c... | [
1,
1053,
22028,
13,
5215,
4036,
13,
5215,
2826,
13,
3166,
22028,
1053,
6837,
261,
13,
13,
2272,
11802,
29889,
2344,
580,
13,
13,
13058,
353,
22028,
29889,
2230,
29889,
29907,
908,
580,
13,
29888,
567,
353,
29871,
29953,
29900,
13,
13,... |
functions/aurora_check_status.py | aws-samples/aws-stepfunctions-aurora-clone | 7 | 14346 | import boto3
client = boto3.client('rds')
def lambda_handler(event, context):
target_db_cluster_identifier=event['TargetDBClusterIdentifier']
payload = event.copy()
try:
response = client.describe_db_clusters(DBClusterIdentifier=target_db_cluster_identifier)
payload... | [
1,
1053,
289,
3747,
29941,
13,
13,
4645,
353,
289,
3747,
29941,
29889,
4645,
877,
5499,
29879,
1495,
13,
13,
1753,
14013,
29918,
13789,
29898,
3696,
29892,
3030,
1125,
13,
268,
13,
1678,
3646,
29918,
2585,
29918,
19594,
29918,
25378,
29... |
yolo/evaluate.py | antcc/proyecto-vc | 0 | 188695 | import numpy as np
import os
from .utils.utils import get_yolo_boxes, makedirs
def evaluate_full(model,
generator,
obj_thresh = 0.5,
nms_thresh = 0.5,
net_h = 416,
net_w = 416,
save_path = ""):
# Predict box... | [
1,
1053,
12655,
408,
7442,
13,
5215,
2897,
13,
3166,
869,
13239,
29889,
13239,
1053,
679,
29918,
29891,
3543,
29918,
1884,
267,
29892,
2136,
287,
12935,
13,
13,
1753,
14707,
29918,
8159,
29898,
4299,
29892,
13,
462,
29871,
15299,
29892,
... |
dataset_toolkit/Export/AbstractExport.py | PeloriTech/DatasetToolkit | 0 | 118040 | from abc import ABC, abstractmethod
from dataset_toolkit.Model.AnnotationModel import AnnotationModel
class AbstractExport(ABC):
@abstractmethod
def start(self):
pass
@abstractmethod
def append(self, new_dataset_dir: str, new_annotations_dir: str,
annotation_model: Annotation... | [
1,
515,
25638,
1053,
16417,
29892,
9846,
5696,
13,
13,
3166,
8783,
29918,
10154,
7354,
29889,
3195,
29889,
21978,
3195,
1053,
530,
16666,
3195,
13,
13,
13,
1990,
25513,
26382,
29898,
19658,
1125,
13,
13,
1678,
732,
16595,
5696,
13,
1678... |
tests/test_main.py | JD-ETH/CompilerGym | 0 | 193875 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import sys
from typing import List, Optional
import gym
import pytest
import compiler_gym # noqa Register environments.
def main... | [
1,
396,
14187,
1266,
313,
29883,
29897,
13327,
29892,
9266,
29889,
322,
967,
23736,
1078,
29889,
13,
29937,
13,
29937,
910,
2752,
775,
338,
7794,
21144,
1090,
278,
341,
1806,
19405,
1476,
297,
278,
13,
29937,
365,
2965,
1430,
1660,
934,... |
AcdUtilLib.py | fermi-lat/AcdUtil | 0 | 62084 | # $Header: /nfs/slac/g/glast/ground/cvs/GlastRelease-scons/AcdUtil/AcdUtilLib.py,v 1.4 2009/08/08 01:08:04 jrb Exp $
def generate(env, **kw):
if not kw.get('depsOnly', 0):
env.Tool('addLibrary', library = ['AcdUtil'])
if env['PLATFORM'] == 'win32':
env.Tool('findPkgPath', package = 'AcdUtil')
env... | [
1,
396,
395,
7850,
29901,
847,
29876,
5847,
29914,
29879,
4620,
29914,
29887,
29914,
3820,
579,
29914,
2057,
29914,
29883,
4270,
29914,
29954,
4230,
19729,
29899,
29879,
3200,
29914,
29909,
2252,
7270,
29914,
29909,
2252,
7270,
14868,
29889,
... |
selfdrive/sensord/rawgps/structs.py | TC921/openpilot | 0 | 2862 | from struct import unpack_from, calcsize
LOG_GNSS_POSITION_REPORT = 0x1476
LOG_GNSS_GPS_MEASUREMENT_REPORT = 0x1477
LOG_GNSS_CLOCK_REPORT = 0x1478
LOG_GNSS_GLONASS_MEASUREMENT_REPORT = 0x1480
LOG_GNSS_BDS_MEASUREMENT_REPORT = 0x1756
LOG_GNSS_GAL_MEASUREMENT_REPORT = 0x1886
LOG_GNSS_OEMDRE_MEASUREMENT_REPORT = 0x14DE
... | [
1,
515,
2281,
1053,
443,
4058,
29918,
3166,
29892,
22235,
2311,
13,
13,
14480,
29918,
20728,
1799,
29918,
24815,
22122,
29918,
1525,
15082,
353,
29871,
29900,
29916,
29896,
29946,
29955,
29953,
13,
14480,
29918,
20728,
1799,
29918,
29954,
7... |
qstklearn/1knn.py | elxavicio/QSTK | 339 | 1790 | <filename>qstklearn/1knn.py<gh_stars>100-1000
'''
(c) 2011, 2012 Georgia Tech Research Corporation
This source code is released under the New BSD license. Please see
http://wiki.quantsoftware.org/index.php?title=QSTK_License
for license details.
Created on Feb 20, 2011
@author: <NAME>
@organization: Georgia I... | [
1,
529,
9507,
29958,
29939,
303,
29895,
19668,
29914,
29896,
3959,
29876,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29900,
29899,
29896,
29900,
29900,
29900,
13,
12008,
30004,
13,
29898,
29883,
29897,
29871,
29906,
299... |
server/pitches/migrations/0012_auto_20171216_2219.py | bholtbholt/unconf | 10 | 184734 | <gh_stars>1-10
# Generated by Django 2.0 on 2017-12-17 06:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pitches', '0011_schedule'),
]
operations = [
migrations.AlterField(
model_name='slot',
name='end_time',... | [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
29937,
3251,
630,
491,
15337,
29871,
29906,
29889,
29900,
373,
29871,
29906,
29900,
29896,
29955,
29899,
29896,
29906,
29899,
29896,
29955,
29871,
29900,
29953,
29901,
29... |
tests/unit/test_environment.py | klmitch/stepmaker | 0 | 98887 | <filename>tests/unit/test_environment.py
import os
import pytest
from six.moves import builtins
from stepmaker import environment
from stepmaker import exceptions
class ExceptionForTest(Exception):
pass
class TestCompletedProcess(object):
def test_init_base(self):
result = environment.CompletedPro... | [
1,
529,
9507,
29958,
21150,
29914,
5441,
29914,
1688,
29918,
20944,
29889,
2272,
13,
5215,
2897,
13,
13,
5215,
11451,
1688,
13,
3166,
4832,
29889,
13529,
267,
1053,
4240,
1144,
13,
13,
3166,
1886,
3358,
5790,
1053,
5177,
13,
3166,
1886,... |
src/fund/analyzer/tf/softmax.py | krizex/fund | 3 | 161054 | <reponame>krizex/fund
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import tensorflow as tf
from fund.log.logger import log
__author__ = '<NAME>'
"""
Created on 07/03/2017
@author: <NAME>
"""
# http://www.shareditor.com/blogshow/?blogId=94
class SoftmaxTrainer(object):
def __init__(self, feature_cou... | [
1,
529,
276,
1112,
420,
29958,
29895,
7485,
735,
29914,
27159,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
5215,
2897,
13,
5215,
26110,
40... |
backend/model/views.py | princesinghtomar/BTP | 0 | 31056 | <filename>backend/model/views.py
from django.shortcuts import render
from django.views.decorators.csrf import csrf_exempt
from rest_framework.parsers import JSONParser
from django.http.response import JsonResponse
import base64
from numpy import random
# Create your views here.
@csrf_exempt
def algo(req):
if req.m... | [
1,
529,
9507,
29958,
27852,
29914,
4299,
29914,
7406,
29889,
2272,
13,
3166,
9557,
29889,
12759,
7582,
29879,
1053,
4050,
13,
3166,
9557,
29889,
7406,
29889,
19557,
4097,
29889,
2395,
9600,
1053,
5939,
9600,
29918,
735,
3456,
13,
3166,
17... |
sem1/lab3_3/lsm.py | NetherQuartz/NumericalMethodsLabs | 1 | 49482 | """ЛР 3.3, <NAME>, М8О-303Б-18"""
import numpy as np
import fire # CLI
import matplotlib.pyplot as plt
from sem1.lab1_1.gauss import lu_decomposition, lu_solve
def f(coeffs, x):
"""Вычисление значения полинома с коэффициентами coeffs"""
return sum([x ** i * c for i, c in enumerate(coeffs)])
def sum_squar... | [
1,
9995,
30050,
30027,
29871,
29941,
29889,
29941,
29892,
529,
5813,
10202,
1142,
29947,
30038,
29899,
29941,
29900,
29941,
30031,
29899,
29896,
29947,
15945,
29908,
13,
13,
5215,
12655,
408,
7442,
13,
5215,
3974,
29871,
396,
24492,
13,
521... |
src/collectors/interrupt/interrupt.py | fasrc/Diamond | 0 | 173390 | <gh_stars>0
# coding=utf-8
"""
The InterruptCollector class collects metrics on interrupts from
/proc/interrupts
#### Dependencies
* /proc/interrupts
"""
import platform
import os
import diamond.collector
from diamond.pycompat import long
# Detect the architecture of the system
# and set the counters for MAX_VAL... | [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
29937,
14137,
29922,
9420,
29899,
29947,
13,
13,
15945,
29908,
13,
1576,
4124,
6685,
28916,
272,
770,
6314,
29879,
21556,
373,
23754,
29879,
515,
13,
29914,
15439,
29914,
1639,
6685,
2987... |
pytype/pyi/parse_pyi.py | CyberFlameGO/pytype | 0 | 21237 | # python3
"""Testing code to run the typed_ast based pyi parser."""
import sys
from pytype import module_utils
from pytype.pyi import parser
from pytype.pyi.types import ParseError # pylint: disable=g-importing-member
from pytype.pytd import pytd_utils
if __name__ == '__main__':
filename = sys.argv[1]
with op... | [
1,
396,
3017,
29941,
13,
13,
15945,
29908,
3057,
292,
775,
304,
1065,
278,
13033,
29918,
579,
2729,
11451,
29875,
13812,
1213,
15945,
13,
13,
5215,
10876,
13,
13,
3166,
11451,
1853,
1053,
3883,
29918,
13239,
13,
3166,
11451,
1853,
29889... |
conans/test/functional/conanfile/deploy_import_file_permission_test.py | laundry-96/conan | 2 | 92742 | <filename>conans/test/functional/conanfile/deploy_import_file_permission_test.py<gh_stars>1-10
import os
import stat
import unittest
from conans.test.utils.tools import TestClient
class DeployImportFilePermissionTest(unittest.TestCase):
def setUp(self):
self.file_name = 'myheader.h'
def _client(sel... | [
1,
529,
9507,
29958,
535,
550,
29914,
1688,
29914,
2220,
284,
29914,
535,
273,
1445,
29914,
16519,
29918,
5215,
29918,
1445,
29918,
16074,
29918,
1688,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
5215... |
cartoonify.py | adl1995/image-processing-filters | 0 | 10700 | <filename>cartoonify.py
#!/usr/bin/env python
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Production"
import matplotlib.pyplot as plt
import numpy as np
import skimage as ski
import Image
def cartoonify(im, display=False):
"""
function receives an image and add its gradient magnitude in it and add i... | [
1,
529,
9507,
29958,
13823,
6150,
1598,
29889,
2272,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
13,
13,
1649,
8921,
1649,
353,
9872,
5813,
11903,
13,
1649,
5269,
1649,
353,
9872,
26862,
6227,
11903,
13,
1649,
4882,
1649,
35... |
chip8_pygame_integration/config_test.py | Artoooooor/chip8 | 0 | 21468 | import unittest
import pygame
from chip8_pygame_integration.config import get_config, KeyBind, to_text
DEFAULT = [KeyBind(pygame.K_o, pygame.KMOD_CTRL, 'some_command')]
class ConfigLoadTest(unittest.TestCase):
def setUp(self):
self.default = None
def test_empty_pattern_returns_empty_array(self):
... | [
1,
1053,
443,
27958,
13,
5215,
22028,
13,
3166,
29830,
29947,
29918,
2272,
11802,
29918,
27925,
29889,
2917,
1053,
679,
29918,
2917,
29892,
7670,
15708,
29892,
304,
29918,
726,
13,
13,
13,
23397,
353,
518,
2558,
15708,
29898,
2272,
11802,... |
app_djangoparser/views.py | mynameismaz/DjangoParser | 0 | 156006 | <gh_stars>0
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
import re
import string
import operator
def index_page(request):
if request.method == 'POST':
f = request.FILES['sentFile']
with open(f.name, 'w'):
file_content = f.read().decode(... | [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
9557,
29889,
12759,
7582,
29879,
1053,
4050,
13,
3166,
9557,
29889,
1124,
1053,
9056,
5103,
29892,
9056,
5103,
24735,
13,
5215,
337,
13,
5215,
1347,
13,
5215,
5455,
13,
13,
1753,
... |
eyesore/decision_graph/compacting/_0_decision_node_compacter.py | twizmwazin/hacrs | 2 | 125380 | <filename>eyesore/decision_graph/compacting/_0_decision_node_compacter.py
from .. import SuccessorsNode, SuccessorNode, DecisionNode, DecisionNotTakenNode
from ..visitor import Visitor
class DecisionNodeCompacter(Visitor):
def _visit_successors_node(self, node, results):
"""
:param node:
... | [
1,
529,
9507,
29958,
1032,
267,
487,
29914,
7099,
2459,
29918,
4262,
29914,
2388,
627,
292,
19891,
29900,
29918,
7099,
2459,
29918,
3177,
29918,
2388,
5761,
29889,
2272,
13,
3166,
6317,
1053,
21397,
943,
4247,
29892,
21397,
272,
4247,
298... |
utils/prepare_bcp.py | smeea/krcg-static | 0 | 45072 | """A convenience function to rename BCP images
"""
import os
import re
from krcg.parser import _CLAN
def prepare_bcp(path):
for (dirpath, _dirnames, filenames) in os.walk(path):
for name in filenames:
clan_prefix = re.match(r"({})_".format(_CLAN), name.lower())
if clan_prefix:
... | [
1,
9995,
29909,
29703,
740,
304,
19508,
350,
6271,
4558,
13,
15945,
29908,
13,
5215,
2897,
13,
5215,
337,
13,
13,
3166,
413,
2214,
29887,
29889,
16680,
1053,
903,
6154,
2190,
13,
13,
13,
1753,
19012,
29918,
29890,
6814,
29898,
2084,
1... |
SqueezeNet/SqueezeNet_keras.py | hgrui/DeepLearning_research | 0 | 62028 | from __future__ import print_function
import os
import keras
from keras.layers import Dense,Flatten,Conv2D,MaxPooling2D,Activation,Input,Concatenate,Dropout,GlobalAveragePooling2D
from keras.models import Model
import time
from keras.datasets import cifar10
from keras.optimizers import SGD
from keras.utils impo... | [
1,
515,
4770,
29888,
9130,
1649,
1053,
1596,
29918,
2220,
30004,
13,
5215,
2897,
30004,
13,
5215,
13023,
294,
30004,
13,
3166,
13023,
294,
29889,
29277,
1053,
360,
1947,
29892,
29943,
5066,
841,
29892,
1168,
29894,
29906,
29928,
29892,
79... |
test/test_io_base.py | dan-win/fairways_py | 0 | 160351 | import unittest
import unittest.mock
def setUpModule():
pass
def tearDownModule():
pass
class MockDriver:
MAX_CONN = 5
LAST_ID = 0
@classmethod
def reset(cls):
cls.LAST_ID = 0
def __init__(self, env_varname):
self.__class__.LAST_ID = self.__class__.LAST_ID + 1
... | [
1,
1053,
443,
27958,
13,
5215,
443,
27958,
29889,
17640,
13,
13,
1753,
731,
3373,
7355,
7295,
13,
1678,
1209,
13,
13,
1753,
734,
279,
6767,
7355,
7295,
13,
1678,
1209,
13,
13,
13,
13,
1990,
26297,
12376,
29901,
13,
1678,
18134,
2991... |
app/main/util/dto.py | tharindukumara/bert-sentiment-analysis | 1 | 162021 | <filename>app/main/util/dto.py<gh_stars>1-10
from flask_restplus import Namespace, fields
class SentimentDto:
api = Namespace('sentiment', description='sentiment prediction')
sentiment = api.model('sentiment', {
'sentence': fields.String(required=True, description='sentence to predict'),
})
| [
1,
529,
9507,
29958,
932,
29914,
3396,
29914,
4422,
29914,
29881,
517,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
3166,
29784,
29918,
5060,
11242,
1053,
14706,
3535,
29892,
4235,
13,
13,
13,
1990,
... |
mtp_api/apps/core/tests/test_scheduled_commands.py | ministryofjustice/mtp-api | 5 | 150520 | <filename>mtp_api/apps/core/tests/test_scheduled_commands.py
import logging
from datetime import timedelta
from django.core.exceptions import ValidationError
from django.test import TestCase
from django.test.utils import captured_stdout
from django.utils import timezone
from mtp_common.test_utils import silence_logger... | [
1,
529,
9507,
29958,
4378,
29886,
29918,
2754,
29914,
13371,
29914,
3221,
29914,
21150,
29914,
1688,
29918,
816,
14989,
29918,
26381,
29889,
2272,
13,
5215,
12183,
13,
3166,
12865,
1053,
5335,
287,
2554,
13,
13,
3166,
9557,
29889,
3221,
2... |
tests/test_auth.py | sergeyberezansky/appr | 31 | 146562 | import os.path
import yaml
from appr.auth import ApprAuth
def test_fake_home(fake_home):
assert os.path.expanduser("~") == fake_home
def test_init_create_dir(fake_home):
ApprAuth(".appr")
assert os.path.exists(os.path.join(str(fake_home), ".appr"))
def test_init_token_empty(fake_home):
k = ApprA... | [
1,
1053,
2897,
29889,
2084,
13,
13,
5215,
343,
8807,
13,
13,
3166,
623,
29878,
29889,
5150,
1053,
2401,
29878,
6444,
13,
13,
13,
1753,
1243,
29918,
29888,
1296,
29918,
5184,
29898,
29888,
1296,
29918,
5184,
1125,
13,
1678,
4974,
2897,
... |
tests/openwisp2/sample_users/models.py | codesankalp/openwisp-ipam | 81 | 163494 | from django.contrib.auth.models import Group as AbstractGroup
from django.core.validators import RegexValidator
from django.db import models
from openwisp_users.base.models import (
AbstractUser,
BaseGroup,
BaseOrganization,
BaseOrganizationOwner,
BaseOrganizationUser,
)
from organizations.abstract ... | [
1,
515,
9557,
29889,
21570,
29889,
5150,
29889,
9794,
1053,
6431,
408,
25513,
4782,
13,
3166,
9557,
29889,
3221,
29889,
3084,
4097,
1053,
25326,
24204,
13,
3166,
9557,
29889,
2585,
1053,
4733,
13,
3166,
1722,
29893,
11936,
29918,
7193,
29... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.